public function index() { $msg = new MsgModel(); $str = ""; $p = isset($_GET['p']) ? $_GET['p'] : 1; $pageSize = 12; $curPage = ($p - 1) * $pageSize; $limit = $curPage . ',' . $pageSize; $message = $msg->getMsg($limit); if (isset($_SESSION['user'])) { $mark = 1; $user = new UserModel(); $uerinfo = $user->userInfo($_SESSION['user']); $this->assign('info', $uerinfo); } else { $mark = 0; } $counts = $msg->msgCount(); if ($counts > $pageSize) { $page = new Page($counts, $p, $pageSize); $str = $page->show('themeuk.php'); } $this->assign('page', $str); $this->assign('msg', $message); $this->assign('mark', $mark); $this->display(); }
public function setReply() { $msg = new MsgModel(); $result = $msg->setReply($_POST['id'], $_POST['msg']); if ($result) { echo 1; } else { echo 0; } }
function dyn_type_foreign_post(&$data, &$ds, &$flags) { /* are there any comments? */ if($ds['m_created'] < time() - 60*30) return; $comments = MsgModel::getComments($ds['m_key']); /* define the standard actions for this post */ $metaElements = array();//array(ageToString($ds['m_created'])); /* insert entries from the cmd array in $flags (these come from plugins) */ if(is_array($flags['cmd'])) foreach($flags['cmd'] as $cmd) $metaElements[] = $cmd; /* admin users get to see an "inspect" button */ if(object('user')->isAdmin()) $metaElements[] = '<a target="_blank" href="'.actionUrl('inspect', 'test', array('id' => $ds['m_key'])).'">Inspect</a>'; $metaElements[] = 'not published yet'; $text = h2_post_excerpt($data['text'], $ds['m_key']); /* onward to the actual display of the message: */ ?><div class="post disabled" id="post_<?php echo $ds['m_key']; ?> "> <div class="postimg"><img src="img/anonymous.png" width="64"/></div> <div class="postcontent"> <div> <? if($ds['m_author'] != $ds['m_owner']) print(HubbubEntity::linkFromId($ds['m_author']).' ► '); ?> <?php echo HubbubEntity::linkFromId($ds['m_owner']); ?> <?php echo $text; ?> </div> <div class="postmeta"><?php echo implode(' · ', $metaElements); ?> </div> </div> <div class="post_actions" id="post_<?php echo $ds['m_key']; ?> _actions"></div> <div id="post_<?php echo $ds['m_key']; ?> _temp" style="display:none"></div> </div><? }