Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 22 Apr 2011, 18:47
SkyStryder SkyStryder is offline
 
Join Date: Dec 2007
Conditional Plugin

I am developing some new plugins that should only work with a new
style I am working on. My new template style is "9". I only want the plugin to
fire if it is my beta template. This code does not seem to work even though
when I var_dumped the array, it seemed that styleid was being set.
I put it as the first line of the plugin. I was also hoping to put it in the
Navbar: Insert CMS Navbar Entry plugin, so I could import the CMS to the
live site and then turn it on to the public when ready.


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

Any ideas?
Thank you!
Rick
Reply With Quote
  #2  
Old 22 Apr 2011, 18:51
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
What hook location are you using? You should look the hook up in the code and see if $vbulletin is global or not. If not, you need to make it global. Or, it could be the variable name is wrong. So, find the hook and see what the code is like around it.
__________________
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
  #3  
Old 25 Apr 2011, 16:39
SkyStryder SkyStryder is offline
 
Join Date: Dec 2007
The Hook location is process_templates_complete
I am using the plugin to create navbar tabs.
Reply With Quote
  #4  
Old 25 Apr 2011, 17:01
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Is the styleid available for use at that point - have you tried spitting it out right there and seeing if it is correct? (And don't you want to use $vbulletin->userinfo['styleid']?)
__________________
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
  #5  
Old 25 Apr 2011, 19:09
SkyStryder SkyStryder is offline
 
Join Date: Dec 2007
I am starting to see what is wrong. These are template plugins, not php plugins.
I tried surrounding the Navbar tab plugin stuff with

if (vb::$vbulletin->options[styleid] !== '9') return; Didn't work. I know why
---
if (vb::$vbulletin->options[styleid] == '9') Didn't work, don't know why
{
plugin code
}
---
and last but not least, when I realized this was a template plugin:

<vb:if condition = "$bbuserinfo['userid'] == 1"> Doesn't work, don't know why
plugin code
</vb:if>
Parse error: syntax error, unexpected '<'

On a PHP eval page, this works: $output = vb::$vbulletin->options[styleid];

Last edited by SkyStryder; 25 Apr 2011 at 19:17.
Reply With Quote
  #6  
Old 25 Apr 2011, 19:55
nhawk nhawk is offline
 
Join Date: Jan 2011
Originally Posted by rickf View Post
The Hook location is process_templates_complete
I am using the plugin to create navbar tabs.
Use the parse_templates hook for anything that needs to be done during a template load.

That is where I modify the navbar so I would think it would work.
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 10:23.

Layout Options | Width: Wide Color: