vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Hook after Quick Links?? (https://vborg.vbsupport.ru/showthread.php?t=320653)

TheAdminMarket 10-30-2015 10:53 AM

Hook after Quick Links??
 
Hello,

I'm trying to add a simple menu link after "Quick Links", but I was never good enought to locate the correct hook. Can someone helps?

Code:

<plugin active="1" executionorder="30">
        <title>Forum Link</title>
        <hookname>cache_templates</hookname>
        <phpcode><![CDATA[
                $templater = vB_Template::create('teamtalk_forum_link');
                $template_hook['navtab_end'] .= $templater->render();
        ]]></phpcode>
</plugin>

and the simple template is:
HTML Code:

<template name="teamtalk_forum_link" templatetype="template" date="1160112327" username="ChrisTERiS" version="1.0.0"><![CDATA[
<li id="vbflink_teamtalk">
<a href="teamtalk.php">{vb:var vbphrase.teamtalk_global}</a></li>
]]></template>

Thank you

ozzy47 10-30-2015 11:23 AM

Why not create it with the navigation manager?

TheAdminMarket 10-30-2015 11:29 AM

Quote:

Originally Posted by ozzy47 (Post 2557889)
Why not create it with the navigation manager?

I don't want Tab. Just a Link in forum. Never tried to add something like this with a product file.

Dave 10-30-2015 11:34 AM

I believe it's the "navbar_end" template hook.
We're talking about the sub-menu under the main navbar right?

ozzy47 10-30-2015 11:34 AM

I know, you can make a link, and assign it to a product with the nab manager. :) So when you export your product XML it will have the navigation entry with it.

TheAdminMarket 10-30-2015 02:25 PM

Quote:

Originally Posted by Dave (Post 2557893)
I believe it's the "navbar_end" template hook.
We're talking about the sub-menu under the main navbar right?

I tried but does not works :(
Anyway thank you David

--------------- Added [DATE]1446218808[/DATE] at [TIME]1446218808[/TIME] ---------------

Quote:

Originally Posted by ozzy47 (Post 2557894)
I know, you can make a link, and assign it to a product with the nab manager. :) So when you export your product XML it will have the navigation entry with it.

I also tried this but adding a link is blocked (read only) to vBulletin product. I can't assign it to another product.

MarkFL 10-30-2015 02:39 PM

What I did in one of my products to add a link to the "Quick Links" drop-down menu is use the plugin hook "global_setup_complete" and the plugin code:

PHP Code:

        $template_hook['navtab_end'] .= '
<script>
    var qlink = document.getElementById("vbmenu_qlinks").lastElementChild;
    if (qlink)
    {
        var newlink = document.createElement("li");
        newlink.innerHTML = "put link here";
        qlink.appendChild(newlink);
    }
</script>'



TheAdminMarket 10-30-2015 02:41 PM

Finally I created a Tab menu for it and if someone wants to move it somewhere he can do it by copying the link and permissions. :)

--------------- Added [DATE]1446219813[/DATE] at [TIME]1446219813[/TIME] ---------------

Quote:

Originally Posted by MarkFL (Post 2557902)
What I did in one of my products to add a link to the "Quick Links" drop-down menu is use the plugin hook "global_setup_complete" and the plugin code:

PHP Code:

        $template_hook['navtab_end'] .= '
<script>
    var qlink = document.getElementById("vbmenu_qlinks").lastElementChild;
    if (qlink)
    {
        var newlink = document.createElement("li");
        newlink.innerHTML = "put link here";
        qlink.appendChild(newlink);
    }
</script>'



Tried your solution Mark but does not seems to work.

Paul M 10-30-2015 02:43 PM

Quote:

Originally Posted by NickTheGreek (Post 2557891)
I don't want Tab. Just a Link in forum. Never tried to add something like this with a product file.

Still just add a link in nav manager, and associate it with your product.

When you export the product, it will export the link in the xml.

MarkFL 10-30-2015 02:46 PM

Christos, try:

PHP Code:

        $template_hook['navtab_end'] .= '
<script>
    var qlink = document.getElementById("vbmenu_qlinks");
    if (qlink)
    {
        var newlink = document.createElement("li");
        newlink.innerHTML = "put link here";
        qlink.lastElementChild.appendChild(newlink);
    }
</script>'



TheAdminMarket 10-30-2015 04:30 PM

1 Attachment(s)
Quote:

Originally Posted by Paul M (Post 2557905)
Still just add a link in nav manager, and associate it with your product.

When you export the product, it will export the link in the xml.

Seems that my mind has messed at all. Ok, I clicked at Navigation Manager, I selected Add Link from Forum selector and then I added a link. I was unable to choose product as vBulletin was preselected (see attached screenshot). But the links appears ok.

The novice question now. What product do I need to download to copy the code? I downloaded the style but there is nothing there. I seen in the Products list but only CMS and Blog exist.

TheAdminMarket 10-30-2015 04:33 PM

Quote:

Originally Posted by MarkFL (Post 2557906)
Christos, try:

PHP Code:

        $template_hook['navtab_end'] .= '
<script>
    var qlink = document.getElementById("vbmenu_qlinks");
    if (qlink)
    {
        var newlink = document.createElement("li");
        newlink.innerHTML = "put link here";
        qlink.lastElementChild.appendChild(newlink);
    }
</script>'



Javascript guru Mark? :) I'll try it as last chance if I don't find another way to place is in a more visible place. Actually the best for me is to add after Private Messages as it's a Conversation System :)

squidsk 10-30-2015 04:52 PM

Quote:

Originally Posted by NickTheGreek (Post 2557915)
Seems that my mind has messed at all. Ok, I clicked at Navigation Manager, I selected Add Link from Forum selector and then I added a link. I was unable to choose product as vBulletin was preselected (see attached screenshot). But the links appears ok.

The novice question now. What product do I need to download to copy the code? I downloaded the style but there is nothing there. I seen in the Products list but only CMS and Blog exist.

You need to put the forum into debug mode I believe for that option to be selectable.

If you want to make it debug mode for just yourself add the following to your config.php where A.B.C.D is your IP address.

PHP Code:

$config['Misc']['debug'] = ($_SERVER['REMOTE_ADDR'] == "A.B.C.D"); 



All times are GMT. The time now is 02:27 AM.

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.01791 seconds
  • Memory Usage 1,761KB
  • 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_html_printable
  • (5)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)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