本文整理汇总了PHP中getComment函数的典型用法代码示例。如果您正苦于以下问题:PHP getComment函数的具体用法?PHP getComment怎么用?PHP getComment使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getComment函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getComment
/**
*递归获取评论列表
*/
function getComment($parent_id = 0, &$result = array())
{
$sql = "select * from tuhao_comm where parent_id={$parent_id} order by reg_time desc";
$rows = fetchAll($sql);
if (empty($rows)) {
return array();
}
foreach ($rows as $row) {
$arr =& $result[];
$row["children"] = getComment($row["id"], $thisArr);
$arr = $row;
}
return $result;
}
示例2: about_media_detail
function about_media_detail()
{
global $_MooClass, $dbTablePre, $user_arr, $name;
include "./module/{$name}/function.php";
//通过ID查找一条新闻的详细内容
$id = $_GET['id'];
$arr = explode("_", $id);
$src = "module/about/templates/default/baodao/" . $arr[0] . "/" . $arr[1] . ".jpg";
if (!file_exists($src)) {
MooMessage('没有这个页面', 'index.php?n=about&h=media', '01');
}
$id = (isset($arr[0][3]) ? $arr[0] : '20' . $arr[0]) * 100 + $arr[1];
$comment = getComment(1, $id);
$left_menu = 'media';
require MooTemplate('public/about_media_detail', 'module');
}
示例3: deletePost
function deletePost()
{
$sess_user = $_SESSION['user_id'];
if (isset($_POST['del_post'])) {
$post_id = (int) $_POST['post_id'];
dbAdd("DELETE FROM litter_posts\n\t\t\tWHERE post_id = '{$post_id}' AND user_id = '{$sess_user}'");
$comments = getComment($post_id);
if (!empty($comments)) {
foreach ($comments as $comments) {
$user_id = $comments['user_id'];
dbAdd("DELETE FROM litter_posts\n\t\t\t\t\tWHERE reply = '{$post_id}' AND user_id = '{$user_id}'");
}
}
return "Your post was successfully trashed!";
}
}
示例4: viewBlog
function viewBlog()
{
if (!isset($_GET["blogId"]) || !$_GET["blogId"]) {
homepage();
return;
}
$data = Page::getPageByTitle($_GET['action']);
//body content
echo "<div id='output'>";
if ($data) {
if ($data->page_protection == '1' && !isset($_SESSION['name'])) {
echo "Please log-in to view this page.";
} else {
if ($data->page_status == 'draft') {
echo "This page is not yet published. Contact the site admin.";
} else {
//show body and blog
echo "<p>" . $data->page_body . "</p>";
$results = array();
$results['blog'] = Blog::getBlogById($_GET["blogId"]);
$results['pageTitle'] = $results['blog']->title . " | Widget News";
$row = $results['blog'];
echo "<input type='hidden' value='" . $row->id . "' id='hBlogId'/>";
echo '<h1 class="headSection">' . $row->title . '</h1><p class="smallText">' . $row->publicationDate . '</p><p>' . $row->content . '</p>';
echo '<p style="font-weight:bold;">Share this!</p><a href="#"><img src="include/images/fb.png"/></a><a href="#"><img src="include/images/twit.png"/></a><a href="#"><img src="include/images/rss2.png"/></a><a href="#"><img src="include/images/google.png"/></a><a href="#"><img src="include/images/delicious.png"/></a><a href="#"><img src="include/images/stumbleupon.png"/></a><a href="#"><img src="include/images/digg.png"/></a><hr/>';
echo '<div id="commentSection"><p class="smallText">Leave a comment...</p><textarea id="comment" placeholder="Put your comment here" required maxlength="1000" style="height: 3em; width:90%; display: block;margin-left: auto;margin-right: auto;"></textarea><input type="button" id="submitComment" value="Post!" title="' . $_GET["blogId"] . '"/></div>';
//existing comments
getComment();
//end of comment
}
}
}
echo "</div>";
//end of body content
//sidebar
echo "<div id='sidebar'>";
if ($data) {
echo "<p>" . $data->page_sidebar . "</p>";
}
echo "</div>";
//end of sidebar
}
示例5: story_content
function story_content()
{
global $_MooClass, $dbTablePre, $userid;
global $user_arr;
$sid = MooGetGPC('sid', 'integer');
if ($sid) {
//增加点击次数
$_MooClass['MooMySQL']->query("update {$dbTablePre}story set hot=hot+1 where sid={$sid} and syscheck = 1");
} else {
$sid = 1;
}
$love_story = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}story WHERE sid = '{$sid}' and syscheck = 1");
if (!$love_story) {
MooMessage('没有对应故事', 'index.php?n=story');
exit;
}
$comment = getComment(2, $sid);
$show_pic = showPic($sid);
include MooTemplate('public/story_content', 'module');
}
示例6: addSql
/**
* 新增歷史語法
*
* @param string $returnResult pay2go 回傳資料
* @param string $add_status 新增狀態
* @param int $today 更新時間
* @param string $prefix DB 前置
*/
function addSql($returnResult, $add_status, $today, $prefix)
{
$sql = "INSERT INTO " . $prefix . "hikashop_history SET";
$sql .= " history_order_id = " . $returnResult['MerchantOrderNo'];
$sql .= ", history_created = " . $today;
$sql .= ", history_ip = 'pay2go'";
$sql .= ", history_new_status = '" . $add_status . "'";
$sql .= ", history_reason = '" . getComment($returnResult);
$sql .= $returnResult['Status'] != 'SUCCESS' ? "錯誤訊息: " . $returnResult['Message'] . "'" : "'";
$sql .= ", history_type = 'callback'";
return $sql;
}
示例7: UpdateInf
//echo $id." ".$pw." ".$Des." ".$BDes." ".$Loc." ".$Icon." ".$oid;
UpdateInf($oid, $id, $pw, $Des, $BDes, $Loc, $Icon);
});
$app->get('/Comment/id/:mid/fid/:fid/Des/:Des/Rating/:rat', function () {
$uri = $_SERVER['REQUEST_URI'];
$arr_items = split('/', $uri);
$Rat = $arr_items[count($arr_items) - 1];
$Des = $arr_items[count($arr_items) - 3];
$fid = $arr_items[count($arr_items) - 5];
$id = $arr_items[count($arr_items) - 7];
echo $id . " " . $fid . " " . $Des . " " . $Rat;
Commend($id, $fid, $Des, $Rat);
});
$app->get('/Comment/id/:mid', function ($mid) {
//echo $mid;
getComment($mid);
});
$app->get('/Login/id/:mid/pw/:pw', function () {
$uri = $_SERVER['REQUEST_URI'];
$arr_items = split('/', $uri);
$pw = $arr_items[count($arr_items) - 1];
$id = $arr_items[count($arr_items) - 3];
//echo $id." ".$pw;
Login($id, $pw);
});
$app->get('/Check/id/:mid', function () {
$uri = $_SERVER['REQUEST_URI'];
$arr_items = split('/', $uri);
$id = $arr_items[count($arr_items) - 1];
//$id = $arr_items[count($arr_items) - 3];
//echo $id;
示例8: deleteUser
function deleteUser()
{
if (isset($_POST['del_user'])) {
$sess_id = $_SESSION['user_id'];
$sess_username = $_SESSION['username'];
/* DEL POSTS */
$posts = getUserPosts($_SESSION['username']);
foreach ($posts as $post) {
$post_id = $post['post_id'];
dbAdd("DELETE FROM litter_posts\n\t\t\tWHERE post_id = '{$post_id}' AND user_id = '{$sess_id}'");
$comments = getComment($post_id);
if (!empty($comments)) {
foreach ($comments as $comments) {
$user_id = $comments['user_id'];
dbAdd("DELETE FROM litter_posts\n\t\t\t\t\t\tWHERE reply = '{$post_id}' AND user_id = '{$user_id}'");
}
}
}
/* CLEAN FOLLOWING */
dbAdd("DELETE FROM litter_following\n\t\t\tWHERE user_id = '{$sess_id}'");
/* CLEAN FOLLOWERS */
dbAdd("DELETE FROM litter_following\n\t\t\tWHERE following = '{$sess_id}'");
/* CLEAN FOLDER */
$dir = 'userIMG/' . $sess_id . '/';
// Open the directory
$dirHandle = opendir($dir);
// Loop over all of the files in the folder
while ($file = readdir($dirHandle)) {
// If $file is NOT a directory remove it
if (!is_dir($file)) {
unlink("{$dir}" . "{$file}");
// unlink() deletes the files
}
}
// Close the directory
closedir($dirHandle);
/* REMOVE FOLDER */
rmdir($dir);
/* DEL USER */
dbAdd("DELETE FROM litter_users\n\t\tWHERE user_id = '{$sess_id}' AND username = '{$sess_username}'");
session_destroy();
session_start();
$_SESSION['error'] = 'Your account has been deleted...';
header('Location: form.php');
}
}
示例9: comments_preview
function comments_preview($atts)
{
global $has_comments_preview;
if (!ps('preview')) {
return;
}
extract(lAtts(array('form' => 'comments', 'wraptag' => '', 'class' => __FUNCTION__), $atts));
assert_article();
$preview = psa(array('name', 'email', 'web', 'message', 'parentid', 'remember'));
$preview['time'] = time();
$preview['discussid'] = 0;
$preview['name'] = strip_tags($preview['name']);
$preview['email'] = clean_url($preview['email']);
if ($preview['message'] == '') {
$in = getComment();
$preview['message'] = $in['message'];
}
$preview['message'] = markup_comment(substr(trim($preview['message']), 0, 65535));
// it is called 'message', not 'novel'
$preview['web'] = clean_url($preview['web']);
$GLOBALS['thiscomment'] = $preview;
$comments = parse_form($form) . n;
unset($GLOBALS['thiscomment']);
$out = doTag($comments, $wraptag, $class);
# set a flag, to tell the comments_form tag that it doesn't have to show a preview
$has_comments_preview = true;
return $out;
}
示例10: sampleDetail
//.........这里部分代码省略.........
<div class="col-md-1">:</div>
<div class="col-md-3">
<label class="field prepend-icon">
<input type="text" name="txt_assign" id="txt_assign" class="gui-input">
<label for="txt_assign" class="field-icon">
<i class="fa fa-calculator"></i>
</label>
</label>
</div>
<div class="col-md-5">
<button class="btn btn-alert" onclick="balance('<?php
echo $row['kp_id'];
?>
')"><i class="fa fa-plus"></i> Balance</button>
<button class="btn btn-alert" onclick="assignSample('<?php
echo $sampleID;
?>
')"><i class="fa fa-pencil"></i> Assign Sample</button>
</div>
<div class="col-md-12"> </div>
<div class="col-md-12" id="sampleAssign"><?php
showTask($sampleID);
?>
</div>
<div class="col-md-12"> </div>
<?php
} elseif ($id == 21 || $id == 23 || $id == 25 || $id == 27) {
assignedTask($id, $sampleID, $_SESSION['ru_kod']);
}
if ($id != 27) {
?>
<div class="col-md-12"> </div>
<div class="col-md-3"><?php
echo getComment($id);
?>
</div>
<div class="col-md-1">:</div>
<div class="col-md-6">
<label class="field prepend-icon">
<textarea class="gui-textarea" id="txt_comment" placeholder="Enter Comment..."><?php
echo getComments($id, $sampleID, $_SESSION['us_id']);
?>
</textarea>
<label for="comment" class="field-icon">
<i class="fa fa-comments"></i>
</label>
<span class="input-footer"><?php
echo getComment($id);
?>
</span>
</label>
</div>
<div class="col-md-12"><font color="red">*</font> required field</div>
<?php
}
?>
</div>
<div class="row">
<div class="col-md-12"> </div>
<div class="col-md-12">
<button class="btn btn-alert" onclick="content('<?php
echo $code;
?>
')"><i class="fa fa-arrow-left"></i> Back</button>
<button class="btn btn-alert" onclick="showProduct('<?php
echo $code;
示例11: cleanit
$uname = cleanit($_REQUEST['uname']);
if ($uname != "") {
STemplate::assign('uname', $uname);
$queryp = "select USERID, username, country, description, color1, color2, website from members where username='" . mysql_real_escape_string($uname) . "' AND status='1'";
$resultsp = $conn->execute($queryp);
$p = $resultsp->getrows();
STemplate::assign('p', $p[0]);
$USERID = intval($p[0]['USERID']);
$qry = "SELECT A.*, B.story, B.nsfw, B.pic\r\n\t\t\t\tFROM posts_comments A, posts B\r\n\t\t\t\t\tWHERE A.USERID = " . $USERID . " AND A.PID = B.PID\r\n\t\t\t\t\t\tGROUP BY A.CID\r\n\t\t\t\t\t\t\tORDER BY A.CID desc\r\n\t\t\t\t\t\t\t\tLIMIT {$pagingstart}, {$config['items_per_page']}";
$qry_result = $conn->execute($qry);
$data = $qry_result->getrows();
if (!$data) {
$t = 'empty.tpl';
//STemplate::assign('tc',0);
} else {
$data = getComment($data);
$data = getHash($data);
STemplate::assign('data', $data);
//STemplate::assign('tc',count($data));
}
if ($USERID > 0) {
STemplate::assign('pagetitle', $uname . " " . $lang['194']);
$eurl = base64_encode("/user/" . $uname . "/messages");
STemplate::assign('eurl', $eurl);
$query = "select count(*) as total from posts where USERID='" . mysql_real_escape_string($USERID) . "' AND active='1' limit 1";
$executequery = $conn->execute($query);
$tl = $executequery->fields['total'];
STemplate::assign('tl', $tl);
$query = "select count(*) as total from posts_favorited where USERID='" . mysql_real_escape_string($USERID) . "' limit 1";
$executequery = $conn->execute($query);
$tf = $executequery->fields['total'];
示例12: atLink
print '<p class="post_post">' . atLink($post['post']) . '</p>';
if ($post['post_pic']) {
print '<img src="userIMG/' . $post['user_id'] . '/' . $post['post_pic'] . '" class="post_img">';
}
print '<div class="time_stamp"><p>' . printTime($post['time_stamp']) . '</p></div>';
/*REPLY_FORM*/
print '<div class="reply">
<form method="POST" action="#' . $post['post_id'] . '">
<input type="hidden" name="post_id" value="' . $post['post_id'] . '">
<input type="text" name="comment" value="' . $post['username'] . '">
<input type="submit" name="postComment" value="Reply" class="button">
</form>
</div>';
/*END REPLY_FORM*/
print '<br></div>';
$comments = getComment($post['post_id']);
if (!empty($comments)) {
print '<div class="postit"><ul>';
foreach ($comments as $comments) {
print '<li>';
/*DELETE_BUTTON*/
if ($sess['user_id'] == $comments['user_id']) {
print '<div class="del_post">';
print '<form method="POST" action="#' . $post['post_id'] . '">
<input type="hidden" name="post_id" value="' . $comments['post_id'] . '">
<button type="submit" name="del_comment"><img src="img/trashicon.png"></button>
</form>';
print '</div>';
}
/*END DELETE_BUTTON*/
/*COMMENT*/
示例13: comment_evaluation
function comment_evaluation()
{
global $prefs;
extract(getComment());
$this->status = array(SPAM => array(), MODERATE => array(), VISIBLE => array(), RELOAD => array());
$this->status_text = array(SPAM => gTxt('spam'), MODERATE => gTxt('unmoderated'), VISIBLE => gTxt('visible'), RELOAD => gTxt('reload'));
$this->message = $this->status;
$this->txpspamtrace[] = "Comment on {$parentid} by {$name} (" . safe_strftime($prefs['archive_dateformat'], time()) . ")";
if ($prefs['comments_moderate']) {
$this->status[MODERATE][] = 0.5;
} else {
$this->status[VISIBLE][] = 0.5;
}
}
示例14: handleCreateTable
function handleCreateTable(&$schema, &$input, &$line)
{
if (preg_match('/^CREATE\\ TABLE\\ ([a-z]*\\.)?([a-z_]+)$/', $line, $match) == 1) {
$tabName = $match[2];
// eat (
getNextLine($input);
$lastcolumn = false;
while ($line = getNextLine($input)) {
$comment = false;
while ($commentLine = getComment($line)) {
$comment = $comment . "\n" . $commentLine;
$line = getNextLine($input);
}
$column = getColumnName($line);
if ($column) {
$lastcolumn = $column;
}
if (!isset($schema[$tabName]['fields'][$lastcolumn])) {
$schema[$tabName]['fields'][$lastcolumn] = array('description' => "No description for column {$lastcolumn} available, please fix");
}
if ($comment) {
$schema[$tabName]['fields'][$lastcolumn]['description'] = $comment;
}
if (getColumnType($schema[$tabName], $lastcolumn, $line)) {
continue;
}
if (preg_match('/^\\) WITHOUT OIDS;/', $line)) {
continue;
}
if ($uniqueconstraints = getUniqueConstraints($line)) {
$keyname = $uniqueconstraints['name'];
$schema[$tabName]['unique keys'][$keyname] = $uniqueconstraints['keys'];
continue;
}
if ($primaryKey = getPrimaryKey($line)) {
$schema[$tabName]['primary key'] = $primaryKey;
continue;
}
fwrite(STDERR, "Unknown statements within CREATE TABLE: {$line}\n");
}
return true;
}
return false;
}
示例15: checkLogin
<?php
include "functions.php";
checkLogin();
$id = (int) $_GET['id'];
include_once 'modele/news/getComments.php';
$commentArray = getComment($id);
foreach ($commentArray as $com) {
$pseudo = $com['pseudo'];
$id_user = $com['ID_membre'];
$id_news = $com['ID_news'];
}
if (!isset($pseudo)) {
$js = false;
$redirect[0] = 'javascript:history.go(-1)';
$redirect[1] = '1';
$page = 'accueil';
$titreErreur = 'news - erreur';
$erreur = 'Ce commentaire n\'existe pas !';
include_once 'vue/erreur.php';
die;
}
$admin = areYouAdmin();
if (!$admin and (!$_SESSION['login'] or $id_user != $_SESSION['ID'])) {
$js = false;
$redirect[0] = 'javascript:history.go(-1)';
$redirect[1] = '1';
$page = 'accueil';
$titreErreur = 'news - erreur';
$erreur = 'Vous n\'êtes pas autorisé à supprimer un commentaire qui ne vous appartient pas!';
include_once 'vue/erreur.php';