Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Topic Icons and Post Icons
Avatar
Jordan
Guest
Guests
Jan 7, 2012 - 8:39 pm

Perhaps I am overlooking something here...

Is there a way to make it so that you see a different image when there are new posts made since your last visit? For example, when you read a topic the far left image is a light blue square. When you return back to the forum and a new post is made within that forum/topic, the square is darker to represent that a new post has been made. Right now I see the same image regardless if there is a new post or not.

Thanks for your time and help.

Jordan

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 8, 2012 - 6:13 am

We changed this in V5 to use the status icon instead. for example, in the Group View you will see the new post icon and clicking on it will popup a lost of the topics with new posts. In Forum View nothing pops up of course (because it is a single topic) but it only shows up if there are new posts.

I have opened a ticket to discuss here adding an option for an alternate main topic icon (on the left) but the new status icon already there is more powerful in the long run.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Jan 11, 2012 - 5:05 pm

Andy I have been thinking about this and have decided that the muddled old men that frequent our forum would benefit from this behaviour. I was thinking of have having a custom topic button that changes from brown to red when a the topic has a new post in it. In fact I have even considered putting an N in it like this wink

 

If you decide not to introduce this fair enough but if you were going to do it, how would you do it?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 12, 2012 - 4:44 am

It is already in the code and will be in the next update.

As always you can control this via the function arguments. For both Group View (i.e., a forum that has topics with new posts) and Forum View (topics with new posts) you can pass icon names in via the 'icon' and 'iconUnread' arguments.

By the way - when you get the next update you can also set a 'truncate' argument against any Group, Forum or Topic title.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Jan 12, 2012 - 6:46 am

Andy so if I update via svn now the latest version will have the truncate and the alternate icon code in it? In order to use the icon and iconUnread what should I have in the code? For instance look at this:

             

# Column 1 of the topic row
                        # ----------------------------------------------------------------------
                        sp_ColumnStart('tagClass=spColumnSection spLeft&width=6%&height=50px');
                            sp_TopicIndexIcon('tagClass=spRowIcon spLeft');
                        sp_ColumnEnd();


How would I add the feature to this? An example of the truncate code would be useful as well? would it be something like

sp_TopicIndexName('tagClass=spRowName &truncate=120', __sp('Browse the thread %NAME%'));

120 being the number of characters?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 12, 2012 - 8:18 am

Yes - they are both available from our svn repository.

first  a quick note on passing arguments. You should never leave spaces between arguments EXCEPT where a space is needed. For example where we have 'tagClass=spRowIcon spLeft' the space is required to treat those two separate classes individually.

But where you have entered 'tagClass=spRowName &truncate=120' you should eliminate that space prior to the ampersand. This - however - is the correct way to use the truncate argument - with a character count. It will truncate any title to that number of characters and add an ellipsis to the end. This is what we do with the Quicklinks drop down lists.

As to topic and forum icons there has always been the argument for 'icon=xxx.jpg'. The icon file would need to be placed in the images folder of the theme. If an icon argument is not passed it uses the default which is spTopicIcon.png.

To add your own icon for the unread post condition then create the icon, place it in the images folder of the theme and then pass the iconUnread argument, literally as 'iconUnread=xxx.jpg'. Well - of course use the icon name not xxx! We use .png files for all the forum graphics but when passed as a function argument it can be any image file type.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Jan 12, 2012 - 9:41 am

Brilliant Andy thanks once again for the fantastic support! It amazes me how well you guys do with full time jobs, it's very appreciated by some of us!

As for the arguments I have plenty to learn and because there are periods of frenzied activity interspersed with long periods of inactivity so I forget stuff embarassed

I'll have a go at implementing both the iconUnread and the truncate function tonight and I'll allow guests so that people can have a look.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 12, 2012 - 11:18 am

Well you know I have to look at the code for every answer as I can never remember anything at all!

andy-signature.png
YELLOW
SWORDFISH
Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Jan 12, 2012 - 6:21 pm

Ok I'm confused now

                        sp_ColumnStart('tagClass=spColumnSection spRight&width=24%&height=55px');
                            sp_ForumIndexLastPost('tagClass=spInRowPostLink&truncate=35&nicedate=0&date=1&time=1&stackdate=1',__sp('Last Post'));
                        sp_ColumnEnd();

That works fine but this                   

  # Column 2 of the topic row
                        # ----------------------------------------------------------------------
                        sp_ColumnStart('tagClass=spColumnSection spLeft&width=48%&height=50px');
                            sp_TopicIndexName('tagClass=spRowName&truncate=40', __sp('Browse the thread %NAME%'));

does not.

    # Start the 'breadCrumbs' section
    # ----------------------------------------------------------------------
    sp_SectionStart('tagClass=spPlainSection spLeft', 'breadCrumbs');
        sp_BreadCrumbs('tagClass=spLeft spBreadCrumbs&tree=0$truncate=35');
    sp_SectionEnd('', 'breadCrumbs');

Nor does the breadcrumbs. Which silly schoolboy error have I made this time

Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Jan 12, 2012 - 7:45 pm

Right I am totally flummoxed!

In forum view the topic icon displayed defaults to 'sp_TopicIcon.png'.

Looking the code in spForumView.php for my theme which is based on the default theme I see that the icon is defined as:

sp_SubForumIndexIcon('tagClass=spRowIcon spLeft');

and

sp_TopicIndexIcon('tagClass=spRowIcon spLeft');

So where is it declared that spRowIcon is sp_TopicIcon.png? I can't find this anywhere in the theme. Where else would it be?

Anyway following on from Andy said earlier I uploaded an icon called sp_TopicIcon_new_post.png into the images folder of my theme and thought that

sp_TopicIndexIcon('tagClass=spRowIcon spLeft&icon=sp_TopicIcon.png&iconUnread=sp_TopicIcon_new_post.png');

It doesn't work of course.

So the questions are:

  1. Am I passing the argument in the right place i.e spForumView.php
  2. Is the syntax correct?

Sorry but I have to learn this somehow, it's great when it works and not so great when it doesn't frown

Conrad

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 617
Members: 17359
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10125
Posts: 79620