The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
showthread php question
So, i've got my showthread.php file right?
Now, you'd think if i put something at the top of the page, it would execute upon loading of the page, right? well it doesn't... This is probably because of some inadequacy of mine, but I don't get what, so there you are. Anyway, I've got a simple code to check the user's Points (from lesane store hack) and I know it does indeed pull them from the DB and assign it to a variable, because is can make the points print @ the top of the page. I have this set to work ONLY in forum id #51. However, when I try to put that into an "If" statement, and show the points ONLY if they've less than 1000, it ONLY works when, on the forum main page, I click the "goto newest" arrow thing by the time and poster.... Anywhere else, it does nothing. Any Ideas why? PHP Code:
|
#2
|
||||
|
||||
have you tried adding an else?
|
#3
|
||||
|
||||
Hmm... Yes, actually, but I had the "else" containing the rest of the file. Would that have caused a problem?
|
#4
|
||||
|
||||
and right now your file looks like this?
PHP Code:
|
#5
|
|||
|
|||
The reason it fails is you are requiring global.php, then later in the file it tries to include it again and the page fails. Try moving your code below the forms actual call to require(global.php).
At least that's what bit us once. |
#6
|
||||
|
||||
Quote:
yes |
#7
|
||||
|
||||
Quote:
Hm? The page runs, but my code doesn't... and the call to require etc that was originally there is halfway down the page, (roughly) and there's code above it I want to run AFTER the check is preformed... I'll try it, though. |
#8
|
||||
|
||||
anyone?
|
#9
|
||||
|
||||
Try this:
$userstuff = $DB_site->query_first("SELECT storep AS points FROM user WHERE userid=$bbuserinfo[userid]"); if ($userstuff[points] < 1000 && $forumid == 51){ echo $userstuff[points]; } |
#10
|
||||
|
||||
Quote:
Why do so many people select from the user table for something already in the $bbuserinfo array? PHP Code:
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|