The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
Ok here it is I have coded a product/plugin and have a location set (navbar) but I also want to allow users to be able to place the link anywhere on their forum:
Code:
<plugin active="1" executionorder="5">
<title>title</title>
<hookname>global_start</hookname>
<phpcode><![CDATA[$xxx = '<!--xxx--!></td>';
$vbulletin->templatecache['xxx'] = str_replace($xxx,$xxx.fetch_template('xxx'),$vbulletin->templatecache['navbar']);
]]></phpcode>
</plugin>
|
|
#2
|
|||
|
|||
|
You could always just tell them the code to put in their template where they want it. That will probably be the easiest way.
|
|
#3
|
|||
|
|||
|
Yes but I want them to just have to place the hook <!--xxx--!> and the link show up if thay had a sidebar or something as I was going to add it to the admincp options page I have coded.
would it be possible to recode it as a if script conditional? if so how? |
|
#4
|
||||
|
||||
|
You *could* loop through the template cache and replace all instances of your comment, but that would be very inefficient. I would suggest having a setting that defines which template they are putting the comment in.
|
|
#5
|
|||
|
|||
|
Quote:
|
|
#6
|
||||
|
||||
|
There is no need to edit XML files, just enable debug mode, and all the options you will need to create a modification will be there.
|
|
#7
|
|||
|
|||
|
Ok so debug is a little over my head lol....as mentioned im a newbie, I played about a little but nothing really did what I wanted, I did how ever manage kill 2 quirys
![]() ......still need help with original problem if anyone can help?! |
|
#8
|
|||
|
|||
|
Ok so I have progressed slightly since I posted the original thread starter but would still like to know how to do as mentioned in first post:
How to allow user to place a hook in any template and for the template its assosiated with to to shown where they have placed the hook. So.....bump
|
|
#9
|
||||
|
||||
|
Just assign the template to a variable, and ask the user to place that variable into the template.
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|