MyBB Community Forums

Full Version: search.php take URL input for various searches
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can i search by URL?

problems
  • search.php doesnt seem to allow the option to search by 0 replies, so to test the rest i have been putting 1 instead
  • i cant find the correct value to insert 

URL i am trying
http://python-forum.io/search.php?action...mreplies=1

What i am trying to automate with that URL via search.php manually
keyword "* * * *" (apparently this is the only way to search anything?)
find threads with at most 1 reply (i want 0, but 0 returns results with more than 0 replies)

my modified search.php
http://codepad.org/LmeimXF4 line 1550
cant post the code in codebox as i get blocked from posting by it. 
The problem is you should be using $searcharray['querycache'] and have your SQL conditions in that. When the querycache field is set in a record, MyBB will use those conditions instead of looking up the tid or pid list. Something kind of like this:

$searcharray['querycache'] = "t.replies=" . $mybb->get_input("replies", MyBB::INPUT_INT);
(2016-10-18, 01:42 PM)dragonexpert Wrote: [ -> ]The problem is you should be using $searcharray['querycache'] and have your SQL conditions in that.  When the querycache field is set in a record, MyBB will use those conditions instead of looking up the tid or pid list.  Something kind of like this:

$searcharray['querycache'] = "t.replies=" . $mybb->get_input("replies", MyBB::INPUT_INT);

Im not really sure how to implement this. I just used someone elses code snippet to add findusersthread2 to get the egosearch i wanted. At what point would i put this code into search.php?

I tried modifying the SQL search via the unanswered plugin (this plugin gives me everything i want except it shows ALL threads without a single reply)
https://github.com/lukasamd/MyBB-View_Un...s.php#L200

and changed it to this
        // Make a query to search <span class="highlight" style="padding-left: 0px; padding-right: 0px;">unanswered</span> topics
        $sql = "SELECT tid
            FROM " . TABLE_PREFIX . "threads 
            WHERE {$this->where}
            and dateline >= date_add(now(), interval -1 day)
            ORDER BY dateline DESC
            LIMIT 500";
        $result = $db->query($sql);


but it still shows older posts than the test 1 day.