Quote:
|
Quote:
Quote:
|
Hi , I need for help
I created a template called: my_template and write "Hi" inside it. I want to get "Hi" in my FORUMHOME template so i made a plugin on global_start and put: PHP Code:
but nothing apper to me How to get my_template content in FORUMHOME or other template ??? |
Quote:
PHP Code:
|
Quote:
|
I apologize for sounding so helpless, but what exactly do you do with templates, and where do you even go to put in the PHP code for them? I opened this article thinking it was about skins. I'll continue to look for a thread about skins, but all this sounds like it's also important on modifying vBulletin to suit your needs, so that's why I'm posting here.
|
Quote:
For FORUMNOME probably will be forumhome_start or forumhome_complete Regards! |
Is it possible to use a custom template and render it into a variable then use that variable in sending HTML email?
I'm trying to use the following PHP code: PHP Code:
Code:
|
thanks for this and hope that someday i can do this too alone and well enough of my own without error...but it's not quite easy at all to understand...just to be honest....:p
well i was about experimenting to show the Current Activity of the Currently Active Members above inside WGO BOX (by mouse hover to the username)....by adding the red code below Code:
<li> {vb:stylevar dirmark}<a class="username" href="{vb:link member, {vb:raw loggedin}}" title="{vb:rawphrase current_activity} {vb:raw loggedin.action} {vb:raw loggedin.where} PHP Code:
thanks and best regards to all :o |
$loggedin.action or $loggedin.where are not valid PHP variables. I do not think that this is just a registering problem. You should probably open your own thread in the forums and explain exactly what and how you are trying to do.
|
This is a great thread and I know I'm on the right track.
I am trying to add a custom profile field to the memberaction_dropdown template. {vb:raw post.field5} How would I register this to work in the memberaction_dropdown? It works on postbit (because I'm assuming it is registered) Thanks again for a great write-up! |
Quote:
thanks anyway for your time mate to reply on this... best regards... :p |
i want to do that some codes work in navbar template but same code dont work in header or navbar . for example how can i run vb:raw forum.title} in forumhome.lastpostinfo template ?
|
i'm a little confused on how to get my loops into the templates.
how would i get mypage.php: Code:
while ($result = $db->fetch_array($results)){ Code:
<ul> |
I've been trying like crazy... We need more turorials...
@ vB staff: RTFM should be WTFM |
Quote:
Quote:
$templater->register('navbits', $navbits); |
Thanks a bunch for the reply :) :)
Quote:
And in the case of the footer template, which has no hook-location, which hook location is best used ? Quote:
And if the navbar template was built after the footer, in which hook-location would I need to pre-register the $navbits ? Thanks ! |
as far as I have seen, footer template is created at the moment any other template is done...
example: if at the top of a file.. before you did any template stuff... you do PHP Code:
but if you do: PHP Code:
--> so just find a place before the first template is created... Felix |
Please can somebody help, I just can't figure out what I'm doing wrong.
I'm trying to add to FORUMHOME and I can't get the basic example working. I've created a new plugin (hook: forumhome_start) with the following PHP code: PHP Code:
PHP Code:
Am I right in expecting <p>abc</p> to appear in my forum home page source? Because I just get empty <p></p>, i.e. the variable doesn't exist. I've tried different hook locations. I also tested the forumhome_start location by adding an "echo 'abc'; in the plugin php, and as expected "abc" appears right at the top of my forum home source. What am I doing wrong? :S EDIT!:: Apologies, missed this post: https://vborg.vbsupport.ru/showpost....1&postcount=72 |
As you wrote it you should use my_var first in template mytemplate.
Then when you use <p>{vb:raw my_insertvar}</p> in FORUMHOME all content from mytemplate will be appear. |
Just wanted to thank Cellarius for this very useful article. Thanks Mate...
|
Where exactly do I write this content? This part is quite complicated
|
Hello, I hope someone can point in the right direction. I'm trying to port a mod to vb4 which has a number of templates. The php file contains a whole bunch of
Code:
eval('$template .= "' . fetch_template('templatename') . '";'); I've tried a number of different iterations form the first post but I can't get anything but the main template to render. How does one go about making something like this work? thanks. |
nevermind. Turns out I had numerous typos.
Now I'm running into a different problem. I'm editing a (sub)template which is rendered in a variable in the php file and called using: Code:
{vb:raw display_map} Code:
Warning: Invalid argument supplied for foreach() in [path]/includes/functions.php on line 3332 Any suggestions where the problem might be? It doesn't seem to matter where I put the variable reference. If there is {vb:raw variable} in the template it won't save. |
Quote:
|
Quote:
Bob |
I'm working to insert my own VAR into an existing template. I've seen the examples saying to use vb_Template::preRegister. However I have a catch...I'm using a cloned copy of an existing template. For example, I cloned the default style -- and created newStyle. Then within newStyle, I modified postbit_legacy and would like to display my own $var within the cloned copy of postbit_legacy.
Questions: 1. How to register/preRegister into a cloned template (newStyle->postbit_legacy). 2. How to properly use preRegister -- if that's what's needed. My data isn't an array, and preRegister only works with arrays. |
If you're creating a new style based on another one (in this case the default style), the template name is still postbit_legacy and the template itself still is template legacy. Doesn't matter at all.
If you're variable is not an array, make it an array. $templatevalues['myvariable'] = $myvariable. |
Could you please point me in the right direction as to how I might add an extra field in newthread template, I was trying to do it automatically with the product install and I read here about using process_template hook and str_replace but Im still a little confused by it any help on this greatly appreciated.
|
Please open your own thread for questions not directly related to this article.
|
It is related to this article? I'm asking how using what I found in this article i can do what others have clearly done since they said so in this thread. If you don't want to help me that's fine but since you helped others with there question to do with the footer I thought you might help me too silly me what was I thinking.
|
oops, fixed it.
|
I've tried following this example, but am having issues.
I am trying to get a custom template that was installed via an addon to show up in the header template. My plugin (uses the global_start hook): PHP Code:
PHP Code:
|
To add a template in another with $template_hook add this plugin:
PHP Code:
PHP Code:
|
Cellarius, this is an excellent article so I hope you may help me on my little issue. I read many threads and this article and I still cannot get aroudn to fix it.
In vB3 I had a simple plugin to display random banners on navbar template or parse_templates hook Code:
$random_number = mt_rand(1, 5); I posted my problem in this thread too. https://vborg.vbsupport.ru/showthread.php?t=249848 I hope you can help and thanks for your time. |
You need to then preregister the array $random_banner for use in the navbar. Something like:
vB_Template::preRegister('navbar', array('random_banner' => $random_banner)); |
Thank you very much Lynne,
I had to add a little bit more and actually change the plugin code to a simpler version. Inside the plugin I had to create a third variable $new_banners and only pre-registered that variable within template and ran it through parse_templates hook Quote:
For some (unknown) reason, {vb:raw random.banner.random_number} wasn't working as you suggested, although the arrays were set correctly. I appreciate your help and borbole for helping me through this. I hope other users find this little experience useful in their sites. |
Quote:
|
Just a small question,
i want to create a template that is showing above the header template.. do i need to register this template ? and how do i call this template above the header? its for a suite version of vB4.X |
I asked this question over at the other VB forum and was directed to this article. Being completely new to all of this stuff and am still learning my way around, can someone please spell this out to me...
Quote:
|
All times are GMT. The time now is 11:27 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 | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|