vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Exclude forum from New Posts (https://vborg.vbsupport.ru/showthread.php?t=203869)

maryx 02-01-2009 09:10 PM

Exclude forum from New Posts
 
Thanks to the excellent suggestion from KW802 of making a plugin in this thread 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:

Code:

<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:
Code:

<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:

Code:

<!-- NAVBAR POPUP MENUS -->
Add below:

Code:

        <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&amp;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:
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&amp;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 [DATE]1233618515[/DATE] at [TIME]1233618515[/TIME] ---------------

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 [DATE]1233618552[/DATE] at [TIME]1233618552[/TIME] ---------------

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!


All times are GMT. The time now is 01:19 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01104 seconds
  • Memory Usage 1,730KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete