getUser(); if ($user) { try { // Proceed knowing you have a logged in user who's authenticated. $user_profile = $facebook->api('/me'); } catch (FacebookApiException $e) { error_log($e); $user = null; } } if(!$user){ header('location:http://www.funnid.com/login.php?next=http://www.funnid.com/'.$_GET['ids']); exit; } } */ include('php/sql.php'); include('php/code.func.php'); $_GET['page'] = ($_GET['page'] > 0)?($_GET['page']):(1); $IDs = alphaID($_GET['ids'], true, 8); $db = new DB(); $db->connect(); $result = $db->assoc("SELECT item.*, item_update.Click, item_update.Editor_ID, item_update.Last_FB_Time, UNIX_TIMESTAMP(item_update.Last_Read_Time) as LRT FROM item LEFT JOIN item_update USING(ID) WHERE item.ID = '".$IDs."' LIMIT 1"); if($result[0]['ID'] && $_GET['page'] == 1){ $db->query("UPDATE item_update SET Last_Read_Time = NOW(), Click = Click + 1 WHERE ID = '".$result[0]['ID']."' LIMIT 1"); //$db->insert("INSERT INTO click_history (ID, Category, Click_Time) VALUES ('".$result[0]['ID']."', '".$result[0]['Category']."', NOW())"); } if($result[0]['Category'] == 1){ include('read.inc.php'); }elseif($result[0]['Category'] == 2){ include('watch.mv.inc.php'); }elseif($result[0]['Category'] == 3){ include('watch.vdo.inc.php'); }elseif($result[0]['Category'] == 4){ include('preview.inc.php'); }elseif($result[0]['Category'] == 5){ include('read.joke.inc.php'); }elseif($result[0]['Category'] == 6){ include('read.luroufan.inc.php'); }elseif($result[0]['Category'] == 7){ include('anchor.inc.php'); }elseif($result[0]['Category'] == 8){ include('read.lady.inc.php'); }else{ $db->close(); header('location:./'); exit; } ?>