vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   [Help] Link anywhere in product/plugin? (https://vborg.vbsupport.ru/showthread.php?t=186170)

Stagehandspace 07-23-2008 09:36 PM

[Help] Link anywhere in product/plugin?
 
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>

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

Quote:

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.


All times are GMT. The time now is 05:11 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01057 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete