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


PHP CacheControl::flushCommentNotifyRSS方法代码示例

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


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

示例1: receiveNotifiedComment

function receiveNotifiedComment($post)
{
    if (empty($post['mode']) || $post['mode'] != 'fb') {
        return 1;
    }
    global $database;
    CacheControl::flushCommentNotifyRSS();
    $post = fireEvent('ReceiveNotifiedComment', $post);
    if ($post === false) {
        return 7;
    }
    $blogid = getBlogId();
    $title = POD::escapeString(UTF8::lessenAsEncoding($post['s_home_title'], 255));
    $name = POD::escapeString(UTF8::lessenAsEncoding($post['s_name'], 255));
    $entryId = POD::escapeString($post['s_no']);
    $homepage = POD::escapeString(UTF8::lessenAsEncoding($post['url'], 255));
    $entryurl = POD::escapeString($post['s_url']);
    $entrytitle = POD::escapeString($post['s_post_title']);
    $parent_id = $post['r1_no'];
    $parent_name = POD::escapeString(UTF8::lessenAsEncoding($post['r1_name'], 80));
    $parent_parent = $post['r1_rno'];
    $parent_homepage = POD::escapeString(UTF8::lessenAsEncoding($post['r1_homepage'], 80));
    $parent_written = $post['r1_regdate'];
    $parent_comment = POD::escapeString($post['r1_body']);
    $parent_url = POD::escapeString(UTF8::lessenAsEncoding($post['r1_url'], 255));
    $child_id = $post['r2_no'];
    $child_name = POD::escapeString(UTF8::lessenAsEncoding($post['r2_name'], 80));
    $child_parent = $post['r2_rno'];
    $child_homepage = POD::escapeString(UTF8::lessenAsEncoding($post['r2_homepage'], 80));
    $child_written = $post['r2_regdate'];
    $child_comment = POD::escapeString($post['r2_body']);
    $child_url = POD::escapeString(UTF8::lessenAsEncoding($post['r2_url'], 255));
    $siteid = POD::queryCell("SELECT id FROM {$database['prefix']}CommentsNotifiedSiteInfo WHERE url = '{$homepage}'");
    if (empty($siteid)) {
        $insertId = getCommentsNotifiedSiteInfoMaxId() + 1;
        if (POD::execute("INSERT INTO {$database['prefix']}CommentsNotifiedSiteInfo\n\t\t\t( id, title, name, url, modified)\n\t\t\tVALUES ({$insertId}, '{$title}', '{$name}', '{$homepage}', UNIX_TIMESTAMP());")) {
            $siteid = $insertId;
        } else {
            return 2;
        }
    }
    $parentId = POD::queryCell("SELECT id\n\t\tFROM {$database['prefix']}CommentsNotified\n\t\tWHERE entry = {$entryId}\n\t\t\tAND siteid = {$siteid}\n\t\t\tAND blogid = {$blogid}\n\t\t\tAND remoteid = {$parent_id}");
    if (empty($parentId)) {
        $insertId = getCommentsNotifiedMaxId() + 1;
        $sql = "INSERT INTO {$database['prefix']}CommentsNotified\n\t\t\t( blogid , replier , id , entry , parent , name , password , homepage , secret , comment , ip , written, modified , siteid , isnew , url , remoteid ,entrytitle , entryurl )\n\t\t\tVALUES (\n\t\t\t\t{$blogid}, NULL , {$insertId}, " . $entryId . ", " . (empty($parent_parent) ? 'null' : $parent_parent) . ", '" . $parent_name . "', '', '" . $parent_homepage . "', '', '" . $parent_comment . "', '', " . $parent_written . ",UNIX_TIMESTAMP(), " . $siteid . ", 1, '" . $parent_url . "'," . $parent_id . ", '" . $entrytitle . "', '" . $entryurl . "'\n)";
        if (!POD::execute($sql)) {
            return 3;
        }
        $parentId = $insertId;
    }
    if (POD::queryCell("SELECT count(*) FROM {$database['prefix']}CommentsNotified WHERE siteid={$siteid} AND remoteid={$child_id}") > 0) {
        return 4;
    }
    $insertId = getCommentsNotifiedMaxId() + 1;
    $sql = "INSERT INTO {$database['prefix']}CommentsNotified\n\t\t( blogid , replier , id , entry , parent , name , password , homepage , secret , comment , ip , written, modified , siteid , isnew , url , remoteid ,entrytitle , entryurl )\n\t\tVALUES (\n\t\t\t{$blogid}, NULL , {$insertId}, " . $entryId . ", {$parentId}, '{$child_name}', '', '{$child_homepage}', '', '{$child_comment}', '', {$child_written}, UNIX_TIMESTAMP(), {$siteid}, 1, '{$child_url}', {$child_id}, '{$entrytitle}', '{$entryurl}')";
    if (!POD::execute($sql)) {
        return 5;
    }
    $sql = "UPDATE {$database['prefix']}CommentsNotified SET modified = UNIX_TIMESTAMP() WHERE blogid = {$blogid} AND id = {$parentId}";
    if (!POD::execute($sql)) {
        return 6;
    }
    return 0;
}
开发者ID:hinablue,项目名称:TextCube,代码行数:64,代码来源:blog.comment.php

示例2: receiveNotifiedComment

function receiveNotifiedComment($post)
{
    if (empty($post['mode']) || $post['mode'] != 'fb') {
        return 1;
    }
    $context = Model_Context::getInstance();
    CacheControl::flushCommentNotifyRSS();
    $post = fireEvent('ReceiveNotifiedComment', $post);
    if ($post === false) {
        return 7;
    }
    $pool = DBModel::getInstance();
    $blogid = getBlogId();
    $title = Utils_Unicode::lessenAsEncoding($post['s_home_title'], 255);
    $name = Utils_Unicode::lessenAsEncoding($post['s_name'], 255);
    $entryId = $post['s_no'];
    $homepage = Utils_Unicode::lessenAsEncoding($post['url'], 255);
    $entryurl = $post['s_url'];
    $entrytitle = $post['s_post_title'];
    $parent_id = $post['r1_no'];
    $parent_name = Utils_Unicode::lessenAsEncoding($post['r1_name'], 80);
    $parent_parent = $post['r1_rno'];
    $parent_homepage = Utils_Unicode::lessenAsEncoding($post['r1_homepage'], 80);
    $parent_written = $post['r1_regdate'];
    $parent_comment = $post['r1_body'];
    $parent_url = Utils_Unicode::lessenAsEncoding($post['r1_url'], 255);
    $child_id = $post['r2_no'];
    $child_name = Utils_Unicode::lessenAsEncoding($post['r2_name'], 80);
    $child_parent = $post['r2_rno'];
    $child_homepage = Utils_Unicode::lessenAsEncoding($post['r2_homepage'], 80);
    $child_written = $post['r2_regdate'];
    $child_comment = $post['r2_body'];
    $child_url = Utils_Unicode::lessenAsEncoding($post['r2_url'], 255);
    $pool->reset('CommentsNotifiedSiteInfo');
    $pool->setQualifier('url', 'eq', $homepage);
    $siteid = $pool->getCell('id');
    if (empty($siteid)) {
        $insertId = getCommentsNotifiedSiteInfoMaxId() + 1;
        $pool->reset('CommentsNotifiedSiteInfo');
        $pool->setAttribute('id', $insertId);
        $pool->setAttribute('title', $title, true);
        $pool->setAttribute('name', $name, true);
        $pool->setAttribute('url', $homepage, true);
        $pool->setAttribute('modified', Timestamp::getUNIXtime());
        if ($pool->insert()) {
            $siteid = $insertId;
        } else {
            return 2;
        }
    }
    $pool->reset('CommentsNotified');
    $pool->setQualifier('entry', 'eq', $entryId);
    $pool->setQualifier('siteid', 'eq', $siteid);
    $pool->setQualifier('blogid', 'eq', $blogid);
    $pool->setQualifier('remoteid', 'eq', $parent_id);
    $parentId = $pool->getCell('id');
    if (empty($parentId)) {
        $insertId = getCommentsNotifiedMaxId() + 1;
        $pool->reset('CommentsNotified');
        $pool->setAttribute('blogid', $blogid);
        $pool->setAttribute('replier', NULL);
        $pool->setAttribute('id', $insertId);
        $pool->setAttribute('entry', $entryId);
        $pool->setAttribute('parent', empty($parent_parent) ? NULL : $parent_parent);
        $pool->setAttribute('name', $parent_name, true);
        $pool->setAttribute('password', '', true);
        $pool->setAttribute('homepage', $parent_homepage, true);
        $pool->setAttribute('secret', '', true);
        $pool->setAttribute('comment', $parent_comment, true);
        $pool->setAttribute('ip', '', true);
        $pool->setAttribute('written', $parent_written, true);
        $pool->setAttribute('modified', Timestamp::getUNIXtime());
        $pool->setAttribute('siteid', $siteid);
        $pool->setAttribute('isnew', 1);
        $pool->setAttribute('url', $parent_url, true);
        $pool->setAttribute('remoteid', $parent_id);
        $pool->setAttribute('entrytitle', $entrytitle, true);
        $pool->setAttribute('entryurl', $entryurl, true);
        if (!$pool->insert()) {
            return 3;
        }
        $parentId = $insertId;
    }
    $pool->reset('CommentsNotified');
    $pool->setQualifier('siteid', 'eq', $siteid);
    $pool->setQualifier('remoteid', 'eq', $child_id);
    if ($pool->getCount() > 0) {
        return 4;
    }
    $insertId = getCommentsNotifiedMaxId() + 1;
    $pool->reset('CommentsNotified');
    $pool->setAttribute('blogid', $blogid);
    $pool->setAttribute('replier', NULL);
    $pool->setAttribute('id', $insertId);
    $pool->setAttribute('entry', $entryId);
    $pool->setAttribute('parent', $parentId);
    $pool->setAttribute('name', $child_name, true);
    $pool->setAttribute('password', '', true);
    $pool->setAttribute('homepage', $child_homepage, true);
    $pool->setAttribute('secret', '', true);
//.........这里部分代码省略.........
开发者ID:webhacking,项目名称:Textcube,代码行数:101,代码来源:comment.php


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