![]() |
Register new vars in all templates
Hi,
How I register new var in all templates? And more question: How i can use php code on settings "Option Code"? Thank you! |
Quote:
|
1 I think you can't, if you find it's possible then let me know! lol
2 what you put in the option code is sorrunded by double-quotes so to use a variable you can just put this $setting[value] instead if you want to use a function then you will have to close the string in this way PHP Code:
|
Quote:
|
Thank you,
I need the value of the var to be on all templates. I know how to register him to one template: PHP Code:
Thank you. |
Be more concrete. Why would you need a variable available on every single template? Perhaps there is another way.
|
Because it a google adsense api code or more image directory, and more..
|
Please, if you want us to help you, you really need to be a bit more forthcoming. That sentence does not make much sense and it explains nothing. Why would you need adsense code available in every single template? What would you do with an image directory in every template? Either take the time to exactly explain what you want to do, or don't. You're the one with the question, remember? Don't make us beg to help you - chances are, we won't.
|
Quote:
I create new style, i put all my images in other images directory thats called "new_images". Some images have the old directory that calles "images" (Default vbulletin directory) and the others on "new_images". So I put a lot of images from "new_images" in many templates. Now, I open in settings a new setting, and put the name of directory because if I want change the directory name on future, it will be easy. and now I want to use this setting on templates without register each template. Thank you! |
Your English is fine, and thank you. In the ACP (Admin control Panel) in debug mode (you must be in debug mode), you can create a new ACP "options" setting. If you do not know how to do this, I will try to find you a tutorial. It should be easy enough to search for one.
Create a new setting in ACP options: "acp_imagepath". It will be automatically appended to "$vBulletin->options", you will then be able to access this "acp_imagepath" variable in all your templates. In your templates: Code:
{vb:raw vboptions.acp_imagepath}/ <!-- rest of your path or image --> This is only one method of many. It was chosen because it best fits your criteria. :) |
All times are GMT. The time now is 10:09 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|