Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
  #286  
Old 10 Aug 2013, 13:48
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
I should probably mention just in case, you don't have to register *every* variable because some standard vb ones are automatically registered, like bbuserinfo, style, show, vboptions, etc.
Reply With Quote
  #287  
Old 31 Mar 2014, 19:09
Kestryll Kestryll is offline
 
Join Date: Nov 2006
I have to admit, this is going a bit beyond my scope of knowledge and I'm a bit lost.

I'm trying to place the same rotating banner ads in 4.2.2 that I currently use in 3.8.7
I've been told I need to register the templates and have been directed to this thread.
I am certain the answer is here however I'm not grasping it.

I currently run in house advertising via a table in the header that calls to plugins using the PHP random feature like this:
In Table in header:
<td style="width: 120px; text-align: center; height: 60px;">$random_banner12[$random_number12]</td>
In plug ins with a hook location of 'parse_templates' Execution order 5
$random_number12 = rand(1, 3);

$random_banner12[1] = '<a href="http://www.vendor/" target="_blank"><img src="/images/ads12/vendor.gif" alt="" border="0" /></a>';
I'm not sure which of these needs to be registered or where to do that at.
Any help would be appreciated.
__________________
Calguns.net
Reply With Quote
  #288  
Old 31 Mar 2014, 19:27
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
At the end of that plugin, you need to register that variable for use in the header template.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #289  
Old 31 Mar 2014, 23:08
Kestryll Kestryll is offline
 
Join Date: Nov 2006
Just so I have this right before trying it and turning my vB install in to Pong game, in the Plug In PHP Code box I add that to the end like this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Then I place this in the Header:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Calguns.net
Reply With Quote
  #290  
Old 01 Apr 2014, 18:15
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Did you try it? You really should have a test site set up so you can try this stuff before doing it on a live site.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #291  
Old 01 Apr 2014, 19:22
Kestryll Kestryll is offline
 
Join Date: Nov 2006
I do have a test site up with a separate database and vB install on it for testing prior to trying anything on my live forum.

You'll have to excuse my manner of asking follow up questions, when I can't get something to work I tend to ask questions in the form of clarification of what I am doing assuming I have made an error rather than saying 'that didn't work'. It seems more respectful of those trying to help.
The comment about roasting my vB install is mostly comedy however I did manage to do something to my test install when I first tried to make the ad banners work that killed it and required a wipe and reinstall.


So far I have not been able to get the random banners to display, all I have gotten is the header code displaying above the title.
I have placed the header code in various places within the header template and have placed the registration code at the very end of the plug in as above and tried it as the second line of the plug in.
All with the same results, I can only assume that I am missing a step somewhere.
__________________
Calguns.net
Reply With Quote
  #292  
Old 02 Apr 2014, 00:17
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
I couldn't tell from your post whether you were asking for help or not. But, I did just notice that you have the variable entered wrong in your template (that's what happens when you look at vB3 and vB4 and vB5 sites all the time!). It's

{vb:raw random_banner11['$random_number11']}

And, I didn't notice you had two variables - you need to register each of them.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #293  
Old 16 May 2014, 12:37
semprot semprot is offline
 
Join Date: Mar 2010
Real name: Jeremy
Question

I'm still confused if i want to add 1 custom variable on "ad_global_below_navbar", where should i type this code and what should i type?
The first post only explains about creating new template.
__________________
Best regards,

Jeremy

Last edited by semprot; 16 May 2014 at 12:44.
Reply With Quote
  #294  
Old 16 May 2014, 19:06
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
The first post shows you how to register a variable here:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That registers the variable $my_insertvar to be used in the template FORUMHOME. Go back and relook at the article and you will see this explained.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #295  
Old 18 May 2014, 10:35
semprot semprot is offline
 
Join Date: Mar 2010
Real name: Jeremy
Question

Originally Posted by Lynne View Post
The first post shows you how to register a variable here:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That registers the variable $my_insertvar to be used in the template FORUMHOME. Go back and relook at the article and you will see this explained.
so i need to type that code on all PHP files on root? (usercp.php, forum.php, etc ?)
__________________
Best regards,

Jeremy
Reply With Quote
  #296  
Old 18 May 2014, 18:24
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by semprot View Post
so i need to type that code on all PHP files on root? (usercp.php, forum.php, etc ?)
No, you can add it to a plugin. If you are using it on every page, then you'll want to use a hook location that is on every page - maybe one of the global_* ones. You'll have to try it and see which works best.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #297  
Old 20 May 2014, 09:02
semprot semprot is offline
 
Join Date: Mar 2010
Real name: Jeremy
Smile

Originally Posted by Lynne View Post
No, you can add it to a plugin. If you are using it on every page, then you'll want to use a hook location that is on every page - maybe one of the global_* ones. You'll have to try it and see which works best.
Awesome it works
__________________
Best regards,

Jeremy
Reply With Quote
  #298  
Old 29 Nov 2014, 14:59
npadbidri npadbidri is offline
 
Join Date: Nov 2014
Hi,

I understand above all things. I just wanted to know that,
{vb:raw user.username}
above code I found in template 'header'.
From where this header template gets object 'user' and how it can able to access it property.

I am interested know where this vBulletin variable like 'user' stored and in which php file?

Can any one help me to understand this?

Thanks!!!!
Reply With Quote
  #299  
Old 29 Nov 2014, 19:12
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by npadbidri View Post
Hi,

I understand above all things. I just wanted to know that,
{vb:raw user.username}
above code I found in template 'header'.
From where this header template gets object 'user' and how it can able to access it property.

I am interested know where this vBulletin variable like 'user' stored and in which php file?

Can any one help me to understand this?

Thanks!!!!
The header template is rendered in the /includes/class_bootstrap.php file around line 509. So, try looking at the code above there. (But, I don't see any $user variable registered for use in that template, nor do I see the template code "{vb:raw user.username}" being used in the header template. If you do see that, then this may be from a modification.)
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #300  
Old 01 Feb 2015, 11:08
TheAdminMarket's Avatar
TheAdminMarket TheAdminMarket is offline
 
Join Date: Jun 2013
Real name: Christos Teriakis
Any suggestion why the code below does not works as expected?

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Taking in account that:
  1. I used many different hooks like: global_start, global_complete, fetch_templates etc.
  2. I also used many different templates like: ad_global_header1 etc
  3. The same code with only difference the last 2 lines is working in php file if I use: print_output($templater->render());
Thank you very much

EDIT: What I was adding in the templates is: {vb:raw mybanners}

Last edited by TheAdminMarket; 01 Feb 2015 at 11:22.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 13:39.

Layout Options | Width: Wide Color: