Support Forum
So that code snippet was for the forum view
I did have some working code for group view but it has gone forever by the looks of things and I cannot remember how I did it. I did not loop through each forum though.
So what about using the appearance of sp_ForumStatusPost.png to trigger the use of alternate forum icon in group view?
Could you suggest an easy way of doing that?
I use the same icon for all forums, it is a custom one but it is the same icon. Only the group icons differ for each group.
Conrad
Looping through the forums in a group is the only way to determine the information. And it is what we will basically need to do when and if we build this support in to the core. We just wont do it in the template function.
I have not tried this and really just do not have the time today to do so but you could ty something like this:
global $spGroupView; $unread = false; if($spGroupView->forums) { foreach($spGroupView->forums as $f) { if($f->unread) $unread=true; } } if($unread) { # you have some unreadposts it at least one forum within the group }
At the end there - if the variable $unread is true then you know there is at least one forum with the unread flag set. If I have my code right of course.
YELLOW
SWORDFISH
|
Andy I'm really sorry for taking up your time and we are talking at crossed purposes. I did want the forum icon to change if there is an unread post but in group view. Unbelievably I found the working code and here it is:
# Check if a custom icon if ($spThisForum->unread) { $icon = $iconUnread; $icon = SPTHEMEICONSURL.sanitize_file_name($icon); } else if (!empty($spThisForum->forum_icon)) { $icon = SFCUSTOMURL.$spThisForum->forum_icon; } else { $icon = SPTHEMEICONSURL.sanitize_file_name($icon); } if ($get) return $icon;
To illustrate what I was actually trying to achieve here is a screen shot.
You can use an alternate icon for forum and topic listings when those have unread posts in them but this is currently limited to the use of theme icons and not one-off custom icons. That's easy and available now.
If you want to do the same things with custom icons then it requires changes to core code which are obviously not recommended as it gets lost on future updates. This will come along at some point but it is nit there yet.
So which do you want to go with?
YELLOW
SWORDFISH
|
Personally, I'd simply wait for this te become part of SP, but my members really miss that new-post-icon (please, don't ask me why, there's 3 easy ways to find new posts ... ) so I guess we'll go with option 1, the easy way, so they're happy untill custom icons become available
custom icons are available now... but limited to one... we already have a ticket open to do what Conrad did with his code to allow multiple icons... probably in 5.1...
Visit Cruise Talk Central and Mr Papa's World
One custom icon would do the trick ...
There's 2 things stopping people from posting, because they find it too difficult: no new post icon and the editor not being visible (see https://simple-press.com/suppo.....t-or-topic).
Around 50% of my members are 55+ and not very 'computer savvy', so things have to be very self-explanatory and, I think, as much like phpBB as possible
As you can see on the forum, I'm using a custom icon (http://vertrekkersinfo.nl/forum/) and I need a differt icon for forums/topics with unread posts ... ("just like all the other fora have" :)).
Right. The templates are in the /templates folder of your SP theme and the icons in the /images folder.
You will need an icon to represent unread posts at forum l;evel and one at topic level. Both of these go in the /images folder with the rest of the icons. You can name these icons whatever you wish but I would avoid spaces in the name.
You will need to make edits to the spGroupView.php and spForumView.php templates. In both cases the edits are the same. So let's take spGroupView as the model.
Locate the template tag that displays the forum icons which is called sp_ForumIndexIcon(). You need to add an argument to the parameters being passed which are probably and by default:
'tagClass=spRowIcon spLeft'
Change this to:
'tagClass=spRowIcon spLeft&iconUnread=name_of_unread_icon.png'
inserting the name of your unread forum icon.
Do the same in the spForumView template for the topic icon tag - sp_TopicIndexIcon().
(Update): I should have added: As always we recommend that you create your own SP theme so that any customisation is not lost during a future update. (http://codex.simple-press.com/.....g-a-theme/)
YELLOW
SWORDFISH
|
1 Guest(s)