Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 18 Aug 2014, 03:13
TopFloorDjs's Avatar
TopFloorDjs TopFloorDjs is offline
 
Join Date: Sep 2008
Real name: Brad
Using existing variables in different templates

Ive been looking through manuals and i just cant get my head around using pre-existing raw variables in different templates. Im rather new to the coding arena of vBulletin and this issue keeps blocking me from modifying templates.

Example:
In the header template we have

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

Now if i wanted to put this data in FORUMHOME template instead i cant seem to do it, even if i change the raw to a var, it simply wont display anything. Ive heard a lot about declaring variables but with the root "pmbox." i assumed it would still display as its makes it globally accessible.

Any help?
Reply With Quote
  #2  
Old 18 Aug 2014, 09:38
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Even the variables you see in vbulletin templates aren't global you have to register them again if you want to use them in another template
There are only a few variables and costants that are availavle in every template
However the last visit and activity code is very easy you could make a new plugin

Plugin hook: forumhome_start (should work)

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

And then you'll be able to use {vb:raw lastvisittime}, {vb:raw lastvisitdate}
I didn't test it so I'm not sure it will work but you can play this plugin and see if you can get it working by yourself, if you can't feel free to ask further help

Last edited by Scanu; 18 Aug 2014 at 09:58.
Reply With Quote
  #3  
Old 18 Aug 2014, 10:36
TopFloorDjs's Avatar
TopFloorDjs TopFloorDjs is offline
 
Join Date: Sep 2008
Real name: Brad
Thank you!! I'll be trying this when i get back to the templates. This also helps me understand more in registering variables.
Reply With Quote
  #4  
Old 18 Aug 2014, 10:44
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Real name: Chris
cellarius wrote a good article on registering variables here, http://www.vbulletin.org/forum/showthread.php?t=228078
__________________
You can get access to my 180 mods for vB 3.6 - 4.x at The Admin Zone as well as the professional support you are used to. New vBulletin Spider Definitions, vBulletin Spiders List Hits 1000 Spiders! ​ OzzModz down. Site has had a data breach, checking how the intrusion happened. Change your PW if you use the same one on my site and others.
Reply With Quote
Reply



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

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 09:43.

Layout Options | Width: Wide Color: