Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Thread Author Sign On Postbit
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #1
Thread Author Sign On Postbit
Requirement: Template Conditionals or PHP in Templates / Complex Templates

Will add an additional image for the Thread Author on postbit/classic.
As an example, we put the code after {$post['onlinestatus']}:

Code:
<if $GLOBALS['thread']['uid'] && $GLOBALS['thread']['uid'] == $post['uid'] && $GLOBALS['thread']['firstpost'] != $post['pid'] then><img src="images/icons/pencil.gif" alt="{$lang->author}" title="{$lang->author}" /></if>

   

With the same method, we can use different layout (background, css class or etc) for it.


01-11-2012 03:20 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #2
RE: Thread Author Sign On Postbit
I already have this conditional, but as I´m a expert I´m going to asume your is better, compare, and I think I will use this, thanks.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
01-13-2012 12:04 PM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #3
RE: Thread Author Sign On Postbit
I'm still learning too, Sama34 Biggrin

(This post was last modified: 01-14-2012 03:19 AM by RateU.)
01-14-2012 03:12 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #4
RE: Thread Author Sign On Postbit
I use this code:

PHP Code:
<if $thread['uid'] == $post['uid'] then>
<img src="images/icons/pencil.gif" alt="{$lang->author}" title="{$lang->author}" />
</if>


It will add a image to all author posts regardless of it being the first post or not. I think yours is better, as it makes not that much sense to include the image in the fisrt post.

But I still do not undestand what the difference between:

PHP Code:
$GLOBALS['thread']['uid']


PHP Code:
$thread['uid']


Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
02-21-2012 11:54 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #5
RE: Thread Author Sign On Postbit
They'll be the same if $thread is global'd (I think it always is for a standard postbit).  If not, $thread will be invalid.
Using $GLOBALS will always work if you're unsure.

Note that RateU's conditional also excludes guests.

My Blog
02-21-2012 04:32 PM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #6
RE: Thread Author Sign On Postbit
Thanks for the explanation Zinga Burga Smile

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
02-22-2012 02:37 PM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: