Ejemplo n.º 1
0
            $xoopsTpl->assign("search_prev", $search_prev);
        }
    }
    $search_info = _SR_KEYWORDS . ": " . $term;
    if ($uname_required) {
        if ($search_info) {
            $search_info .= "<br />";
        }
        $search_info .= _MD_USERNAME . ": " . $myts->htmlSpecialChars($search_username);
    }
    $xoopsTpl->assign("search_info", $search_info);
}
$forumperms =& xoops_getmodulehandler('permission', 'newbb');
$allowed_forums = $forumperms->getPermissions('forum');
$forum_handler =& xoops_getmodulehandler('forum', 'newbb');
$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 => $forum) {
    if (in_array($forum->getVar('forum_id'), array_keys($allowed_forums))) {
        $select_forum .= '<option value="' . $forum->getVar('forum_id') . '">' . $forum->getVar('forum_name') . '</option>';
    }
}
$select_forum .= '</select>';
$xoopsTpl->assign("forum_selection_box", $select_forum);
$select_since =& newbb_sinceSelectBox($xoopsModuleConfig['since_default']);
$xoopsTpl->assign("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';
Ejemplo n.º 2
0
}
$forum_selection_sort = '<select name="sort">';
foreach ($sel_sort_array as $sort_k => $sort_v) {
    $forum_selection_sort .= '<option value="' . $sort_k . '"' . ($sort == $sort_k ? ' selected="selected"' : '') . '>' . $sort_v . '</option>';
}
$forum_selection_sort .= '</select>';
$xoopsTpl->assign_by_ref('forum_selection_sort', $forum_selection_sort);
$order = !isset($_GET['order']) || $_GET['order'] != "ASC" ? "DESC" : "ASC";
$forum_selection_order = '<select name="order">';
$forum_selection_order .= '<option value="ASC"' . ($order == "ASC" ? ' selected' : '') . '>' . _MD_ASCENDING . '</option>';
$forum_selection_order .= '<option value="DESC"' . ($order == "DESC" ? ' 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"];
mod_loadFunctions("time", "newbb");
$forum_selection_since = newbb_sinceSelectBox($since);
$xoopsTpl->assign_by_ref('forum_selection_since', $forum_selection_since);
$query_sort = $query_array;
unset($query_sort["sort"], $query_sort["order"]);
$page_query_sort = implode("&amp;", array_values($query_sort));
unset($query_sort);
$xoopsTpl->assign('h_topic_link', "viewforum.php?{$page_query_sort}&amp;sort=t.topic_title&amp;order=" . ($sort == "t.topic_title" && $order == "DESC" ? "ASC" : "DESC"));
$xoopsTpl->assign('h_reply_link', "viewforum.php?{$page_query_sort}&amp;sort=t.topic_replies&amp;order=" . ($sort == "t.topic_replies" && $order == "DESC" ? "ASC" : "DESC"));
$xoopsTpl->assign('h_poster_link', "viewforum.php?{$page_query_sort}&amp;sort=u.uname&amp;order=" . ($sort == "u.uname" && $order == "DESC" ? "ASC" : "DESC"));
$xoopsTpl->assign('h_views_link', "viewforum.php?{$page_query_sort}&amp;sort=t.topic_views&amp;order=" . ($sort == "t.topic_views" && $order == "DESC" ? "ASC" : "DESC"));
$xoopsTpl->assign('h_rating_link', "viewforum.php?{$page_query_sort}&amp;sort=t.topic_ratings&amp;order=" . ($sort == "t.topic_ratings" && $order == "DESC" ? "ASC" : "DESC"));
$xoopsTpl->assign('h_date_link', "viewforum.php?{$page_query_sort}&amp;sort=p.post_time&amp;order=" . ($sort == "p.post_time" && $order == "DESC" ? "ASC" : "DESC"));
$xoopsTpl->assign('h_publish_link', "viewforum.php?{$page_query_sort}&amp;sort=t.topic_time&amp;order=" . ($sort == "t.topic_time" && $order == "DESC" ? "ASC" : "DESC"));
$xoopsTpl->assign('forum_since', $since);
// For $since in search.php
$startdate = empty($since) ? 0 : time() - newbb_getSinceTime($since);
Ejemplo n.º 3
0
 function buildSelection(&$xoopsTpl)
 {
     $selection = array("action" => $this->page);
     $selection["vars"] = $this->vars;
     $selection["vars"]["order"] = $selection["vars"]["since"] = null;
     $sort_selected = empty($this->vars["sort"]) ? "lastpost" : $this->vars["sort"];
     $sorts = $this->getSort("", "title");
     $selection["sort"] = "<select name='sort'>";
     foreach ($sorts as $sort => $title) {
         $selection["sort"] .= "<option value='{$sort}' " . ($sort == $sort_selected ? " selected='selected'" : "") . ">{$title}</option>";
     }
     $selection["sort"] .= "</select>";
     $selection["order"] = "<select name='order'>";
     $selection["order"] .= "<option value='0' " . (empty($this->vars["order"]) ? " selected='selected'" : "") . ">" . _DESCENDING . "</option>";
     $selection["order"] .= "<option value='1' " . (!empty($this->vars["order"]) ? " selected='selected'" : "") . ">" . _ASCENDING . "</option>";
     $selection["order"] .= "</select>";
     $since = isset($this->vars['since']) ? $this->vars['since'] : $this->config["since_default"];
     $selection["since"] = newbb_sinceSelectBox($since);
     $xoopsTpl->assign_by_ref('selection', $selection);
 }