vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [HOW TO - vB4] Rendering templates and registering variables - a short guide (https://vborg.vbsupport.ru/showthread.php?t=228078)

cellarius 10-09-2010 04:47 AM

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.

Vikingant 10-09-2010 08:23 PM

Quote:

Originally Posted by cellarius (Post 2108329)
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.

Thank you cellarius
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?

cellarius 10-10-2010 02:37 PM

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/

Vikingant 10-14-2010 10:59 AM

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

cellarius 10-14-2010 12:23 PM

PHP files you find via FTP, plugins and addons you handle via AdminCP.

Duncan 10-25-2010 04:56 AM

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!

kurv 11-04-2010 05:08 AM

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;
$newTemplate = vB_Template::create('navbarforumdisplay');
$template_hook['fd_navbar'] .= $newTemplate->render()

Then I added the following code to the FORUMDISPLAY template

Code:

{vb:raw fd_navbar}
and removed
Code:

{vb:raw navbar}
Can someone tell me what I am doing wrong, or what is the best way to do this?

Thank you!!!

ROTPAR 11-06-2010 11:34 AM

could anybody please give me a step by step tutorial, how to make this code work in postbit_legacy?

PHP Code:

<vb:if condition="$show['fb_likebutton']">
            {
vb:raw fblikebutton}
        </
vb:if> 


cellarius 11-07-2010 08:50 PM

Quote:

Originally Posted by kurv (Post 2117765)
...

Waaaay too complicated. Go to the normal navbar template and put everything you do not want to appear on forumdisplay inside this condition:
Code:

<vb:if condition="THIS_SCRIPT != 'forumdisplay'">code not to be shown on forumdisplay</vb:if>

StarBuG 11-13-2010 07:39 AM

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">&amp;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


All times are GMT. The time now is 11:56 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.02656 seconds
  • Memory Usage 1,745KB
  • 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)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete