Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 01-02-2008, 09:53 AM
evannn evannn is offline
 
Join Date: Oct 2005
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 01-02-2008, 10:21 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Those examples are not constants but variables.

You are looking for the THIS_SCRIPT constant.
Reply With Quote
  #3  
Old 01-02-2008, 11:35 AM
evannn evannn is offline
 
Join Date: Oct 2005
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
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?
Reply With Quote
  #4  
Old 01-02-2008, 12:11 PM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 01-02-2008, 02:02 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 01-09-2008, 02:09 AM
Darkwaltz4's Avatar
Darkwaltz4 Darkwaltz4 is offline
 
Join Date: Oct 2002
Location: Chicago
Posts: 1,538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 so, im trying to dig around to find the various constants to turn off everything else -_-
Reply With Quote
  #7  
Old 01-09-2008, 05:55 AM
evannn evannn is offline
 
Join Date: Oct 2005
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes. If vBulletin is able to release all these information in the member directory, that would be great.
Reply With Quote
  #8  
Old 01-09-2008, 06:15 AM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)); 
Reply With Quote
  #9  
Old 01-09-2008, 06:25 AM
Darkwaltz4's Avatar
Darkwaltz4 Darkwaltz4 is offline
 
Join Date: Oct 2002
Location: Chicago
Posts: 1,538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeah, finding them is no big deal 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
Reply With Quote
  #10  
Old 01-09-2008, 06:53 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:44 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07852 seconds
  • Memory Usage 2,254KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete