source: temp/test-xoops.ec-cube.net/html/roadmap/index.php @ 1291

Revision 1291, 2.0 KB checked in by kakinaka, 19 years ago (diff)
Line 
1<?php
2require_once("../modules/newbb/class/class.util.php");
3
4include '../mainfile.php';
5include XOOPS_ROOT_PATH.'/modules/newbb/functions.php';
6include XOOPS_ROOT_PATH.'/modules/newbb/config.php';
7
8// this page uses smarty template
9// this must be set before including main header.php
10$xoopsOption['template_main_path'] = XOOPS_ROOT_PATH . '/modules/newbb/templates/newbb_response.html';
11include XOOPS_ROOT_PATH."/header.php";
12
13$xoopsTpl->assign('lang_topic', _MD_TOPIC);
14$xoopsTpl->assign('lang_response', _MD_RESPONSE);
15$xoopsTpl->assign('lang_date', _MD_DATE);
16$xoopsTpl->assign('forum_name', 'Âбþ¾õ¶·°ìÍ÷');
17
18$sql = 'SELECT topic_id, topic_title, topic_response, topic_last_post_id, forum_id,  from_unixtime(topic_time) as topic_time, uname FROM xoops_bb_topics as tpc left join xoops_users as usr on tpc.topic_response_uid = usr.uid WHERE tpc.topic_response != 1 ORDER BY topic_response, topic_id DESC';
19if ( !$result = $xoopsDB->query($sql) ) {
20    redirect_header('index.php',2,_MD_ERROROCCURED);
21    exit();
22}
23
24// Read topic 'lastread' times from cookie, if exists
25$topic_lastread = newbb_get_topics_viewed();
26while ( $myrow = $xoopsDB->fetchArray($result) ) {
27    $fix = getFixName($myrow['forum_id']);
28
29    $sql_tmp = "SELECT p.post_id FROM ".$xoopsDB->prefix('bb_posts')." p WHERE p.pid = 0 AND p.topic_id = ".$myrow['topic_id'];
30    $result_tmp = $xoopsDB->query($sql_tmp);
31    $myrow_tmp = $xoopsDB->fetchArray($result_tmp);
32    $myrow['post_id'] = $myrow_tmp['post_id'];
33   
34    $topiclink = 'viewtopic.php?topic_id='.$myrow['topic_id'].'&amp;forum='.$myrow['forum_id'];
35   
36    $xoopsTpl->append('topics', array(
37                                'topic_id'=>$myrow['topic_id'],
38                                'forum_id'=>$myrow['forum_id'],
39                                'topic_link'=>$topiclink,
40                                'topic_fix'=>$fix,
41                                'topic_number'=>$myrow['post_id'],
42                                'topic_title'=>$myrow['topic_title'],
43                                'topic_response'=>$myrow['topic_response'],
44                                'topic_response_user'=>$myrow['uname'],
45                                'topic_time'=>$myrow['topic_time']));
46}
47
48// Âбþ¾õ¶·
49$xoopsTpl->assign('arrResponse', $arrResponse);
50
51include XOOPS_ROOT_PATH."/footer.php";
52?>
Note: See TracBrowser for help on using the repository browser.