// always check groups (to hide private groups) $from = " LEFT JOIN " . table_groups . " ON " . table_links . ".link_group_id = " . table_groups . ".group_id "; $groups = $db->get_results("SELECT * FROM " . table_group_member . " WHERE member_user_id = {$current_user->user_id} and member_status = 'active'"); if ($groups) { $group_ids = array(); foreach ($groups as $group) { $group_ids[] = $group->member_group_id; } $group_list = join(",", $group_ids); $where = " AND (" . table_groups . ".group_privacy!='private' OR ISNULL(" . table_groups . ".group_privacy) OR " . table_groups . ".group_id IN({$group_list})) "; } else { $group_list = ''; $where = " AND (" . table_groups . ".group_privacy!='private' OR ISNULL(" . table_groups . ".group_privacy))"; } get_votes($time); get_new_stories($time); get_new_published($time); get_comments($time); if ($last_timestamp == 0) { $last_timestamp = time(); } echo "timestamp={$last_timestamp};\n"; if (count($events) < 1) { exit; } ksort($events); $keys = array_reverse(array_keys($events)); $lines = min(count($keys), $max_items); $counter = 0; echo "new_items={$lines};\n"; echo "new_data = ([";
echo "window.location.reload(true);"; exit(); } $now = time(); $last_timestamp = $time; if (empty($_GET['nochat'])) { check_chat(); get_chat($time); } if($_GET['r'] % 5 == 0) update_sneakers(); if (empty($_GET['novote']) || empty($_GET['noproblem'])) get_votes($time); if (empty($_GET['nonew'])) get_new_stories($time); if (empty($_GET['nopublished'])) get_new_published($time); if (empty($_GET['nocomment'])) get_comments($time); if($last_timestamp == 0) $last_timestamp = $now; $ccnt = $db->get_var("select count(*) from sneakers"); echo "ts=$last_timestamp;ccnt=$ccnt;\n"; if(count($events) < 1) exit; ksort($events); $keys = array_reverse(array_keys($events)); $lines = min(count($keys), $max_items); $counter=0; echo "new_data = (["; foreach ($keys as $key) {