function check_akismet_comment() { global $cfgrow, $name, $email, $url, $message, $parent_id, $pixelpost_db_prefix; // query for testing if the function is performed anyway $params = array('comment_type' => 'comment', 'comment_author' => $name, 'comment_author_email' => $email, 'comment_author_url' => $url, 'comment_content' => $message); if ('true' == pp_auto_check_comment($params)) { $query = "UPDATE {$pixelpost_db_prefix}comments SET publish = 'spm' WHERE id = last_insert_id()"; mysql_query($query); $cfgrow['commentemail'] = 'no'; eval_addon_front_workspace('comment_blocked_askimet'); $extra_message = '<b>Your comment is marked as SPAM by Akismet Spam Checker and now in moderation queue until the Administrator has reviewed it.</b><p /> '; } else { eval_addon_front_workspace('comment_passed_askimet'); } $akismet_comment_checked = true; }
if (is_comment_in_moderation_list($message, $ip, $name)) { $cmnt_publish_permission = 'no'; $cmnt_moderate_permission = 'yes'; } eval_addon_front_workspace('comment_passed'); // to the job now if ($cmnt_moderate_permission == 'yes') { $extra_message = "<b>{$lang_message_moderating_comment}</b><p /> "; } $query = "INSERT INTO " . $pixelpost_db_prefix . "comments(id,parent_id,datetime,ip,message,name,url,email,publish)\n\t\tVALUES(NULL,'{$parent_id}','{$datetime}','{$ip}','{$message}','{$name}','{$url}','{$email}','{$cmnt_publish_permission}')"; mysql_query($query) or die("MySQL error " . mysql_errno() . ": " . mysql_error()); // if we come here it means comment is in DB now and we can set flag enabling email notification $email_flag = 1; eval_addon_front_workspace('comment_accepted'); } else { eval_addon_front_workspace('comment_blocked_banlist'); $extra_message = "<b>{$lang_message_banned_comment}</b><p /> "; } } // ##########################################################################################// // EMAIL NOTE ON COMMENTS // ##########################################################################################// $comment_image_id = intval($_POST['parent_id']); $link_to_comment = $cfgrow['siteurl'] . "index.php?showimage={$comment_image_id}"; if ($cfgrow['commentemail'] == "yes" && $email_flag == 1) { $admin_email = $cfgrow['email']; $comment_name = clean_comment($_POST['name']); $comment_url = clean_comment($_POST['url']); if (strpos($comment_url, 'https://') === false && strpos($comment_url, 'http://') === false && strlen($comment_url) > 0) { $comment_url = "http://" . $comment_url; }
if ($cfgrow = sql_array("SELECT * FROM `" . $pixelpost_db_prefix . "config`")) { //$upload_dir = $cfgrow['imagepath']; } else { show_splash('Coming Soon. Not Installed Yet. Cause #1', 'templates'); } /** * Begin frontpage addons * */ refresh_addons_table(ADDON_DIR); $addon_front_functions = array(0 => array('function_name' => '', 'workspace' => '', 'menu_name' => '', 'submenu_name' => '')); $addon_admin_functions = array(0 => array('function_name' => '', 'workspace' => '', 'menu_name' => '', 'submenu_name' => '')); create_front_addon_array(); session_start(); // Initialize the workspace eval_addon_front_workspace('frontpage_init'); // Fix proposed by tomyeah on the forum header('Content-Type: text/html; charset=utf-8'); // Set a cookie for the visitor counter, re-count a person after 60 mins setcookie("lastvisit", "expires in 60 minutes", time() + 60 * 60); // save user info if requested if (isset($_POST['vcookie'])) { $vcookiename = clean($_POST['name']); $vcookieurl = clean($_POST['url']); $vcookieemail = clean($_POST['email']); setcookie("visitorinfo", "{$vcookiename}%{$vcookieurl}%{$vcookieemail}", time() + 60 * 60 * 24 * 30); // save cookie 30 days } // cleanup $_GET['x'] if (isset($_GET['x'])) { $_GET['x'] = eregi_replace('[^a-z0-9_-]', '', $_GET['x']);
/** * defensio_process_comment_pixelpost() * * @param mixed $defensioXML_result * @param mixed $firstcall * @param mixed $comment_id * @return */ function defensio_process_comment_pixelpost($defensioXML_result, $firstcall, $comment_id = null) { global $pixelpost_db_prefix, $cfgrow; // Depending on the fact this is the first call to the database we either have // to update based upon last_insert_id, signature or comment id (if failed previously). if ($firstcall) { if ($comment_id == null) { $where_clause = 'WHERE id = last_insert_id()'; } else { $where_clause = 'WHERE id = ' . $comment_id; } } else { $where_clause = "WHERE `signature` = '" . $defensioXML_result[1]->signature . "'"; } if ($defensioXML_result[0] == 200) { // succesful query to Defensio switch ($defensioXML_result[1]->status) { case 'success': // we have to see if the comment was classified as SPAM or not if ($defensioXML_result[1]->allow == 'true' && $defensioXML_result[1]->classification == 'legitimate') { // The comment has been classified als good by Defensio, so we can publish it $query = "UPDATE {$pixelpost_db_prefix}comments \n SET publish = 'yes', \n `spaminess` = '" . $defensioXML_result[1]->spaminess . "',\n `status` = '" . $defensioXML_result[1]->status . "',\n `allow` = '" . $defensioXML_result[1]->allow . "',\n `classification` = '" . $defensioXML_result[1]->classification . "' " . $where_clause; $result = mysql_query($query); if ($cfgrow['commentemail'] == 'yes') { // we need to send an email to the user $query = "SELECT `{$pixelpost_db_prefix}comments`.`parent_id`, `{$pixelpost_db_prefix}comments`.`url`, \n \t\t\t\t\t\t\t\t\t\t\t\t`{$pixelpost_db_prefix}comments`.`name`, `{$pixelpost_db_prefix}comments`.`email`, \n \t\t\t\t\t\t\t\t\t\t\t\t`{$pixelpost_db_prefix}comments`.`message`, `{$pixelpost_db_prefix}pixelpost`.`image` \n \t\t\t\t\t\t\t\t\t\t\t\tFROM `{$pixelpost_db_prefix}comments`, `{$pixelpost_db_prefix}pixelpost` " . $where_clause . " AND `{$pixelpost_db_prefix}comments`.`parent_id` = `{$pixelpost_db_prefix}pixelpost`.`id`"; $comment_info = mysql_query($query) or die(mysql_error()); $comment = mysql_fetch_array($comment_info, MYSQL_ASSOC); sendout_email($comment, $cfgrow); } eval_addon_front_workspace('comment_passed_askimet'); } else { $cfgrow['commentemail'] = 'no'; // Defensio thinks it is SPAM so we keep it in our quarantine // We do update the values for spaminess and status $query = "UPDATE {$pixelpost_db_prefix}comments \n SET publish = 'dfn', \n `spaminess` = '" . $defensioXML_result[1]->spaminess . "',\n `status` = '" . $defensioXML_result[1]->status . "',\n `allow` = '" . $defensioXML_result[1]->allow . "',\n `classification` = '" . $defensioXML_result[1]->classification . "'" . $where_clause; $result = mysql_query($query) or die(mysql_error()); eval_addon_front_workspace('comment_blocked_askimet'); } break; case 'pending': $cfgrow['commentemail'] = 'no'; // we update the table $query = "UPDATE {$pixelpost_db_prefix}comments \n SET `publish` = 'dfn',\n `spaminess` = '-1', \n `signature` = '" . $defensioXML_result[1]->signature . "', \n `status` = '" . $defensioXML_result[1]->status . "' " . $where_clause; $result = mysql_query($query) or die(mysql_error()); // and leave the rest to the callback function. break; case 'fail': // we update the table $cfgrow['commentemail'] = 'no'; $query = "UPDATE {$pixelpost_db_prefix}comments \n SET `publish` = 'dfn',\n `spaminess` = '-1', \n `status` = 'fail' " . $where_clause; $result = mysql_query($query) or die(mysql_error()); eval_addon_front_workspace('comment_blocked_askimet'); break; default: // we update the table $cfgrow['commentemail'] = 'no'; $query = "UPDATE {$pixelpost_db_prefix}comments \n SET `publish` = 'dfn',\n `spaminess` = '-1', \n `status` = 'fail' " . $where_clause; $result = mysql_query($query) or die(mysql_error()); eval_addon_front_workspace('comment_blocked_askimet'); break; } } else { // the query to Defensio failed for some reason // Assume it is a SPAM comment $cfgrow['commentemail'] = 'no'; $query = "UPDATE {$pixelpost_db_prefix}comments \n SET `publish` = 'dfn',\n `spaminess` = '-1',\n `status` = '" . $defensioXML_result[1]->status . "' " . $where_clause; $result = mysql_query($query) or die(mysql_error()); eval_addon_front_workspace('comment_blocked_askimet'); } return $return; }