2012-12-17, 05:46 PM
Rather than using the same off/on images on the index next to each forum (indicating read/unread status), I thought it would be a great idea to designate different off/on images for each forum.
I went out and got a set of icons that that have both grayscale versions (for the "off") and full color versions (for the "on"). I uploaded each off/on image set to its own directory on my server. The directory name would correspond to the fid of the forum.
For reference, here is what a normal forumbit_depth2_forum template would look like (I'm only providing the relevant line):
To achieve individual on/off images for each forum on the index list, here is what I changed the line to:
The relevant change to the img src being:
Now, this solution works just fine and displays the proper image when a forum is either read (off) or unread (on).
Here's the problem:
Does anyone have any suggestions on what can be done to correct this issue? Other than this small issue, everything is working great and I think this is a great way to consolidate the on/off images with forum images (which usually is only available with a plugin).
I went out and got a set of icons that that have both grayscale versions (for the "off") and full color versions (for the "on"). I uploaded each off/on image set to its own directory on my server. The directory name would correspond to the fid of the forum.
For reference, here is what a normal forumbit_depth2_forum template would look like (I'm only providing the relevant line):
<img src="{$theme['imgdir']}/{$lightbulb['folder']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" />
To achieve individual on/off images for each forum on the index list, here is what I changed the line to:
<img src="{$theme['imgdir']}/cicons/{$forum['fid']}/{$lightbulb['folder']}.png" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}">
The relevant change to the img src being:
Quote:{$theme['imgdir']}/cicons/{$forum['fid']}/{$lightbulb['folder']}.png
Now, this solution works just fine and displays the proper image when a forum is either read (off) or unread (on).
Here's the problem:
- User sees the "on" version of the image for a particular forum
- User clicks on the image to "turn it off" and nothing changes
- If the user were to refresh the page, the image does show as off. This indicates that the "click on image to mark as read" feature is working, it just doesn't change the image onclick.
Does anyone have any suggestions on what can be done to correct this issue? Other than this small issue, everything is working great and I think this is a great way to consolidate the on/off images with forum images (which usually is only available with a plugin).