vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   I'm not seeing something here... (https://vborg.vbsupport.ru/showthread.php?t=312458)

darnoldy 06-26-2014 09:14 PM

I'm not seeing something here...
 
Okay, so in the header template that I'm working on (yes, this is usually in the navbar template), I have:
HTML Code:

        <div id="notifications">
            <a href="usercp.php$session[sessionurl_q]"> Foobar $vbphrase[your_notifications]:</a> $notifications_total
        </div>
        <script type="text/javascript"> vBmenu.register("notifications"); </script>

When I display the page, and look at the source, I have:
HTML Code:

        <div style="cursor: pointer;" id="notifications">
            <a href="usercp.php"> Foobar Your Notifications:</a> 1
          <img alt="" title="" src="images/misc/menu_open.gif" border="0"></div>
        <script type="text/javascript"> vBmenu.register("notifications"); </script>

Where did the style in the div tag and the img come from? Its not that I don't want them—I actually want to put the image on another link.
I just can't figure out how they got there.

--don

tbworld 06-26-2014 09:19 PM

Most likely from either JavaScript, or a plugin modifying the template cache. Sorry, I do not have vb3 setup right now to confirm. :(

blind-eddie 06-27-2014 03:57 AM

You source code will always show more then what's in the template.
The menu_open.gif is the drop down arrow like the ones in the navbar above.
With notifications, it will only show if you have unread notifications.

tbworld 06-27-2014 08:40 AM

Quote:

Originally Posted by blind-eddie (Post 2503982)
You source code will always show more then what's in the template.
The menu_open.gif is the drop down arrow like the ones in the navbar above.
With notifications, it will only show if you have unread notifications.

Really good point, @Blind-eddie. :)

darnoldy 06-27-2014 04:12 PM

Quote:

Originally Posted by blind-eddie (Post 2503982)
The menu_open.gif is the drop down arrow like the ones in the navbar above.
With notifications, it will only show if you have unread notifications.

While both of those things are true, they don't explain why the template is generating the code that it is.

Quote:

You source code will always show more then what's in the template.
Yes, it does. As template variables are replaced by their value (which could be the result of a script running, or the content of another template). There are no variables in these two locations—which is why I'm confused.

--don

Okay...based o your comments, I went back and looked at the navabr of the default skin:

HTML Code:

<td id="usercptools" class="vbmenu_control">
    <a href="$show[nojs_link]#usercptools" accesskey="3">
        $vbphrase[quick_links]
    </a>
    <script type="text/javascript"> vbmenu_register("usercptools"); </script>
</td>

and the source of the element"
HTML Code:

<td style="cursor: pointer;" id="usercptools" class="vbmenu_control">
    <a href="/teach/index.php?nojs=1#usercptools" accesskey="3">
        Quick Links
    </a>
    <script type="text/javascript"> vbmenu_register("usercptools"); </script>
    <img alt="" title="" src="images/misc/menu_open.gif" border="0">
</td>

Maybe it is the javascript that's adding these things (seems an odd approach)! Off to investigate further...

Simon Lloyd 06-27-2014 06:08 PM

Turn off JS in your nrowser and see what you get, it will more likely show you the same look but keep the id=...etc as the css is still used.

darnoldy 06-27-2014 06:36 PM

That did it...when I disabled javascript, the image and the pointer went away...so they are being added by a script! That explains how they got there.

Simon Lloyd 06-27-2014 07:26 PM

Glad you could read my typo "nrowser" lol :)


All times are GMT. The time now is 03:28 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.01067 seconds
  • Memory Usage 1,736KB
  • 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
  • (4)bbcode_html_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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