Log in

View Full Version : using phrases on non-VB pages


Ratchet
01-21-2007, 02:00 AM
Currently I'm including global.php to get vb data on my external page, and that works well, but I can't get the vbphrases. Is there something I have to include to get access to VB phrases on non-VB pages?

Attilitus
01-21-2007, 02:03 AM
Add this line of code near the top of your file:


$phrasegroups = array();


That ought to do the trick, let me know if for some odd reason it doesn't work.

Ratchet
01-21-2007, 02:18 AM
unfortunately that didn't seem to work

I'm not setting it up as a "proper" template system, just... well, here's the code I use to call global.php (including your recent advice):

<?php
$curdir = getcwd(); // store the current directory
chdir($_SERVER['DOCUMENT_ROOT']."/board/"); // switch to the forum directory

require_once('./global.php'); // init vbulletin
require_once("functions.php"); // get site specific functions

$phrasegroups = array();

chdir($curdir); // change back to the original working directory
?>
everything after this is custom code for the site.

Actually the phrase does show up when I put it directly in my php file, but it doesn't show when I put it in a custom template.

Nevermind, I got it. Simply forgot to bring the $vbphrase array into my function :)