Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
Social Group Calendars Details »»
Social Group Calendars
Version: 2.0, by Farcaster Farcaster is offline
Developer Last Online: Jun 2014 Show Printable Version Email this Page

Category: Social Group and Album Enhancements - Version: 4.0.x Rating:
Released: 03-06-2010 Last Update: Never Installs: 53
DB Changes Uses Plugins Template Edits
Code Changes Is in Beta Stage  
No support by the author.

In short, this modification will allow social groups on your forum have their own calendar area and have upcoming events shown on their group page. Here is a list of features:
  1. Upcoming events for a group are shown on the group's page, grouped by day.
  2. The group's next event is shown in more detail and can be configured to show the entire event description or be trimmed to a certain number of characters.
  3. Members can see events for all the social groups they belong to consolidated into one calendar.
  4. The forum home index page can be setup to show upcoming events for social groups.
  5. Non-members can see upcoming events for a public group by viewing the group's page if the group doesn't require joining to view content. They will not see events for these groups in the calendar view or on the forum homepage, which will help keep the clutter down.
  6. Group's that are moderated, invite only, or must join to view content, will not display their upcoming events to non-members. Their events are also secured, so following a link to an event by a non-member will result in a no permissions error.
  7. Group owners can optionally allow members to be able to post events, or they can set their group up so that only they can post events.
  8. When clicking on the New Event link from the group's page, the event will automatically be assigned to the referring group.
  9. When creating a new event from the calendar view, the creator can assign the event to any group he has permissions to post events. These events will appear in a drop down box on the event.
  10. Admins and moderators can be set to be excluded from all filtering and permissions. This allows the administrator an unfiltered view of the social group calendar, and the ability to move or edit group's events as needed.
  11. Plays nice with Farcaster's Event Attendance v3.0 (RSVP mod).
Installation Instructions (Remember to Mark Installed)
Follow the installation instructions available here: https://vborg.vbsupport.ru/showthread.php?p=1999324

Revision Log
  • 0.1.0 BETA - 01/28/09 - Initial Version
  • 1.0.0 - 04/05/09 - Bug Fixes and Release
  • 2.0 - 03/07/10 - Updated to work with vb4.
Known Issues
None at this time.

Download Now

File Type: xml product-rah_socialgroup_calendars.xml (33.8 KB, 278 views)

Screenshots

File Type: jpg sgc.jpg (28.9 KB, 0 views)

Show Your Support

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

Comments
  #2  
Old 03-07-2010, 07:20 PM
Farcaster Farcaster is offline
 
Join Date: Dec 2005
Posts: 386
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Unfortunately, vBulletin lacks some hooks in key places for events, such as hooks to the event SQL statements. This means that there are a number of file edits needed for this modification. Sorry for that, but I hope it will be worth it! Enjoy!

Step One ? Backup Your Database and vBulletin Files!
This really needs to be said, especially since this version is in BETA. Loss of data/time/business is not the responsibility of the developer. Use at your own risk.

Step Two ? Import the Product File
In the Admin CP, import rah_socialgroup_calendars.xml.

Step Three ? Edit vBulletin File: includes/functions_calendar.php
Note: If you do not want to have Social Group Events show up in the upcoming events section on your forum homepage, then you only need do steps 1 through 7 in this section.

1. Find the first instance of (in function cache_events, near the beginning of the file):

PHP Code:
    $events $vbulletin->db->query_read_slave("
        SELECT event.*, 
2. Above that add:

PHP Code:
// Social Group Calendar **************************************************
 
    // Exempt administrators and other designated groups.
    
$exemptgroups explode(',',str_replace(' ','',$vbulletin->options['rah_socialcal_admins'])); 
 
    if (
is_member_of($vbulletin->userinfo,$exemptgroups)) {
        
$exemptsql " OR 1=1 ";
    }    
    if (
$vbulletin->userinfo['userid']) {
        
$eventjoin "     LEFT JOIN ".TABLE_PREFIX."socialgroupmember sgm ON sgm.userid = 0".$vbulletin->userinfo['userid']." AND sgm.groupid = event.socialgroupcalendar 
                        LEFT JOIN (SELECT groupid, name FROM "
.TABLE_PREFIX."socialgroup) sg ON sg.groupid = event.socialgroupcalendar";
        
$eventwhere " AND (event.socialgroupcalendar = 0 OR sgm.groupid IS NOT NULL $exemptsql) ";
        
$eventselect " sg.name as socialgroupname, ";
    }
 
    
// Social Group Calendar END *********************************************** 
3. Scroll back down and after the comma in ?SELECT event.*,? add:

PHP Code:
$eventselect 
4. Scroll down about five lines to find:
PHP Code:
        LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid event.userid
5. Below that add:
PHP Code:
$eventjoin 
6. Scroll down about four lines to find:
PHP Code:
            visible 
7. Below that add:
PHP Code:
$eventwhere 
8. Find the following (in function build_events, near the end of the file):

PHP Code:
    $events $vbulletin->db->query_read_slave("
        SELECT eventid, userid, event.title, recurring, recuroption, dateline_from, dateline_to, event.calendarid, IF (dateline_to = 0, 1, 0) AS singleday, customfields,
            dateline_from AS dateline_from_user, dateline_to AS dateline_to_user, utc, dst 
9. Above that add:
PHP Code:
    // Social Group Calendar **************************************************
    
$eventjoin "     LEFT JOIN (SELECT groupid, name FROM ".TABLE_PREFIX."socialgroup) sg ON sg.groupid = event.socialgroupcalendar ";
    
$eventselect ", event.socialgroupcalendar, sg.name as socialgroupname ";
    
// Social Group Calendar END *********************************************** 
10. After ?dateline_to AS dateline_to_user, utc, dst?, add:
PHP Code:
$eventselect 
11. Scroll down about two lines and find:
PHP Code:
        INNER JOIN " . TABLE_PREFIX . "calendar AS calendar USING (calendarid
12. Below that add:
PHP Code:
$eventjoin 
Step Four ? Edit vBulletin File: forum.php
Note: If you do not want to have Social Group Events show up in the upcoming events section on your forum homepage, you can skip this section entirely. Keep in mind though that if you do have your calendar options set to show events from the calendar that social group events will be posted to, the list will not be filtered and everyone will see them.

1. Find the following:
PHP Code:
// ### TODAY'S EVENTS #################################################
if ($vbulletin->options['showevents'])

2. Below that add:
PHP Code:
// Social Group Calendar **************************************************
// Get Social Group Memberships    
$usersocialgroups = array();    
if (
$vbulletin->userinfo['userid']) {
 
    
$getsocialgroups $vbulletin->db->query_read_slave("
    SELECT groupid 
    FROM "
.TABLE_PREFIX."socialgroupmember sgm 
    WHERE sgm.userid = "
.intval($vbulletin->userinfo['userid']));
 
    while (
$group $vbulletin->db->fetch_array($getsocialgroups)) {
        
$usersocialgroups[]=$group['groupid'];
 
    }        
}
 
// Exempt administrators and other designated groups.
$exemptgroups explode(',',str_replace(' ','',$vbulletin->options['rah_socialcal_admins']));     
 
if (
is_member_of($vbulletin->userinfo,$exemptgroups)) {
    
$exempt true;
}
// Social Group Calendar END *********************************************** 
3. Find the following:
PHP Code:
        {
            
$sub $eventinfo['dateline_from_user'] - (86400 * (intval($eventinfo['dateline_from_user'] / 86400)));
        } 
4. Below that add:
PHP Code:
        // Social Group Calendar **********************************************
        
$filterevent false;
        if (
$eventinfo['socialgroupcalendar'] AND !in_array($eventinfo['socialgroupcalendar'],$usersocialgroups)) {
            
// This is a social group event, and this is not a member.  Suppress the event
            
$filterevent true;
        }
 
        
// Add exception for admins and other designated groups.
        
if ($exempt) {
            
$filterevent false;
        }
 
        
// Add social group name to event title.
        
if ($eventinfo['socialgroupcalendar']) {
            
$eventstore[$eventinfo[eventid]]['title'] = "<font style=\"font-weight:bold\">[$eventinfo[socialgroupname]]</font> $eventinfo[title]";
        }        
        
// Social Group Calendar END ******************************************* 
5. Immediately below the code you just entered, find:
PHP Code:
        if ($vbulletin->userinfo['calendarpermissions']["$eventinfo[calendarid]"] & $vbulletin->bf_ugp_calendarpermissions['canviewcalendar'] OR ($eventinfo['holidayid'] AND $vbulletin->options['showholidays']))
        { 
6. Replace with:
PHP Code:
        // Edited from original for Social Group Calendar
        
if (!$filterevent AND $vbulletin->userinfo['calendarpermissions']["$eventinfo[calendarid]"] & $vbulletin->bf_ugp_calendarpermissions['canviewcalendar'] OR ($eventinfo['holidayid'] AND $vbulletin->options['showholidays']))
        { 
Step Five ? Upload Files
Upload the modified files to the appropriate directory in your forum.

Step Six ? Edit Template: socialgroups_form
1. Find the following:
HTML Code:
					<vb:if condition="$show['enable_group_messages']">
					<li>
						<label for="enable_group_messages">
						<input type="checkbox" name="options[enable_group_messages]" id="enable_group_messages" value="1" {vb:raw checked.enable_group_messages} tabindex="1" />
						{vb:rawphrase enable_messages}
						</label>
					</li>
					</vb:if>
2. Below that add:
HTML Code:
					<li>
						<label for="member_entered_events">
						<input type="checkbox" name="member_entered_events" id="member_entered_events" value="1" {vb:raw checked.member_entered_events} /> 
						{vb:rawphrase member_entered_events}
						</label>
					</li>
Step Seven ? Edit Template: socialgroups_group

Note: You can adjust the placement of the event block to your liking by changing the positioning in the socialgroups_group template.
1. Find the following:
HTML Code:
</vb:if><vb:comment>$show['groupinfo']</vb:comment>
2. Above that add:
HTML Code:
<br/>{vb:raw socialgroups_events}<br/>

Step Eight ? Edit Template: calendar_edit
1. Find the following:
HTML Code:
		<h2 class="blockhead">{vb:raw pagetitle}</h2>
		<div class="blockbody formcontrols">{
2. Below that add:
HTML Code:
{vb:raw socialgroup_dropdown}

Step Nine? Configuration
In the Admin CP, go into vBulletin Options -> Social Group Calendar. Set the options as desired. The product will not start working until a calendar ID is entered in this section. Make sure to configure the calendar selected to allow members to post events.
Reply With Quote
  #3  
Old 03-07-2010, 08:34 PM
cindy helmond cindy helmond is offline
 
Join Date: Feb 2006
Location: The Netherlands
Posts: 334
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow thx we needed this for the normal calender !!
Can you fix that ?
Reply With Quote
  #4  
Old 03-08-2010, 02:29 AM
Farcaster Farcaster is offline
 
Join Date: Dec 2005
Posts: 386
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cindy helmond View Post
wow thx we needed this for the normal calender !!
Can you fix that ?
Cindy, what do you mean? What this mod does is provide a cross over from the calendar into social groups.
Reply With Quote
  #5  
Old 03-08-2010, 08:36 AM
cindy helmond cindy helmond is offline
 
Join Date: Feb 2006
Location: The Netherlands
Posts: 334
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Farcaster View Post
Cindy, what do you mean? What this mod does is provide a cross over from the calendar into social groups.
o ok i mean if i dont have an social group i can use this for my default calendar ?
thx
Reply With Quote
  #6  
Old 03-08-2010, 03:13 PM
Farcaster Farcaster is offline
 
Join Date: Dec 2005
Posts: 386
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cindy,

This doesn't add any functionality to the calendar other than the tie in with social groups, so no, if your site doesn't use social groups, this mod will not do anything for you.
Reply With Quote
  #7  
Old 03-11-2010, 03:41 AM
DivineMessenger DivineMessenger is offline
 
Join Date: Feb 2008
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This hack doesn't show events on the main calendar unless the member is in the group in which the event is for, correct? Is there a way to make it so everyone can see the event regardless of if they are in the group or not on the main calendar?
Reply With Quote
  #8  
Old 03-14-2010, 02:55 AM
Farcaster Farcaster is offline
 
Join Date: Dec 2005
Posts: 386
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DivineMessenger View Post
Is there a way to make it so everyone can see the event regardless of if they are in the group or not on the main calendar?
It is possible, but it isn't a feature of the modification at this point.
Reply With Quote
  #9  
Old 03-20-2010, 04:27 AM
ScottiG ScottiG is offline
 
Join Date: Jan 2008
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Will this work with vb 3.8.4? Or do you have a version that does? I have installed your RSVP system on 3.8.4 and it works well, but I am hoping to add calendar functionality to social groups AND the RSVP system, THAT would work VERY well on our forum!
Reply With Quote
  #10  
Old 03-26-2010, 04:41 PM
alessai alessai is offline
 
Join Date: Feb 2006
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed,
Reply With Quote
Reply

Thread Tools

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:03 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.04544 seconds
  • Memory Usage 2,405KB
  • Queries Executed 26 (?)
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_html
  • (18)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete