View Full Version : Variables for conditionals
JohnK
04-19-2004, 10:38 PM
I am just starting to look at using conditionals, and they look like a simple but powerful tool. However you need to know what variables are available and what they do.
Is this documented anywhere? I've looked through the manual and searched on vbulletin.com and here but can't find anything -- have I missed it?
Thanks
John
assassingod
04-19-2004, 10:43 PM
It really depeds on what you want to do. There isn't a list of what variable you can use because you can use anything.
SVTBlackLight01
04-19-2004, 11:24 PM
As far as I know (which isn't much :D ), there isn't a list of the variables anywhere. Although a single searchable location of all the variables and what they do would be great.
filburt1
04-19-2004, 11:42 PM
I am just starting to look at using conditionals, and they look like a simple but powerful tool. However you need to know what variables are available and what they do.
Is this documented anywhere? I've looked through the manual and searched on vbulletin.com and here but can't find anything -- have I missed it?
Thanks
John
I very strongly agree with you that there needs to be a great deal of documentation available on what variables can be used (for example; what keys are in the $post array for postbits, $bbuserinfo everywhere, etc.).
JohnK
04-20-2004, 12:13 AM
OK, how about something really basic
The variables appear to be in two parts eg $bbuserinfo['userid'] there are also $show $post etc
Can anyone start by explaining how this works?
Thanks
John
zetetic
06-18-2004, 03:28 PM
OK, how about something really basic
The variables appear to be in two parts eg $bbuserinfo['userid'] there are also $show $post etc
Can anyone start by explaining how this works?
I assume you've figured this out by now, but in case anyone else stumbles on this thread and is wondering the same thing...
$bbuserinfo is a variable array: A variable that can hold multiple values, as opposed to a standard variable that holds only one value.
'userid' is one value in the $bbuserinfo array that is only set if the user is a registered member.
So basically "if $bbuserinfo['userid']" is equivelant to saying, "Is the 'userid' value in the $bbuserinfo array set? If yes, then the user is registered".
To the best of my knowledge there is no one location where all the standard conditionals are documented here. One developer said it's because there are dozens of variable arrays with hundreds of values each, and as such making a list is just too time consuming for anyone to get to it right now.
Or something. :)
Zachery
06-18-2004, 03:38 PM
I assume you've figured this out by now, but in case anyone else stumbles on this thread and is wondering the same thing...
$bbuserinfo is a variable array: A variable that can hold multiple values, as opposed to a standard variable that holds only one value.
'userid' is one value in the $bbuserinfo array that is only set if the user is a registered member.
So basically "if $bbuserinfo['userid']" is equivelant to saying, "Is the 'userid' value in the $bbuserinfo array set? If yes, then the user is registered".
To the best of my knowledge there is no one location where all the standard conditionals are documented here. One developer said it's because there are dozens of variable arrays with hundreds of values each, and as such making a list is just too time consuming for anyone to get to it right now.
Or something. :)
there are only a speciric ammount of $show varibles and for the most part they are not global
$bbuserinfo
$vboptions
$stylevar
Are the 3 globals that i am aware about besides $GLOBAL
$bbuserinfo can show anything that is stored in the usertable field for the specific person who is online: IE $bbuserinfo[posts] will show the amount of posts, $bbuserinfo[username] will show a users, username.
$vboptions are all the options that are stored in the settings table like to show DHTML or the name of your board or even your bulletin boards url
$vboptions[bburl] $vboptions[homeurl]
$stylevar holds all the non css style settings, like the image directorys.
The problem with the documentation is there are so many vairbles that are possible for all thoughs said templates its hard to just document them.
vbmechanic
06-18-2004, 03:40 PM
A comprehensive list of $vboptions and $stylevar would be dandy.
Zachery
06-18-2004, 03:42 PM
A comprehensive list of $vboptions and $stylevar would be dandy.
Ill see about getting a list out for thoughs two later today, :)
zetetic
06-18-2004, 03:47 PM
There's a post here (http://www.vbulletin.com/forum/showpost.php?p=475554&postcount=5) that suggests one way of finding out what is stored in a particular array. As mentioned in that thread, though, you'll only see the output relevant to the current user.
zetetic
06-18-2004, 04:27 PM
Okay, here are the values of my $bbuserinfo array on index.php (I've deleted the actual values for security purposes, and I apologize in advance if posting this code somehow violates any rules here):
Array
(
[userid] =>
[temp] =>
[field1] =>
[field2] =>
[field3] =>
[field4] =>
[subfolders] =>
[pmfolders] =>
[buddylist] =>
[ignorelist] =>
[signature] =>
[searchprefs] =>
[usergroupid] =>
[membergroupids] =>
[displaygroupid] =>
[username] =>
[password] =>
[passworddate] =>
[email] =>
[styleid] =>
[parentemail] =>
[homepage] =>
[icq] =>
[aim] =>
[yahoo] =>
[showvbcode] =>
[usertitle] =>
[customtitle] =>
[joindate] =>
[daysprune] =>
[lastvisit] =>
[lastactivity] =>
[lastpost] =>
[posts] =>
[reputation] =>
[reputationlevelid] =>
[timezoneoffset] =>
[pmpopup] =>
[avatarid] =>
[avatarrevision] =>
[options] =>
[birthday] =>
[birthday_search] =>
[maxposts] =>
[startofweek] =>
[ipaddress] =>
[referrerid] =>
[languageid] =>
[msn] =>
[emailstamp] =>
[threadedmode] =>
[autosubscribe] =>
[pmtotal] =>
[pmunread] =>
[salt] =>
[arcadesettings] =>
[lang_options] =>
[lang_code] =>
[lang_charset] =>
[lang_locale] =>
[lang_imagesoverride] =>
[lang_dateoverride] =>
[lang_timeoverride] =>
[lang_registereddateoverride] =>
[lang_calformat1override] =>
[lang_calformat2override] =>
[lang_logdateoverride] =>
[lang_decimalsep] =>
[lang_thousandsep] =>
[showsignatures] =>
[showavatars] =>
[showimages] =>
[coppauser] =>
[adminemail] =>
[showvcard] =>
[dstauto] =>
[dstonoff] =>
[showemail] =>
[invisible] =>
[showreputation] =>
[receivepm] =>
[emailonpm] =>
[hasaccessmask] =>
[postorder] =>
[urlusername] =>
[musername] =>
[displaygrouptitle] =>
[displayusertitle] =>
[realstyleid] =>
[tzoffset] =>
[lastvisitdate] =>
[permissions] => Array
(
[usergroupid] =>
[title] =>
[description] =>
[usertitle] =>
[passwordexpires] =>
[passwordhistory] =>
[pmquota] =>
[pmsendmax] =>
[pmforwardmax] =>
[opentag] =>
[closetag] =>
[canoverride] =>
[ispublicgroup] =>
[forumpermissions] =>
[pmpermissions] =>
[calendarpermissions] =>
[wolpermissions] =>
[adminpermissions] =>
[genericpermissions] =>
[genericoptions] =>
[pmpermissions_bak] =>
[attachlimit] =>
[avatarmaxwidth] =>
[avatarmaxheight] =>
[avatarmaxsize] =>
[profilepicmaxwidth] =>
[profilepicmaxheight] =>
[profilepicmaxsize] =>
[arcadepermissions] =>
)
[forumpermissions] => Array
(
[1] =>
[2] =>
)
[calendarpermissions] => Array
(
[1] =>
)
[joingroupid] =>
Zachery
06-18-2004, 04:32 PM
Okay, here are the values of my $bbuserinfo array on index.php (I've deleted the actual values for security purposes, and I apologize in advance if posting this code somehow violates any rules here):
Array
(
[userid] =>
[temp] =>
[field1] =>
[field2] =>
[field3] =>
[field4] =>
[subfolders] =>
[pmfolders] =>
[buddylist] =>
[ignorelist] =>
[signature] =>
[searchprefs] =>
[usergroupid] =>
[membergroupids] =>
[displaygroupid] =>
[username] =>
[password] =>
[passworddate] =>
[email] =>
[styleid] =>
[parentemail] =>
[homepage] =>
[icq] =>
[aim] =>
[yahoo] =>
[showvbcode] =>
[usertitle] =>
[customtitle] =>
[joindate] =>
[daysprune] =>
[lastvisit] =>
[lastactivity] =>
[lastpost] =>
[posts] =>
[reputation] =>
[reputationlevelid] =>
[timezoneoffset] =>
[pmpopup] =>
[avatarid] =>
[avatarrevision] =>
[options] =>
[birthday] =>
[birthday_search] =>
[maxposts] =>
[startofweek] =>
[ipaddress] =>
[referrerid] =>
[languageid] =>
[msn] =>
[emailstamp] =>
[threadedmode] =>
[autosubscribe] =>
[pmtotal] =>
[pmunread] =>
[salt] =>
[arcadesettings] =>
[lang_options] =>
[lang_code] =>
[lang_charset] =>
[lang_locale] =>
[lang_imagesoverride] =>
[lang_dateoverride] =>
[lang_timeoverride] =>
[lang_registereddateoverride] =>
[lang_calformat1override] =>
[lang_calformat2override] =>
[lang_logdateoverride] =>
[lang_decimalsep] =>
[lang_thousandsep] =>
[showsignatures] =>
[showavatars] =>
[showimages] =>
[coppauser] =>
[adminemail] =>
[showvcard] =>
[dstauto] =>
[dstonoff] =>
[showemail] =>
[invisible] =>
[showreputation] =>
[receivepm] =>
[emailonpm] =>
[hasaccessmask] =>
[postorder] =>
[urlusername] =>
[musername] =>
[displaygrouptitle] =>
[displayusertitle] =>
[realstyleid] =>
[tzoffset] =>
[lastvisitdate] =>
[permissions] => Array
(
[usergroupid] =>
[title] =>
[description] =>
[usertitle] =>
[passwordexpires] =>
[passwordhistory] =>
[pmquota] =>
[pmsendmax] =>
[pmforwardmax] =>
[opentag] =>
[closetag] =>
[canoverride] =>
[ispublicgroup] =>
[forumpermissions] =>
[pmpermissions] =>
[calendarpermissions] =>
[wolpermissions] =>
[adminpermissions] =>
[genericpermissions] =>
[genericoptions] =>
[pmpermissions_bak] =>
[attachlimit] =>
[avatarmaxwidth] =>
[avatarmaxheight] =>
[avatarmaxsize] =>
[profilepicmaxwidth] =>
[profilepicmaxheight] =>
[profilepicmaxsize] =>
[arcadepermissions] =>
)
[forumpermissions] => Array
(
[1] =>
[2] =>
)
[calendarpermissions] => Array
(
[1] =>
)
[joingroupid] =>
Anything in the user table, and all userprofile feilds are avable thogh $bbuserinfo
zetetic
06-18-2004, 04:42 PM
Here's the $vboptions array (keeping in mind my board is hacked, so I may have options here that others don't):
Array
(
[templateversion] =>
[attachfile] =>
[attachpath] =>
[usefileavatar] =>
[avatarpath] =>
[avatarurl] =>
[divnotpara] =>
[usebbcodeparserecurse] =>
[bbactive] =>
[bbclosedreason] =>
[bbtitle] =>
[bburl] =>
[hometitle] =>
[homeurl] =>
[contactuslink] =>
[contactusoptions] =>
[webmasteremail] =>
[privacyurl] =>
[copyrighttext] =>
[companyname] =>
[faxnumber] =>
[address] =>
[keywords] =>
[description] =>
[useforumjump] =>
[pagenavpages] =>
[enableaccess] =>
[showimicons] =>
[addtemplatename] =>
[usestrikesystem] =>
[yestoday] =>
[timeoffset] =>
[dstonoff] =>
[dateformat] =>
[timeformat] =>
[registereddateformat] =>
[calformat1] =>
[calformat2] =>
[logdateformat] =>
[cookietimeout] =>
[cookiepath] =>
[cookiedomain] =>
[gzipoutput] =>
[gziplevel] =>
[addheaders] =>
[nocacheheaders] =>
[useheaderredirect] =>
[allowphpinfo] =>
[cachemaxage] =>
[threadviewslive] =>
[attachmentviewslive] =>
[emailsendnum] =>
[sessionlimit] =>
[loadlimit] =>
[allowimgsizefailure] =>
[gdversion] =>
[safeupload] =>
[tmppath] =>
[usemailqueue] =>
[needfromemail] =>
[copypostindex] =>
[languageid] =>
[styleid] =>
[allowchangestyles] =>
[cleargifurl] =>
[storecssasfile] =>
[usepopups] =>
[legacypostbit] =>
[enablecensor] =>
[censorchar] =>
[censorwords] =>
[blankasciistrip] =>
[enableemail] =>
[displayemails] =>
[secureemail] =>
[emailfloodtime] =>
[allowregistration] =>
[usecoppa] =>
[moderatenewmembers] =>
[regimagecheck] =>
[welcomemail] =>
[newuseremail] =>
[allowmultiregs] =>
[verifyemail] =>
[requireuniqueemail] =>
[minuserlength] =>
[maxuserlength] =>
[illegalusernames] =>
[usereferrer] =>
[defaultregoptions] =>
[ctMaxChars] =>
[ctCensorWords] =>
[ctCensorMod] =>
[allowsignatures] =>
[sigmax] =>
[allowbbcode] =>
[allowsmilies] =>
[allowbbimagecode]
[allowhtml] =>
[ignoremods] =>
[avatarenabled] =>
[numavatarswide] =>
[numavatarsperpage] =>
[profilepicenabled] =>
[reputationenable] =>
[reputationhide] =>
[reputationdefault] =>
[reputationundefined] =>
[showuserrates] =>
[adminpower] =>
[rdpower] =>
[pcpower] =>
[kppower] =>
[minreputationpost] =>
[minreputationcount] =>
[maxreputationperday] =>
[reputationrepeat] =>
[unallowvbcode] =>
[unallowsmilies] =>
[unallowimg] =>
[unallowhtml] =>
[enablememberlist] =>
[memberlistposts] =>
[memberlistfields] =>
[memberlistperpage] =>
[usememberlistadvsearch] =>
[profilelastpost] =>
[enablebanning] =>
[banip] =>
[banemail] =>
[allowkeepbannedemail] =>
[globalignore] =>
[allowedbbcodes] =>
[codemaxlines] =>
[quickreply] =>
[quickreplyclick] =>
[postminchars] =>
[ignorequotechars] =>
[quotetitle] =>
[postmaxchars] =>
[maximages] =>
[stopshouting] =>
[allowdynimg] =>
[floodchecktime] =>
[editthreadtitlelimit] =>
[addpolltimeout] =>
[edittimelimit] =>
[noeditedbytime] =>
[logip] =>
[allowvbcodebuttons] =>
[wysiwyg_show_smiliebox] =>
[smtotal] =>
[smcolumns] =>
[wysiwyg_smtotal] =>
[syscolorpicker] =>
[attachtotalspace] =>
[attachlimit] =>
[attachboxcount] =>
[allowattachdel] =>
[allowclosedattachdel] =>
[allowduplicates] =>
[viewattachedimages] =>
[attachthumbs] =>
[attachthumbssize] =>
[attachrow] =>
[thumbpng] =>
[maxpolloptions] =>
[updatelastpost] =>
[showvotes] =>
[votechange] =>
[enablesearches] =>
[searchfloodtime] =>
[minsearchlength] =>
[maxsearchlength] =>
[goodwords] =>
[searchperpage] =>
[maxresults] =>
[allowwildcards] =>
[similarthreadsearch] =>
[similarthreadthreshold] =>
[multimatchscore] =>
[datescore] =>
[threadtitlescore] =>
[posttitlescore] =>
[replyscore] =>
[replyfunc] =>
[viewscore] =>
[viewfunc] =>
[ratescore] =>
[ratefunc] =>
[forumhome] =>
[displayloggedin] =>
[showbirthdays] =>
[birthdaydatecut] =>
[showevents] =>
[showholidays] =>
[showeventtype] =>
[forumhomedepth] =>
[forumdisplaydepth] =>
[subforumdepth] =>
[showforumdescription] =>
[hideprivateforums] =>
[showlocks] =>
[lastthreadchars] =>
[showmoderatorcolumn] =>
[showforumusers] =>
[maxthreads] =>
[showstickies] =>
[showdots] =>
[usehotthreads] =>
[hotnumberviews] =>
[hotnumberposts] =>
[linktopages] =>
[maxmultipage] =>
[threadpreview] =>
[oneannounce] =>
[showthreadusers] =>
[maxposts] =>
[usermaxposts] =>
[showdeficon] =>
[enableage] =>
[wordwrap] =>
[threadvoted] =>
[threadsubscribed] =>
[showsimilarthreads] =>
[allowthreadedmode] =>
[threadedmode] =>
[threaded_listdepth] =>
[threaded_maxcache] =>
[enablepms] =>
[checknewpm] =>
[pmmaxchars] =>
[pmfloodtime] =>
[pmperpage] =>
[pmmaxperpage] =>
[privallowicons] =>
[privallowbbcode] =>
[privallowsmilies] =>
[privallowbbimagecode] =>
[privallowhtml] =>
[WOLenable] =>
[WOLrefresh] =>
[WOLguests] =>
[WOLresolve] =>
[enablespiders] =>
[spiderstrings] =>
[spiderdesc] =>
[archiveenabled] =>
[archive_threadsperpage] =>
[archive_postsperpage] =>
[cpstylefolder] =>
[timeoutcontrolpanel] =>
[adminquickstats] =>
[cp_collapse_forums] =>
[cp_usereditcolumns] =>
[externaljs] =>
[externalrss] =>
[externalxml] =>
[errorlogdatabase] =>
[errorlogsecurity] =>
[errorlogmaxsize] =>
[disableerroremail] =>
[subscriptionmethods] =>
[ppemail] =>
[ncxemail] =>
[worldpay_instid] =>
[authorize_loginid] =>
[abspath] =>
[hourdiff] =>
)
zetetic
06-18-2004, 04:46 PM
And $stylevar:
Array
(
[cellpadding] =>
[cellspacing] =>
[closedthreadimage] =>
[codeblockwidth] =>
[contenttype] =>
[formspacer] =>
[formwidth] =>
[formwidth_usercp] =>
[htmldoctype] =>
[htmlextrasfolder] =>
[imagesfolder] =>
[imgdir_attach] =>
[imgdir_button] =>
[imgdir_editor] =>
[imgdir_misc] =>
[imgdir_poll] =>
[imgdir_rating] =>
[imgdir_reputation] =>
[imgdir_statusicon] =>
[messagewidth] =>
[messagewidth_usercp] =>
[newreplyimage] =>
[newthreadimage] =>
[outerborderwidth] =>
[outertablewidth] =>
[spacersize] =>
[tablewidth] =>
[textareacols_ie4] =>
[textareacols_ns4] =>
[textareacols_ns6] =>
[titleimage] =>
[textdirection] =>
[left] =>
[right] =>
[languagecode] =>
[charset] =>
[body_bgcolor] =>
[body_fgcolor] =>
[page_bgcolor] =>
[page_fgcolor] =>
[tborder_bgcolor] =>
[tborder_fgcolor] =>
[tcat_bgcolor] =>
[tcat_fgcolor] =>
[thead_bgcolor] =>
[thead_fgcolor] =>
[tfoot_bgcolor] =>
[tfoot_fgcolor] =>
[alt1_bgcolor] =>
[alt1_fgcolor] =>
[alt2_bgcolor] =>
[alt2_fgcolor] =>
[alt3_bgcolor] =>
[alt3_fgcolor] =>
[wysiwyg_bgcolor] =>
[wysiwyg_fgcolor] =>
[time_fgcolor] =>
[highlight_fgcolor] =>
[fjsel_bgcolor] =>
[fjsel_fgcolor] =>
[fjdpth0_bgcolor] =>
[fjdpth0_fgcolor] =>
[panel_bgcolor] =>
[panel_fgcolor] =>
[panelsurround_bgcolor] =>
[panelsurround_fgcolor] =>
[legend_fgcolor] =>
[vbmenu_control_bgcolor] =>
[vbmenu_control_fgcolor] =>
[vbmenu_popup_bgcolor] =>
[vbmenu_popup_fgcolor] =>
[vbmenu_option_bgcolor] =>
[vbmenu_option_fgcolor] =>
[vbmenu_hilite_bgcolor] =>
[vbmenu_hilite_fgcolor] =>
[imgdir_arcade] =>
[outerdivwidth] =>
[divwidth] =>
)
RapCheck
07-28-2004, 05:50 PM
good thread, it just helped me
gotta love the search
functions that can be used with conditionals:
// php functions
in_array();
is_array();
is_numeric();
isset();
empty();
defined();
array();
// vBulletin functions
can_moderate();
can_moderate_calendar();
exec_switch_bg();
is_browser();
is_member_of();
feldon23
08-14-2004, 04:32 PM
Not sure how posting a list of variables without example values is helpful...
When hacking vB3, I usually
echo "<pre>";
print_r($array);
echo "</pre>";
so I can see what a variable is for.
T3MEDIA
02-11-2005, 11:25 PM
User id is say 150
how do I write this in code to find his field20 lets say in his profile.
If I use $bbuserinfo it pulls back my (the loged in users) info.
I want to pull any users info...
this isnt proper code but I want something like this.
$onlineuser[userid](field20)
just assume $onlineuser acutally pulls the user id of 150
field20 lets say is "Huston"
at the end of the day on the HTML page you see HUSTON
and it would change for each user.
this is for WOL BTW
neocorteqz
02-24-2005, 10:30 AM
User id is say 150
how do I write this in code to find his field20 lets say in his profile.
If I use $bbuserinfo it pulls back my (the loged in users) info.
I want to pull any users info...
this isnt proper code but I want something like this.
$onlineuser[userid](field20)
just assume $onlineuser acutally pulls the user id of 150
field20 lets say is "Huston"
at the end of the day on the HTML page you see HUSTON
and it would change for each user.
this is for WOL BTW
$bbuserinfo[field20]
Guest190829
02-24-2005, 01:47 PM
This is very useful, keep up the good work!
AshAbed
02-24-2005, 03:33 PM
How about this...
I have a profile field with a dropdown list where a member chooses the state they live in. I want a conditional that says 'if user selected choice #__ in profile field #__.'
Thanks.
How about this...
I have a profile field with a dropdown list where a member chooses the state they live in. I want a conditional that says 'if user selected choice #__ in profile field #__.'
Thanks.
<if condition="$var[fieldX]">do stuff</if>
I think.
$var would be $post or $bbuserinfo or whatever.
neocorteqz
02-24-2005, 10:35 PM
<if condition="$var[fieldX]">do stuff</if>
I think.
$var would be $post or $bbuserinfo or whatever.
For fields in profile it's $bbuserinfo.
and yes that is the conditional
<if condition="$bbuserinfo[fieldX]">Some code here </if>
If the user didn't selct a certain choice you don't want displayed, I'mnot exactly sure what you do. I know you can exlude code by != But I'mnot exactly sure how one would excluse a profile field that is notstatic.
AshAbed
02-24-2005, 11:36 PM
I made it so the users must select a choice upon registration. Lets say they chose '7' and the field's ID is '15'... what would be the code to display something for a user with that selected?
T3MEDIA
02-25-2005, 03:06 AM
$bbuserinfo[field20]This only works on areas where the logged in user is. I want a varable. say userid 2555 field 20 this is what I mean. How can you do that?
DavidatMPA
04-18-2005, 01:20 AM
Yep, gotta love the search, GREAT thread!
dutchbb
09-23-2005, 12:38 PM
Sorry to bump this but:
I want to show code in a certain thread. So I use the threadID
How do I define the conditional for a threadid?
T3MEDIA
10-06-2005, 11:38 AM
This only works on areas where the logged in user is. I want a varable. say userid 2555 field 20 this is what I mean. How can you do that?light bump to refresh my first question.
SO if say YOU are looking at my page you can see visually my field 20.
So I am asking how to pull up.... say... my userid... not yours... (as in bbuser) and find field 20
Yorixz
10-23-2005, 01:13 PM
Might be a little late for a reaction but still; I'm wondering if there's also a $post variable available that contains the name of the usergroup as person is in. In fact it would be similar to the "Group:" you got with IPB, I just don't feel like putting up 10 conditionals for every usergroup I've got...
I want to be able to let people edit their usertitle without having trouble with users acting like they're a staffmember.
perju
04-07-2007, 11:17 PM
This thread is great. Can somone provide a list for the $post array?
Zachery
04-08-2007, 12:28 PM
Same as $bbuserinfo, but just for the person who made the [post.
perju
04-10-2007, 12:59 AM
How would I display a user's profile picture inside of a post? I'm having lots of trouble with this.
Zachery
04-10-2007, 04:36 AM
ATM theres no easy way, as in theres no varible. Try making a request.
perju
04-10-2007, 02:49 PM
Do I request it here? :)
perju
04-25-2007, 06:16 PM
If I were to create the variable, what file / template would I look into?
dartho
09-11-2007, 03:15 AM
Thanks for all the info!
dartho
11-09-2007, 05:07 AM
Are there any variables which can tell you where you are on the site?
If a user is viewing one of a number of pages, I want to add additional links to the navbar.
After checking the whosonlinebit template I see there is $userinfo[location], but this doesn;t seem to be set in other templates. Any ideas?
Thanks
Opserty
11-09-2007, 12:30 PM
THIS_SCRIPT is defined on all vBulletin pages (that use templates) I think they are just the name of the file without the .php extension. Therefore your conditional with look like:
<if condition="THIS_SCRIPT == 'showthread'">
You are viewing a thread!
</if>
dartho
11-09-2007, 08:43 PM
thanks, did the trick!
alaa2142
11-10-2007, 03:46 PM
good thread, it just helped me
gotta love the search
dartho
12-04-2007, 11:00 AM
I'm trying to add a conditional to my postbit which does not show attachments in a specific forum. Any ideas on the variable?
<if condition="$postinfo[forumid] != '5'">Show attachments</if>
I'm guessing here, but it now work :(
Zachery
12-04-2007, 03:59 PM
$GLOBALS[forumid]
dartho
12-05-2007, 01:28 AM
Thankyou!
Anyone able to make a complete list of $GLOBALS variables? This thread has helped me a lot quite often!
valdet
12-05-2007, 04:43 AM
Keep the list growing guys. This is an amazing resource.
Opserty
12-05-2007, 12:08 PM
Anyone able to make a complete list of $GLOBALS variables?
You only need to use $GLOBALS when the template is called inside a function, there isn't a list so you have to check the files that calls that template to see what is available.
Zachery
12-06-2007, 12:48 PM
You only need to use $GLOBALS when the template is called inside a function, there isn't a list so you have to check the files that calls that template to see what is available.
Most everything is avaible in globals in some way shape or form.
Opserty
12-06-2007, 02:42 PM
Most everything is avaible in globals in some way shape or form.
I never said it wasn't...:confused:
rungok
12-09-2007, 11:49 AM
Is there a way to check if someone has birthday today? The birthday and birthdaysearch-field contains year aswell, so breaking this variable up in a template would be a bit difficult. In forumhome there is a cake displayed for the persons that have birthday, so maybe there is some variable floating around that I could use to trigger som happening in postbit like showing this cake under the users avatar?
RedTyger
12-09-2007, 12:12 PM
I doubt it is as simple as a conditional, but there is already a modification around that does this.
rungok
12-09-2007, 05:02 PM
I doubt it is as simple as a conditional, but there is already a modification around that does this.
Do you know where this modification is?
adnan2007
12-09-2007, 10:50 PM
Hey can u define your own variables to be available in template conditionals?
If so, can somebody tell me how?
I put some code in Global Start along with some vars, but when i go to check against their values in template conditionals, it seems they're out of scope.
Anybody know how to do this?
thx
rungok
12-13-2007, 09:07 PM
Is there a way to check if someone has birthday today? The birthday and birthdaysearch-field contains year aswell, so breaking this variable up in a template would be a bit difficult. In forumhome there is a cake displayed for the persons that have birthday, so maybe there is some variable floating around that I could use to trigger som happening in postbit like showing this cake under the users avatar?
To answer my own question (in case anyone wonders) I can probably use this little snippet of code:
https://vborg.vbsupport.ru/showthread.php?t=82612
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.