The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Small problem... My plugin keeps repeating itself...
What I mean is, I have a plugin that is supposed to replace something in the postbit with additional info, but it repeats that additional info more for each poster in the thread, so for example their post count looks like this
Posts: 125! next user Posts: 36,588!! Next user Posts: 16!!! and so on adding more ! every time, here is the code, and I'm using postbit_display_complete because it's the only one that actually even inserts the data. Thanks for your help Code:
$stuff="!"; $lookfor='$vbphrase[posts]: $post[posts]'; $replace='$vbphrase[posts]: $post[posts] $stuff'; $vbulletin->templatecache['postbit_legacy'] = str_replace($lookfor, $replace, $vbulletin->templatecache['postbit_legacy']); |
#2
|
|||
|
|||
The template cache only needs to be edited once... you are editing it each time the postbit is displayed. Find another hook location for the plugin, e.g. showthread_start or something. (One that does not get repeated).
|
#3
|
|||
|
|||
it works now, I moved everything from the $replace section into the $stuff section and it works great.
|
#4
|
|||
|
|||
But your code only needs to be executed once, you are executing it each time the postbit is displayed.
|
#5
|
|||
|
|||
thanks, I will try another hook.
--------------- Added [DATE]1213039449[/DATE] at [TIME]1213039449[/TIME] --------------- i have tried about 7 different hooks, this is the only one that shows the info. |
#6
|
|||
|
|||
Hmm what hooks did you try? Did you try showthread_start as I suggested? (By only "shows the info", do you mean only one that shows the changes the plugin makes?)
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|