Hi,
On http://calmcharity.org/events.php it shows the next event in a yellow box at the top.
This is the code:
PHP Code:
$cur_datetime = date('Y-m-d H:is'); if($rank >= 5) { $where = "type='1' OR type='2' OR type='3' OR type='4'"; } elseif($rank >= 4) { $where = "type='1' OR type='2' OR type='3'"; } elseif($rank >= 3) { $where = "type='1' OR type='2'"; } else { $where = "type='1'"; } $next_event_res = $db->query("SELECT * FROM events WHERE date > '$cur_datetime' AND $where ORDER BY date ASC LIMIT 1");
now $rank is users rank which goes from 1 - 3
1 = admin
2 = committee
3 = normal member
and then you have the type on the events
which goes
1 = public (shows to all without login)
2 = requires basic account
3 = family acct
4 = committee
5 = admin.
And this is suposed to do it so if im logged in as admin and the nearest event is a admin/committee/family/public event will show
if logged in as committee and nearest event is committee/family/public
if family shows family/public
BUT. when your not logged in it shows the latest public event as it should.
BUT if your logged in it shows the earliest event for your rank.
so if admin it shows the very first admin event if committee shows the very first committee meeting.
WHY!?
how can i fix this? :s thanks,
TP for working answer 
__________________
Personal UK Webhosting Get 25% of ANY shared package for life ~ Promo: webmaster-talk
|