![]() |
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']"> 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. |
Try using php in the option - $vbulletin->options['bburl'] and $vbulletin->session->vars['sessionurl'] etc.
|
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. |
Try just spitting out {vb:raw vboptions.boofo_additional_link_1} in the template. What do you get then?
|
{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?
|
I mean, just spit it out. Not in the <a href..> tag. Just see what it is carrying to the template.
|
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. ;) |
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?
|
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. |
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?
|
It is set as free right now.
|
You know, I really don't know if I've seen any other option that includes the use of variables like that. I am guessing you may need to do something to get it to parse the php in it, but I'm honestly not sure exactly what.
|
What is strange is that I have other links in the template that have those variables in them that parse just fine. Something is getting lost between the setting and the template. It's got me puzzled.
|
All times are GMT. The time now is 05:17 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|