} $forum_selection_sort .= '</select>'; $xoopsTpl->assign_by_ref('forum_selection_sort', $forum_selection_sort); $sortorder = (!isset($_GET['sortorder']) || $_GET['sortorder'] != "ASC") ? "DESC" : "ASC"; $forum_selection_order = '<select name="sortorder">'; $forum_selection_order .= '<option value="ASC"'.(($sortorder == "ASC") ? ' selected="selected"' : '').'>'._MD_ASCENDING.'</option>'; $forum_selection_order .= '<option value="DESC"'.(($sortorder == "DESC") ? ' selected="selected"' : '').'>'._MD_DESCENDING.'</option>'; $forum_selection_order .= '</select>'; $xoopsTpl->assign_by_ref('forum_selection_order', $forum_selection_order); $since = isset($_GET['since']) ? intval($_GET['since']) : $xoopsModuleConfig["since_default"]; $forum_selection_since = forum_sinceSelectBox($since); $xoopsTpl->assign_by_ref('forum_selection_since', $forum_selection_since); $xoopsTpl->assign('h_topic_link', "viewforum.php?forum=$forum_id&sortname=t.topic_title&since=$since&sortorder=". (($sortname == "t.topic_title" && $sortorder == "DESC") ? "ASC" : "DESC"))."&type=$type"; $xoopsTpl->assign('h_reply_link', "viewforum.php?forum=$forum_id&sortname=t.topic_replies&since=$since&sortorder=". (($sortname == "t.topic_replies" && $sortorder == "DESC") ? "ASC" : "DESC"))."&type=$type"; $xoopsTpl->assign('h_poster_link', "viewforum.php?forum=$forum_id&sortname=u.uname&since=$since&sortorder=". (($sortname == "u.uname" && $sortorder == "DESC") ? "ASC" : "DESC"))."&type=$type"; $xoopsTpl->assign('h_views_link', "viewforum.php?forum=$forum_id&sortname=t.topic_views&since=$since&sortorder=". (($sortname == "t.topic_views" && $sortorder == "DESC") ? "ASC" : "DESC"))."&type=$type"; $xoopsTpl->assign('h_rating_link', "viewforum.php?forum=$forum_id&sortname=t.topic_ratings&since=$since&sortorder=". (($sortname == "t.topic_ratings" && $sortorder == "DESC") ? "ASC" : "DESC"))."&type=$type"; $xoopsTpl->assign('h_date_link', "viewforum.php?forum=$forum_id&sortname=p.post_time&since=$since&sortorder=". (($sortname == "p.post_time" && $sortorder == "DESC") ? "ASC" : "DESC"))."&type=$type"; $xoopsTpl->assign('h_publish_link', "viewforum.php?forum=$forum_id&sortname=t.topic_time&since=$since&sortorder=". (($sortname == "t.topic_time" && $sortorder == "DESC") ? "ASC" : "DESC"))."&type=$type"; $xoopsTpl->assign('forum_since', $since); // For $since in search.php $startdate = empty($since)?0:(time() - forum_getSinceTime($since)); $start = !empty($_GET['start']) ? intval($_GET['start']) : 0; list($allTopics, $sticky) = $forum_handler->getAllTopics($forum_obj,$startdate,$start,$sortname,$sortorder,$type,$xoopsModuleConfig['post_excerpt']);
if($uname_required){ if($search_info) $search_info .= "<br />"; $search_info .= _MD_USERNAME.": ".$myts->htmlSpecialChars($search_username); } $xoopsTpl->assign("search_info", $search_info); } $xforumperms =& xoops_getmodulehandler('permission', 'xforum'); $allowed_forums = $xforumperms->getPermissions('forum'); $forum_handler =& xoops_getmodulehandler('forum', 'xforum'); $forum_array = $forum_handler->getForums(); $select_forum = '<select name="forum[]" size="5" multiple="multiple">'; $select_forum .= '<option value="all">'._MD_SEARCHALLFORUMS.'</option>'; foreach ($forum_array as $key => $xforum) { if (in_array($xforum->getVar('forum_id'), array_keys($allowed_forums))) { $select_forum .= '<option value="'.$xforum->getVar('forum_id').'">'.$xforum->getVar('forum_name').'</option>'; } } $select_forum .= '</select>'; $xoopsTpl->assign_by_ref("forum_selection_box", $select_forum); $select_since = forum_sinceSelectBox($xoopsModuleConfig['since_default']); $xoopsTpl->assign_by_ref("since_selection_box", $select_since); if ($xoopsConfigSearch['keyword_min'] > 0) { $xoopsTpl->assign("search_rule", sprintf(_SR_KEYIGNORE, $xoopsConfigSearch['keyword_min'])); } include XOOPS_ROOT_PATH.'/footer.php'; ?>