You need to find out in the php files where the quickchooserbits and languagechooserbits variables are filled; they also will be registered for the footer template there. Then you need to find a hook that's executed afterwards and register those two variables for the template you want to put it in.
|
Quote:
Does this come in english? O.o Sorry, but I am VERY new to all of this due to necessity and am not familiar with some of the terminology yet. Where do I look for the PHP files? How do I register variables? How do I find/register a hook? |
The php files (among other stuff) is what you upload to your webspace. How to register variables for templates is what this tutorial is all about, but if you don't have at least basic knowledge of php this may be difficult to do.
Some basics about the vB addon/plugin system can be found here: http://www.vbulletin.com/docs/html/ |
Thanks for that. I may be getting over excited with wanting to do stuff now that I can. I will definately read up some more. I have found (bluffed) my way through a lot relatively unscathed so far.
Quick hint: Do I look int the FTP or ACP? Ta |
PHP files you find via FTP, plugins and addons you handle via AdminCP.
|
I am using a custom page and it works properly. However, I have listed on the custom page in the style editor {vb:raw navbar2}. I want the template to display what is in my navbar2 style.
This is in the php file for the custom page: $templater = vB_Template::create('ncsu'); $templater->register_page_templates(); $templater->register('navbar', $navbar); $templater->register('navbar2', $navbar2); $templater->register('pagetitle', $pagetitle); print_output($templater->render()); And it is still not recognizing {vb:raw navbar2}. Should I add something about this? If so, what? Thank you! |
Okay guys, I have read the entire thread and my apologies for my coding ignorance. What I am trying to do is, use a different navbar template on the forumdisplay pages than on the home page.
So I added a new template, called navbarforumdisplay Copied the code from the navbar template into navbarforumdisplay and removed the items I added in the forumhome version that I don't want appearing in the forumdisplay (only items I added to begin with, not vB code :) ). Then after reading this thread, I created a plugin here Title: Forumdisplay Navbar Hook Location: forumdisplay_complete Exc Order: 5 with the following code Code:
global $template_hook; Code:
{vb:raw fd_navbar} Code:
{vb:raw navbar} Thank you!!! |
could anybody please give me a step by step tutorial, how to make this code work in postbit_legacy?
PHP Code:
|
Quote:
Code:
<vb:if condition="THIS_SCRIPT != 'forumdisplay'">code not to be shown on forumdisplay</vb:if> |
Hello. I need your help.
I need the $pagenumber variable to be available in postbit_legacy so that I can create an url when the thread has multiple pages. Currently I am using: <a href="http://www.patientenfragen.net/{vb:link thread, {vb:raw thread}}" target="_blank"> but I need it to work this way: <a href="http://www.patientenfragen.net/{vb:link thread, {vb:raw thread}<vb:if condition="$pagenumber">&page={vb:raw pagenumber}</vb:if>}" target="_blank"> I need the url including the page the user is on. I am no programmer so even though your explanation is quite detailed I don't really get what I have to do. I need to register that variable to the postbit_legacy template, but how do I do that? Sorry for asking such a stupid question but I am totally lost here. Any help is much appreciated. StarBuG |
thanks for the time and effort spent on this article
very helpfull |
Please help me with this issue.
I have a plug in (Location: parse_templates) Code:
if($vbulletin->options['enable_vbadv'] AND in_array($vbulletin->userinfo['usergroupid'], explode(',', $vbulletin->options['vbadv_ug']))) I've tried to fix it like this Code:
if($vbulletin->options['enable_vbadv'] AND in_array($vbulletin->userinfo['usergroupid'], explode(',', $vbulletin->options['vbadv_ug']))) Thank you very much, and sorry for my bad English. --------------- Added [DATE]1293914180[/DATE] at [TIME]1293914180[/TIME] --------------- It's Fixed. Just simple change Location to "global_start" |
All I want to do is covert the current fetch template into current VB code. How do I do this in 4.0?
Code:
eval('$soundnotification = "' . fetch_template('sound_notification') . '";'); Code:
$soundnotification .= vB_Template::create('sound_notification')->render(); |
is posible to do
{vb:raw my_var.userid} or how i should call for the user id or username? for example vb3: <br>User Registration IP Address: $spammerinfo[ipaddress] <br>User IP Address for Selected Post: $postinfo[ipaddress] but how to make it work for vb4? :S |
Quote:
{vb:raw spammerinfo.ipaddress} {vb:raw postinfo.ipaddress} |
uhmm yeah, but the problem is that spammerinfo attribute is not working :S
|
Quote:
|
Quote:
|
I want to register $forum in facebook_publishcheckbox template. But I don't know where I set those set those register value in what file.
PHP Code:
facebook_publishcheckbox Template Code:
<label id="fb_pulishlabel" for="fb_dopublish"> |
Put the register code in a plugin, and call it where your template displays (by choosing hook location). In the case you don't really know what to do, Creat a new plugin and choose hook location is global_start or parse_template
|
Quote:
|
I've created a custom template "memberaction_dropdown_one" which I want to have show up in another custom template "postbit1".
Please help show me how to declare this. If anyone has skype it would be very much appreciated if you could walk me through the process in realtime (probably 5 min max). Send me a PM. |
Just out of curiosity, is there any reason why this wouldn't work in vB 4.1.1? I'm getting some unexpected errors and wanted to rule out that element before I dig TOO deep.
Brandon |
Quote:
|
This is where one of those "thank you" mods would come in handy. This was a lifesaver, I was able to upgrade a mod that I needed for any upgrade.
|
Is there any way to make plugin that uses remote database connection or use to extract data from other server?
We have vbulletin forum for our site, but our site is located on one server and forum located on another server in order to avoid load. I want to extract data from main site (which is located on another server) and display it on forum. I tried lot , searched everywhere. But I not found any specific plugin / mod. I created custom plugin on my own but it giving errors like "MySql client ran out of memory" "Invalid key error" |
This is question has nothing to do with the article this discussion thread is for. Please open your own thread in an appropriate forum.
|
I'm trying to capture a rendered/parsed template to a variable like so:
PHP Code:
Can anyone help me? |
using in a mod:
1) make a new plugin Hook: global_start code: PHP Code:
also, tested and working in vb 4.1.2 also note that you can even make your own hook by using the code: HTML Code:
{vb:raw template_hook.hook_name} simple stuff. |
Quote:
By the way: hook global_start is not a good choice. It does not exist in the CMS and will vanish from any part of the product that gets rewritten to the OOP framework in future. |
Quote:
Code:
$myvar = $templater->render(); should be this: Code:
$myvar .= $templater->render(); |
I'm struggling with getting data from a variable into one of the stock templates. Here's what I've done:
Created a custom plugin with the hook location set to "global_start": $roscohtml = "<div>HELLO WORLD!</div>"; error_log($roscohtml); vB_Template::preRegister('header',array('roscohtml '=>$roscohtml)); Then I customized the header template to contain this: <div class="above_body"> <!-- closing tag is in template navbar --> <div>test before</div> {vb:raw roscohtml} <div>test after</div> Unfortunately the variable isn't being output. I do see the contents in the error log, so I know it's firing. Any tips? Thanks, Rosco --------------- Added [DATE]1302039172[/DATE] at [TIME]1302039172[/TIME] --------------- OK, I think I found the problem - the global_start hook is not the right place for this to live. I moved my code to the parse_templates hook and the data is now available. Is there a document which outlines the best way to leverage the hooks, or at least where each is called in the flow? Rosco |
as templates no longer get output using eval
i tried to change it but seems not working. can anyone help me with this code? PHP Code:
|
<a href="https://vborg.vbsupport.ru/showpost.php?p=2180014&postcount=151" target="_blank">https://vborg.vbsupport.ru/showp...&postcount=151</a>
|
I hoping this isn't too far off topic bt if possible I think it would make a good addition to the article...
What if I want to override an existing template with a new template. Basically ignore whatever is in a given template and render a new template, and copy the new template to the old template? Is that possible? I've tried stuff like: Code:
$templater = vB_Template::create('my_new_template'); Is what I'm asking possible? Seems like it should be... Any input would be appreciated. |
Yes, it can be done easily, if what you are wanting is what I understand it to be. As an example, here is what I did for that:
Code:
$templater = vB_Template::create('boofo_forumhome_event'); |
Great, Thanks Boofo!
It might be worth mentioning for anyone else- you have to register any variables used to the ORIGINAL template (the one you are overriding) not the new template... At least that's the only way it's working for me. (On parse_templates hook) |
Are you sure? I used the same variables when I did it but I would think you only need to pre-register the variables you are going to use, not the other way around.
I did the above code in forumhome_start. Did you try the process_templates_complete hook? |
Maybe I didn't explain it right... in your example registering callink and the others to boofo_forumhome_event didn't do anything for me- I had to preRegister them to forumhome_event for them to work. I tried both parse_templates and process_templates_complete hooks.
To me it makes sense since the forum thinks it's outputting forumhome_event, and this is confirmed by viewing template names in the HTML source code. |
Well, yes and no. Since I did it in the forumhome_start hook, it needed those pre-registered for my new template. As long as the variables are good at that hook, then it will work the way I did it.
The forumhome doesn't care about the old template as long as I pre-register everything for my new template. Doing it in the parse_templates hook might be why it didn't work for you with your code. You would have to check whether whatever variables you are pre-registering have already been validated at whatever hook you are using. Now I'm getting confused. And it hurts! LOL |
All times are GMT. The time now is 04:20 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 | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|