The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Help with validating a PHP script... "unexpected $end"
I'm no genius with PHP, this will probably be obvious to you at some point soon.
I've written a PHP script to perform a very specific function: find all users who have a session open on the site AND find if they have ticked a particular profile field as yes. I'm not really used to this (ColdFusion and .NET developer, the syntax is confusing me) so please help! Code:
<?php function get_onlinehosts($onlinehosts) { global $vbulletin; $datecut = TIMENOW - $vbulletin->options['cookietimeout']; $onlinehosts = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX . "session WHERE userid = $userinfo[userid] AND lastactivity > $datecut AND .userfield.field6 = 'yes' INNER JOIN " . TABLE_PREFIX . "userfield ON(session.userid = userfield.userid)); { return $onlinehosts; } } ?> |
#2
|
||||
|
||||
I can't think of why you have parenthesis around your return line and no need for the period at the beginning of ".userfield.field6"
|
#3
|
|||
|
|||
Thanks Lynne, I'll take a look at it a little later.
1) I thought that there was supposed to be an affirmative action at the end of the function to describe how it was going to be output? 2) I don't quite know. There's a large space that opened up there, I don't know if that's even there intentionally. |
#4
|
||||
|
||||
1) You just want to have the return line - no need to put it in {}
2) Well, I don't know why either. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|