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


PHP comment::render_comment方法代码示例

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


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

示例1: foreach

        $start_datestamp = $gen->convert_date($poll_datestamp, "long");
        $end_datestamp = $gen->convert_date($poll_end_datestamp, "long");
        $text = "<table style='" . USER_WIDTH . "'>\n\t\t<tr>\n\t\t<td colspan='2' class='mediumtext' style='text-align:center'>\n\t\t<b>" . $tp->toHTML($poll_title, TRUE, 'TITLE') . "</b>\n\t\t<div class='smalltext'>" . POLLAN_35 . " <a href='" . e_BASE . "user.php?id.{$user_id}'>" . $user_name . "</a>.<br /> " . POLLAN_37 . " " . $start_datestamp . " " . POLLAN_38 . " " . $end_datestamp . ".<br />" . POLLAN_26 . ": {$voteTotal}</div>\n\t\t<br />\n\n\t\t</td>\n\t\t</tr>";
        $count = 0;
        $barl = file_exists(THEME . "images/barl.png") ? THEME . "images/barl.png" : e_PLUGIN . "poll/images/barl.png";
        $barr = file_exists(THEME . "images/barr.png") ? THEME . "images/barr.png" : e_PLUGIN . "poll/images/barr.png";
        $bar = file_exists(THEME . "images/bar.png") ? THEME . "images/bar.png" : e_PLUGIN . "poll/images/bar.png";
        foreach ($optionArray as $option) {
            $text .= "\n\t\t\t<tr>\n\t\t\t<td style='width:40%; text-align: right' class='mediumtext'><b>" . $tp->toHTML($option, TRUE, 'TITLE') . "</b>&nbsp;&nbsp;</td>\n\t\t\t<td class='smalltext'>\n\t\t\t<div style='background-image: url({$barl}); width: 5px; height: 14px; float: left;'>\n\t\t\t</div>\n\t\t\t<div style='background-image: url({$bar}); width: " . (floor($percentage[$count]) != 100 ? floor($percentage[$count]) : 95) . "%; height: 14px; float: left;'>\n\t\t\t</div>\n\t\t\t<div style='background-image: url({$barr}); width: 5px; height: 14px; float: left;'>\n\t\t\t</div>\n\t\t\t" . $percentage[$count] . "% [" . POLLAN_31 . ": " . $voteArray[$count] . "]\n\t\t\t</td>\n\t\t\t</tr>\n";
            $count++;
        }
        $query = "SELECT c.*, u.* FROM #comments AS c\n\t\tLEFT JOIN #user AS u ON FLOOR(SUBSTR(c.comment_author,1,INSTR(c.comment_author,'.')-1))=u.user_id\n\t\tWHERE comment_item_id=" . intval($poll_id) . " AND comment_type=4 ORDER BY comment_datestamp";
        if ($comment_total = $sql->db_Select_gen($query) !== FALSE) {
            $text .= "<tr><td colspan='2'><br /><br />";
            while ($row = $sql->db_Fetch()) {
                $text .= $cobj->render_comment($row);
            }
            $text .= "</td></tr>";
        }
        $text .= "</table>";
        $ns->tablerender(POLL_ADLAN01 . " #" . $poll_id, $text);
    }
}
$query = "SELECT p.*, u.user_name FROM #polls AS p\nLEFT JOIN #user AS u ON p.poll_admin_id = u.user_id\nWHERE p.poll_type=1\nORDER BY p.poll_datestamp DESC";
if (!$sql->db_Select_gen($query)) {
    $ns->tablerender(POLLAN_28, "<div style='text-align:center'>" . POLLAN_33 . "</div>");
    require_once FOOTERF;
    exit;
}
$array = $sql->db_getList();
$oldpollArray = array_slice($array, 1);
开发者ID:armpit,项目名称:e107,代码行数:31,代码来源:oldpolls.php

示例2: ebGetComment

/**
* Add comments to a plugins
* <p>This method returns the HTML for a comment form. In addition, it will post comments to the e107v7
* comments database and get any existing comments for the current item.</p>
* @param   string   a unique ID for this plugin, maximum of 10 character
* @param   int      id of the item comments are allowed for
* @return  string   HTML for existing comments for an item and the comments form to allow new comments to be posted
*/
function ebGetComment($pluginid, $id)
{
    global $pref, $e107cache, $tp;
    // Include the comment class. Normally, this file is included at a global level, so we need to make the variable
    // it decalares global so it is available inside the comment class
    require_once e_HANDLER . "comment_class.php";
    require e_FILE . "shortcode/batch/comment_shortcodes.php";
    $GLOBALS["comment_shortcodes"] = $comment_shortcodes;
    $pid = 0;
    // What is this w.r.t. comment table? Parent ID?
    // Define a comment object
    $cobj = new comment();
    // See if we need to post a comment to the database
    if (isset($_POST['commentsubmit'])) {
        $cobj->enter_comment($_POST['author_name'], $_POST['comment'], $pluginid, $id, $pid, $_POST['subject']);
        if ($pref['cachestatus']) {
            $e107cache->clear("comment.{$pluginid}.{$sub_action}");
        }
    }
    // Specific e107 0.617 processing to render existing comments
    if (!isV07()) {
        $query = $pref['nested_comments'] ? "comment_item_id='{$id}' AND comment_type='{$pluginid}' AND comment_pid='0' ORDER BY comment_datestamp" : "comment_item_id='{$id}' AND comment_type='{$pluginid}' ORDER BY comment_datestamp";
        unset($text);
        $mysql = new db();
        if ($comment_total = $mysql->db_Select("comments", "*", $query)) {
            $width = 0;
            while ($row = $mysql->db_Fetch()) {
                // ** Need to sort out how to do nested comments here
                if ($pref['nested_comments']) {
                    $text .= $cobj->render_comment($row, $pluginid, "comment", $id, $width, $subject, true);
                } else {
                    $text .= $cobj->render_comment($row, $pluginid, "comment", $id, $width, $subject, true);
                }
            }
            if (ADMIN && getperms("B")) {
                $text .= "<div style='text-align:right'><a href='" . e_ADMIN . "modcomment.php?{$pluginid}.{$id}'>" . LAN_314 . "</a></div>";
            }
        }
    }
    // Get comment form - e107 sends this to the output buffer so we must grab it and assign to our return string
    ob_start();
    if (isV07()) {
        // e107 0.7
        $cobj->compose_comment($pluginid, "comment", $id, $width, $subject, false);
    } else {
        // e107 0.617
        if (strlen($text) > 0) {
            $ns = new e107table();
            $ns->tablerender(LAN_5, $text);
        }
        $cobj->form_comment("comment", $pluginid, $id, $subject, $content_type);
    }
    $text = ob_get_contents();
    ob_end_clean();
    return $text;
}
开发者ID:testt98,项目名称:ebattles,代码行数:64,代码来源:main.php


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