The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
Hi guys,
I created a plugin/hook with the following code: Product: vBulletin Hook Location: global_start (also tried init_startup) Subject: XPRank Execution Order: 5 Plugin PHP code: Code:
$gebruiker_id = 1;
$sql="SELECT `xp` FROM `rank` WHERE `userid` = '".$gebruiker_id."'";
$dataxp=mysql_query($sql)or die(mysql_error());
while($inhoud = mysql_fetch_array($dataxp)) {
$xprank = $inhoud['xp'];
}
{vb:raw xprank} Result: Doesn't work, even not when i create a variable like $phpecho="test echo"; and then use {vbraw: phpecho}. Nothing works. Does anyone has a idea how to fix this? |
|
#2
|
|||
|
|||
|
You need to register the variable for use in the template. Add this line to your code:
PHP Code:
Here's an article if you want to read more about it: https://vborg.vbsupport.ru/showthread.php?t=228078 |
|
#3
|
|||
|
|||
|
Quote:
If i do echo $xprank; in the plugin, it outputs it above the website, so there is a value in it and the code is right. The variable contains data, the trick now, is to output it. I added your line of code and still had no output whatsoever using this: Code:
{vb:raw xprank}
--------------- Added [DATE]1313018307[/DATE] at [TIME]1313018307[/TIME] --------------- Quote:
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|