vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Plugin Links and varibles (https://vborg.vbsupport.ru/showthread.php?t=228054)

cory_booth 11-15-2009 09:59 PM

Plugin Links and varibles
 
I am learning the new link format by using plugins to add tabs to the navbar.
I go that working.

The next problem I have though is some of my 3.8 links used userid varibles as part of the url.

i.e.
<li><a href="http://xxxxxxxxxx.com/showcat.php?cat=999&user={vb:raw (or var) bbuserinfo.userid}">My Stuff</a></li>

I have tried everything from "' to '" to ". to '". to get this working and can't seem to figure it out.

Any help?

Lynne 11-15-2009 10:25 PM

This would be the correct link to put into a template:
HTML Code:

<li><a href="http://xxxxxxxxxx.com/showcat.php?cat=999&user={vb:raw bbuserinfo.userid}">My Stuff</a></li>
If it's in a plugin, you may need to just use $vbulletin->userinfo['userid'] as before. Hard to tell from what you've written.

cory_booth 11-15-2009 10:34 PM

Yes this is a plugin.

I get Parse error: syntax error, unexpected T_STRING in /home1/gggggggggggg/public_html/yyyyyy/includes/class_bootstrap.php(685) : eval()'d code on line 85

If I copy paste
$vbulletin->userinfo['userid']

Lynne 11-15-2009 10:36 PM

That tells me absolutely nothing. What does the whole plugin look like? You could (and do) have a syntax error and I can't see it if you don't post the code.

cory_booth 11-15-2009 10:39 PM

I added the ===== to show what I am struggling with.


PHP Code:

global $template_hook;
$tabselected '';
$tablinks '';
if (
PP_SCRIPT == 'PP_Classifieds')
{
    
$vbulletin->options['selectednavtab']='pp_classifieds';
    
$tabselected ' class="selected"';
    
$tablinks '<ul class="floatcontainer">
<li><a href="http://creek.com/classifieds/">Classifieds Home</a></li>


//===========================

<li><a href="http://creek.com/classifieds/showcat.php?cat=500&ppuser=$vbulletin->userinfo['
userid']">My Ads</a></li>

//==========================

<li><a href="http://creek.com/classifieds/showcat.php?cat=fav">My Watch List</a></li>
<li><a href="http://creek.com/classifieds/member.php?protype=6">Messages</a></li>
<li><a href="http://creek.com/classifieds/showmembers.php">Member List</a></li>
<li><a href="http://creek.com/classifieds/uploadproduct.php">Upload Ad</a></li>
<li><a href="http://creek.com/classifieds/search.php">Search</a></li>

                </ul> '
;



$template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="http://aquiacreek.com/classifieds/">Classifieds</a>'.$tablinks.'</li>'


Lynne 11-15-2009 10:53 PM

HTML Code:

<li><a href="http://creek.com/classifieds/showcat.php?cat=500&ppuser='.$vbulletin->userinfo['userid'].'">My Ads</a></li>
(You really should have posted this in the article and I would have known right away exactly where you were talking about and what you wanted to modify.)

cory_booth 11-15-2009 10:56 PM

Sorry...

Thought is was an easy correction and I worry about hacks :-)


All times are GMT. The time now is 12:09 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.01126 seconds
  • Memory Usage 1,728KB
  • 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
  • (2)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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