vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Parsing variables in link question (https://vborg.vbsupport.ru/showthread.php?t=260211)

Boofo 03-11-2011 03:04 PM

Parsing variables in link question
 
Can someone please tell me how you get the raw variables to parse in the link that is an option in a product? Here is what I have in the template:

HTML Code:

<vb:if condition="$vbulletin->options['boofo_additional_link_1']">
        <li><a href="http://{vb:raw vboptions.boofo_additional_link_1}" target="_blank">{vb:raw vboptions.boofo_additional_link_1_title}</a></li>
</vb:if>


And the link I have set for the boofo_additional_link_1 option:

HTML Code:

{vb:raw vboptions.bburl}/search.php?{vb:raw session.sessionurl}do=finduser&userid={vb:raw bbuserinfo.userid}&contenttype=vBForum_Post&showposts=1

The raw variables don't get parsed when viewing the link in the menu.

Lynne 03-11-2011 03:33 PM

Try using php in the option - $vbulletin->options['bburl'] and $vbulletin->session->vars['sessionurl'] etc.

Boofo 03-11-2011 03:53 PM

I tried it like this and they don't get parsed when I add it to the setting:
HTML Code:

$vbulletin->options['bburl']/search.php?$vbulletin->session->vars['sessionurl']do=finduser&userid=$vbulletin->userinfo['userid']&contenttype=vBForum_Post&showposts=1

If I add the raw variable line directly into the template, then it parses fine. Just not through the setting.

Lynne 03-11-2011 04:05 PM

Try just spitting out {vb:raw vboptions.boofo_additional_link_1} in the template. What do you get then?

Boofo 03-11-2011 04:12 PM

{vb:raw vboptions.boofo_additional_link_1} is what I have in the template. The link is in the boofo_additional_link_1 setting line. Or am I missing what you are meaning?

Lynne 03-11-2011 04:40 PM

I mean, just spit it out. Not in the <a href..> tag. Just see what it is carrying to the template.

Boofo 03-11-2011 05:06 PM

Ok, with the raw variables, this is what I get when I do a print_r in the template:
Code:

print_r (http://www.mysitehere.com/forums/search.php?do=finduser&userid=1&contenttype=vBForum_Post&showposts=1);

It parses fine directly in the template. Only when I do it via the setting, it doesn't.

I changed my site to mysitehere, for reasons you already know. ;)

Lynne 03-11-2011 06:04 PM

What I am saying it just put {vb:raw vboptions.boofo_additional_link_1} directly in the template. What exactly do you get then? What is printing out in the template when you do that? And what do you have in the options exactly right now?

Boofo 03-11-2011 06:38 PM

I get this when I do that:
Code:

{vb:raw vboptions.bburl}/search.php?{vb:raw session.sessionurl}do=finduser&userid={vb:raw bbuserinfo.userid}&contenttype=vBForum_Post&showposts=1

That is the same exact code I have in the options setting. It does the same thing if I use $vbulletin->options.

If I do it like this in the template, then it parses fine.
Code:

<li><a href="{vb:raw vboptions.bburl}/search.php?{vb:raw session.sessionurl}do=finduser&userid={vb:raw bbuserinfo.userid}&contenttype=vBForum_Post&showposts=1" target="_blank">{vb:raw vboptions.boofo_additional_link_5_title}</a></li>

It just doesn't like going from the setting to the variable in the template for some reason.

Lynne 03-11-2011 09:39 PM

OK, so you need to do something to actually parse the options setting. Have you tried changing the Data Validate Type for the option? What type is it currently?


All times are GMT. The time now is 09:24 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.01304 seconds
  • Memory Usage 1,735KB
  • 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
  • (3)bbcode_code_printable
  • (3)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete