function doReply()
 {
     if (!isset($_POST[content]) || empty($_POST[content])) {
         $this->error("内容不能为空!");
         exit;
     }
     $userId = $this->mid;
     $map = new HashMap();
     $map->put('userId', $userId);
     $map->put('cTime', time());
     $map->put('threadId', $_POST['threadId']);
     $map->put('content', $_POST['content']);
     $dao = D('ThreadPost');
     if ($result = $dao->add($map)) {
         //刷新帖子回复数据
         $dao = D('Group');
         $dao->resetThreadReply($_POST['threadId'], $userId);
         /* add_user_feed */
         $feedTitle = "回复了帖子:<a href=\"/Group/thread/id/{$_POST['threadId']}\">" . getThreadTitle($_POST['threadId']) . "</a>";
         $feedInfo = '<div class="share-comment"><p>' . getShort($_POST['content']) . '...</p></div>';
         $this->addUserFeed($userId, 'add', 'group', $result, $feedTitle, $feedInfo);
         /* /add_user_feed */
         header('location:' . __APP__ . '/Group/thread/id/' . $_POST['threadId']);
         //$this->success("回帖成功!");
     } else {
         $this->error("回帖失败!");
     }
 }
Beispiel #2
0
			<?php 
getExternLinks();
?>
		</div><br>
		<br>
		<div id="channelLinks" class=" inTheNews links showLinks external post posts cybercms">
			<?php 
getNewLinks();
getNewNews();
?>
		</div>
	</aside>
	<section id="main_section" class="post posts"><!-- meet of the website-->
		<header><div class="title"><h1><?php 
echo getShowName($_GET['threadId']) . " - ";
getThreadTitle();
?>
</h1></div></header>
		<article id="article1"> <!-- group similar information  -- articles can have headers and footers-->		
			<button onclick="show();" class="buttonStyle">Add New Post</button><br>
			<div id="newPost">
			<?php 
$currPage = $_GET['threadId'];
if (!isset($_SESSION['username'])) {
    echo "You need to log in to post";
} else {
    ?>
					<form action="posts.php?threadId=<?php 
    echo $currPage;
    ?>
" method="POST">