The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Plugin for specific styleid
Been trying to write a plugin that will have effect on only one (or only) style installed.
I have tried PHP Code:
I also tried PHP Code:
I am missing something, anybody have suggestions pretty please. p.s. another thing, should the plugin run at 'parse_templates' or 'style_fetch'. The code is PHP Code:
|
#2
|
|||
|
|||
I think parse_templates is good, and at that hook it looks like $vbulletin->userinfo[styleid] should have worked. You could also try $styleid but put in a "global $styleid;" line first.
|
#3
|
||||
|
||||
Many thanks for the really fast reply, I will play.
Please excuse my ignorance, what do you mean by: |
#4
|
|||
|
|||
I mean something like this:
Code:
global $styleid; if ($styleid == 1){ Code } But like I mentioned above, I don't see why $vbulletin->userinfo[styleid] shouldn't work. |
#5
|
||||
|
||||
Thats great. I will try this now.
Quote:
Using the 'global $styleid;' first certainly triggers the template replacement, but what happens now is that both the original and replacement templates are trying to display... Ahh! just had a thought. Think I know whats happening, I'll let you know later. |
#6
|
|||
|
|||
PHP Code:
PHP Code:
PHP Code:
|
Благодарность от: | ||
gothicuser |
#8
|
|||
|
|||
Ah...good call, that certainly solves that issue.
|
#9
|
||||
|
||||
Some more examples
Code:
if ($vbulletin->session->vars['styleid'] == X) { Plugin Code } Code:
if ($vbulletin->session->vars['styleid'] != X) { Plugin Code } |
#10
|
||||
|
||||
Hey guys, such a response. Thankyou all.
Too late in the evening to play right now, mrs will torture me!! will let you know how it went in the morning (the coding I mean). Thanks again. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|