PDA

View Full Version : Using vbulletin global phrases in vbdrupal blocks


webdzinez
12-21-2007, 12:28 AM
I am not sure if this feature exists, but was hoping if you could shed some light on this.

I want to create a URL such as: $vboptions[bburl]/forumdisplay.php?f=12

Now, $vboptions[bburl] is a standard variable in vbulletin, but if I add this URL in a block, the vboptions[bburl] variable is not translated. Is there a way this can be achieved?

Goddess
12-21-2007, 01:46 PM
see if this thread helps get you pointed in the right direction...
http://vbdrupal.org/forum/showthread.php?t=33&highlight=global+variables

except with the $vboptions[bburl], doesn't that give you the entire forum url, and not just the relative path? 'cause it sounds like you're wanting to create a virtual directory structure for your forums something like you'd do with pathauto? i don't know if you can do that or not.

if you're a vbseo user, you also have some facility to autowrite urls without having to figure out all the redirect stuff. but if you're not, it costs about $150 to join the party.

elmuerte
12-23-2007, 04:46 AM
$vboptions doesn't actually exist. It's rewritten to $vbulletin->options during vbulletin template parsing

so use {$vbulletin->options[bburl]}
(note: the {} are needed otherwise PHP won't recognize the object reference)

webdzinez
12-26-2007, 11:49 PM
Thanks guys but I am still not getting it right, I am trying to use vbulletin global variables inside vbdrupal blocks, here is what I am doing:

- I create a block and put this code into that block [left column]:
<td align="center" class="tcat"><span id="other"><strong> <a href="http://{$vbulletin->options[bburl]}/adminconsole" target="_blank"> Admin</a></strong></span></td></tr>
-save

Basically it should show a URL to my admin CP, but the URL comes as this:
http://{$vbulletin->options[bburl]}/adconsole

As you can see the "{$vbulletin->options[bburl]}" is not translated to correct path.

elmuerte
12-27-2007, 08:27 AM
Drupal blocks are not like vBulletin templates. If you want to use PHP variables you need to switch the input format to PHP, and then enter something like:


<td align="center" class="tcat"><span id="other"><strong> <a href="http://<?php global $vbulletin; echo $vbulletin->options[bburl]; ?>/adminconsole" target="_blank"> Admin</a></strong></span></td></tr>

(note, this is one way to use PHP)