Log in

View Full Version : help with $vbphrase[x_members_and_y_guests]


halliday06
06-19-2008, 04:06 PM
I am developing a script to run a website outside of VB, but using the vb login cresidentials n stuff.

i want to display the amount of guests at the top of the website..

i pulled $vbphrase[x_members_and_y_guests] from the who's online bit

echo "Users Online: $vbphrase[x_members_and_y_guests]";

but when i view it from my page it comes out like this:

Users Online: %1$s members and %2$s guests

however it is displayed correctly on the forums,

any ideas why?

also where is the filed stored that holds the $vbphrase stuff?

thanks

Opserty
06-19-2008, 04:11 PM
You need to use construct_phrase() see the API docs for info: vBulletin 3.7 Code Documentation (http://members.vbulletin.com/api/)

You'll have the to generate the numbers yourself, check the PHP code of the default page and mimic that.

halliday06
06-19-2008, 07:27 PM
i couldnt find construct_phrase() on that site, i'm quite new to this can you point me in the right direction

King Kovifor
06-19-2008, 07:48 PM
http://members.vbulletin.com/api/vBulletin/_includes---functions.php.html#functionconstruct_phrase

You want to use something like this:

construct_phrase($vbphrase['x_members_and_y_guests'], $members, $guests);

halliday06
06-19-2008, 08:08 PM
thanks, but that doesnt return anything??

i also tried echo'ing $members $guests variables.. but nothing either,

sorry.. just a beginner

Opserty
06-19-2008, 08:13 PM
You'll need some grasp of PHP if you want to do this. I recommend you go and learn the basics of PHP (there are many tutorials out there, just google search).

You need to generate values for $members and $guests yourself, like I said previously see the index.php page of your forum it should be in there.

halliday06
06-20-2008, 07:04 AM
i have had a good look but cant really see it, i'm gunna do some tutorials...

i was managing ok until now, ive managed to get the vbstatus ajax thing working externally along with usernames & private messages.

thanks