PDA

View Full Version : [Help] Link anywhere in product/plugin?


Stagehandspace
07-23-2008, 09:36 PM
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:

<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'),$vbull etin->templatecache['navbar']);
]]></phpcode>
</plugin>

what can I place in the highlighted part to enable this?

MoT3rror
07-24-2008, 04:31 AM
You could always just tell them the code to put in their template where they want it. That will probably be the easiest way.

Stagehandspace
07-24-2008, 07:21 AM
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?

Dismounted
07-24-2008, 07:34 AM
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.

Stagehandspace
07-25-2008, 12:35 AM
I would suggest having a setting that defines which template they are putting the comment in.

Ok how would I go about doing that? I am a newbie and have really only got as far as I have by looking at other mod xml coding ;)

Dismounted
07-25-2008, 06:40 AM
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.

Stagehandspace
07-26-2008, 06:13 AM
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 :D

......still need help with original problem if anyone can help?!

Stagehandspace
02-12-2009, 02:32 AM
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 :)

Dismounted
02-12-2009, 03:45 AM
Just assign the template to a variable, and ask the user to place that variable into the template.