本文整理汇总了PHP中comment::compose_comment方法的典型用法代码示例。如果您正苦于以下问题:PHP comment::compose_comment方法的具体用法?PHP comment::compose_comment怎么用?PHP comment::compose_comment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类comment
的用法示例。
在下文中一共展示了comment::compose_comment方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
}
}
}
}
} else {
// Invalid action - just exit
e107::redirect();
exit;
}
if (isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == 'news') {
echo "<span class='smalltext'><b>" . $pref['trackbackString'] . "</b> " . SITEURLBASE . e_PLUGIN_ABS . "trackback/trackback.php?pid={$id}</span>";
}
$field = $field ? $field : ($id ? $id : "");
// ID of associated source item
$width = isset($width) && $width ? $width : "";
$cobj->compose_comment($table, $action, $field, $width, $subject, $rate = FALSE);
if (isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == 'news') {
if ($sql->db_Select("trackback", "*", "trackback_pid={$id}")) {
$tbArray = $sql->db_getList();
if (file_exists(THEME . "trackback_template.php")) {
require_once THEME . "trackback_template.php";
} else {
require_once e_CORE . "templates/trackback_template.php";
}
$text = "";
foreach ($tbArray as $trackback) {
extract($trackback);
$TITLE = $trackback_title;
$EXCERPT = $trackback_excerpt;
$BLOGNAME = "<a href='{$trackback_url}' rel='external'>{$trackback_blogname}</a>";
$text .= preg_replace("/\\{(.*?)\\}/e", '$\\1', $TRACKBACK);
示例2: define
$DL_TITLE = $tp->parseTemplate($DL_VIEW_PAGETITLE, TRUE, $download_shortcodes);
define("e_PAGETITLE", $DL_TITLE);
require_once HEADERF;
$DL_TEMPLATE = $DOWNLOAD_VIEW_TABLE_START . $DOWNLOAD_VIEW_TABLE . $DOWNLOAD_VIEW_TABLE_END;
$text = $tp->parseTemplate($DL_TEMPLATE, TRUE, $download_shortcodes);
if (!isset($DL_VIEW_NEXTPREV)) {
$DL_VIEW_NEXTPREV = "\n\t\t<div style='text-align:center'>\n\t\t\t<table style='" . USER_WIDTH . "'>\n\t\t\t<tr>\n\t\t\t<td style='width:40%;'>{DOWNLOAD_VIEW_PREV}</td>\n\t\t\t<td style='width:20%; text-align: center;'>{DOWNLOAD_BACK_TO_LIST}</td>\n\t\t\t<td style='width:40%; text-align: right;'>{DOWNLOAD_VIEW_NEXT}</td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t</div>\n\t\t\t";
}
// ------- Next/Prev -----------
$text .= $tp->parseTemplate($DL_VIEW_NEXTPREV, TRUE, $download_shortcodes);
$dlbreadcrumb = $dl->getBreadcrumb(array(LAN_dl_18 => e_SELF, $dlrow['download_category_name'] => e_SELF . "?list." . $dlrow['download_category_id'], $dlrow['download_name']));
$dl_title .= $tp->parseTemplate("{BREADCRUMB=dlbreadcrumb}", TRUE, $download_shortcodes);
$ns->tablerender($dl_title, $text);
unset($text);
if ($dlrow['download_comment']) {
$cobj->compose_comment("download", "comment", $id, $width, $dlrow['download_name'], $showrate = FALSE);
}
require_once FOOTERF;
exit;
}
//====================================================
// REPORT BROKEN LINKS
//====================================================
if ($action == "report" && check_class($pref['download_reportbroken'])) {
$query = "\n\t\tSELECT d.*, dc.* FROM #download AS d\n\t\tLEFT JOIN #download_category AS dc ON d.download_category = dc.download_category_id\n\t\tWHERE d.download_id = {$id}\n\t\t AND download_active > 0\n\t\tLIMIT 1";
if (!$sql->db_Select_gen($query)) {
//if (!$sql->db_Select("download", "*", "download_id = {$id} AND download_active > 0")) {
require_once HEADERF;
require_once FOOTERF;
exit;
}
示例3: 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;
}
示例4: header
// Show comment totals or 'Be the first to comment etc' when total is zero when setting is enabled
if (General::getCommentTotal(easyshop, $item_id) == 0) {
$text .= "<br />" . EASYSHOP_SHOP_38;
} else {
$text .= "<br />" . EASYSHOP_SHOP_39 . ": " . General::getCommentTotal(easyshop, $item_id);
}
}
// Render the value of $text in a table.
$title = EASYSHOP_SHOP_00;
$ns->tablerender($title, $text);
if ($enable_comments == 1) {
// Show comments and input comments form when setting is enabled
// Show comments input section
$comment_to = $item_id;
$comment_sub = "Re: " . $tp->toFORM($item_name, false);
$cobj->compose_comment("easyshop", "comment", $comment_to, $width, $comment_sub, $showrate = false);
if (isset($_POST['commentsubmit'])) {
$cobj->enter_comment($_POST['author_name'], $_POST['comment'], "easyshop", $comment_to, $pid, $_POST['subject']);
$target = 'easyshop.php?prod.' . $item_id;
header("Location: " . $target);
}
}
}
//-----------------------------------------------------------------------------+
//----------------------- Show All Categories ---------------------------------+
//-----------------------------------------------------------------------------+
if ($action == "allcat" || $action == "catpage" || $action == "blanks") {
$add_where = '';
if ($action == "blanks") {
$add_where = " AND category_main_id= '' ";
}
示例5: pageComment
function pageComment($page_comment_flag)
{
if ($page_comment_flag) {
require_once e_HANDLER . "comment_class.php";
$cobj = new comment();
if (isset($_POST['commentsubmit'])) {
$cobj->enter_comment($_POST['author_name'], $_POST['comment'], "page", $this->pageID, $pid, $_POST['subject']);
$e107cache = e107::getCache();
$e107cache->clear("comment.page." . $this->pageID);
$e107cache->clear($this->cacheString);
}
return $cobj->compose_comment("page", "comment", $this->pageID, 0, $this->title, false, true);
}
}