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


PHP feed::getComments方法代码示例

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


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

示例1: mysqli

$db = new mysqli($CONF['host'], $CONF['user'], $CONF['pass'], $CONF['name']);
if ($db->connect_errno) {
    echo "Failed to connect to MySQL: (" . $db->connect_errno . ") " . $db->connect_error;
}
$db->set_charset("utf8");
$resultSettings = $db->query(getSettings());
$settings = $resultSettings->fetch_assoc();
// The theme complete url
$CONF['theme_url'] = $CONF['theme_path'] . '/' . $settings['theme'];
if (!empty($_POST['id']) && !empty($_POST['start']) && !empty($_POST['cid'])) {
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $loggedIn = new loggedIn();
        $loggedIn->db = $db;
        $loggedIn->url = $CONF['url'];
        $loggedIn->username = isset($_SESSION['username']) ? $_SESSION['username'] : $_COOKIE['username'];
        $loggedIn->password = isset($_SESSION['password']) ? $_SESSION['password'] : $_COOKIE['password'];
        $verify = $loggedIn->verify();
    }
    $feed = new feed();
    $feed->db = $db;
    $feed->url = $CONF['url'];
    $feed->censor = $settings['censor'];
    $feed->smiles = $settings['smiles'];
    $feed->time = $settings['time'];
    // Verify if it's logged in, then send the username to the class property to determine if any buttons is shown
    if ($verify['username']) {
        $feed->username = $verify['username'];
    }
    $feed->c_per_page = $settings['cperpage'];
    echo $feed->getComments($_POST['id'], $_POST['cid'], $_POST['start']);
}
开发者ID:Broomble,项目名称:AlumniSocialnetwork,代码行数:31,代码来源:load_comments.php

示例2: isset

        $loggedIn->db = $db;
        $loggedIn->url = $CONF['url'];
        $loggedIn->username = isset($_SESSION['username']) ? $_SESSION['username'] : $_COOKIE['username'];
        $loggedIn->password = isset($_SESSION['password']) ? $_SESSION['password'] : $_COOKIE['password'];
        $verify = $loggedIn->verify();
        if ($verify['username']) {
            $feed = new feed();
            $feed->db = $db;
            $feed->url = $CONF['url'];
            $feed->title = $settings['title'];
            $feed->email = $CONF['email'];
            $feed->id = $verify['idu'];
            $feed->username = $verify['username'];
            $feed->user_email = $verify['email'];
            $feed->time = $settings['time'];
            $feed->email_comment = $settings['email_comment'];
            $rand = rand();
            // If the message is not too long
            if (strlen($_POST['comment']) < $settings['mlimit']) {
                $result = $feed->addComment($_POST['id'], $_POST['comment']);
                if ($result) {
                    echo $feed->getComments(null, null, null, 1);
                } else {
                    echo '<div class="message-reply-container" id="post_comment_' . $rand . '"><div class="message-reported">' . $LNG['comment_error'] . ' <a onclick="deleteNotification(1, \'' . $rand . '\')" title="Delete notification"><div class="delete_btn"></div></a></div></div>';
                }
            } else {
                echo '<div class="message-reply-container" id="post_comment_' . $rand . '"><div class="message-reported">' . sprintf($LNG['comment_too_long'], $settings['mlimit']) . ' <a onclick="deleteNotification(1, \'' . $rand . '\')" title="Delete notification"><div class="delete_btn"></div></a></div></div>';
            }
        }
    }
}
开发者ID:Jeg72,项目名称:php_sound,代码行数:31,代码来源:post_comment.php


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