本文整理汇总了PHP中unknown::get_comment方法的典型用法代码示例。如果您正苦于以下问题:PHP unknown::get_comment方法的具体用法?PHP unknown::get_comment怎么用?PHP unknown::get_comment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unknown
的用法示例。
在下文中一共展示了unknown::get_comment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_function_getcomments
/**
*
*
* @param unknown $params
* @param unknown $bBlog (reference)
*/
function smarty_function_getcomments($params, &$bBlog)
{
$assign = "comments";
$postid = $bBlog->show_post;
$replyto = $_REQUEST['replyto'];
extract($params);
// first, assign the hidden fields
$commentformhiddenfields = '<input type="hidden" name="do" value="submitcomment" />';
$commentformhiddenfields .= '<input type="hidden" name="comment_postid" value="' . $postid . '" />';
if (is_numeric($replyto)) {
$commentformhiddenfields .= '<a name="commentform"></a><input type="hidden" name="replytos" value="' . $replyto . '" />';
}
$bBlog->assign("commentformhiddenfields", $commentformhiddenfields);
$bBlog->assign("commentformaction", $bBlog->_get_entry_permalink($postid));
// are we posting a comment ?
if ($_POST['do'] == 'submitcomment' && is_numeric($_POST['comment_postid'])) {
// we are indeed!
if (is_numeric($_POST['replytos'])) {
$rt = $_POST['replytos'];
} else {
$rt = false;
}
$bBlog->new_comment($_POST['comment_postid'], $rt);
}
// get the comments.
/* start loop and get posts*/
$rt = false;
if (is_numeric($_GET['replyto'])) {
$rt = $_GET['replyto'];
$cs = $bBlog->get_comment($postid, $rt);
} else {
$cs = $bBlog->get_comments($postid, FALSE);
}
/* assign loop variable */
$bBlog->assign($assign, $cs);
}
示例2: editComment
/**
*
*
* @param unknown $bBlog (reference)
* @param unknown $commentid
* @param unknown $postid
* @return unknown
*/
function editComment(&$bBlog, $commentid, $postid)
{
$rval = true;
if (!(is_numeric($commentid) && is_numeric($postid))) {
$rval = false;
}
$comment = $bBlog->get_comment($postid, $commentid);
if (!$comment) {
$rval = false;
}
if ($rval === true) {
$bBlog->assign('showeditform', TRUE);
$bBlog->assign('comment', $comment[0]);
}
return $rval;
}