示例#1
0
文件: view.php 项目: phannack/GCMS
             $cache->save($sql, $datas);
         }
     }
     foreach ($datas as $i => $item) {
         // moderator และ เจ้าของ สามารถแก้ไขความคิดเห็นได้
         $canEdit = $moderator || $isMember && $login['id'] == $item['member_id'];
         $replace = array();
         $replace[] = $canEdit ? '\\1' : 'hidden';
         $replace[] = $canDelete ? '\\1' : 'hidden';
         $replace[] = gcms::HighlightSearch(gcms::showDetail($item['detail'], $canview), $search);
         $replace[] = (int) $item['member_id'];
         $replace[] = $item['displayname'];
         $replace[] = $item['status'];
         $replace[] = gcms::mktime2date($item['last_update']);
         $replace[] = date(DATE_ISO8601, $item['last_update']);
         $replace[] = gcms::showip($item['ip']);
         $replace[] = $i + 1;
         $replace[] = $item['id'];
         $comments[] = preg_replace($patt, $replace, $skin);
     }
 }
 if ($canReply) {
     // antispam
     $register_antispamchar = gcms::rndname(32);
     $_SESSION[$register_antispamchar] = gcms::rndname(4);
 }
 // url ของหน้านี้
 if ($config['module_url'] == '1') {
     $canonical = gcms::getURL($index['module'], $index['alias']);
 } else {
     $canonical = gcms::getURL($index['module'], '', 0, $index['id']);
示例#2
0
文件: print.php 项目: phannack/GCMS
     $datas = $cache->get($sql);
     if (!$datas) {
         $datas = $db->customQuery($sql);
         if (sizeof($datas) > 0) {
             $cache->save($sql, $datas);
         }
     }
     foreach ($datas as $i => $item) {
         $i++;
         $row = '<article class=r>';
         $row .= '<div class=detail>' . gcms::showDetail($item['detail'], true) . '</div>';
         $row .= '<footer>';
         $row .= '<p><strong>{LNG_COMMENT_NO}#' . $i . '</strong></p>';
         $row .= '<p><strong>{LNG_BY}</strong>: ' . $index['displayname'] . '</p>';
         $row .= '<p><strong>{LNG_POSTED}</strong>: ' . gcms::mktime2date($index['last_update']) . '</p>';
         $row .= '<p><strong>{LNG_IP}</strong>: ' . gcms::showip($item['ip']) . '</p>';
         $row .= '</footer>';
         $row .= '</article>';
         $comments[] = $row;
     }
 }
 $title = $index['topic'];
 if ($config['module_url'] == '1') {
     $url = gcms::getURL($modules['module'], $index['alias'], 0, 0, '', false);
 } else {
     $url = gcms::getURL($modules['module'], '', 0, $index['id'], '', false);
 }
 $content = '<article>';
 $content .= '<header><h1>' . $index['topic'] . '</h1></header>';
 $content .= '<div class=detail>' . gcms::showDetail($index['detail'], true, false) . '</div>';
 $content .= '<footer>';