findHashDeleteCache($title);
 $url = cleanit($_REQUEST['url']);
 $category = intval(cleanit($_REQUEST['category']));
 if ($url == "") {
     $error = $lang['96'];
 } elseif ($title == "") {
     $error = $lang['95'];
 } else {
     $pos = strrpos($url, ".");
     $ph = strtolower(substr($url, $pos + 1, strlen($url) - $pos));
     if ($ph == "jpg" || $ph == "jpeg" || $ph == "png" || $ph == "gif") {
         $query = "INSERT INTO posts SET USERID='" . mysql_real_escape_string($SID) . "', story='" . mysql_real_escape_string($title) . "', tags='" . mysql_real_escape_string($tags) . "', source='" . mysql_real_escape_string($source) . "', category='" . mysql_real_escape_string($category) . "', nsfw='" . mysql_real_escape_string($nsfw) . "', url='" . mysql_real_escape_string($url) . "', time_added='" . time() . "', date_added='" . date("Y-m-d") . "', active='0', pip='" . $_SERVER['REMOTE_ADDR'] . "'";
         $result = $conn->execute($query);
         $pid = mysql_insert_id();
         $uploadedimage = $config['pdir'] . '/' . $pid . '-temp.' . $ph;
         if (!download_photo($url, $uploadedimage)) {
             $error = $lang['97'];
             $query = "DELETE FROM posts WHERE PID='" . mysql_real_escape_string($pid) . "'";
             $conn->execute($query);
         } else {
             $theimageinfo = getimagesize($uploadedimage);
             if ($theimageinfo[2] != 1 && $theimageinfo[2] != 2 && $theimageinfo[2] != 3) {
                 $error = $lang['94'];
                 $query = "DELETE FROM posts WHERE PID='" . mysql_real_escape_string($pid) . "'";
                 $conn->execute($query);
                 unlink($uploadedimage);
             } else {
                 $approve_stories = $config['approve_stories'];
                 if ($approve_stories == "1") {
                     $active = "0";
                 } else {
Exemple #2
0
 $SFNAME = $result->fields['fname'];
 $SLNAME = $result->fields['lname'];
 $_SESSION['USERID'] = $SUSERID;
 $_SESSION['EMAIL'] = $SEMAIL;
 $_SESSION['VERIFIED'] = $SVERIFIED;
 $_SESSION['PP'] = $SPP;
 $_SESSION['FNAME'] = $SFNAME;
 $_SESSION['LNAME'] = $SLNAME;
 $_SESSION['FB'] = "1";
 //add pics
 if (intval($fbpid) > 0) {
     $fp1 = $fbpicurl;
     $fp2 = $fbpicurl2;
     $tfpp = $userid . ".jpg";
     $fimage = $config['mdir'] . "/o/" . $tfpp;
     if (!download_photo($fp2, $fimage)) {
         if (file_exists($fimage)) {
             unlink($fimage);
         }
     } else {
         $fi2 = $config['mdir'] . "/" . $tfpp;
         do_resize_image($fimage, "192", "192", false, $fi2);
         $fi3 = $config['mdir'] . "/thumbs/" . $tfpp;
         do_resize_image($fimage, "50", "50", false, $fi3);
         if (file_exists($config['mdir'] . "/o/" . $tfpp)) {
             $query = "UPDATE members SET profilepicture='{$tfpp}' WHERE USERID='" . mysql_real_escape_string($userid) . "'";
             $conn->execute($query);
             $_SESSION['PP'] = $tfpp;
         }
     }
 }