Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-11-2011, 03:04 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 03-11-2011, 03:33 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try using php in the option - $vbulletin->options['bburl'] and $vbulletin->session->vars['sessionurl'] etc.
Reply With Quote
  #3  
Old 03-11-2011, 03:53 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 03-11-2011, 04:05 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try just spitting out {vb:raw vboptions.boofo_additional_link_1} in the template. What do you get then?
Reply With Quote
  #5  
Old 03-11-2011, 04:12 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

{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?
Reply With Quote
  #6  
Old 03-11-2011, 04:40 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I mean, just spit it out. Not in the <a href..> tag. Just see what it is carrying to the template.
Reply With Quote
  #7  
Old 03-11-2011, 05:06 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 03-11-2011, 06:04 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #9  
Old 03-11-2011, 06:38 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 03-11-2011, 09:39 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:51 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04721 seconds
  • Memory Usage 2,256KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (3)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete