当前位置: 首页>>代码示例>>PHP>>正文


PHP Akismet::setPermalink方法代码示例

本文整理汇总了PHP中Akismet::setPermalink方法的典型用法代码示例。如果您正苦于以下问题:PHP Akismet::setPermalink方法的具体用法?PHP Akismet::setPermalink怎么用?PHP Akismet::setPermalink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Akismet的用法示例。


在下文中一共展示了Akismet::setPermalink方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: commentValidate

 public function commentValidate($comment)
 {
     $result = null;
     if (!$comment['contact_id'] && ($api_key = $this->getSettingValue('api_key')) && class_exists('Akismet')) {
         $url = wa()->getRouteUrl('blog', array(), true);
         $post_url = null;
         if (isset($comment['post_data'])) {
             $post_url = blogPost::getUrl($comment['post_data']);
             if (is_array($post_url)) {
                 $post_url = array_shift($post_url);
             }
         }
         $akismet = new Akismet($url, $api_key);
         $akismet->setCommentAuthor($comment['name']);
         $akismet->setCommentAuthorEmail($comment['email']);
         //$akismet->setCommentAuthorURL($comment['site']);
         $akismet->setCommentContent($comment['text']);
         if ($post_url) {
             $akismet->setPermalink($post_url);
         }
         if ($akismet->isCommentSpam()) {
             $result = array('text' => _wp('According to Akismet.com, your comment very much looks like spam, thus will not be published. Please rewrite your comment. Sorry for the inconvenience.'));
         }
     }
     return $result;
 }
开发者ID:cjmaximal,项目名称:webasyst-framework,代码行数:26,代码来源:blogAkismet.plugin.php

示例2:

 function __construct($comment)
 {
     $ini = eZINI::instance('akismet.ini');
     $blogURL = $ini->variable('SiteSettings', 'BlogURL');
     $apiKey = $ini->variable('AccountSettings', 'APIKey');
     parent::__construct($blogURL, $apiKey);
     if (isset($comment['permalink'])) {
         parent::setPermalink($comment['permalink']);
     }
     if ($comment['type']) {
         parent::setCommentType($comment['type']);
     }
     if (isset($comment['author'])) {
         parent::setCommentAuthor($comment['author']);
     } else {
         parent::setCommentAuthor('');
     }
     if (isset($comment['email'])) {
         parent::setCommentAuthorEmail($comment['email']);
     }
     if ($comment['website']) {
         parent::setCommentAuthorURL($comment['website']);
     }
     if ($comment['body']) {
         parent::setCommentContent($comment['body']);
     }
 }
开发者ID:BGCX067,项目名称:ezakismet-svn-to-git,代码行数:27,代码来源:ezakismet.php

示例3: HandleGuestStore

function HandleGuestStore($pagename, $auth)
{
    global $wpcom_api_key, $wpcom_home;
    $akismet = new Akismet($wpcom_home, $wpcom_api_key);
    $akismet->setCommentAuthor($_POST['name']);
    $akismet->setCommentAuthorEmail($_POST['email']);
    $akismet->setCommentAuthorURL($_POST['url']);
    $akismet->setCommentContent($_POST['comment']);
    $itemurl = $pagename . date("Ymd") . "-" . uniqid();
    $akismet->setPermalink($itemurl);
    $page['name'] = $itemurl;
    $page['text'] = "----\n";
    $page['text'] .= strlen($_POST['name']) > 0 ? $_POST['name'] : "Unbekannt";
    if (strlen($_POST['email']) > 0) {
        $page['text'] .= " [[✉->mailto:";
        $page['text'] .= $_POST['email'];
        $page['text'] .= "]]";
    }
    if (strlen($_POST['url']) > 0) {
        $page['text'] .= " [[➚->";
        $page['text'] .= substr($_POST['url'], 0, 4) == "http" ? $_POST['url'] : "http://" . $_POST['url'];
        $page['text'] .= "]]";
    }
    $page['text'] .= " schrieb am ";
    $page['text'] .= date("d.m.Y");
    $page['text'] .= ":\n\n";
    $page['text'] .= $_POST['comment'];
    $page['text'] .= $akismet->isCommentSpam() ? "(:spam: true:)" : "(:spam: false:)";
    $page['time'] = $Now;
    $page['host'] = $_SERVER['REMOTE_ADDR'];
    $page['agent'] = @$_SERVER['HTTP_USER_AGENT'];
    UpdatePage($page['name'], $page, $page);
    HandleBrowse($pagename);
}
开发者ID:ansgar,项目名称:pmguest,代码行数:34,代码来源:guest.php

示例4: akismet_create_topic

function akismet_create_topic($msg_options, $topic_options, $poster_options)
{
    global $modSettings, $scripturl, $smcFunc, $sourcedir;
    require $sourcedir . '/Akismet.class.php';
    // If the subject is 'akismet-test-123', then mark it as spam (this is a test)
    if ($msg_options['subject'] == 'akismet-test-123') {
        $spam = true;
    } else {
        // If the API key has been set
        if (isset($modSettings['akismetAPIKey']) && $modSettings['akismetAPIKey'] != "") {
            // Set up the Akismet class
            $akismet = new Akismet($scripturl, $modSettings['akismetAPIKey']);
            $akismet->setAuthor($poster_options['name']);
            $akismet->setAuthorEmail($poster_options['email']);
            //$akismet->setCommentAuthorURL(""); -- URL's not used in SMF.
            $akismet->setContent($msg_options['body']);
            if (!empty($topic_options['id'])) {
                $akismet->setPermalink($scripturl . '?topic=' . $topicOptions['id']);
            }
            $akismet->setType('smf-post');
            // Now, the moment of truth... Send the post to Akismet
            $akismet_return = $akismet->isSpam();
            // Was the server down?
            if ($akismet_return === 'conn_error') {
                // Assume it's not spam. We log an error to the error log later
                $spam = false;
                // Log it!
                if (empty($modSettings['akismetNoLog'])) {
                    log_error(sprintf($txt['akismet_cant_connect2'], $_POST['guestname'], $scripturl . '?topic=' . $topic . (isset($_REQUEST['msg']) ? '.msg' . $_REQUEST['msg'] : '')));
                }
            } elseif ($akismet_return === true) {
                // Oh, the horror! Someone posted spam to your forum!
                $spam = true;
            } else {
                $spam = false;
            }
        } else {
            // No API key, assume it isn't spam
            $spam = false;
        }
    }
    if ($spam) {
        // Mark the message as spam and unapprove the post. Post moderation is a big help here. :)
        $smcFunc['db_query']('', '
			UPDATE {db_prefix}topics
			SET spam = 1,
				approved = 0,
				unapproved_posts = 1
			WHERE id_topic = {int:id_topic}', array('id_topic' => $topic_options['id']));
        $smcFunc['db_query']('', '
			UPDATE {db_prefix}messages
			SET approved = 0
			WHERE id_msg = {int:id_msg}', array('id_msg' => $msg_options['id']));
        // Increase spam count
        $smcFunc['db_query']('', '
			UPDATE {db_prefix}settings
			SET value = value + 1
			WHERE variable = {string:akismetCaughtSpam}', array('akismetCaughtSpam' => 'akismetCaughtSpam'));
    }
}
开发者ID:valek0972,项目名称:hackits,代码行数:60,代码来源:Subs-Akismet.php

示例5: perform

 /**
  * check if a comment is spam through Akismet
  *
  * @param mixed $data Data passed to this action
  * @return bool TRUE if comment is spam else FALSE
  */
 public function perform($data = FALSE)
 {
     include_once JAPA_BASE_DIR . 'modules/common/includes/Akismet.class.php';
     $akismet = new Akismet($data['url'], $data['key']);
     $akismet->setCommentAuthor($data['user']['name']);
     $akismet->setCommentAuthorEmail($data['user']['email']);
     $akismet->setCommentAuthorURL($data['user']['url']);
     $akismet->setCommentContent($data['user']['comment']);
     $akismet->setPermalink($data['permaLink']);
     return $akismet->isCommentSpam();
 }
开发者ID:BackupTheBerlios,项目名称:openpublisher-svn,代码行数:17,代码来源:ActionCommonSpam.php

示例6: create

 /**
  * Function: create
  * Attempts to create a comment using the passed information. If the Akismet API key is present, it will check it.
  *
  * Parameters:
  *     $body - The comment.
  *     $author - The name of the commenter.
  *     $url - The commenter's website.
  *     $email - The commenter's email.
  *     $post - The <Post> they're commenting on.
  *     $parent - The <Comment> they're replying to.
  *     $notify - Notification on follow-up comments.
  *     $type - The type of comment. Optional, used for trackbacks/pingbacks.
  */
 static function create($body, $author, $url, $email, $post, $parent, $notify, $type = null)
 {
     if (!self::user_can($post->id) and !in_array($type, array("trackback", "pingback"))) {
         return;
     }
     $config = Config::current();
     $route = Route::current();
     $visitor = Visitor::current();
     if (!$type) {
         $status = $post->user_id == $visitor->id ? "approved" : $config->default_comment_status;
         $type = "comment";
     } else {
         $status = $type;
     }
     if (!empty($config->akismet_api_key)) {
         $akismet = new Akismet($config->url, $config->akismet_api_key);
         $akismet->setCommentContent($body);
         $akismet->setCommentAuthor($author);
         $akismet->setCommentAuthorURL($url);
         $akismet->setCommentAuthorEmail($email);
         $akismet->setPermalink($post->url());
         $akismet->setCommentType($type);
         $akismet->setReferrer($_SERVER['HTTP_REFERER']);
         $akismet->setUserIP($_SERVER['REMOTE_ADDR']);
         if ($akismet->isCommentSpam()) {
             self::add($body, $author, $url, $email, $_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT'], "spam", $post->id, $visitor->id, $parent, $notify);
             error(__("Spam Comment"), __("Your comment has been marked as spam. It has to be reviewed and/or approved by an admin.", "comments"));
         } else {
             $comment = self::add($body, $author, $url, $email, $_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT'], $status, $post->id, $visitor->id, $parent, $notify);
             fallback($_SESSION['comments'], array());
             $_SESSION['comments'][] = $comment->id;
             if (isset($_POST['ajax'])) {
                 exit("{ \"comment_id\": \"" . $comment->id . "\", \"comment_timestamp\": \"" . $comment->created_at . "\" }");
             }
             Flash::notice(__("Comment added."), $post->url() . "#comments");
         }
     } else {
         $comment = self::add($body, $author, $url, $email, $_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT'], $status, $post->id, $visitor->id, $parent, $notify);
         fallback($_SESSION['comments'], array());
         $_SESSION['comments'][] = $comment->id;
         if (isset($_POST['ajax'])) {
             exit("{ \"comment_id\": \"" . $comment->id . "\", \"comment_timestamp\": \"" . $comment->created_at . "\" }");
         }
         Flash::notice(__("Comment added."), $post->url() . "#comment");
     }
 }
开发者ID:betsyzhang,项目名称:chyrp,代码行数:60,代码来源:model.Comment.php

示例7: queryAkismet

 public function queryAkismet($author, $textDiff, $permalink)
 {
     global $wgMWAkismetKey;
     global $wgMWAkismetURL;
     // First check to see if the config settings are set
     if ($wgMWAkismetKey == '' || $wgMWAkismetURL == '') {
         echo "Akismet key and url must be set.  Instructions for getting a key are here: <a href=\"http://faq.wordpress.com/2005/10/19/api-key/\">API key FAQ on Wordpress.com</a>";
         die;
     }
     $akismet = new Akismet($wgMWAkismetURL, $wgMWAkismetKey);
     $akismet->setCommentAuthor($author);
     $akismet->setCommentAuthorEmail("");
     $akismet->setCommentAuthorURL("");
     $akismet->setCommentContent($textDiff);
     $akismet->setPermalink($permalink);
     $isSpam = $akismet->isCommentSpam();
     return $isSpam;
 }
开发者ID:aag,项目名称:mwakismet,代码行数:18,代码来源:MwAkismet.class.php

示例8: eventRmcommonCheckPostSpam

 /**
  * This event check spam in comments, posts and other contents for modules
  * 
  * @param array All params to check (blogurl, name, email, url, text, permalink)
  * @return bool
  */
 public function eventRmcommonCheckPostSpam($params)
 {
     $config = RMFunctions::get()->plugin_settings('akismet', true);
     if ($config['key'] == '') {
         return;
     }
     extract($params);
     $akismet = new Akismet($blogurl, $config['key']);
     $akismet->setCommentAuthor($name);
     $akismet->setCommentAuthorEmail($email);
     $akismet->setCommentAuthorURL($url);
     $akismet->setCommentContent($text);
     $akismet->setPermalink($permalink);
     $akismet->setUserIP($_SERVER['REMOTE_ADDR']);
     if ($akismet->isCommentSpam()) {
         return false;
     }
     return true;
 }
开发者ID:laiello,项目名称:bitcero-modules,代码行数:25,代码来源:rmcommon.php

示例9: action_comment_insert_before

 public function action_comment_insert_before(Comment $comment)
 {
     $api_key = Options::get('habariakismet__api_key');
     $provider = Options::get('habariakismet__provider');
     if ($api_key == null || $provider == null) {
         return;
     }
     $endpoint = $provider == 'Akismet' ? self::SERVER_AKISMET : self::SERVER_TYPEPAD;
     $a = new Akismet(Site::get_url('habari'), $api_key);
     $a->setAkismetServer($endpoint);
     $a->setCommentAuthor($comment->name);
     $a->setCommentAuthorEmail($comment->email);
     $a->setCommentAuthorURL($comment->url);
     $a->setCommentContent($comment->content);
     $a->setPermalink($comment->post->permalink);
     try {
         $comment->status = $a->isCommentSpam() ? 'spam' : 'ham';
         return;
     } catch (Exception $e) {
         EventLog::log($e->getMessage(), 'notice', 'comment', 'HabariAkismet');
     }
 }
开发者ID:habari-extras,项目名称:habariakismet,代码行数:22,代码来源:habariakismet.plugin.php

示例10: isSpam

 /**
  * Use Akismet to check comment data for spam
  *
  * @param array $data
  * @return array Data with spam field set
  */
 function isSpam(&$data)
 {
     $apiKey = Configure::read('AppSettings.wordpress_api_key');
     if (empty($apiKey)) {
         return false;
     }
     try {
         App::import('Vendor', 'akismet');
         $siteUrl = 'http://' . getenv('SERVER_NAME');
         $akismet = new Akismet($siteUrl, $apiKey);
         $akismet->setCommentAuthor($data[$this->name]['name']);
         $akismet->setCommentAuthorEmail($data[$this->name]['email']);
         $akismet->setCommentAuthorURL($data[$this->name]['url']);
         $akismet->setCommentContent($data[$this->name]['content']);
         $akismet->setPermalink($data['Post']['permalink']);
         if ($akismet->isCommentSpam()) {
             return true;
         }
     } catch (Exception $e) {
         $this->log('Akismet not reachable!');
     }
     return false;
 }
开发者ID:Jaciss,项目名称:wildflower,代码行数:29,代码来源:wild_comment.php

示例11: isSpam

 /**
  * Use Akismet to check comment data for spam
  *
  * @param array $data
  * @return bool
  */
 function isSpam(&$data)
 {
     $apiKey = Configure::read('Wildflower.settings.wordpress_api_key');
     if (empty($apiKey)) {
         return false;
     }
     try {
         App::import('Vendor', 'akismet');
         $siteUrl = Configure::read('Wildflower.fullSiteUrl');
         $akismet = new Akismet($siteUrl, $apiKey);
         $akismet->setCommentAuthor($data[$this->name]['name']);
         $akismet->setCommentAuthorEmail($data[$this->name]['email']);
         $akismet->setCommentAuthorURL($data[$this->name]['url']);
         $akismet->setCommentContent($data[$this->name]['content']);
         $akismet->setPermalink($data['Post']['permalink']);
         if ($akismet->isCommentSpam()) {
             return true;
         }
     } catch (Exception $e) {
         trigger_error('Akismet not reachable: ' . $e->message);
     }
     return false;
 }
开发者ID:uuking,项目名称:wildflower,代码行数:29,代码来源:comment.php

示例12: getAkismet

 protected function getAkismet($invoker)
 {
     $request = sfContext::getInstance()->getRequest();
     $api_key = sfConfig::get('app_akismet_api_key');
     if (empty($api_key)) {
         return false;
     }
     $akismet = new Akismet($request->getUriPrefix() . $request->getRelativeUrlRoot(), $api_key);
     $data = $invoker->getAkismetData();
     // Set values
     if (!empty($data['author_name'])) {
         $akismet->setCommentAuthor($data['author_name']);
     } else {
         return true;
     }
     if (!empty($data['author_email'])) {
         $akismet->setCommentAuthorEmail($data['author_email']);
     }
     if (!empty($data['author_url'])) {
         $akismet->setCommentAuthorURL($data['author_url']);
     }
     if (!empty($data['content'])) {
         $akismet->setCommentContent($data['content']);
     } else {
         return true;
     }
     if (!empty($data['permalink'])) {
         $akismet->setPermalink($data['permalink']);
     }
     if (!empty($data['referrer'])) {
         $akismet->setReferer($data['referrer']);
     }
     if (!empty($data['user_ip'])) {
         $akismet->setUserIp($data['user_ip']);
     }
     return $akismet;
 }
开发者ID:jeremyfa,项目名称:dmAkismetPlugin,代码行数:37,代码来源:DmAkismet.php

示例13: akismet_showpage


//.........这里部分代码省略.........
        if (phpnum() >= 5) {
            include_once akismet_lib_path . 'Akismet.class_5.php';
        } else {
            include_once akismet_lib_path . 'Akismet.class_4.php';
        }
        if ($view == 'isSpam') {
            if ($_GET['action'] == "bulkmod") {
                if (isset($_POST['submit'])) {
                    $spam = array();
                    foreach ($_POST["spam"] as $k => $v) {
                        $spam[intval($k)] = $v;
                    }
                    foreach ($spam as $key => $value) {
                        if (isset($key)) {
                            $link_id = sanitize($key, 3);
                        } else {
                            continue;
                        }
                        $link = new Link();
                        $link->id = $link_id;
                        $link->read();
                        $user = new User();
                        $user->id = $link->author;
                        $user->read();
                        if (phpnum() < 5) {
                            $comment = array('author' => $user->username, 'email' => $user->email, 'website' => $link->url, 'body' => $link->content, 'permalink' => my_base_url . getmyurl('story', $link->id));
                            $akismet = new Akismet(my_base_url . my_pligg_base, get_misc_data('wordpress_key'), $comment);
                        } else {
                            $akismet = new Akismet(my_base_url . my_pligg_base, get_misc_data('wordpress_key'));
                            $akismet->setCommentAuthor($user->username);
                            $akismet->setCommentAuthorEmail($user->email);
                            $akismet->setCommentAuthorURL($link->url);
                            $akismet->setCommentContent($link->content);
                            $akismet->setPermalink(my_base_url . getmyurl('story', $link->id));
                        }
                        if ($value == "spam") {
                            $link->status = 'spam';
                            $link->store();
                            killspam($user->id);
                            $akismet->submitSpam();
                        } elseif ($value == "notspam") {
                            $link->status = 'new';
                            $link->store();
                            $akismet->submitHam();
                        }
                        $db->query("DELETE FROM " . table_prefix . "spam_links WHERE linkid={$link_id}");
                    }
                }
            }
            header('Location: ' . URL_akismet . '&view=manageSpam');
            die;
        }
        if ($view == 'isSpamcomment') {
            if ($_GET['action'] == "bulkmod") {
                if (isset($_POST['submit'])) {
                    $spamcomment = array();
                    foreach ($_POST["spamcomment"] as $k => $v) {
                        $spamcomment[intval($k)] = $v;
                    }
                    foreach ($spamcomment as $key => $value) {
                        if (isset($key)) {
                            $link_id = sanitize($key, 3);
                        } else {
                            continue;
                        }
                        $sql_result = "Select * from " . table_prefix . "spam_comments where auto_id=" . $link_id;
开发者ID:hyrmedia,项目名称:pligg-cms,代码行数:67,代码来源:akismet_main.php

示例14: add_comment

 public function add_comment()
 {
     $aItem = $this->prepareDataForFunction('add_comment');
     $authorName = trim($aItem['authorName']);
     $authorName = strip_tags($authorName);
     $authorEmail = trim($aItem['authorEmail']);
     $authorEmail = strip_tags($authorEmail);
     $body = trim($aItem['body']);
     $body = strip_tags($body);
     $title = $aItem['title'];
     $itemId = $aItem['id'];
     $userId = $aItem['userId'];
     $status_num = -1;
     $item = $this->manager->findByPrimaryKey($itemId);
     $itemURL = osc_item_url();
     Params::setParam('itemURL', $itemURL);
     if ($authorName == '' || !preg_match('|^.*?@.{2,}\\..{2,3}$|', $authorEmail)) {
         return 3;
     }
     if ($body == '') {
         return 4;
     }
     $num_moderate_comments = osc_moderate_comments();
     if ($userId == null) {
         $num_comments = 0;
     } else {
         $num_comments = count(ItemComment::newInstance()->findByAuthorID($userId));
     }
     if ($num_moderate_comments == -1 || $num_moderate_comments != 0 && $num_comments >= $num_moderate_comments) {
         $status = 'ACTIVE';
         $status_num = 2;
     } else {
         $status = 'INACTIVE';
         $status_num = 1;
     }
     if (osc_akismet_key()) {
         require_once LIB_PATH . 'Akismet.class.php';
         $akismet = new Akismet(osc_base_url(), osc_akismet_key());
         $akismet->setCommentAuthor($authorName);
         $akismet->setCommentAuthorEmail($authorEmail);
         $akismet->setCommentContent($body);
         $akismet->setPermalink($itemURL);
         $status = $akismet->isCommentSpam() ? 'SPAM' : $status;
         if ($status == 'SPAM') {
             $status_num = 5;
         }
     }
     $mComments = ItemComment::newInstance();
     $aComment = array('dt_pub_date' => DB_FUNC_NOW, 'fk_i_item_id' => $itemId, 's_author_name' => $authorName, 's_author_email' => $authorEmail, 's_title' => $title, 's_body' => $body, 'e_status' => $status, 'fk_i_user_id' => $userId);
     if ($mComments->insert($aComment)) {
         $notify = osc_notify_new_comment();
         $admin_email = osc_contact_email();
         $prefLocale = osc_language();
         //Notify admin
         if ($notify) {
             $mPages = new Page();
             $aPage = $mPages->findByInternalName('email_new_comment_admin');
             $locale = osc_current_user_locale();
             $content = array();
             if (isset($aPage['locale'][$locale]['s_title'])) {
                 $content = $aPage['locale'][$locale];
             } else {
                 $content = current($aPage['locale']);
             }
             $words = array();
             $words[] = array('{COMMENT_AUTHOR}', '{COMMENT_EMAIL}', '{COMMENT_TITLE}', '{COMMENT_TEXT}', '{ITEM_TITLE}', '{ITEM_ID}', '{ITEM_URL}');
             $words[] = array($authorName, $authorEmail, $title, $body, $item['s_title'], $itemId, $itemURL);
             $title_email = osc_mailBeauty($content['s_title'], $words);
             $body_email = osc_mailBeauty($content['s_text'], $words);
             $from = osc_contact_email();
             $from_name = osc_page_title();
             if (osc_notify_contact_item()) {
                 $add_bbc = osc_contact_email();
             }
             $emailParams = array('from' => $admin_email, 'from_name' => __('Admin mail system'), 'subject' => $title_email, 'to' => $admin_email, 'to_name' => __('Admin mail system'), 'body' => $body_email, 'alt_body' => $body_email);
             osc_sendMail($emailParams);
         }
         osc_run_hook('add_comment', $item);
         return $status_num;
     }
     return -1;
 }
开发者ID:hashemgamal,项目名称:OSClass,代码行数:82,代码来源:ItemActions.php

示例15: akismet_showpage


//.........这里部分代码省略.........
        }
        if ($view == 'isSpam') {
            if ($_GET['action'] == "bulkmod") {
                if (isset($_POST['submit'])) {
                    $spam = array();
                    foreach ($_POST["spam"] as $k => $v) {
                        $spam[intval($k)] = $v;
                    }
                    foreach ($spam as $key => $value) {
                        if ($value == "spam") {
                            if (isset($key)) {
                                $link_id = sanitize($key, 3);
                            } else {
                                $link_id = '';
                            }
                            $spam_links = get_misc_data('spam_links');
                            $spam_links = unserialize(get_misc_data('spam_links'));
                            $key = array_search($link_id, $spam_links);
                            unset($spam_links[$key]);
                            misc_data_update('spam_links', serialize($spam_links));
                            $link = new Link();
                            $link->id = $link_id;
                            $link->read();
                            $link->status = 'discard';
                            $link->store();
                            $user = new User();
                            $user->id = $link->author;
                            $user->read();
                            $akismet = new Akismet(my_base_url . my_pligg_base, get_misc_data('wordpress_key'));
                            $akismet->setCommentAuthor($user->username);
                            $akismet->setCommentAuthorEmail($user->email);
                            $akismet->setCommentAuthorURL($link->url);
                            $akismet->setCommentContent($link->content);
                            $akismet->setPermalink(getmyurl('story', $link->id));
                            $akismet->submitSpam();
                        } elseif ($value == "notspam") {
                            if (isset($key)) {
                                $link_id = sanitize($key, 3);
                            } else {
                                $link_id = '';
                            }
                            $spam_links = get_misc_data('spam_links');
                            $spam_links = unserialize(get_misc_data('spam_links'));
                            $key = array_search($link_id, $spam_links);
                            unset($spam_links[$key]);
                            misc_data_update('spam_links', serialize($spam_links));
                            $link = new Link();
                            $link->id = $link_id;
                            $link->read(FALSE);
                            $link->status = 'queued';
                            $link->store();
                            $user = new User();
                            $user->id = $link->author;
                            $user->read();
                            $akismet = new Akismet(my_base_url . my_pligg_base, get_misc_data('wordpress_key'));
                            $akismet->setCommentAuthor($user->username);
                            $akismet->setCommentAuthorEmail($user->email);
                            $akismet->setCommentAuthorURL($link->url);
                            $akismet->setCommentContent($link->content);
                            $akismet->setPermalink(getmyurl('story', $link->id));
                            $akismet->submitHam();
                        }
                    }
                }
            }
            header('Location: ' . URL_akismet . '&view=manageSpam');
开发者ID:pantofla,项目名称:waterfan,代码行数:67,代码来源:akismet_main.php


注:本文中的Akismet::setPermalink方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。