[Core Edit] View Unanswered Threads

Spartak

Well-known member
Member
Joined
9 yrs. 9 mth. 5 days
Messages
587
Reaction score
8,878
Wallet
0$
[Core Edit] View Unanswered Threads

This will add a new specialized Search preset link "View Unanswered Threads" to header.<br />
<br />
Open template <code class="inline-code">header_welcomeblock_member_search</code> and add at the bottom:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-php">&lt;li&gt;&lt;a href=&quot;{$mybb-&gt;settings['bburl']}/search.php?action=findunansweredthreads&quot;&gt;View Unanswered Threads&lt;/a&gt;&lt;/li&gt;
</code></pre> <br />
Now open your search.php file in an editor. Go to line no. around 1252, find this line:<br />
<code class="inline-code">elseif($mybb-&gt;input['action'] == &quot;finduserthreads&quot;)</code><br />
<br />
and change it to:<br />
<code class="inline-code">elseif($mybb-&gt;input['action'] == &quot;finduserthreads&quot; || $mybb-&gt;input['action'] == &quot;findunansweredthreads&quot;)</code><br />
<br />
Just after that, find this line:<br />
<code class="inline-code">$where_sql = &quot;uid='&quot;.$mybb-&gt;get_input('uid', MyBB::INPUT_INT).&quot;'&quot;;</code><br />
<br />
and change it to:<br />
<pre data-deferred="true" class="block-code line-numbers language-none"><code class="language-php"> 
    if($mybb-&gt;input['action'] == &quot;finduserthreads&quot;)
    {
        $where_sql = &quot;uid='&quot;.$mybb-&gt;get_input('uid', MyBB::INPUT_INT).&quot;'&quot;;
    }
    else
    {
        $where_sql = &quot;replies='0'&quot;;
    }
</code></pre><br />
Now save the modified search.php and reupload to your forum root, replacing the existing one.<br />
<br />
Result:<br />
<br />
<img src="
Please, Log in or Register to view URLs content!
" data-original-url="https://user-images.githubusercontent.com/21265591/112095966-71db1980-8bc3-11eb-936d-2c72f7197633.gif" loading="lazy" width="640" height="350" alt="[Image: 112095966-71db1980-8bc3-11eb-936d-2c72f7197633.gif]" class="mycode_img" />


Please, Log in or Register to view URLs content!
 
Top Bottom