The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
[VB4] Need help with variables
Hey vBulletin.org-Community
I have a problem with my variables I want to "echo" a variable called "gfxpoints"(numeric) in my template "memberinfo_block_ministats", the variable "gfxpoints" should read out with a mysql_query from table user, my question, where I must register the variable gfxpoints that this code in the "memberinfo_block_ministats" works ? Quote:
|
#2
|
|||
|
|||
Try creating a plugin using hook member_execute_start. And you're using vB_Template:reRegister, right?
Edit: oops - the in vB_Template:reRegister was changed to a smilie. I meant that you should be using vB_Template:reRegister(). |
#3
|
|||
|
|||
ok I try it
--------------- Added [DATE]1325765878[/DATE] at [TIME]1325765878[/TIME] --------------- member_execute_start I dont?t find the hook what I do wrong ? --------------- Added [DATE]1325766285[/DATE] at [TIME]1325766285[/TIME] --------------- sry I have found it yay |
#4
|
|||
|
|||
nvm
|
#5
|
|||
|
|||
ok, it don?t work
this is my code in the "memberinfo_block_ministats". <dl class="stats"> <dt>GFX-Points</dt> <dd>{vb:raw gfxpoints}</dd> </dl> and This I have placed in the member.php on line 140+141 Quote:
Addon: vBulletin Hook: member_execute_start Title: gfxpoints "Reihenfolge": 5 Quote:
|
#6
|
|||
|
|||
OK - this line:
Code:
($hook = vBulletinHook::fetch_hook('member_execute_start')) ? eval($hook) : false; is the place where the plugin code gets executed (if hook location member_execute_start is selected). So you don't need to edit member.php (at least to do what you're trying to do here), you can just put the code in the plugin. Also, you need to use vB_Template:reRegister() because at the point that the plugin code is run, you don't have $templater set yet. So, take that code out of member.php and try this as your plugin code: Code:
$usrid = $vbulletin->userinfo['userid']; $gfxpquery = $db->query_read("SELECT gfxpoints FROM user WHERE userid = '".$usrid."'")or die(mysql_error()); $gfxpoints = mysql_result($gfxpquery,0); vB_Template::preRegister('memberinfo_block_ministats', array('gfxpoints' => $gfxpoints)); |
#7
|
|||
|
|||
thaaaaanks !!! I wanna marry you !!! DD ;D
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|