The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
problem with variables in plugin
hi,
i've got a plugin with a query which is gettin the threads in different forums for each user. My problem is, i save the query result in a variable and want to print it in the postbit, but the variable seems to be empty in postbit. As hook i'm using "showthread_postbit_create" query code: PHP Code:
PHP Code:
the qery seems to be ok, i tested it. so, whats the problem? P.S. my english isnt perfect, hope u understand me |
#2
|
|||
|
|||
Try setting $tresult_anzahl = $tresult['anzahl']; and then use $tresult_anzahl in postbit.
|
#3
|
|||
|
|||
hi, thx but still the same problem...
|
#4
|
|||
|
|||
Try setting $post['anzahl'] = $tresult['anzahl']; and then use $post[anzahl] in postbit.
|
#5
|
||||
|
||||
you declared the variable to be $tresult, so to print your result in postbit, you should put $tresult[anzahl]
|
#6
|
|||
|
|||
showthread_postbit_create is the wrong hook.
Use postbit_display_complete. |
#7
|
|||
|
|||
$tresult != $result
Use $tresult[anzahl] in your postbit. If it still don't show, add the following line to the top of your plugin: PHP Code:
PHP Code:
Please also note that this should be optimized to avoid performance issues. Your plugin (and the query inside) will be executed for each post on a page, also if the same member has posted more then once on the same page. It would be better to retrieve the values of each user that has posted only once. |
#8
|
|||
|
|||
ignore... being dumb or tired or both
|
#9
|
|||
|
|||
$this->registry->db
|
#10
|
|||
|
|||
Thanks merk, didn't think of that, duh on me.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|