Dr.CustUmz
04-15-2016, 06:07 PM
I wanted to post this in vb3 articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187) and believe that's where it should be, but I do not have permission to post there, so maybe someone can move this :D
For some of the basic conditionals visit THIS THREAD (https://vborg.vbsupport.ru/showthread.php?t=215032)
This list is meant for developers and are conditionals I have collected and made over the years.
If you have a unique / useful conditional to add please share and I will add it to the list.
New posts
<if condition="$show['gotonewpost']">
<if condition="$forum[statusicon]=='new'">
If hot thread
if reply count is greater than or equal to number of posts to be considered a hot thread option and that option is greater than 0
OR
if view count is greater than or equal to number of views to be considered a hot thread option and that option is greater than 0
<if condition="($thread['replycount'] >= $vbulletin->options['hotnumberposts'] AND $vbulletin->options['hotnumberposts'] > 0) OR ($thread['views'] >= $vbulletin->options['hotnumberviews'] AND $vbulletin->options['hotnumberviews'] > 0)">
If thread open
<if condition="$thread['open']">
Show to guest if registration is on
<if condition="$show['registerbutton']">
No replies
<if condition="$thread['firstpostid'] == $thread['lastpostid']">
<if condition="$thread['replycount'] == 0">
if user posts less than 1
<if condition="$bbuserinfo['posts'] < 1">
if these forum ids
<if condition="in_array($foruminfo['forumid'], array(1, 2, 3))">
<if condition="in_array($forum['forumid'], array(1, 2, 3))">
if these scripts (page name)
<if condition="in_array(THIS_SCRIPT, array('newreply','showthread', 'showpost'))">
if thread has prefix
<if condition="$thread['prefix_rich']">
if this page of this script
<if condition="THIS_SCRIPT == 'index' AND $page == 2">
if last post over a year ago
<if condition="$thread['lastpost'] < (TIMENOW - (365 * 86400))">
If thread starter
<if condition="$thread['postuserid'] == $post['userid']">
if unread message
<if condition="$bbuserinfo[pmunread]">
if user option show avatars
<if condition="$bbuserinfo[showavatars]">
if notification
<if condition="$notification['total'] > 0">
This one is just as an example (something to build from) but the jist of what it says is:
If can register OR option is on and is an admin
<if condition="$show['registerbutton'] OR ($vboptions[drc_rb] == 1 AND ($vboptions[drc_rb_edt] == 1 AND is_member_of($bbuserinfo, 6)))">
This is more of a Reference / backup for my snippets, but again feel free to add yours and I will add it to the list.
For some of the basic conditionals visit THIS THREAD (https://vborg.vbsupport.ru/showthread.php?t=215032)
This list is meant for developers and are conditionals I have collected and made over the years.
If you have a unique / useful conditional to add please share and I will add it to the list.
New posts
<if condition="$show['gotonewpost']">
<if condition="$forum[statusicon]=='new'">
If hot thread
if reply count is greater than or equal to number of posts to be considered a hot thread option and that option is greater than 0
OR
if view count is greater than or equal to number of views to be considered a hot thread option and that option is greater than 0
<if condition="($thread['replycount'] >= $vbulletin->options['hotnumberposts'] AND $vbulletin->options['hotnumberposts'] > 0) OR ($thread['views'] >= $vbulletin->options['hotnumberviews'] AND $vbulletin->options['hotnumberviews'] > 0)">
If thread open
<if condition="$thread['open']">
Show to guest if registration is on
<if condition="$show['registerbutton']">
No replies
<if condition="$thread['firstpostid'] == $thread['lastpostid']">
<if condition="$thread['replycount'] == 0">
if user posts less than 1
<if condition="$bbuserinfo['posts'] < 1">
if these forum ids
<if condition="in_array($foruminfo['forumid'], array(1, 2, 3))">
<if condition="in_array($forum['forumid'], array(1, 2, 3))">
if these scripts (page name)
<if condition="in_array(THIS_SCRIPT, array('newreply','showthread', 'showpost'))">
if thread has prefix
<if condition="$thread['prefix_rich']">
if this page of this script
<if condition="THIS_SCRIPT == 'index' AND $page == 2">
if last post over a year ago
<if condition="$thread['lastpost'] < (TIMENOW - (365 * 86400))">
If thread starter
<if condition="$thread['postuserid'] == $post['userid']">
if unread message
<if condition="$bbuserinfo[pmunread]">
if user option show avatars
<if condition="$bbuserinfo[showavatars]">
if notification
<if condition="$notification['total'] > 0">
This one is just as an example (something to build from) but the jist of what it says is:
If can register OR option is on and is an admin
<if condition="$show['registerbutton'] OR ($vboptions[drc_rb] == 1 AND ($vboptions[drc_rb_edt] == 1 AND is_member_of($bbuserinfo, 6)))">
This is more of a Reference / backup for my snippets, but again feel free to add yours and I will add it to the list.