Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Hidden Invite Only Social Groups Details »»
Hidden Invite Only Social Groups
Version: 1.02, by XiZa XiZa is offline
Developer Last Online: Nov 2008 Show Printable Version Email this Page

Category: Social Group and Album Enhancements - Version: 3.7.2 Rating:
Released: 07-07-2008 Last Update: 07-07-2008 Installs: 15
Code Changes  
No support by the author.

Hello,

I've made a code modification to hide invite only social groups from the group.php page (including search). If you are an admin, you will still see those groups listed even if you are not a member of them.

Anyway so this hack does the following:

- Removes all invite only social groups from the group list page.
- Shows an error when you try to access the group by URL if you're not a member or not invited.
Same for picture page, etc.

I just made this today and it seems like it works, but please for now test it locally first!


I didn't make a plugin since there don't seem to be hooks in the locations that I need.

Instructions:

Download the new group.php and replace your old one. Alternatively, find all the sections labeled //WESLEY mod and do the replacements manually.

UPDATE:

I also added two other replacement files, you can either just download them or follow along here to do the updates yourself..

To also remove the invitation only social groups from the list on the profile page, open includes/class_profileblock.php and go to line 1130 or so.

Remove this:

PHP Code:

/*
            $socialgroups = $this->registry->db->query_read_slave("
                SELECT socialgroup.*
                FROM " . TABLE_PREFIX . "socialgroupmember AS socialgroupmember
                INNER JOIN " . TABLE_PREFIX . "socialgroup AS socialgroup ON
                    (socialgroup.groupid = socialgroupmember.groupid)
                WHERE
                    socialgroupmember.userid = " . $this->profile->userinfo['userid'] . "
                    AND socialgroupmember.type = 'member'
                ORDER BY socialgroup.name
            ");

*/
//REMOVED BY WESLEY 
Replace by this

PHP Code:
//changed by wesley
            
$sql =     "SELECT socialgroup.*
                FROM " 
TABLE_PREFIX "socialgroupmember AS socialgroupmember
                INNER JOIN " 
TABLE_PREFIX "socialgroup AS socialgroup ON
                    (socialgroup.groupid = socialgroupmember.groupid)
                WHERE
                    socialgroupmember.userid = " 
$this->profile->userinfo['userid'] . "
                    AND socialgroupmember.type = 'member' " 

                (!
can_moderate(0'caneditsocialgroups') ? " AND socialgroup.type != 'inviteonly'" "") . "
                ORDER BY socialgroup.name"
;
            
            
$socialgroups $this->registry->db->query_read_slave($sql);

//changed by wesley 
Lastly, if you do not want to show a link to the social group from the last activity bit ("Viewing social group: link") open includes/functions_online.php

Go to line 2182

Change

PHP Code:
            WHERE groupid IN (0$socialgroupids
to

PHP Code:
            WHERE groupid IN (0$socialgroupids) AND type != 'inviteonly' 
If the group is invite only it will now just display "Viewing social group".

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 12-08-2008, 06:35 AM
JamesAB JamesAB is offline
 
Join Date: Dec 2003
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I believe it's still not possible to hide invite only groups in vbulletin 3.8.0 RC1

Anyone else working on this?

This line should not use TABLE_PREFIX, instead try this:

PHP Code:
$socialgroupsearch->generator->where['type'] = "socialgroup.type != 'inviteonly'"
Thanks,
James
Reply With Quote
  #13  
Old 01-05-2009, 12:00 PM
PtitLu's Avatar
PtitLu PtitLu is offline
 
Join Date: Feb 2007
Location: France
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by JamesAB View Post
This line should not use TABLE_PREFIX, instead try this:
Works perfectly on 3.7.4 without TABLE_PREFIX. Thanks.
Reply With Quote
  #14  
Old 01-06-2009, 08:30 AM
PtitLu's Avatar
PtitLu PtitLu is offline
 
Join Date: Feb 2007
Location: France
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

With your mod installed it is no longer possible to view the date/hour of the last post in the group you belong to. Would it be possible to display this (only hour or hour and name of the poster) ?
Thanks.
Reply With Quote
  #15  
Old 04-06-2009, 07:32 PM
donnyaz's Avatar
donnyaz donnyaz is offline
 
Join Date: Aug 2006
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Shoot you have a great idea but I am scared so scared.
Reply With Quote
  #16  
Old 05-17-2011, 08:29 PM
grey_goose grey_goose is offline
 
Join Date: Jun 2009
Posts: 284
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Seems to work fine with the groups.php and modifying functions_online.php. I get an error with the class_profileblock.php.

Using 3.8.6; would like to see this updated.

EDIT:

Ooops, doesn't work. Get an error on a new group creation:
A required field called socialgroupcategoryid is missing or has an invalid value.
(Category dropdown is non-functional)
Reply With Quote
  #17  
Old 05-17-2011, 08:54 PM
grey_goose grey_goose is offline
 
Join Date: Jun 2009
Posts: 284
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Found another one:

PHP Code:
//wesley MOD
// If a group id is specified, but the group doesn't exist, error out
if ($vbulletin->GPC['groupid'])
{
    
$group fetch_socialgroupinfo($vbulletin->GPC['groupid']);

    if (empty(
$group)) {
        
standard_error(fetch_error('invalidid'$vbphrase['social_group'], $vbulletin->options['contactuslink']));
    }
    else if (
$group['type'] == 'inviteonly' && $group['membertype'] != 'member' AND $group['membertype'] != 'invited' && !can_moderate(0'caneditsocialgroups'))
    {
        
print_no_permissions();
    }
}
//WESLEY MOD 
The last line should be:

print_no_permission();

Note that the 's' is removed from permission. I guess this is a 3.8 change?
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 04:28 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04279 seconds
  • Memory Usage 2,293KB
  • Queries Executed 23 (?)
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
  • (6)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)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_postinfo_query
  • fetch_postinfo
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete