The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
can this be done with hooks (postbit escape)
I am trying to prevent the first post of every thread from being displayed. I was going to add to the $hook_query_where string, but that causes the thread to appear locked when there is only one post (i.e. nothing is returned).
I decided that hacking the following top places would be best: PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
#2
|
|||
|
|||
Ok, 2 suggestions:
1. I didn't try it, but can't you test if it is the first post in the hook that gets executed as last in processing the current post, and then simply unset (or make empty) the postbit variable if it is the first post? 2. Use continue or break: Continue will stop processing the current instance of the foreach, while,.. loops, and procede to the next element in the loop. Break will stop the current loop, and will continue at the statement following the end of the loop. If you are nesting loops, for example: PHP Code:
continue; - Will stop processing the current item and continue the next item in loop 2 continue 2; - Will stop processing the current item of both loop 1 & 2 and continue the next item in loop 1 (continue X, will break the loop for X nested levels) break; - Will stop processing loop 2, and continue as Location B break2; - Will stop processing loop 1 & 2, and continue as Location C Edit: Hope this helps, because i didn't totally understand what the problem is. |
#3
|
||||
|
||||
continue/break don't affect Code outside eval(), eg. doesn't work in Plugins.
You could try PHP Code:
|
#4
|
|||
|
|||
Quote:
|
#5
|
||||
|
||||
Quote:
2) Don't think so ... example code? |
#6
|
|||
|
|||
Quote:
PHP Code:
Maybe I'll suggest they make a hook at this location: PHP Code:
Thanks for your help, everyone. And, if anyone gets 'continue' or 'return;' to work... I would love that as well. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|