
10-06-2004, 09:58 AM
|
 |
|
|
Join Date: May 2006
Posts: 180
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally Posted by buro9
Here's the psuedo SQL:
PHP Code:
$query = "SELECT `eventid` , `userid` , `event` , `title` , `allowsmilies` , `recurring` , `recuroption` , `calendarid` , `customfields` , `visible` , `dateline` , `utc` , `dateline_from` , `dateline_to` , `useroll` , `roll`
FROM `" . TABLE_PREFIX . "event`
WHERE `roll` LIKE '%i:" . $bbuserinfo['userid'] . ";s:" . strlen($bbuserinfo['userid']) . ":\"" . $bbuserinfo['username'] . "\"%' LIMIT 0, 30";
That would return all events that a user was attending.
Note that the SQL matches the entire user information, as performing wildcard LIKE's are never good because if we just did the userid we might match events that had the same number of attendees as the user id... or worse, if we compared on username, there may be a user named Rob and one named RobSmith and we'd match that.
So that's the SQL... and it works... so it shouldn't be too hard to write the rest
Please, when writing the rest, bear in mind whether the event is publicly viewable, i.e. that the calendar that it appears on is viewable. 
|
sorry im lost is any1 looking at coding this
|