vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How can I define global var vb:raw? (https://vborg.vbsupport.ru/showthread.php?t=316090)

fxdigi-cash 12-17-2014 11:53 PM

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,

kh99 12-18-2014 12:01 AM

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

fxdigi-cash 12-18-2014 12:09 AM

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? :confused:

kh99 12-18-2014 12:15 AM

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.

fxdigi-cash 12-18-2014 01:00 AM

Thanks for the detailed answer, kh99

now it is clear. This is exactly what I was looking for! :)


All times are GMT. The time now is 12:11 AM.

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.00946 seconds
  • Memory Usage 1,719KB
  • 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
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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