News: Welcome to the TinyPortal Support site.

Login  |  Register
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

September 15, 2019, 01:30:44 AM

Login with username, password and session length

Recent

Members
  • Total Members: 3752
  • Latest: Alizee
Stats
  • Total Posts: 188879
  • Total Topics: 20751
  • Online Today: 38
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 0
Guests: 38
Total: 38

Author Topic: Getting the new post icon to show up for each individual post...  (Read 5766 times)

0 Members and 1 Guest are viewing this topic.

Homer_J_S

  • Guest
I posted this in the Theme forum but thought I would post it here also. Didn't know quite where this post fit. If its not supposed to be in this forumn just delete. Thanks. 

First let me say Thank you,  Thank you, thank you for your wonderful theme (Helios-Red)  AND the TP project. It was exactly what I was looking for for my site and I have recieved many kudos from my small but growing user base.  ;D

Anyway, back to my question.  I have searched the SMF website looking for a mod or hack where it would show the "new" Icon besides each individual post in a thread that was new. In other words when you clicked on a post that has new post since you last visted, when you get into the thread all of the new post would have a flag with the new.gif besides the title.

The most I got off the SMF site is that you would put it on the display.template and it would be taken care of by themes. If you have any suggestions or if you could just point me in the right direction I would really appreciate it. Again this is really the only thing I am missing from my forum that my users are asking for.

Again thank you for all your hard work on the themes and TP portal, I can't tell you how much I really appreciate it.       

Bjørn

  • Guest
Re: Getting the new post icon to show up for each individual post...
« Reply #1 on: March 05, 2005, 10:22:21 AM »
Thank you. :) I am glad you like it.

As for "new" icons in Display, I will look into it. Its primarliy Helios you would like this?

Homer_J_S

  • Guest
Re: Getting the new post icon to show up for each individual post...
« Reply #2 on: March 05, 2005, 10:28:09 AM »
Thank you. :) I am glad you like it.

As for "new" icons in Display, I will look into it. Its primarliy Helios you would like this?
Yes. I am also running TP. So I guess it would be the Helios_tp theme. Again thanks.  ;D   

Bjørn

  • Guest
Re: Getting the new post icon to show up for each individual post...
« Reply #3 on: March 05, 2005, 10:51:22 AM »
Find this in Display.template.php ( you could do it both in Helios and Helios_TP)
Code: [Select]
                // Done with the information about the poster... on to the post itself.
                echo '
                                                        </div>
                                                </td>
                                                <td valign="top" width="85%" height="100%">
                                                        <table width="100%" border="0"><tr>
                                                                <td align="left" valign="middle"><a href="', $message['href'], '"><img src="', $settings['images_url'], '/post/' . $message['icon'] . '.gif" alt="" border="0" /></a></td>
                                                                <td align="left" valign="middle">
                                                                        <b><a href="', $message['href'], '">', $message['subject'], '</a></b>';

And replace with this:
Code: [Select]
                // Done with the information about the poster... on to the post itself.
                echo '
                                                        </div>
                                                </td>
                                                <td valign="top" width="85%" height="100%">
                                                        <table width="100%" border="0"><tr>
                                                                <td align="left" valign="middle"><a href="', $message['href'], '"><img src="', $settings['images_url'], '/post/' . $message['icon'] . '.gif" alt="" border="0" /></a></td>
                                                                <td align="left" valign="middle">
                                                                 ' , $message['new'] ? '<img src="'.$settings['images_url'].'/'.$context['user']['language'].'/new.gif" align="middle" border="0" />' : '' , '
                                                                        <b><a href="', $message['href'], '">', $message['subject'], '</a></b>';


Homer_J_S

  • Guest
Re: Getting the new post icon to show up for each individual post...
« Reply #4 on: March 05, 2005, 11:50:06 AM »
Thanks for the quick reply. It works but now the New button shows all the time. Even after the post has been read. I wonder if the command is missing an If statement. I will try and play with it.
Thanks again on the quick reply. It was just what I was looking for. I will let you know if I am succesful.   

Homer_J_S

  • Guest
Re: Getting the new post icon to show up for each individual post...
« Reply #5 on: March 05, 2005, 02:25:28 PM »
well I wasn't quite successful. I just need one more piece of Information (i think). How would  an If statement look like to check wether or not an individual post has been read or in this case not read? I am not familiar enough with SMF to figure this out. 
Thanks. 
« Last Edit: March 05, 2005, 02:27:29 PM by Homer_J_S »

Bjørn

  • Guest
Re: Getting the new post icon to show up for each individual post...
« Reply #6 on: March 05, 2005, 03:46:34 PM »
ehem. That sentence.. ' , $message['new'] ? '<img....' : ' ' , ' is the SAME as writing

if($message['new']==true)
     echo '<img...>';
else
   echo ' ';

But it seems that every post is un-read like that, not just some. i will check more on why this is.

Homer_J_S

  • Guest
Re: Getting the new post icon to show up for each individual post...
« Reply #7 on: March 05, 2005, 03:53:29 PM »
Sorry bout that. Still learning PHP.  :-[

Thanks again for looking into this.

Bjørn

  • Guest
Re: Getting the new post icon to show up for each individual post...
« Reply #8 on: March 05, 2005, 04:12:48 PM »
I think I found out why.

Use the same code , BUT in this sentence:

' , $message['new'] ? '<img src="'.$settings[......

put simply a ! before the variable:

' , !$message['new'] ? '<img src="'.$settings[.....

That means: if the variable $message['new'] is false, then go ahead and show the button(the <img..). In my first example I tested for if the variable was true - which was wrong. ;)

Homer_J_S

  • Guest
Re: Getting the new post icon to show up for each individual post...
« Reply #9 on: March 05, 2005, 04:34:38 PM »
That did it. Thanks so much. Without you my site would not look half as good as it does now. And hey I also learned some things too.  ;D

Eagerly awaiting Beta 5 for TP.  ;)