![]() |
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 :) |
Try setting $tresult_anzahl = $tresult['anzahl']; and then use $tresult_anzahl in postbit.
|
hi, thx but still the same problem... :(
|
Try setting $post['anzahl'] = $tresult['anzahl']; and then use $post[anzahl] in postbit.
|
you declared the variable to be $tresult, so to print your result in postbit, you should put $tresult[anzahl]
|
showthread_postbit_create is the wrong hook.
Use postbit_display_complete. |
$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. |
ignore... being dumb or tired or both
|
$this->registry->db
|
Thanks merk, didn't think of that, duh on me.
|
All times are GMT. The time now is 01:46 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|