vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Opt-Out Forums from Get New/Get Daily (https://vborg.vbsupport.ru/showthread.php?t=91025)

Andreas 10-05-2005 08:38 PM

Yes.
register_addmember_process
PHP Code:

$userdata->set('excludeforumsgnp''X'); 


dieselpowered 10-05-2005 09:56 PM

Quote:

Originally Posted by KirbyDE
Yes.
register_addmember_process
PHP Code:

$userdata->set('excludeforumsgnp''X'); 


Oh crap, I thought that was the answer to my question...glad I checked the other page ;)

dsotmoon 10-05-2005 10:12 PM

Quote:

Originally Posted by KirbyDE
Yes.
register_addmember_process
PHP Code:

$userdata->set('excludeforumsgnp''X'); 


was this the answer to my question or offline?, just want to make sure :nervous: i just want to have one specific forum thats will not show up at all in new posts

dsotmoon 10-05-2005 10:28 PM

Quote:

Originally Posted by KirbyDE
Yes.
register_addmember_process
PHP Code:

$userdata->set('excludeforumsgnp''X'); 



also, is that a template or in the product or xml? i couldnt find a template with that name

Andreas 10-05-2005 10:31 PM

That was the answer for

Quote:

Originally Posted by offline
Nice work, works great on 3.50 gold. One quick question... Is there a way to set a new user to automatically have a specific forum turned off from the new posts search?


dsotmoon 10-05-2005 10:36 PM

Quote:

Originally Posted by KirbyDE
That was the answer for

oh, ok, anyway to set this so one specific forum will not show up for any user/usergroup, ie: test forum doesnt show up in new posts for anyone?

Andreas 10-05-2005 10:39 PM

Edit the Plugin and add the Forumid to the list.

dsotmoon 10-05-2005 10:52 PM

Quote:

Originally Posted by KirbyDE
Edit the Plugin and add the Forumid to the list.

i dont see a forum id list? which exact file? is there a string i can search for to find it? sorry to be a pain :ermm:

Andreas 10-05-2005 10:58 PM

*** Untested ***

To make this work with the welcome module of CMPS:

In welcomeblock.php
FIND
PHP Code:

$getnewposts $db->query_first("SELECT COUNT(*) AS count FROM " TABLE_PREFIX "post WHERE dateline >= " $vbulletin->userinfo['lastvisit']); 

REPLACE that with
PHP Code:

$getnewposts $db->query_first("
    SELECT COUNT(*) AS count FROM " 
TABLE_PREFIX "post AS post
    " 
iif($vbulletin->userinfo['excludeforumsgnp'], "LEFT JOIN " TABLE_PREFIX "thread AS thread ON (thread.threadid=post.threadid)") . "
    WHERE post.dateline >= " 
$vbulletin->userinfo['lastvisit'] . "
    " 
iif($vbulletin->userinfo['excludeforumsgnp'], "AND thread.forumid NOT IN (0," $vbulletin->userinfo['excludeforumsgnp'] . ")") . "
"
); 

(The query might need some optimization though)

Andreas 10-05-2005 11:00 PM

Quote:

Originally Posted by dsotmoon
i dont see a forum id list? which exact file? is there a string i can search for to find it? sorry to be a pain :ermm:

PHP Code:

$vbulletin->GPC['exclude'] .= ((!$vbulletin->GPC['exclude']) ? $vbulletin->userinfo['excludeforumsgnp'] : ',' $vbulletin->userinfo['excludeforumsgnp']); 

That's the line which (re)defines the comma-separated list of excluded forums - add your ID to it.

dsotmoon 10-05-2005 11:06 PM

Quote:

Originally Posted by KirbyDE

That's the line which (re)defines the comma-separated list of excluded forums - add your ID to it.

so it would look like this?

PHP Code:

 $vbulletin->GPC['exclude'] .= ((!$vbulletin->GPC['exclude']) ? $vbulletin->userinfo['excludeforumsgnp'] : '8,' $vbulletin->userinfo['excludeforumsgnp']); 

with the forum id being 8

Andreas 10-05-2005 11:19 PM

Not quite ;)

PHP Code:

$vbulletin->GPC['exclude'] .= ((!$vbulletin->GPC['exclude']) ? $vbulletin->userinfo['excludeforumsgnp'] : ',' $vbulletin->userinfo['excludeforumsgnp']) . ',8'


dsotmoon 10-05-2005 11:38 PM

Quote:

Originally Posted by KirbyDE
Not quite ;)

PHP Code:

$vbulletin->GPC['exclude'] .= ((!$vbulletin->GPC['exclude']) ? $vbulletin->userinfo['excludeforumsgnp'] : ',' $vbulletin->userinfo['excludeforumsgnp']) . ',8'



haha, i was almost close, thanks Kirby

dsotmoon 10-05-2005 11:57 PM

Quote:

Originally Posted by KirbyDE
Not quite ;)

PHP Code:

$vbulletin->GPC['exclude'] .= ((!$vbulletin->GPC['exclude']) ? $vbulletin->userinfo['excludeforumsgnp'] : ',' $vbulletin->userinfo['excludeforumsgnp']) . ',8'


actually i changed that code and it doesnt work, users can still see forumid8 ???

here is what it looks like to be sure

PHP Code:

// Rebuild Bitfields
require_once(DIR '/includes/class_bitfield_builder.php');
vB_Bitfield_Builder::save($db);
build_forum_permissions();]]></uninstallcode>
        </
code>
    </
codes>
    <
templates>
    </
templates>
    <
plugins>
        <
plugin active="1">
            <
title><![CDATA[Opt-Out Forums from "Get New Posts"]]></title>
            <
hookname>search_getnew_start</hookname>
            <
phpcode><![CDATA[if ($vbulletin->userinfo['excludeforumsgnp'])
{
    
$vbulletin->GPC['exclude'] .= ((!$vbulletin->GPC['exclude']) ? $vbulletin->userinfo['excludeforumsgnp'] : ',' $vbulletin->userinfo['excludeforumsgnp']) . ',8';  
}]]></
phpcode>
        </
plugin>
        <
plugin active="1">
            <
title><![CDATA[Opt-Out Forums from "Get New Posts"]]></title>
            <
hookname>profile_editoptions_start</hookname>
            <
phpcode><![CDATA[function fetch_optout_forumids_array($parentid = -1$depthmark '')



Andreas 10-06-2005 12:00 AM

Yeah, it only kicks in if the user has defined custom excludes as well.
If you want it to be always active, undo the edit and place

PHP Code:

$vbulletin->GPC['exclude'] .= ',8'

below the }

dsotmoon 10-06-2005 12:03 AM

Quote:

Originally Posted by KirbyDE
Yeah, it only kicks in if the user has defined custom excludes as well.
If you want it to be always active, undo the edit and place

PHP Code:

$vbulletin->GPC['exclude'] .= ',8'

below the }

like this

PHP Code:

{
    
$vbulletin->GPC['exclude'] .= ',8';
    
$vbulletin->GPC['exclude'] .= ((!$vbulletin->GPC['exclude']) ? $vbulletin->userinfo['excludeforumsgnp'] : ',' $vbulletin->userinfo['excludeforumsgnp']);  
}]]></
phpcode>
        </
plugin>
        <
plugin active="1">
            <
title><![CDATA[Opt-Out Forums from "Get New Posts"]]></title>
            <
hookname>profile_editoptions_start</hookname>
            <
phpcode><![CDATA[function fetch_optout_forumids_array($parentid = -1$depthmark '')



dsotmoon 10-06-2005 12:05 AM

or this

PHP Code:

{
    
$vbulletin->GPC['exclude'] .= ',8'; ((!$vbulletin->GPC['exclude']) ? $vbulletin->userinfo['excludeforumsgnp'] : ',' $vbulletin->userinfo['excludeforumsgnp']);  
}]]></
phpcode>
        </
plugin>
        <
plugin active="1">
            <
title><![CDATA[Opt-Out Forums from "Get New Posts"]]></title>
            <
hookname>profile_editoptions_start</hookname>
            <
phpcode><![CDATA[function fetch_optout_forumids_array($parentid = -1$depthmark '')



Andreas 10-06-2005 12:05 AM

I said below the }, not below the { ;)
Furthermore, why are you editing the XML?
This won't have any effect (at least as long as you don't reimport it)

dsotmoon 10-06-2005 12:16 AM

Quote:

Originally Posted by KirbyDE
I said below the }, not below the { ;)
Furthermore, why are you editing the XML?
This won't have any effect (at least as long as you don't reimport it)

because i am still learning plugins/products and I dont know where you want me to change this :nervous:

i am confused at which " } " to put it under? the XML?, edit product?

Andreas 10-06-2005 12:18 AM

ACP / Plugin System / Plugin Manager
Locate the Plugin on Hook search_getnew_start for this Hack, click edit.

dsotmoon 10-06-2005 12:25 AM

Quote:

Originally Posted by KirbyDE
ACP / Plugin System / Plugin Manager
Locate the Plugin on Hook search_getnew_start for this Hack, click edit.

sometimes i need a picture :D thanks again Kirby , got it now, worked perfect

offline 10-06-2005 03:03 AM

Quote:

Originally Posted by KirbyDE
Yes.
register_addmember_process
PHP Code:

$userdata->set('excludeforumsgnp''X'); 


Thanks! One more quick question, can the user turn the forum back on themselves?

Andreas 10-06-2005 08:35 AM

Yes they can.

offline 10-06-2005 12:53 PM

you are awesome! Thanks!

scottct1 10-07-2005 05:24 PM

Any chance you can update this hack so that when users turn off the forums they dont want from the new posts search the forums are also no longer displayed in forumhome and the quick jumps?

Andreas 10-07-2005 09:03 PM

No. This is not a feature I find useful therefore it will not make it into this Hack which is only meant for Get New Posts/Get Daily.
Sorry :)

Karri 10-07-2005 11:23 PM

Is it possible to add a check box next to the forum names instead of just highlighting the ones you do not want to appear? I have a ton of boards on my site and a few users are having trouble selecting the ones they want on and off with just highlight them. If they had a check box they wouldn't have to hold down shift or ctrl and could easily scroll through the list.

Thanks!!!

Andreas 10-07-2005 11:28 PM

The listbox works the same way the listbox for Search does, therefore i'll keep it this way.
Standardized Controls = more usability.

weaver 10-07-2005 11:40 PM

Quote:

Originally Posted by KirbyDE
Yes.
register_addmember_process
PHP Code:

$userdata->set('excludeforumsgnp''X'); 


Is that a template name? I don't see this.

ETA: I've tried choosing "None" but it's still excluding me from my RSS feed forum. There are new threads within that forum that should be showing up for me now.

dieselpowered 10-10-2005 08:47 PM

Quote:

Originally Posted by KirbyDE
*** Untested ***

To make this work with the welcome module of CMPS:

In welcomeblock.php
FIND
PHP Code:

$getnewposts $db->query_first("SELECT COUNT(*) AS count FROM " TABLE_PREFIX "post WHERE dateline >= " $vbulletin->userinfo['lastvisit']); 

REPLACE that with
PHP Code:

$getnewposts $db->query_first("
    SELECT COUNT(*) AS count FROM " 
TABLE_PREFIX "post
    LEFT JOIN " 
TABLE_PREFIX "thread AS thread ON (thread.threadid=post.threadid)
    WHERE post.dateline >= " 
$vbulletin->userinfo['lastvisit'] . "
        AND thread.forumid NOT IN (0," 
$vbulletin->userinfo['excludeforumsgnp'] . ")
"
); 

(The query might need some optimization though)

Ya that did not work my friend:

Quote:

Database error in vBulletin 3.5.0:

Invalid SQL:

SELECT COUNT(*) AS count FROM vb3_post
LEFT JOIN vb3_thread AS thread ON (thread.threadid=post.threadid)
WHERE post.dateline >= 1128974249
AND thread.forumid NOT IN (0,);

MySQL Error : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 4
Error Number : 1064
Date : Monday, October 10th 2005 @ 04:44:28 PM
Script : http://www.weapondepot.com/
Referrer :
IP Address : XXX.XX.XX.XX
Username : XXXXXXXX
Classname : vb_database

Andreas 10-10-2005 09:02 PM

Do you have any Forums excluded?

dieselpowered 10-10-2005 09:27 PM

Quote:

Originally Posted by KirbyDE
Do you have any Forums excluded?

No at this time I do not.

I was just about to go in and test it, however, I received that error...so I had to revert the file.

Andreas 10-10-2005 09:27 PM

That's the problem then - it only works if you have Forums excluded :)

dieselpowered 10-10-2005 09:31 PM

Quote:

Originally Posted by KirbyDE
That's the problem then - it only works if you have Forums excluded :)

So you are saying that any of my visitors who do not have any forums excluded will be unable to visit my site as they will receive that error.

Hmmm well that will not work.

See some people may want to see everything versus some may want to opt out...therefore, sounds like I will not be able to change the welcome module to only show the new posts from the forums they want to see.

Andreas 10-10-2005 09:36 PM

I've edited my post with the Code; the revised version should work no matter if Forums are excluded or not.

JulianD 10-10-2005 09:59 PM

GREEEEEEEEAT EXTENSION!!!!! My users were requesting this one a long time ago! Thank you so muuuuuuuuch!

dieselpowered 10-11-2005 03:52 PM

Quote:

Originally Posted by KirbyDE
I've edited my post with the Code; the revised version should work no matter if Forums are excluded or not.

Worked just fine my friend.

Now you indicated the code needed to be optimized, is that still the case?

Thank you sir!

Andreas 10-11-2005 04:01 PM

Still could need an optimization, but not sure - havn't looked at that.

dieselpowered 10-11-2005 04:02 PM

Quote:

Originally Posted by KirbyDE
Still could need an optimization, but not sure - havn't looked at that.

Not even sure what you mean by optimization, however, if you say it needs something I believe you. So is that something you were going to do, or do I need to find someone to do it?

Thanks again for all your help, that was very cool of you!

Andreas 10-11-2005 04:05 PM

i'll take a look at it ... when I am very bored :D
Anyway, even if it could be optimized it's not a big issue.


All times are GMT. The time now is 03:55 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.02778 seconds
  • Memory Usage 1,898KB
  • 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
  • (20)bbcode_php_printable
  • (21)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete