View Full Version : Where can I look for vbulletin constants?
evannn
01-02-2008, 09:53 AM
Hi everyone.
Where can I find/read up on all the vbulletin's constants?
eg:
$show['member']
or
$bbuserinfo[username]
Right now I wish to detect whether the current page is "index.php". I believe I have to look through the constants.
Can any kind soul please give some advice please?
Thanks
Marco van Herwaarden
01-02-2008, 10:21 AM
Those examples are not constants but variables. ;)
You are looking for the THIS_SCRIPT constant.
evannn
01-02-2008, 11:35 AM
Those examples are not constants but variables. ;)
You are looking for the THIS_SCRIPT constant.
Thanks Marco!
But, where are the references for these variables? Which part of the vbulletin manual can I find it? :D
Dismounted
01-02-2008, 12:11 PM
There isn't anything about them in the manual. The manual only specifies how to run the forum and occasionally touches on the technical coding.
Lynne
01-02-2008, 02:02 PM
At the top of the index page (and most pages) is a line that says define('THIS_SCRIPT', 'index'); (it's unique for every page). So, if you want to check for that page in a template, you would write
<if condition="THIS_SCRIPT=='index'">
Some useful articles (the whole articles section is great!):
https://vborg.vbsupport.ru/showthread.php?t=98047
https://vborg.vbsupport.ru/showthread.php?t=98009
Darkwaltz4
01-09-2008, 02:09 AM
Actually, such a list of constants (yes, i mean constants) would actually be very useful.
currently I have to do a search for define(' over the entire vbulletin directory, and that just pulls up a ton of repeats and ones I know about already (like THIS_SCRIPT, TIMENOW, TABLE_PREFIX, etc).
Not to mention this doesnt cover the ones that can be defined, and get checked along the way, like DISABLE_HOOKS... a search for defined(' gets those, but again, this doesnt guarantee that it finds all of them.
And of course nowhere does it explain what each constant is meant to indicate or flag... magical stuff like SKIP_SESSIONCREATE or LOCATION_BYPASS... fun stuff which I can sort of guess what they do, but wish I could know for sure the exact implications to create optimized pages, ones that I know exactly what they need to do, and everything else will just be a waste of time and resources.
In fact theres one block I am trying to write which will simply echo out a row from datastore (an external system processes the output). except datastore can be stored in multiple ways which get handled by global, and I dont want the script to bother with sessions or any of the usual vb setup. just build the appropriate datastore system, get my row, and die :D so, im trying to dig around to find the various constants to turn off everything else -_-
evannn
01-09-2008, 05:55 AM
Yes. If vBulletin is able to release all these information in the member directory, that would be great.
Opserty
01-09-2008, 06:15 AM
But this in a PHP Plugin somewhere, it will fetch constants that are defined but you won't be able to find those that aren't.
print_r(get_defined_constants(true));
Darkwaltz4
01-09-2008, 06:25 AM
yeah, finding them is no big deal :D like i said a quick search through the files will find tons... but does nothing to explain what vb intends them to do without studying the code. and half the time you dont even know some of them are there without seeing some random file defining it at the top of the page - so how would you know when to run that little line :p
Marco van Herwaarden
01-09-2008, 06:53 AM
Last time i build such a list was for 3.6.3:
// Last check 3.6.3
AVATAR_ON_NAVBAR
BYPASS_FILE_CHECK // Bypass File Check (install/tools/etc..)
BYPASS_STYLE_OVERRIDE
CP_BACKURL
CP_REDIRECT
CVS_REVISION
CWD
DEMO_MODE
DIE_QUIETLY
DISABLE_HOOKS
DISABLE_MAIL
DISABLE_PASSWORD_CLEARING // you may define this if you don't want the password in the login box to be zapped onsubmit; good for integration
DISABLE_PRODUCT_REDIRECT
DONEFIND
DONE_CPHEADER
DONE_HEADER
ECHO_CRON_LOG
FEED_SAVE_ERROR
FILE_VERSION
FORCE_HOOKS
FORCE_MAIL_CRLF
HIDEPROCEED
IN_CONTROL_PANEL
IS_NAV_PANEL
LOCATION_BYPASS
MAXFORUMDEPTH
MYSQL_VERSION
NOCOOKIES
NOHEADER
NONEXTSTEP
NOPMPOPUP
NOSHUTDOWNFUNC
NOZIP
NO_CP_COPYRIGHT
NO_IMPORT_DOTS
NO_LOG
NO_PAGE_TITLE
NO_POST_EDITOR_BUILD
ONLYID // Internal?
PMPREVIEW
POST_EXPLAIN
RAND_SEEDED
SCRIPTCOMPLETE
SESSION_BYPASS
SKIPDB
SKIP_AGGRESSIVE_LOGOUT
SKIP_DEFAULTDATASTORE
SKIP_REFERRER_CHECK
SKIP_SESSIONCREATE
SKIP_USERINFO
THIS_SCRIPT
TODAYDATE
TOMDATE
UPGRADE_COMPAT
VB_AREA
VB_ERROR_LITE
VB_ERROR_PERMISSION
VERSION
VERSION_COMPAT_ENDS
VERSION_COMPAT_STARTS
YESTDATE
evannn
01-09-2008, 10:40 AM
Thanks Marco.
May I suggest vBulletin add those to the official documentation?
Thanks.
PS: with explaination too.
--------------- Added 1199884383 at 1199884383 ---------------
Hey guys,
I noticed a "feature" in vB admincp.
If you mouseover any right pane options, the alt/title description will hover and states the related variables.
Eg: you hover over:
Allow Users to Email Other Members
It will display:
$vbulletin->options['displayemails'];
Darkwaltz4
01-09-2008, 08:35 PM
many thanks marco :D a great starting point
but i too will go suggest vb post somewhere the list of useful constants, and file-prefix flag constants
Marco van Herwaarden
01-10-2008, 07:38 AM
If you mouseover any right pane options, the alt/title description will hover and states the related variables.
Eg: you hover over:
Allow Users to Email Other Members
It will display:
$vbulletin->options['displayemails'];
If i remember correctly, then this will only work while in debug mode.
Lynne
01-10-2008, 01:36 PM
If i remember correctly, then this will only work while in debug mode.
Nope, I just checked and it works when debug is not on also.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.