vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Preventing RSS From Being Disabled When View Forum Set to No (https://vborg.vbsupport.ru/showthread.php?t=255363)

btlewand 12-16-2010 10:26 PM

Preventing RSS From Being Disabled When View Forum Set to No
 
In vBulletin when you set permissions to view a forum to "NO" the program is also configured to disable the RSS feed in that forum and any child forums. While I want to prevent any unregistered users from entering the forum, I would still like to be able to have RSS feeds enabled (or at least for the child forums) so the feeds can be streamed back via RSS to a LinkedIn group.

I was told by support at vBulletin that keeping the RSS feeds enabled can be done via the external.php file but do not know what to edit in the file. Seems like an easy edit of changing code from no to yes but just need to be pointed in the right direction.

I've tried to use the Advanced Permissions Based On Post Count hack posted on vBulletin.org but am not able to get it to fully work on vB 4.08. If there is any easier fix, I'm open to hearing what it is.

Lynne 12-17-2010 03:40 AM

On my 3.8 forum, I have a couple of forums I have closed off to unregistered users (spiders basically), but I did want my users to be able to have access to the rss feed. So, I modified these lines which look the same in 4.x. You can try it and see.

Find:
PHP Code:

    foreach ($forumids AS $forumid)
    {
        
$forumid intval($forumid);
        
$forumperms =& $vbulletin->userinfo['forumpermissions']["$forumid"];

        if (isset(
$vbulletin->forumcache["$forumid"])
            AND (
$forumperms $vbulletin->bf_ugp_forumpermissions['canview'])
            AND (
$forumperms $vbulletin->bf_ugp_forumpermissions['canviewothers'])
            AND ((
$forumperms $vbulletin->bf_ugp_forumpermissions['canviewthreads']) OR in_array($vbulletin->GPC['type'], array('JS''XML'))) // JS/XML only shows titles
            
AND verify_forum_password($forumid$vbulletin->forumcache["$forumid"]['password'], false)
        )
        {
            
$forumchoice[] = $forumid;
        }
    } 

Change to:
PHP Code:

    foreach ($forumids AS $forumid)
    {
        
$forumid intval($forumid);
        
$forumperms =& $vbulletin->userinfo['forumpermissions']["$forumid"];

        if (
$forumid != 'x') {
        if (isset(
$vbulletin->forumcache["$forumid"])
            AND (
$forumperms $vbulletin->bf_ugp_forumpermissions['canview'])
            AND (
$forumperms $vbulletin->bf_ugp_forumpermissions['canviewothers'])
            AND ((
$forumperms $vbulletin->bf_ugp_forumpermissions['canviewthreads']) OR in_array($vbulletin->GPC['type'], array('JS''XML'))) // JS/XML only shows titles
            
AND verify_forum_password($forumid$vbulletin->forumcache["$forumid"]['password'], false)
        )
            {
                
$forumchoice[] = $forumid;
            }
        }
        if (
$forumid == 'x'
        {
        if (isset(
$vbulletin->forumcache["$forumid"]))
            {
                
$forumchoice[] = $forumid;
            }
        }
    } 

Change X to your forumid (in a couple of places). Try it and see if it's what you want. Remember that this will NOT check permissions for users in those forums, so anything that is posted is now viewable.

btlewand 12-17-2010 05:24 AM

Thanks for giving me these edits. However, I tried with just a single forum id in the two places where you would replace the 'x' and it didn't prevent me from entering the forum as an unregistered user.

I do want to mention two hacks that are on vBulletin.org which I tried and had a very unusual situation. Both hacks allow you to enter a forum based on a number of posts (so I can set the post to '1' and as long as all registered users have '1' post they can enter and the RSS feed issue is not affected. These are the two mods (I tried each individually):

https://vborg.vbsupport.ru/showthread.php?t=233979 and
https://vborg.vbsupport.ru/showthread.php?t=249977

One forum I have set up worked using either one of the above hacks separately, but I haven't been able to get a second forum on my site to work. I checked/compared the working forum with another forum set up and the configuration was the same. Then, thinking that there was something in the saved working forum template that I couldn't see, I copied the working forum and created a new forum presuming the entire configuration would copy over. That didn't work either. So both of the above hacks work but on just one forum and copying the working forum to create another did not work. Also tried disabling other plugins without success but didn't think plugins were an issue anyway since one forum was not allowing access to the unregistered usergroup and working as expected. So now I''m completely perplexed trying to troubleshoot this issue.

Lynne 12-17-2010 03:38 PM

Quote:

Originally Posted by btlewand (Post 2135221)
Thanks for giving me these edits. However, I tried with just a single forum id in the two places where you would replace the 'x' and it didn't prevent me from entering the forum as an unregistered user.

All those edits do is allow unregistered users to see the rss feed for a forum that you have set to not allowed unregistered users to see. That is what you said you wanted - no? These edits are in the external.php page which is your rss feed. It does absolutely nothing to the forums.

"While I want to prevent any unregistered users from entering the forum, I would still like to be able to have RSS feeds enabled (or at least for the child forums) so the feeds can be streamed back via RSS to a LinkedIn group."


All times are GMT. The time now is 10:24 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.01488 seconds
  • Memory Usage 1,750KB
  • 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
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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