View Full Version : Exclude forum from New Posts
maryx
02-01-2009, 09:10 PM
Thanks to the excellent suggestion from KW802 of making a plugin in this thread (https://vborg.vbsupport.ru/showthread.php?t=185868&highlight=exclude+new+posts) I have been able to exclude one of my forums from New Posts.
However, I would like to give my members the option of selecting whether or not to see this forum in New Posts.
This means that I need to make a drop down menu in the navbar under New Posts; one selection would say "exclude shopping", one selection would say "include shopping".
The problem is twofold: where to edit a drop down menu for New Posts, and then, how to attach the plugin that excludes shopping to that navbar selection.
Any ideas out there?
glennybee
02-02-2009, 01:00 PM
First of all, there isn't a drop down menu for New Posts so you would need to create one. Open the navnar template.
Find:
<if condition="$show['member']">
<td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a></td>
<else />
Replace it with:
<if condition="$show['member']">
<td id="newposts" class="vbmenu_control"><a href="search.php?$session[sessionurl]" accesskey="2">$vbphrase[new_posts_nav]</a><script type="text/javascript">vbmenu_register("newposts"); </script></td>
<else />
Find:
<!-- NAVBAR POPUP MENUS -->
Add below:
<div class="vbmenu_popup" id="newposts_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr><td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">NIncluding Shopping</a></td></tr>
<tr><td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getnew&exclude=x" accesskey="2">Excluding Shopping</a></td></tr>
</table>
</div>
Where x is the forumid of the shipping forum.
I always test new things on a default style that is not selectable to normal members before implementing it on my main board.
Good luck!
Max Kwiatkowski
02-02-2009, 01:03 PM
You can also add a new plugin.
Hook Location: search_start
Title: Exclude from New Posts
Plugin PHP Code:
if ($_REQUEST['do'] == 'getnew' OR $_REQUEST['do'] == 'getdaily')
{
$_REQUEST['exclude'] .= ',xx';
}
Replace 'xx' to ID of forum.
Lynne
02-02-2009, 02:17 PM
Back on my 3.0 board, I created a profile field (fieldx) for the users and they could put in forumids they wanted excluded, ie. 3,4,7 - it had to be in that specific format (no spaces) and then I added a dropdown for New Posts with a new Your Search link that went to
search.php?$session[sessionurl]do=getnew&exclude=$bbuserinfo[fieldx]
(I think that's what I did - I don't use that anymore.)
maryx
02-02-2009, 03:06 PM
These are all great suggestions. I was able to make the changes the board needed. Thanks so much to all of you!
--------------- Added 1233618515 at 1233618515 ---------------
Now, a related question!
What code would give me, in a drop down box, a third selection of New Posts called Only Shopping. This New Posts choice would have posts only from one category of the forum - the Shopping category. The forum ID of this category is 27
Thanks for your help, all your suggestions were great and they worked!
--------------- Added 1233618552 at 1233618552 ---------------
Now, a related question!
What code would give me, in a drop down box, a third selection of New Posts called Only Shopping. This New Posts choice would have posts only from one category of the forum - the Shopping category. The forum ID of this category is 27
Thanks for your help, all your suggestions were great and they worked!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.