Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-01-2009, 09:10 PM
maryx maryx is offline
 
Join Date: Jan 2006
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 02-02-2009, 01:00 PM
glennybee glennybee is offline
 
Join Date: Feb 2008
Location: Scotland
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #3  
Old 02-02-2009, 01:03 PM
Max Kwiatkowski's Avatar
Max Kwiatkowski Max Kwiatkowski is offline
 
Join Date: Sep 2008
Location: Baltic Coast, PL
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 02-02-2009, 02:17 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.)
Reply With Quote
  #5  
Old 02-02-2009, 03:06 PM
maryx maryx is offline
 
Join Date: Jan 2006
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:25 AM.


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.04014 seconds
  • Memory Usage 2,205KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete