2: 2004-10-28 (木) 13:51:21 nao-pon  |
現: 2004-10-28 (木) 13:51:21 nao-pon  |
| // Project: The XOOPS Project // | | // Project: The XOOPS Project // |
| // ------------------------------------------------------------------------- // | | // ------------------------------------------------------------------------- // |
| + | |
| + if(!empty($_SERVER["PATH_INFO"]) && preg_match("/^\/(.*)\/$/",$_SERVER["PATH_INFO"],$match)) | | + if(!empty($_SERVER["PATH_INFO"]) && preg_match("/^\/(.*)\/$/",$_SERVER["PATH_INFO"],$match)) |
| + { | | + { |
| // Project: The XOOPS Project // | | // Project: The XOOPS Project // |
| // ------------------------------------------------------------------------- // | | // ------------------------------------------------------------------------- // |
| + | |
| include "header.php"; | | include "header.php"; |
| + | |
| $forum = intval($HTTP_GET_VARS['forum']); | | $forum = intval($HTTP_GET_VARS['forum']); |
| if ( $forum < 1 ) { | | if ( $forum < 1 ) { |
| // Project: The XOOPS Project // | | // Project: The XOOPS Project // |
| // ------------------------------------------------------------------------- // | | // ------------------------------------------------------------------------- // |
| + | |
| + if(!empty($_SERVER["PATH_INFO"]) && preg_match("/^\/(.*)\/$/",$_SERVER["PATH_INFO"],$match)) | | + if(!empty($_SERVER["PATH_INFO"]) && preg_match("/^\/(.*)\/$/",$_SERVER["PATH_INFO"],$match)) |
| + { | | + { |
| + | | + |
| include "header.php"; | | include "header.php"; |
| + | |
| $forum = intval($HTTP_GET_VARS['forum']); | | $forum = intval($HTTP_GET_VARS['forum']); |
| if ( $forum < 1 ) { | | if ( $forum < 1 ) { |
| ! $xoopsTpl->assign('forum_name', $myts->makeTboxData4Show($forumdata['forum_name'])); | | ! $xoopsTpl->assign('forum_name', $myts->makeTboxData4Show($forumdata['forum_name'])); |
| $xoopsTpl->assign('lang_moderatedby', _MD_MODERATEDBY); | | $xoopsTpl->assign('lang_moderatedby', _MD_MODERATEDBY); |
| + | |
| $forum_moderators = ""; | | $forum_moderators = ""; |
| --- 122,132 ---- | | --- 122,132 ---- |
| ! //$xoopsTpl->assign('forum_name', $myts->makeTboxData4Show($forumdata['forum_name'])); | | ! //$xoopsTpl->assign('forum_name', $myts->makeTboxData4Show($forumdata['forum_name'])); |
| $xoopsTpl->assign('lang_moderatedby', _MD_MODERATEDBY); | | $xoopsTpl->assign('lang_moderatedby', _MD_MODERATEDBY); |
| + | |
| $forum_moderators = ""; | | $forum_moderators = ""; |
| *************** | | *************** |
| // assign to template | | // assign to template |
| $xoopsTpl->assign('forum_selection_order', $forum_selection_order); | | $xoopsTpl->assign('forum_selection_order', $forum_selection_order); |
| + | |
| ! $sortsince = !empty($HTTP_GET_VARS['sortsince']) ? intval($HTTP_GET_VARS['sortsince']) : 100; | | ! $sortsince = !empty($HTTP_GET_VARS['sortsince']) ? intval($HTTP_GET_VARS['sortsince']) : 100; |
| $sel_since_array = array(1, 2, 5, 10, 20, 30, 40, 60, 75, 100); | | $sel_since_array = array(1, 2, 5, 10, 20, 30, 40, 60, 75, 100); |
| // assign to template | | // assign to template |
| $xoopsTpl->assign('forum_selection_order', $forum_selection_order); | | $xoopsTpl->assign('forum_selection_order', $forum_selection_order); |
| + | |
| ! //nao-pon | | ! //nao-pon |
| ! $sortsince = !empty($HTTP_GET_VARS['sortsince']) ? intval($HTTP_GET_VARS['sortsince']) : 1000; | | ! $sortsince = !empty($HTTP_GET_VARS['sortsince']) ? intval($HTTP_GET_VARS['sortsince']) : 1000; |
| $xoopsTpl->assign('h_date_link', "viewforum.php?forum=$forum&sortname=p.post_time&sortsince=$sortsince&sortorder=". (($sortname == "p.post_time" && $sortorder == "DESC") ? "ASC" : "DESC")); | | $xoopsTpl->assign('h_date_link', "viewforum.php?forum=$forum&sortname=p.post_time&sortsince=$sortsince&sortorder=". (($sortname == "p.post_time" && $sortorder == "DESC") ? "ASC" : "DESC")); |
| $xoopsTpl->assign('lang_date', _MD_DATE); | | $xoopsTpl->assign('lang_date', _MD_DATE); |
| + | |
| ! $startdate = time() - (86400* $sortsince); | | ! $startdate = time() - (86400* $sortsince); |
| $start = !empty($HTTP_GET_VARS['start']) ? intval($HTTP_GET_VARS['start']) : 0; | | $start = !empty($HTTP_GET_VARS['start']) ? intval($HTTP_GET_VARS['start']) : 0; |
| + | |
| $sql = 'SELECT t.*, u.uname, u2.uname as last_poster, p.post_time as last_post_time, p.icon FROM '.$xoopsDB->prefix("bb_topics").' t LEFT JOIN '.$xoopsDB->prefix('users').' u ON u.uid = t.topic_poster LEFT JOIN '.$xoopsDB->prefix('bb_posts').' p ON p.post_id = t.topic_last_post_id LEFT JOIN '.$xoopsDB->prefix('users').' u2 ON u2.uid = p.uid WHERE t.forum_id = '.$forum.' AND (p.post_time > '.$startdate.' OR t.topic_sticky=1) ORDER BY topic_sticky DESC, '.$sortname.' '.$sortorder; | | $sql = 'SELECT t.*, u.uname, u2.uname as last_poster, p.post_time as last_post_time, p.icon FROM '.$xoopsDB->prefix("bb_topics").' t LEFT JOIN '.$xoopsDB->prefix('users').' u ON u.uid = t.topic_poster LEFT JOIN '.$xoopsDB->prefix('bb_posts').' p ON p.post_id = t.topic_last_post_id LEFT JOIN '.$xoopsDB->prefix('users').' u2 ON u2.uid = p.uid WHERE t.forum_id = '.$forum.' AND (p.post_time > '.$startdate.' OR t.topic_sticky=1) ORDER BY topic_sticky DESC, '.$sortname.' '.$sortorder; |
| if ( !$result = $xoopsDB->query($sql,$forumdata['topics_per_page'],$start) ) { | | if ( !$result = $xoopsDB->query($sql,$forumdata['topics_per_page'],$start) ) { |
| exit(); | | exit(); |
| } | | } |
| + | |
| --- 202,216 ---- | | --- 202,216 ---- |
| $xoopsTpl->assign('h_date_link', "viewforum.php?forum=$forum&sortname=p.post_time&sortsince=$sortsince&sortorder=". (($sortname == "p.post_time" && $sortorder == "DESC") ? "ASC" : "DESC")); | | $xoopsTpl->assign('h_date_link', "viewforum.php?forum=$forum&sortname=p.post_time&sortsince=$sortsince&sortorder=". (($sortname == "p.post_time" && $sortorder == "DESC") ? "ASC" : "DESC")); |
| $xoopsTpl->assign('lang_date', _MD_DATE); | | $xoopsTpl->assign('lang_date', _MD_DATE); |
| + | |
| ! //nao-pon | | ! //nao-pon |
| ! $startdate = ($sortsince == 1000)? 0 : time() - (86400* $sortsince); | | ! $startdate = ($sortsince == 1000)? 0 : time() - (86400* $sortsince); |
| ! //$startdate = time() - (86400* $sortsince); | | ! //$startdate = time() - (86400* $sortsince); |
| $start = !empty($HTTP_GET_VARS['start']) ? intval($HTTP_GET_VARS['start']) : 0; | | $start = !empty($HTTP_GET_VARS['start']) ? intval($HTTP_GET_VARS['start']) : 0; |
| + | |
| $sql = 'SELECT t.*, u.uname, u2.uname as last_poster, p.post_time as last_post_time, p.icon FROM '.$xoopsDB->prefix("bb_topics").' t LEFT JOIN '.$xoopsDB->prefix('users').' u ON u.uid = t.topic_poster LEFT JOIN '.$xoopsDB->prefix('bb_posts').' p ON p.post_id = t.topic_last_post_id LEFT JOIN '.$xoopsDB->prefix('users').' u2 ON u2.uid = p.uid WHERE t.forum_id = '.$forum.' AND (p.post_time > '.$startdate.' OR t.topic_sticky=1) ORDER BY topic_sticky DESC, '.$sortname.' '.$sortorder; | | $sql = 'SELECT t.*, u.uname, u2.uname as last_poster, p.post_time as last_post_time, p.icon FROM '.$xoopsDB->prefix("bb_topics").' t LEFT JOIN '.$xoopsDB->prefix('users').' u ON u.uid = t.topic_poster LEFT JOIN '.$xoopsDB->prefix('bb_posts').' p ON p.post_id = t.topic_last_post_id LEFT JOIN '.$xoopsDB->prefix('users').' u2 ON u2.uid = p.uid WHERE t.forum_id = '.$forum.' AND (p.post_time > '.$startdate.' OR t.topic_sticky=1) ORDER BY topic_sticky DESC, '.$sortname.' '.$sortorder; |
| if ( !$result = $xoopsDB->query($sql,$forumdata['topics_per_page'],$start) ) { | | if ( !$result = $xoopsDB->query($sql,$forumdata['topics_per_page'],$start) ) { |
| exit(); | | exit(); |
| } | | } |
| + | |
| *************** | | *************** |
| *** 219,225 **** | | *** 219,225 **** |
| // Project: The XOOPS Project // | | // Project: The XOOPS Project // |
| // ------------------------------------------------------------------------- // | | // ------------------------------------------------------------------------- // |
| + | |
| include 'header.php'; | | include 'header.php'; |
| $forum = isset($HTTP_GET_VARS['forum']) ? intval($HTTP_GET_VARS['forum']) : 0; | | $forum = isset($HTTP_GET_VARS['forum']) ? intval($HTTP_GET_VARS['forum']) : 0; |
| // Project: The XOOPS Project // | | // Project: The XOOPS Project // |
| // ------------------------------------------------------------------------- // | | // ------------------------------------------------------------------------- // |
| + | |
| + if(!empty($_SERVER["PATH_INFO"]) && preg_match("/^\/(.*)\/$/",$_SERVER["PATH_INFO"],$match)) | | + if(!empty($_SERVER["PATH_INFO"]) && preg_match("/^\/(.*)\/$/",$_SERVER["PATH_INFO"],$match)) |
| + { | | + { |
| *** 82,93 **** | | *** 82,93 **** |
| } | | } |
| + | |
| if ( !$result = $xoopsDB->query($sql) ) { | | if ( !$result = $xoopsDB->query($sql) ) { |
| ! redirect_header('viewforum.php?forum='.$forum,2,_MD_ERROROCCURED); | | ! redirect_header('viewforum.php?forum='.$forum,2,_MD_ERROROCCURED); |
| exit(); | | exit(); |
| } | | } |
| + | |
| if ( !$forumdata = $xoopsDB->fetchArray($result) ) { | | if ( !$forumdata = $xoopsDB->fetchArray($result) ) { |
| ! redirect_header('viewforum.php?forum='.$forum,2,_MD_FORUMNOEXIST); | | ! redirect_header('viewforum.php?forum='.$forum,2,_MD_FORUMNOEXIST); |
| --- 92,103 ---- | | --- 92,103 ---- |
| } | | } |
| + | |
| if ( !$result = $xoopsDB->query($sql) ) { | | if ( !$result = $xoopsDB->query($sql) ) { |
| ! redirect_header($bbUrl['root'].'viewforum/forum/'.$forum,2,_MD_ERROROCCURED); | | ! redirect_header($bbUrl['root'].'viewforum/forum/'.$forum,2,_MD_ERROROCCURED); |
| exit(); | | exit(); |
| } | | } |
| + | |
| if ( !$forumdata = $xoopsDB->fetchArray($result) ) { | | if ( !$forumdata = $xoopsDB->fetchArray($result) ) { |
| ! redirect_header($bbUrl['root'].'viewforum/forum/'.$forum.'/',2,_MD_FORUMNOEXIST); | | ! redirect_header($bbUrl['root'].'viewforum/forum/'.$forum.'/',2,_MD_FORUMNOEXIST); |
| $forumdata['topic_title'] = $myts->makeTboxData4Show($forumdata['topic_title']);$forumdata['forum_name'] = $myts->makeTboxData4Show($forumdata['forum_name']); | | $forumdata['topic_title'] = $myts->makeTboxData4Show($forumdata['topic_title']);$forumdata['forum_name'] = $myts->makeTboxData4Show($forumdata['forum_name']); |
| ! $xoopsTpl->assign(array('topic_title' => '<a href="'.$bbUrl['root'].'viewtopic.php?viewmode='.$viewmode.'&topic_id='.$topic_id.'&forum='.$forum.'">'.$forumdata['topic_title'].'</a>', 'forum_name' => $forumdata['forum_name'], 'topic_time' => $forumdata['topic_time'], 'lang_nexttopic' => _MD_NEXTTOPIC, 'lang_prevtopic' => _MD_PREVTOPIC)); | | ! $xoopsTpl->assign(array('topic_title' => '<a href="'.$bbUrl['root'].'viewtopic.php?viewmode='.$viewmode.'&topic_id='.$topic_id.'&forum='.$forum.'">'.$forumdata['topic_title'].'</a>', 'forum_name' => $forumdata['forum_name'], 'topic_time' => $forumdata['topic_time'], 'lang_nexttopic' => _MD_NEXTTOPIC, 'lang_prevtopic' => _MD_PREVTOPIC)); |
| + | |
| // add image links to admin page if the user viewing this page is a forum admin | | // add image links to admin page if the user viewing this page is a forum admin |
| if ( $xoopsUser ) { | | if ( $xoopsUser ) { |
| ! //nao-pon | | ! //nao-pon |
| ! $xoopsTpl->assign("xoops_pagetitle",$forumdata['topic_title']."-".$forumdata['forum_name']."-"._MD_FORUM); | | ! $xoopsTpl->assign("xoops_pagetitle",$forumdata['topic_title']."-".$forumdata['forum_name']."-"._MD_FORUM); |
| + | |
| // add image links to admin page if the user viewing this page is a forum admin | | // add image links to admin page if the user viewing this page is a forum admin |
| if ( $xoopsUser ) { | | if ( $xoopsUser ) { |
| *** 242,248 **** | | *** 242,248 **** |
| } | | } |
| + | |
| if ( $can_post == 1 ) { | | if ( $can_post == 1 ) { |
| ! $xoopsTpl->assign(array('viewer_can_post' => true, 'forum_post_or_register' => "<a href=\"newtopic.php?forum=".$forum."\"><img src=\"".$bbImage['post']."\" alt=\""._MD_POSTNEW."\" /></a>")); | | ! $xoopsTpl->assign(array('viewer_can_post' => true, 'forum_post_or_register' => "<a href=\"newtopic.php?forum=".$forum."\"><img src=\"".$bbImage['post']."\" alt=\""._MD_POSTNEW."\" /></a>")); |
| --- 256,262 ---- | | --- 256,262 ---- |
| } | | } |
| + | |
| if ( $can_post == 1 ) { | | if ( $can_post == 1 ) { |
| ! $xoopsTpl->assign(array('viewer_can_post' => true, 'forum_post_or_register' => "<a href=\"{$bbUrl['root']}newtopic.php?forum=".$forum."\"><img src=\"".$bbImage['post']."\" alt=\""._MD_POSTNEW."\" /></a>")); | | ! $xoopsTpl->assign(array('viewer_can_post' => true, 'forum_post_or_register' => "<a href=\"{$bbUrl['root']}newtopic.php?forum=".$forum."\"><img src=\"".$bbImage['post']."\" alt=\""._MD_POSTNEW."\" /></a>")); |
| | | |
| #comment(btn:つっこみ) | | #comment(btn:つっこみ) |
- | #ping(http://www.blogpeople.net/servlet/weblogUpdates) | |