vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Where can I look for vbulletin constants? (https://vborg.vbsupport.ru/showthread.php?t=166721)

evannn 01-02-2008 09:53 AM

Where can I look for vbulletin constants?
 
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

Quote:

Originally Posted by Marco van Herwaarden (Post 1413795)
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
Code:

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
Code:

<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.
PHP Code:

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:
Code:

// 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 [DATE]1199884383[/DATE] at [TIME]1199884383[/TIME] ---------------

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

Quote:

Originally Posted by evannn (Post 1418294)
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

Quote:

Originally Posted by Marco van Herwaarden (Post 1418843)
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.


All times are GMT. The time now is 03:50 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01205 seconds
  • Memory Usage 1,754KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (14)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete