Esempio n. 1
0
        $search_data = array("keywords" => $mybb->input['keywords'], "postthread" => 1, "tid" => $mybb->get_input('tid', MyBB::INPUT_INT));
        if ($db->can_search == true) {
            if ($mybb->settings['searchtype'] == "fulltext" && $db->supports_fulltext_boolean("posts") && $db->is_fulltext("posts")) {
                $search_results = perform_search_mysql_ft($search_data);
            } else {
                $search_results = perform_search_mysql($search_data);
            }
        } else {
            error($lang->error_no_search_support);
        }
        $sid = md5(uniqid(microtime(), true));
        $searcharray = array("sid" => $db->escape_string($sid), "uid" => $mybb->user['uid'], "dateline" => $now, "ipaddress" => $db->escape_binary($session->packedip), "threads" => $search_results['threads'], "posts" => $search_results['posts'], "resulttype" => 'posts', "querycache" => $search_results['querycache'], "keywords" => $db->escape_string($mybb->input['keywords']));
        $plugins->run_hooks("search_thread_process");
        $db->insert_query("searchlog", $searcharray);
        $plugins->run_hooks("search_do_search_end");
        redirect("search.php?action=results&sid=" . $sid, $lang->redirect_searchresults);
    } else {
        $plugins->run_hooks("search_start");
        $srchlist = make_searchable_forums();
        $prefixselect = build_prefix_select('all', 'any', 1);
        $rowspan = 5;
        $moderator_options = '';
        if (is_moderator()) {
            $rowspan += 2;
            eval("\$moderator_options = \"" . $templates->get("search_moderator_options") . "\";");
        }
        $plugins->run_hooks("search_end");
        eval("\$search = \"" . $templates->get("search") . "\";");
        output_page($search);
    }
}
Esempio n. 2
0
         $postbit = build_postbit($post, 1);
         eval("\$preview = \"" . $templates->get("previewpost") . "\";");
     }
     $message = htmlspecialchars_uni($mybb->input['message']);
     $subject = htmlspecialchars_uni($mybb->input['subject']);
 } else {
     if ($mybb->input['attachmentaid'] || $mybb->input['newattachment'] || $mybb->input['updateattachment'] || $thread_errors) {
         $message = htmlspecialchars_uni($mybb->input['message']);
         $subject = htmlspecialchars_uni($mybb->input['subject']);
     }
 }
 // Generate thread prefix selector
 if (!intval($mybb->input['threadprefix'])) {
     $mybb->input['threadprefix'] = 0;
 }
 $prefixselect = build_prefix_select($forum['fid'], $mybb->input['threadprefix']);
 $posthash = htmlspecialchars_uni($mybb->input['posthash']);
 // Can we disable smilies or are they disabled already?
 if ($forum['allowsmilies'] != 0) {
     eval("\$disablesmilies = \"" . $templates->get("newthread_disablesmilies") . "\";");
 } else {
     $disablesmilies = "<input type=\"hidden\" name=\"postoptions[disablesmilies]\" value=\"no\" />";
 }
 // Show the moderator options
 if (is_moderator($fid)) {
     $modoptions = $mybb->input['modoptions'];
     if ($modoptions['closethread'] == 1) {
         $closecheck = "checked=\"checked\"";
     } else {
         $closecheck = '';
     }
Esempio n. 3
0
                     if ($notification == 2) {
                         $postoptions_subscriptionmethod_pm = "checked=\"checked\"";
                     } else {
                         $postoptions_subscriptionmethod_dont = "checked=\"checked\"";
                     }
                 }
             }
         }
     }
 }
 // Generate thread prefix selector if this is the first post of the thread
 if ($thread['firstpost'] == $pid) {
     if (!$mybb->get_input('threadprefix', MyBB::INPUT_INT)) {
         $mybb->input['threadprefix'] = $thread['prefix'];
     }
     $prefixselect = build_prefix_select($forum['fid'], $mybb->get_input('threadprefix', MyBB::INPUT_INT));
 } else {
     $prefixselect = "";
 }
 $editreason = '';
 if ($mybb->settings['alloweditreason'] == 1) {
     eval("\$editreason = \"" . $templates->get("editpost_reason") . "\";");
     $bgcolor = "trow2";
     $bgcolor2 = "trow1";
 } else {
     $bgcolor = "trow1";
     $bgcolor2 = "trow2";
 }
 // Fetch subscription select box
 eval("\$subscriptionmethod = \"" . $templates->get("post_subscription_method") . "\";");
 $query = $db->simple_select("posts", "*", "tid='{$tid}'", array("limit" => 1, "order_by" => "dateline", "order_dir" => "asc"));