function &show_online() { global $xoopsModuleConfig, $xforumImage; if ($this->forumtopic) { $criteria = new Criteria('online_topic', $this->forumtopic); } elseif ($this->forum) { $criteria = new Criteria('online_forum', $this->forum); } else { $criteria = null; } $users =& $this->getAll($criteria); $num_total = count($users); $num_user = 0; $users_id = array(); $users_online = array(); for ($i = 0; $i < $num_total; $i++) { if(empty($users[$i]['online_uid'])) continue; $users_id[] = $users[$i]['online_uid']; $users_online[$users[$i]['online_uid']] = array( "link" => XOOPS_URL . "/userinfo.php?uid=" . $users[$i]['online_uid'], "uname" => $users[$i]['online_uname'], ); $num_user ++; } $num_anonymous = $num_total - $num_user; $online = array(); $online['image'] = forum_displayImage($xforumImage['whosonline']); $online['num_total'] = $num_total; $online['num_user'] = $num_user; $online['num_anonymous'] = $num_anonymous; $administrator_list = forum_isModuleAdministrators($users_id, $GLOBALS["xoopsModule"]->getVar("mid")); foreach ($users_online as $uid=>$user) { if(!empty($administrator_list[$uid])){ $user['level']= 2; } elseif(forum_isModerator($this->forum_object, $uid)){ $user['level']= 1; } else{ $user['level']= 0; } $online["users"][] = $user; } return $online; }
function &display(&$xforums_obj) { global $xoopsModule, $xoopsConfig, $xoopsModuleConfig, $xforumImage, $myts; include_once XOOPS_ROOT_PATH.'/modules/xforum/include/functions.php'; $posts = array(); $posts_obj = array(); foreach (array_keys($xforums_obj) as $id) { $posts[] = $xforums_obj[$id]->getVar("forum_last_post_id"); } if(!empty($posts)){ $post_handler =& xoops_getmodulehandler('post', 'xforum'); $posts_obj =& $post_handler->getAll(new Criteria("post_id", "(".implode(", ", $posts).")", "IN"), array("uid", "topic_id", "post_time", "subject", "poster_name", "icon")); } $users = array(); $reads = array(); foreach (array_keys($xforums_obj) as $id) { $forum_obj =& $xforums_obj[$id]; if(!$forum_obj->getVar("forum_last_post_id")) continue; if(!$post_obj =& $posts_obj[$forum_obj->getVar("forum_last_post_id")]) { $forum_obj->assignVar("forum_last_post_id", 0); continue; } $users[] = $post_obj->getVar("uid"); if($moderators = $forum_obj->getModerators()){ $users = array_merge($users, $moderators); } // reads if(!empty($xoopsModuleConfig["read_mode"])){ $reads[$id] = ($xoopsModuleConfig["read_mode"] == 1)?$post_obj->getVar('post_time'):$post_obj->getVar('post_id'); } } $forum_isread = forum_isRead("forum", $reads); $users_linked = forum_getUnameFromIds(array_unique($users), !empty($xoopsModuleConfig['show_realname']), true); $xforums_array = array(); foreach (array_keys($xforums_obj) as $id) { $forum_obj =& $xforums_obj[$id]; if(!$this->getPermission($forum_obj, "access", false)) continue; $_forum_data = array(); $_forum_data["forum_order"] = $forum_obj->getVar('forum_order'); $_forum_data["forum_id"] = $id; $_forum_data["forum_cid"] = $forum_obj->getVar('cat_id'); $_forum_data["forum_name"] = $forum_obj->getVar('forum_name'); $_forum_data["forum_desc"] = $forum_obj->getVar('forum_desc'); $_forum_data["forum_posts"] = $forum_obj->getVar("forum_posts"); $_forum_data["forum_topics"] = $forum_obj->getVar("forum_topics"); $_forum_data["forum_type"] = $forum_obj->getVar('forum_type'); $_forum_data["forum_permission"]= $this->getPermission($forum_obj, "view"); $forum_moderators = array(); $moderators = $forum_obj->getModerators(); foreach($moderators as $moderator){ $forum_moderators[] = @$users_linked[$moderator]; } $_forum_data["forum_moderators"] = implode(", ", array_filter($forum_moderators)); if($forum_obj->getVar("forum_last_post_id")): $post_obj =& $posts_obj[$forum_obj->getVar("forum_last_post_id")]; if(!empty($users_linked[$post_obj->getVar("uid")])){ $_forum_data["forum_lastpost_user"] = $users_linked[$post_obj->getVar("uid")]; }elseif($post_obj->getVar("poster_name")){ $_forum_data["forum_lastpost_user"] = $post_obj->getVar("poster_name"); }else{ $_forum_data["forum_lastpost_user"] = $myts->htmlSpecialChars($GLOBALS["xoopsConfig"]["anonymous"]); } $_forum_data['forum_lastpost_time'] = forum_formatTimestamp($post_obj->getVar('post_time')); $_forum_data['forum_lastpost_icon'] = '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar("dirname") . '/viewtopic.php?post_id=' . $post_obj->getVar('post_id') . '&topic_id=' . $post_obj->getVar('topic_id') . '#forumpost' . $post_obj->getVar('post_id') . '">'. '<img src="' . XOOPS_URL . '/images/subject/' . ($post_obj->getVar('icon')?$post_obj->getVar('icon'): 'icon1.gif') . '" alt="" />'. '</a>'; endif; if (empty($forum_isread[$id])) { $forum_folder = ($forum_obj->getVar('forum_type') == 1) ? $xforumImage['locked_forum_newposts'] : $xforumImage['newposts_forum']; } else { $forum_folder = ($forum_obj->getVar('forum_type') == 1) ? $xforumImage['locked_forum'] : $xforumImage['folder_forum']; } $_forum_data['forum_folder'] = forum_displayImage($forum_folder); $xforums_array[$forum_obj->getVar('parent_forum')][] = $_forum_data; } return $xforums_array; }
$forum_form->addElement(new XoopsFormHidden('topic_id', $topic_id)); $forum_form->addElement(new XoopsFormHidden('forum', $forum_id)); $forum_form->addElement(new XoopsFormHidden('viewmode', $viewmode)); $forum_form->addElement(new XoopsFormHidden('order', $order)); $forum_form->addElement(new XoopsFormHidden('start', $start)); // backward compatible if(!class_exists("XoopsSecurity")){ $post_valid = 1; $_SESSION['submit_token'] = $post_valid; $forum_form->addElement(new XoopsFormHidden('post_valid', $post_valid)); } $forum_form->addElement(new XoopsFormHidden('notify', -1)); $forum_form->addElement(new XoopsFormHidden('contents_submit', 1)); $submit_button = new XoopsFormButton('', 'quick_submit', _SUBMIT, "submit"); $submit_button->setExtra('onclick="if(document.forms.quick_reply.message.value == \'RE\' || document.forms.quick_reply.message.value == \'\'){ alert(\''._MD_QUICKREPLY_EMPTY.'\'); return false;}else{ return true;}"'); $button_tray = new XoopsFormElementTray(''); $button_tray->addElement($submit_button); $forum_form->addElement($button_tray); $toggles = forum_getcookie('G', true); $display = (in_array('qr', $toggles)) ? 'none;' : 'block;'; $xoopsTpl->assign('quickreply', array( 'show' => 1, 'display'=>$display, 'icon'=>forum_displayImage($xforumImage['t_qr']), 'form' => $forum_form->render())); unset($forum_form); }else{ $xoopsTpl->assign('quickreply', array( 'show' => 0)); } include XOOPS_ROOT_PATH.'/footer.php'; ?>
} $xoopsTpl->assign('forum_topictype', $current_type); $all_topics = $forum_handler->getTopicCount($forum_obj,$startdate,$type); if ( $all_topics > $xoopsModuleConfig['topics_per_page']) { include XOOPS_ROOT_PATH.'/class/pagenav.php'; $nav = new XoopsPageNav($all_topics, $xoopsModuleConfig['topics_per_page'], $start, "start", 'forum='.$forum_obj->getVar('forum_id').'&sortname='.$sortname.'&sortorder='.$sortorder.'&since='.$since."&type=$type&mode=".$mode); $xoopsTpl->assign('forum_pagenav', $nav->renderNav(4)); } else { $xoopsTpl->assign('forum_pagenav', ''); } if(!empty($xoopsModuleConfig['show_jump'])){ $xoopsTpl->assign('forum_jumpbox', forum_make_jumpbox($forum_obj->getVar('forum_id'))); } $xoopsTpl->assign('down',forum_displayImage($xforumImage['doubledown'])); $xoopsTpl->assign('menumode',$menumode); $xoopsTpl->assign('menumode_other',$menumode_other); if($xoopsModuleConfig['show_permissiontable']){ $permission_table = & $getpermission->permission_table($permission_set,$forum_obj->getVar('forum_id'), false, $isadmin); $xoopsTpl->assign_by_ref('permission_table', $permission_table); unset($permission_table); } if ($xoopsModuleConfig['rss_enable'] == 1) { $xoopsTpl->assign("rss_button","<div align='right'><a href='".XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/rss.php?f=".$forum_obj->getVar('forum_id')."' title='RSS feed' target='_blank'>".forum_displayImage($xforumImage['rss'], 'RSS feed')."</a></div>"); } include XOOPS_ROOT_PATH."/footer.php"; ?>
$lang_title = _MD_VIEWALLPOSTS; break; } if($uid>0){ $lang_title .= ' ('.XoopsUser::getUnameFromId($uid).')'; } $xoopsTpl->assign('lang_title',$lang_title); $xoopsTpl->assign('p_up',forum_displayImage($xforumImage['p_up'],_MD_TOP)); $xoopsTpl->assign('groupbar_enable', $xoopsModuleConfig['groupbar_enabled']); $xoopsTpl->assign('anonymous_prefix', $xoopsModuleConfig['anonymous_prefix']); $xoopsTpl->assign('down',forum_displayImage($xforumImage['doubledown'])); $xoopsTpl->assign('down2',forum_displayImage($xforumImage['down'])); $xoopsTpl->assign('up',forum_displayImage($xforumImage['up'])); $xoopsTpl->assign('printer',forum_displayImage($xforumImage['printer'])); $xoopsTpl->assign('personal',forum_displayImage($xforumImage['personal'])); $xoopsTpl->assign('post_content',forum_displayImage($xforumImage['post_content'])); $all_link = "viewall.php?forum=".$forum_id."&start=$start"; $post_link = "viewpost.php?forum=".$forum_id; $newpost_link = "viewpost.php?forum=".$forum_id."&new=1"; $digest_link = "viewall.php?forum=".$forum_id."&start=$start&type=digest"; $unreplied_link = "viewall.php?forum=".$forum_id."&start=$start&type=unreplied"; $unread_link = "viewall.php?forum=".$forum_id."&start=$start&type=unread"; $xoopsTpl->assign('all_link', $all_link); $xoopsTpl->assign('post_link', $post_link); $xoopsTpl->assign('newpost_link', $newpost_link); $xoopsTpl->assign('digest_link', $digest_link); $xoopsTpl->assign('unreplied_link', $unreplied_link); $xoopsTpl->assign('unread_link', $unread_link);
function &get($uid) { global $xoopsModuleConfig, $xforumImage; $userinfo = array(); if(!isset($this->users[$uid])) return $userinfo; if(class_exists("User_language")){ $user = new User_language($this->users[$uid]); }else{ $user = new User($this->users[$uid]); } $userinfo = $user->getInfo(); if($xoopsModuleConfig['groupbar_enabled'] && !empty($userinfo["groups_id"])){ foreach($userinfo["groups_id"] as $id){ if(isset($this->groups[$id])) $userinfo['groups'][] = $this->groups[$id]; } } if ($xoopsModuleConfig['wol_enabled']) { $userinfo["status"] = isset($this->status[$uid]) ? forum_displayImage($xforumImage['online'], _MD_ONLINE) : forum_displayImage($xforumImage['offline'],_MD_OFFLINE); } return $userinfo; }
$sortby = 'p.post_time DESC'; $subquery = ""; $searchin = "both"; $sort = ""; $since = isset($_POST['since']) ? $_POST['since'] : (isset($_GET['since']) ? $_GET['since'] : null); $next_search['since'] = $since; $term = isset($_POST['term']) ? $_POST['term'] : (isset($_GET['term']) ? $_GET['term'] : null); $uname = isset($_POST['uname']) ? $_POST['uname'] : (isset($_GET['uname']) ? $_GET['uname'] : null); if ($xoopsModuleConfig['wol_enabled']){ $online_handler =& xoops_getmodulehandler('online', 'xforum'); $online_handler->init(0); } $xoopsTpl->assign("forumindex", sprintf(_MD_FORUMINDEX, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES))); $xoopsTpl->assign("img_folder", forum_displayImage($xforumImage['folder_topic'])); if ( !empty($_POST['submit']) || !empty($_GET['submit']) || !empty($uname) || !empty($term)) { $start = isset($_GET['start']) ? $_GET['start'] : 0; $xforum = isset($_POST['forum']) ? $_POST['forum'] : (isset($_GET['forum']) ? $_GET['forum'] : null); if (empty($xforum) or $xforum == 'all' or (is_array($xforum) and in_array('all', $xforum))) { $xforum = array(); } elseif(!is_array($xforum)){ $xforum = array_map("intval",explode(",", $xforum)); } $next_search['forum'] = implode(",", $xforum); $addterms = isset($_POST['andor']) ? $_POST['andor'] : (isset($_GET['andor']) ? $_GET['andor'] : ""); $next_search['andor'] = $addterms; if ( !in_array(strtolower($addterms), array("or", "and", "exact"))){
$echo .= "<td align='center'>" . $f_edit_link . "</td>"; $echo .= "<td align='center'>" . $f_del_link . "</td>"; $echo .= "<td align='center'>" . $sf_add_link . "</td>"; $echo .= "<td align='center'>" . $f_move_link . "</td>"; $echo .= "<td align='center'>" . $f_merge_link . "</td>"; $echo .= "</tr>"; if (!isset($xforums[$c][$f]["sub"])) { continue; } foreach (array_keys($xforums[$c][$f]["sub"]) as $s) { $f_link = " <a href=\"" . $xforumUrl['root'] . "/viewforum.php?forum=" . $s . "\">-->" . $xforums[$c][$f]["sub"][$s]["title"] . "</a>"; $f_edit_link = "<a href=\"admin_forum_manager.php?op=mod&forum=" . $s . "\">" . forum_displayImage($xforumImage['edit']) . "</a>"; $f_del_link = "<a href=\"admin_forum_manager.php?op=del&forum=" . $s . "\">" . forum_displayImage($xforumImage['delete']) . "</a>"; $sf_add_link = ""; $f_move_link = "<a href=\"admin_forum_manager.php?op=moveforum&forum=" . $s . "\">" . forum_displayImage($xforumImage['move_topic']) . "</a>"; $f_merge_link = "<a href=\"admin_forum_manager.php?op=mergeforum&forum=" . $s . "\">" . forum_displayImage($xforumImage['move_topic']) . "</a>"; $echo .= "<tr class='odd' align='left'><td></td>"; $echo .= "<td><strong>" . $f_link . "</strong></td>"; $echo .= "<td align='center'>" . $f_edit_link . "</td>"; $echo .= "<td align='center'>" . $f_del_link . "</td>"; $echo .= "<td align='center'>" . $sf_add_link . "</td>"; $echo .= "<td align='center'>" . $f_move_link . "</td>"; $echo .= "<td align='center'>" . $f_merge_link . "</td>"; $echo .= "</tr>"; } } } unset($xforums, $categories); echo $echo; echo "</table>"; echo "</fieldset>";
function showPost($isadmin) { global $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsUser, $myts, $xoopsTpl; global $xforumUrl, $xforumImage; global $viewtopic_users, $viewtopic_posters, $viewtopic_forum, $xforumtopic, $online, $user_karma, $viewmode, $order, $start, $total_posts, $topic_status; static $post_NO = 0; static $user_ip; $post_id = $this->getVar('post_id'); $topic_id = $this->getVar('topic_id'); $forum_id = $this->getVar('forum_id'); $topic_status = $xforumtopic->getVar('topic_status'); $uid = is_object($xoopsUser)? $xoopsUser->getVar('uid'):0; $post_NO ++; if (strtolower($order) == "desc") $post_no = $total_posts - ($start + $post_NO) + 1; else $post_no = $start + $post_NO; if ($isadmin or $this->checkIdentity()) { $post_text = $this->getVar('post_text'); $post_attachment = $this->displayAttachment(); } elseif ($xoopsModuleConfig['enable_karma'] && $this->getVar('post_karma') > $user_karma) { $post_text = "<div class='karma'>" . sprintf(_MD_KARMA_REQUIREMENT, $user_karma, $this->getVar('post_karma')) . "</div>"; $post_attachment = ''; } elseif ( $xoopsModuleConfig['allow_require_reply'] && $this->getVar('require_reply') && ( !$uid || !in_array($uid, $viewtopic_posters) ) ) { $post_text = "<div class='karma'>" . _MD_REPLY_REQUIREMENT . "</div>"; $post_attachment = ''; } else { $post_text = $this->getVar('post_text'); $post_attachment = $this->displayAttachment(); } $poster = (($this->getVar('uid') > 0) && isset($viewtopic_users[$this->getVar('uid')]))? $viewtopic_users[$this->getVar('uid')]: array( 'poster_uid' => 0, 'name' => $this->getVar('poster_name')?$this->getVar('poster_name'):$myts->HtmlSpecialChars($xoopsConfig['anonymous']), 'link' => $this->getVar('poster_name')?$this->getVar('poster_name'):$myts->HtmlSpecialChars($xoopsConfig['anonymous']) ); $posticon = $this->getVar('icon'); if (!empty($posticon)){ $post_image = '<a name="' . $post_id . '"><img src="' . XOOPS_URL . '/images/subject/' . $posticon . '" alt="" /></a>'; }else{ $post_image = '<a name="' . $post_id . '"><img src="' . XOOPS_URL . '/images/icons/posticon.gif" alt="" /></a>'; } $post_title = $this->getVar('subject'); $thread_buttons = array(); if($GLOBALS["xoopsModuleConfig"]['enable_permcheck']){ $topic_handler = &xoops_getmodulehandler('topic', 'xforum'); if ($topic_handler->getPermission($forum_id, $topic_status, "edit")) { $edit_ok = false; if ($isadmin) { $edit_ok = true; } elseif ($this->checkIdentity() && $this->checkTimelimit('edit_timelimit')) { $edit_ok = true; } if ($edit_ok) { $thread_buttons['edit']['image'] = forum_displayImage($xforumImage['p_edit'], _EDIT); $thread_buttons['edit']['link'] = "edit.php?forum=" . $forum_id . "&topic_id=" . $topic_id . "&viewmode=$viewmode&order=$order"; $thread_buttons['edit']['name'] = _EDIT; } } if ($topic_handler->getPermission($forum_id, $topic_status, "delete")) { $delete_ok = false; if ($isadmin) { $delete_ok = true; } elseif ($this->checkIdentity() && $this->checkTimelimit('delete_timelimit')) { $delete_ok = true; } if ($delete_ok) { $thread_buttons['delete']['image'] = forum_displayImage($xforumImage['p_delete'], _DELETE); $thread_buttons['delete']['link'] = "delete.php?forum=" . $forum_id . "&topic_id=" . $topic_id . "&viewmode=$viewmode&order=$order"; $thread_buttons['delete']['name'] = _DELETE; } } if ($topic_handler->getPermission($forum_id, $topic_status, "reply")) { $thread_buttons['reply']['image'] = forum_displayImage($xforumImage['p_reply'], _MD_REPLY); $thread_buttons['reply']['link'] = "reply.php?forum=" . $forum_id . "&topic_id=" . $topic_id . "&viewmode=$viewmode&order=$order&start=$start"; $thread_buttons['reply']['name'] = _MD_REPLY; /* $thread_buttons['quote']['image'] = forum_displayImage($xforumImage['p_quote'], _MD_QUOTE); $thread_buttons['quote']['link'] = "reply.php?forum=" . $forum_id . "&topic_id=" . $topic_id . "&viewmode=$viewmode&order=$order&start=$start&quotedac=1"; $thread_buttons['quote']['name'] = _MD_QUOTE; */ } }else{ $thread_buttons['edit']['image'] = forum_displayImage($xforumImage['p_edit'], _EDIT); $thread_buttons['edit']['link'] = "edit.php?forum=" . $forum_id . "&topic_id=" . $topic_id . "&viewmode=$viewmode&order=$order"; $thread_buttons['edit']['name'] = _EDIT; $thread_buttons['delete']['image'] = forum_displayImage($xforumImage['p_delete'], _DELETE); $thread_buttons['delete']['link'] = "delete.php?forum=" . $forum_id . "&topic_id=" . $topic_id . "&viewmode=$viewmode&order=$order"; $thread_buttons['delete']['name'] = _DELETE; $thread_buttons['reply']['image'] = forum_displayImage($xforumImage['p_reply'], _MD_REPLY); $thread_buttons['reply']['link'] = "reply.php?forum=" . $forum_id . "&topic_id=" . $topic_id . "&viewmode=$viewmode&order=$order&start=$start"; $thread_buttons['reply']['name'] = _MD_REPLY; } if (!$isadmin && $xoopsModuleConfig['reportmod_enabled']) { $thread_buttons['report']['image'] = forum_displayImage($xforumImage['p_report'], _MD_REPORT); $thread_buttons['report']['link'] = "report.php?forum=" . $forum_id . "&topic_id=" . $topic_id . "&viewmode=$viewmode&order=$order"; $thread_buttons['report']['name'] = _MD_REPORT; } $thread_action = array(); /* if ($isadmin) { $thread_action['news']['image'] = forum_displayImage($xforumImage['news'], _MD_POSTTONEWS); $thread_action['news']['link'] = "posttonews.php?topic_id=" . $topic_id; $thread_action['news']['name'] = _MD_POSTTONEWS; } $thread_action['pdf']['image'] = forum_displayImage($xforumImage['pdf'], _MD_PDF); $thread_action['pdf']['link'] = "makepdf.php?type=post&pageid=0&scale=0.66"; $thread_action['pdf']['name'] = _MD_PDF; $thread_action['print']['image'] = forum_displayImage($xforumImage['printer'], _MD_PRINT); $thread_action['print']['link'] = "print.php?form=2&forum=". $forum_id."&topic_id=" . $topic_id; $thread_action['print']['name'] = _MD_PRINT; if(is_object($xoopsUser) && $this->getVar('uid') > 0 && isset($viewtopic_users[$this->getVar('uid')])){ $thread_action['pm']['image'] = $image_url = "<img src=\"".$xforumImage['pm']."\" alt=\""._MD_PM."\" align=\"middle\" />"; $thread_action['pm']['link'] = "posttopm.php?"; $thread_action['pm']['name'] = _MD_PM; } */ if (file_exists(XOOPS_ROOT_PATH."/modules/tag/include/tagbar.php")) { include_once XOOPS_ROOT_PATH."/modules/tag/include/tagbar.php"; $tagbar = tagBar($post_id, $catid = 0); $hastags = true; } else { $tagbar = ''; $hastags = false; } $post = array( 'post_id' => $post_id, 'post_parent_id' => $this->getVar('pid'), 'post_date' => forum_formatTimestamp($this->getVar('post_time')), 'post_image' => $post_image, 'post_title' => $post_title, 'post_text' => $post_text, 'post_attachment' => $post_attachment, 'post_edit' => $this->displayPostEdit(), 'post_no' => $post_no, 'post_signature' => ($this->getVar('attachsig'))?@$poster["signature"]:"", 'poster_ip' => ($isadmin && $xoopsModuleConfig['show_ip'])?long2ip($this->getVar('poster_ip')):"", 'thread_action' => $thread_action, 'thread_buttons' => $thread_buttons, 'poster' => $poster, 'hastags' => $hastags, 'tagbar' => $tagbar ); unset($thread_buttons); unset($eachposter); return $post; }
$xoopsTpl->assign('newpost_link', $newpost_link); $xoopsTpl->assign('digest_link', $digest_link); $xoopsTpl->assign('unreplied_link', $unreplied_link); $xoopsTpl->assign('unread_link', $unread_link); $xoopsTpl->assign('current_type', $current_type); $xoopsTpl->assign('current_link', $current_link); $all_topics = $forum_handler->getTopicCount($viewall_forums, $startdate, $type); unset($viewall_forums); if ( $all_topics > $xoopsModuleConfig['topics_per_page']) { include XOOPS_ROOT_PATH.'/class/pagenav.php'; $nav = new XoopsPageNav($all_topics, $xoopsModuleConfig['topics_per_page'], $start, "start", 'sortname='.$sortname.'&sortorder='.$sortorder.'&since='.$since."&type=$type&mode=".$mode); $xoopsTpl->assign('forum_pagenav', $nav->renderNav(4)); } else { $xoopsTpl->assign('forum_pagenav', ''); } if(!empty($xoopsModuleConfig['show_jump'])){ $xoopsTpl->assign('forum_jumpbox', forum_make_jumpbox()); } $xoopsTpl->assign('down',forum_displayImage($xforumImage['doubledown'])); $xoopsTpl->assign('menumode',$menumode); $xoopsTpl->assign('menumode_other',$menumode_other); $xoopsTpl->assign('mode', $mode); $xoopsTpl->assign('type', $type); $xoopsTpl->assign('viewer_level', ($isadmin)?2:(is_object($xoopsUser)?1:0) ); $xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name'). ' - ' .$current_type); include XOOPS_ROOT_PATH."/footer.php"; ?>
$xoopsTpl->assign('unreplied_link', "viewall.php?type=unreplied"); $xoopsTpl->assign('unread_link', "viewall.php?type=unread"); $xoopsTpl->assign('down',forum_displayImage($xforumImage['doubledown'])); $xoopsTpl->assign('menumode',$menumode); $xoopsTpl->assign('menumode_other',$menumode_other); $isadmin = forum_isAdmin(); $xoopsTpl->assign('viewer_level', ($isadmin)?2:(is_object($xoopsUser)?1:0) ); $mode = (!empty($_GET['mode'])) ? intval($_GET['mode']) : 0; $xoopsTpl->assign('mode', $mode ); $xoopsTpl->assign('viewcat', $viewcat); $xoopsTpl->assign('version', $xoopsModule->getVar("version")); /* To be removed */ if ( $isadmin ) { $xoopsTpl->assign('forum_index_cpanel',array("link"=>"admin/index.php", "name"=>_MD_ADMINCP)); } if ($xoopsModuleConfig['rss_enable'] == 1) { $xoopsTpl->assign("rss_enable",1); $xoopsTpl->assign("rss_button", forum_displayImage($xforumImage['rss'], 'RSS feed')); } $xoopsTpl->assign(array( "img_hotfolder" => forum_displayImage($xforumImage['newposts_forum']), "img_folder" => forum_displayImage($xforumImage['folder_forum']), "img_locked_nonewposts" => forum_displayImage($xforumImage['locked_forum']), "img_locked_newposts" => forum_displayImage($xforumImage['locked_forum_newposts']), 'img_subforum' => forum_displayImage($xforumImage['subforum']))); include_once XOOPS_ROOT_PATH.'/footer.php'; ?>
function display_topic($xforum, $topic_id, $content_only = 1) { global $db, $myts, $xoopsUser, $xoopsModule, $xforumTable, $xforumImage, $meta; if($content_only==0) { include_once(XOOPS_ROOT_PATH."/header.php"); } $q = "select * from ".$xforumTable['forums']." WHERE forum_id=".$xforum; $result = $db->query($q); $xforumdata = $db->fetch_array($result); $q = "select * from ".$xforumTable['topics']." WHERE topic_id=".$topic_id; $result = $db->query($q); $topicdata = $db->fetch_array($result); echo "<table border='0' width='100%' cellpadding='5'>"; echo "<tr><td align='left'>".forum_displayImage($xforumImage['f_open'])." <a href='".$xforumPath['url']."archive.php'>"; echo _MD_FORUM_ARCHIVE."</a>"; if($xforumdata['parent_forum'] == 0) { echo "<br /> ".forum_displayImage($xforumImage['f_open'])." <a href='archive.php?forum=$xforum'>".$myts->htmlSpecialChars($xforumdata['forum_name'])."</a>"; echo "<br />".forum_displayImage($xforumImage['f_content'])." <strong>".$myts->htmlSpecialChars($topicdata['topic_title'])."</strong><br />"; } else { $q = "select forum_name from ".$xforumTable['forums']." WHERE forum_id=".$xforumdata['parent_forum']; $row = $db->fetch_array($db->query($q)); echo "<br /> ".forum_displayImage($xforumImage['f_open'])." <a href='".$xforumPath['url']."archive.php?forum=".$xforumdata['parent_forum']."'>".$myts->htmlSpecialChars($row['forum_name'])."</a>"; echo "<br /> ".forum_displayImage($xforumImage['f_open'])." <a href='archive.php?forum=$xforum'>".$myts->htmlSpecialChars($xforumdata['forum_name'])."</a>"; echo "<br /> ".forum_displayImage($xforumImage['f_content'])." <strong>".$myts->htmlSpecialChars($topicdata['topic_title'])."</strong><br />"; } echo "</td></tr></table><br />"; // =============== LINK HEADER =============== echo "<table border='0' width='640' cellpadding='5' cellspacing='0' bgcolor='#FFFFFF' align=center><tr><td>"; echo "<h3>"._MD_FORUM." : ".$xforumdata['forum_name']."</h3>"; echo "<h3>"._MD_SUBJECT." : ".$topicdata['topic_title']."</h3>"; echo "<i><strong>".$meta['copyright']."<br /><a href=".XOOPS_URL.">".XOOPS_URL."</a> <br /><br />"._MD_PRINT_TOPIC_LINK."<br /> <a href='".XOOPS_URL."/modules/".$xoopsModule->dirname()."/viewtopic.php?topic_id=$topic_id&forum=$xforum'>".XOOPS_URL."/modules/".$xoopsModule->dirname()."/viewtopic.php?topic_id=$topic_id&forum=$xforum</a> </strong></i><br /><br />"; // ============= END LINK HEADER ============= $xforumpost = new ForumPosts(); $xforumpost->setOrder("post_time ASC"); $xforumpost->setTopicId($topic_id); $xforumpost->setParent(0); $postsArray = $xforumpost->getAllPosts(); $count = 0; echo "<table border='0' width='100%' cellpadding='5' cellspacing='0' bgcolor='#FFFFFF'><tr><td>"; foreach ($postsArray as $obj) { if ( !($count % 2) ) { $row_color = 1; } else { $row_color = 2; } echo "<tr><td>"; $xforumpost->setType($obj->type); $obj->showPostForPrint($order); $count++; echo "</td></tr>"; } echo "</table>"; echo "</td></tr></table>"; if($content_only==0) { include_once(XOOPS_ROOT_PATH."/footer.php"); } }
break; } loadModuleAdminMenu(1, _AM_XFORUM_CATADMIN); echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XFORUM_CATADMIN . "</legend>"; echo "<br />"; echo "<a style='border: 1px solid #5E5D63; color: #000000; font-family: verdana, tahoma, arial, helvetica, sans-serif; font-size: 1em; padding: 4px 8px; text-align:center;' href='admin_cat_manager.php'>" . _AM_XFORUM_CREATENEWCATEGORY . "</a><br /><br />"; echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>"; echo "<tr align='center'>"; echo "<td class='bg3'>" . _AM_XFORUM_CATEGORY1 . "</td>"; //echo "<td class='bg3' width='10%'>" . _AM_XFORUM_STATE . "</td>"; echo "<td class='bg3' width='10%'>" . _AM_XFORUM_EDIT . "</td>"; echo "<td class='bg3' width='10%'>" . _AM_XFORUM_DELETE . "</td>"; echo "</tr>"; foreach ($categories as $key => $onecat) { $cat_edit_link = "<a href=\"admin_cat_manager.php?op=mod&cat_id=" . $onecat->getVar('cat_id') . "\">" . forum_displayImage($xforumImage['edit'], _EDIT) . "</a>"; $cat_del_link = "<a href=\"admin_cat_manager.php?op=del&cat_id=" . $onecat->getVar('cat_id') . "\">" . forum_displayImage($xforumImage['delete'], _DELETE) . "</a>"; $cat_title_link = "<a href=\"" . XOOPS_URL . "/modules/" . $xoopsModule->getVar("dirname") . "/index.php?cat=" . $onecat->getVar('cat_id') . "\">" . $onecat->getVar('cat_title') . "</a>"; echo "<tr class='odd' align='left'>"; echo "<td>" . $cat_title_link . "</td>"; echo "<td align='center'>" . $cat_edit_link . "</td>"; echo "<td align='center'>" . $cat_del_link . "</td>"; echo "</tr>"; } echo "</table>"; echo "</fieldset>"; break; case "mod": $fc =& $category_handler->get($cat_id); loadModuleAdminMenu(1, _AM_XFORUM_EDITCATEGORY . $fc->getVar('cat_title')); echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XFORUM_EDITCATEGORY . "</legend>"; echo "<br />";
$useravgrating = 0; while (list($rating2) = $xoopsDB->fetchRow($result2)) { $useravgrating = $useravgrating + $rating2; } if ($useravgrating > 0) { $useravgrating = $useravgrating / $uservotes; $useravgrating = number_format($useravgrating, 2); } xoops_cp_header(); loadModuleAdminMenu(10, _AM_XFORUM_VOTE_RATINGINFOMATION); echo "\n\t\t<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XFORUM_VOTE_DISPLAYVOTES . "</legend>\n\n\t\t<div style='padding: 8px;'>\n\n\t\t<div><strong>" . _AM_XFORUM_VOTE_USERAVG . ": </strong>{$useravgrating}</div>\n\n\t\t<div><strong>" . _AM_XFORUM_VOTE_TOTALRATE . ": </strong>{$uservotes}</div>\n\n\t\t<div style='padding: 8px;'>\n\n\t\t<ul><li>" . forum_displayImage($xforumImage['delete'], _DELETE) . " " . _AM_XFORUM_VOTE_DELETEDSC . "</li></ul>\n\t\t<div>\n\n\t\t</fieldset>\n\n\t\t<br />\n\n\n\t\t<table width='100%' cellspacing='1' cellpadding='2' class='outer'>\n\n\t\t<tr>\n\n\t\t<th align='center'>" . _AM_XFORUM_VOTE_ID . "</th>\n\n\t\t<th align='center'>" . _AM_XFORUM_VOTE_USER . "</th>\n\n\t\t<th align='center'>" . _AM_XFORUM_VOTE_IP . "</th>\n\n\t\t<th align='center'>" . _AM_XFORUM_VOTE_FILETITLE . "</th>\n\n\t\t<th align='center'>" . _AM_XFORUM_VOTE_RATING . "</th>\n\n\t\t<th align='center'>" . _AM_XFORUM_VOTE_DATE . "</th>\n\n\t\t<th align='center'>" . _AM_XFORUM_ACTION . "</th></tr>\n"; if ($votes == 0) { echo "<tr><td align='center' colspan='7' class='head'>" . _AM_XFORUM_VOTE_NOVOTES . "</td></tr>"; } while (list($ratingid, $topic_id, $ratinguser, $rating, $ratinghostname, $ratingtimestamp) = $xoopsDB->fetchRow($results)) { $sql = "SELECT topic_title FROM " . $xoopsDB->prefix('xf_topics') . " WHERE topic_id=" . $topic_id . ""; $down_array = $xoopsDB->fetchArray($xoopsDB->query($sql)); $formatted_date = formatTimestamp($ratingtimestamp, _DATESTRING); $ratinguname = forum_getUnameFromId($ratinguser, $xoopsModuleConfig['show_realname']); echo "\n\t\t<tr>\n\n\t\t<td class='head' align='center'>{$ratingid}</td>\n\n\t\t<td class='even' align='center'>{$ratinguname}</td>\n\n\t\t<td class='even' align='center' >{$ratinghostname}</td>\n\n\t\t<td class='even' align='left'><a href='" . XOOPS_URL . "/modules/xforum/viewtopic.php?topic_id=" . $topic_id . "' target='topic'>" . $myts->htmlSpecialChars($down_array['topic_title']) . "</a></td>\n\n\t\t<td class='even' align='center'>{$rating}</td>\n\n\t\t<td class='even' align='center'>{$formatted_date}</td>\n\n\t\t<td class='even' align='center'><strong><a href='admin_votedata.php?op=delvotes&topic_id={$topic_id}&rid={$ratingid}'>" . forum_displayImage($xforumImage['delete'], _DELETE) . "</a></strong></td>\n\n\t\t</tr>\n"; } echo "</table>"; //Include page navigation include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; $page = $votes > 20 ? _AM_XFORUM_MINDEX_PAGE : ''; $pagenav = new XoopsPageNav($page, 20, $start, 'start'); echo '<div align="right" style="padding: 8px;">' . $page . '' . $pagenav->renderImageNav(4) . '</div>'; break; } echo chronolabs_inline(false); xoops_cp_footer();