PDA

View Full Version : Original Poster Plugin


Black Snow
06-05-2015, 10:43 AM
If we use this condition in vB templates to show and icon etc on the original posters posts,:
<if condition="$thread['postuserid'] == $post['userid'] && $thread['firstpostid'] != $post['postid']">

What would I write to put that into a plugin? Is it:
if($vbulletin->$thread['postuserid'] blah blah)
or
if($thread['postuserid'] blah blah)

Not quite sure how to put it.

MarkFL
06-05-2015, 01:12 PM
You would use the same conditional in your plugin code that you would use in the template. For example, if you are adding to the postbit of all of the posts in a thread belonging to the OP, then in your plugin, you could use:

if ($post['userid'] == $thread['postuserid'])
{
//code
}

Black Snow
06-05-2015, 01:16 PM
Thanks MarkFL! That's great!

I think we should have a thread where all variables are shown and what they do. Like $post['BLAH'] is used on 'X' template(s) and does 'Y'. This would be helpful to everyone I think.