Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-17-2014, 11:53 PM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How can I define global var vb:raw?

Hi,

I want to know how to register a global variable {vb:raw my_var} as a link. I'm trying to do that to avoid time wasting when I have to change a url to my images, smilies, avatars, js scripts and etc...

for example: in css templates, we use it like this ---

Code:
{vb:raw vboptions.bburl}/images/sidebar.png
or maybe like this:

Code:
{vb:raw vboptions.bburl}/clientscript/vbulletin_css/style1.css
or maybe like this:

Code:
{vb:raw vboptions.bburl}/clientscript/jquery.js
so what I want is to register a global variable such as {vb:raw new_url} and add it to links above so I can change it anytime I move from a domain to another.

like this:
Code:
{vb:raw new_url}/clientscript/jquery.js
I hope the idea is clear.

Thanks,
Reply With Quote
  #2  
Old 12-18-2014, 12:01 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, if you created a new setting with new_url as the varname, then you could use {vb:raw vboptions.new_url}. To create an option you can temporarily turn on debug mode for your site, then go to the settings in the admincp, go to the group you want to add to, then click on the "Add Setting" link that will appear at the top of each group. You can also create a new setting group if you want (there's a link on the main option page).

Here's an article about turning on debug mode, if you aren't familiar with it: https://vborg.vbsupport.ru/showthread.php?t=265999
Reply With Quote
  #3  
Old 12-18-2014, 12:09 AM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi kh99, Thanks for the comments.

maybe I wasn't clear enough. I meant independent or custom url where I can use anywhere in all templates. I don't mean to change the main vb url, but rather to change url images, scripts and so on since I use a subdomain for all these stuff.

does what I say make sense?
Reply With Quote
  #4  
Old 12-18-2014, 12:15 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, maybe I don't understand. But if you create a setting, then you can enter any value you want and use it in any template. Maybe you're thinking that it's changing some other url because it has vboptions in the name? That's just the name of the array that holds all the settings. You can create a setting with any varname you want and use it for anything you want, and it won't affect anything else (as long as you choose a varname that it's already used, but I don't think it will let you create a duplicate). ETA: no, you can't create a duplicate, so you don't have to worry about that.
Reply With Quote
Благодарность от:
fxdigi-cash
  #5  
Old 12-18-2014, 01:00 AM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the detailed answer, kh99

now it is clear. This is exactly what I was looking for!
Reply With Quote
Reply


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 04:40 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.04067 seconds
  • Memory Usage 2,200KB
  • 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
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (1)post_thanks_box_bit
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete