0) { $prefix=""; if (strpos($root,"tv")) $prefix="tv_"; if (strpos($root,"video")) $prefix="video_"; if (strpos($root,"blogues")) $prefix="blogues_"; $dest=$db->get_var("SELECT link_url FROM ".$prefix."links WHERE link_id='".$id."'"); } else $dest=$_REQUEST['dest']; if ($id>0) { require_once(mnminclude."check_behind_proxy.php"); $ip=check_ip_behind_proxy(); if ($current_user && $current_user->user_id) $wh="(click_ip='$ip' OR click_user='".$current_user->user_id."')"; else $wh="click_ip='$ip'"; if (!$db->get_var("SELECT click_link_id FROM clicks WHERE click_link_id='".$id."' AND ".$wh)) { if (!stripos($_SERVER['HTTP_USER_AGENT'],'Googlebot')) { $db->query("INSERT INTO clicks (click_link_id,click_user,click_ip,click_date) VALUES ('".$id."','".$current_user->user_id."','".$ip."',NOW())"); $db->query("UPDATE links SET link_clicks=link_clicks+1 WHERE link_id='".$id."'"); } } } header("Location: ".$dest); ?>