The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Where this hook edit should go...
Hey guys, Maybe you can help me out. I'm creating a new condition to be able to use in the postbit template. The condition will be something like this:
HTML Code:
<if condition="$check"> <!-- $check holds information --> <else /> <!-- $check doesn't hold information --> </if> PHP Code:
|
#2
|
||||
|
||||
place it in postbit_display_start and make sure via a static variable, that the query just runs once!
|
#3
|
|||
|
|||
Thanks Xenon, though that doesn't seem to work as expected. It seemed to add one addional query for each post per page. The condition didn't seem to work also.
Basicly I need a query to check that database to see if the user who is viewing the threadid is in the database table. If he is show X if he isn't show Y. Normaly I would just add this to the showthread.php and it works fine. Though I have to add this to the postbit template. So theres no reason to run 10 extra queries when they will always equal the same thing. The problem is getting the condition to work in the postbit template. |
#4
|
||||
|
||||
that's why i said you need a static variable to run it just once
PHP Code:
|
#5
|
|||
|
|||
Quote:
PHP Code:
PHP Code:
|
#6
|
||||
|
||||
Would it work to put the query in showthread and assign the results to a variable? Then in postbit, you could declare the variable global and check the value. Might be worth a shot.
|
#7
|
||||
|
||||
hmm, that should be possible as well amy.
as for the other thing, that seems to be a glitch in the plugin system, or better said in the eval() function of php... not the first one i noticed... ^^ |
#8
|
|||
|
|||
Should I ask vBulletin about this and see if its a glitch in the plugin system?
Also Amy: Are you saying add the query to showthread_start and use $GLOBALS[]? |
#9
|
||||
|
||||
nope, its a provlem in the eval function, which is used by vbulletin.
and to answer question two. that would be possible, but it should be enough to use global variablename in the postbit plugin |
#10
|
||||
|
||||
What stefan said.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|