1 | <?php |
---|
2 | require_once("../modules/newbb/class/class.util.php"); |
---|
3 | |
---|
4 | include "../modules/newbb/header.php"; |
---|
5 | // this page uses smarty template |
---|
6 | // this must be set before including main header.php |
---|
7 | $xoopsOption['template_main_path'] = XOOPS_ROOT_PATH . '/modules/newbb/templates/newbb_response.html'; |
---|
8 | include XOOPS_ROOT_PATH."/header.php"; |
---|
9 | |
---|
10 | $xoopsTpl->assign('lang_topic', _MD_TOPIC); |
---|
11 | $xoopsTpl->assign('lang_response', _MD_RESPONSE); |
---|
12 | $xoopsTpl->assign('lang_date', _MD_DATE); |
---|
13 | $xoopsTpl->assign('forum_name', 'Âбþ¾õ¶·°ìÍ÷'); |
---|
14 | |
---|
15 | $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 ORDER BY topic_response, topic_id DESC'; |
---|
16 | if ( !$result = $xoopsDB->query($sql) ) { |
---|
17 | redirect_header('index.php',2,_MD_ERROROCCURED); |
---|
18 | exit(); |
---|
19 | } |
---|
20 | |
---|
21 | // Read topic 'lastread' times from cookie, if exists |
---|
22 | $topic_lastread = newbb_get_topics_viewed(); |
---|
23 | while ( $myrow = $xoopsDB->fetchArray($result) ) { |
---|
24 | $fix = getFixName($myrow['forum_id']); |
---|
25 | |
---|
26 | $sql_tmp = "SELECT p.post_id FROM ".$xoopsDB->prefix('bb_posts')." p WHERE p.pid = 0 AND p.topic_id = ".$myrow['topic_id']; |
---|
27 | $result_tmp = $xoopsDB->query($sql_tmp); |
---|
28 | $myrow_tmp = $xoopsDB->fetchArray($result_tmp); |
---|
29 | $myrow['post_id'] = $myrow_tmp['post_id']; |
---|
30 | |
---|
31 | $topiclink = 'viewtopic.php?topic_id='.$myrow['topic_id'].'&forum='.$myrow['forum_id']; |
---|
32 | |
---|
33 | $xoopsTpl->append('topics', array( |
---|
34 | 'topic_id'=>$myrow['topic_id'], |
---|
35 | 'forum_id'=>$myrow['forum_id'], |
---|
36 | 'topic_link'=>$topiclink, |
---|
37 | 'topic_fix'=>$fix, |
---|
38 | 'topic_number'=>$myrow['post_id'], |
---|
39 | 'topic_title'=>$myrow['topic_title'], |
---|
40 | 'topic_response'=>$myrow['topic_response'], |
---|
41 | 'topic_response_user'=>$myrow['uname'], |
---|
42 | 'topic_time'=>$myrow['topic_time'])); |
---|
43 | } |
---|
44 | |
---|
45 | // Âбþ¾õ¶· |
---|
46 | $xoopsTpl->assign('arrResponse', $arrResponse); |
---|
47 | |
---|
48 | include XOOPS_ROOT_PATH."/footer.php"; |
---|
49 | ?> |
---|