vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > vBa CMPS v1.x (Archive - Closed for Posting) > Add-On Modules & Modifications

 
 
Thread Tools Display Modes
  #1  
Old 05-16-2004, 11:47 AM
Dragon_IBA Dragon_IBA is offline
Junior Member
 
Join Date: Mar 2004
Posts: 23
Default ported the upcoming events hack

I take absolutely no credit for this hack. All credit goes to the original author Tom M. The original hack thread can be found here

I hope he will forgive me for beating him to this but i really needed to get this to work with the new CMPS.

Hopefully I did this well enough that you will not have problems with it, because i am by no means a php guru, so dont ask me for a bunch of support on this.

Dragon_IBA
Attached Files
File Type: txt ported upcoming events.txt (7.1 KB, 946 views)

Last edited by Dragon_IBA; 05-19-2004 at 09:58 PM.
  #2  
Old 05-16-2004, 04:05 PM
r00t3d r00t3d is offline
Junior Member
 
Join Date: Apr 2004
Posts: 19
Default Re: ported the upcoming events hack

tnx for this
  #3  
Old 05-18-2004, 06:30 PM
dafreak dafreak is offline
Junior Member
 
Join Date: Feb 2004
Posts: 4
Default Re: ported the upcoming events hack

thanks
  #4  
Old 05-18-2004, 08:42 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: ported the upcoming events hack

Thanks for doing this. I've been out of town for a few days and it will also be a while before I convert over to CMPS.
  #5  
Old 05-19-2004, 07:46 AM
Dragon_IBA Dragon_IBA is offline
Junior Member
 
Join Date: Mar 2004
Posts: 23
Default Re: ported the upcoming events hack

Ironic - I port it now i have troubles. Warning to all... as soon as I unistalled vbadvanced this stopped working. not sure why, I am still searching. Anyone else have this problem?
  #6  
Old 05-19-2004, 12:23 PM
PixelFX's Avatar
PixelFX PixelFX is offline
Senior Member
 
Join Date: Jan 2004
Posts: 187
Default Re: ported the upcoming events hack

hows it work with a clean install though ? I'm assuming your talking about the warning if you uninstall vbadvanced 1.1?
  #7  
Old 05-19-2004, 01:36 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: ported the upcoming events hack

It will still require the code changes to functions.php as well as the templates it relies on. My guess at the moment would be you lost the templates it uses.
  #8  
Old 05-19-2004, 10:02 PM
Dragon_IBA Dragon_IBA is offline
Junior Member
 
Join Date: Mar 2004
Posts: 23
Default Re: ported the upcoming events hack

Well after several hours of banging my head against the desk, I figured out. lol

Had to update the change of phrasing in the functions.php file to accomodate the new version.

I have updated the instructions file in the first post, but in a nut shell here it is:

in functions.php find:

PHP Code:
if (THIS_SCRIPT == 'online' OR THIS_SCRIPT == 'calendar' OR (THIS_SCRIPT == 'adv_index' AND $vboptions['showcalendar']) OR (THIS_SCRIPT == 'index' AND $vboptions['showevents'])) 
replace with:

PHP Code:
if (THIS_SCRIPT == 'online' OR THIS_SCRIPT == 'calendar' OR (THIS_SCRIPT == 'adv_index' AND $vboptions['showevents']) OR (THIS_SCRIPT == 'index' AND $vboptions['showevents'])) 
hope this helps others out too...
  #9  
Old 05-19-2004, 11:19 PM
allhandl allhandl is offline
Junior Member
 
Join Date: Mar 2004
Posts: 16
Default Re: ported the upcoming events hack

Anyone have an ideas how I can get the upcoming events into a module block so I can place it in the center column of vbacmps
?
  #10  
Old 06-05-2004, 02:28 AM
-Chef- -Chef- is offline
Junior Member
 
Join Date: Jun 2004
Posts: 11
Default Re: ported the upcoming events hack

Quote:
Originally Posted by allhandl
Anyone have an ideas how I can get the upcoming events into a module block so I can place it in the center column of vbacmps
?
This would be a helpful modification.

EDIT:
allhandl, this can be done pretty easily. You could just shift Mini Calendar over to the center but I needed the mini where it was on the home page but a center one on a new page.
Keep in mind I am a noob but this is how I got it to display.

1. Go to "Edit Modules" and click on the "Mini Calendar".
See all the settings. It might be easier to intead of clicking "Mini Calendar" to instead right click and select "Open in new window" and you can work off that.

2. Back in regular CP, now click "Add Module". Now duplicate everything that was in "Edit Mini Calendar" except Module Title: ( name the new module something like "Center Column Calendar") and make sure the column field is set to "Center" then save.

3. Now you will have that calendar and events available as a center module and when you activate it per page, you can just unselect the regular right side one so that you don't have two calendars.

Personally, I did this on a new page "events" (index.php?page=events) and disabled ALL the right side modules and it even spaned all the over and looks quite nice. (see attached) Hope this works out for you.
Attached Images
File Type: jpg cal-center.jpg (188.1 KB, 986 views)

Last edited by -Chef-; 06-05-2004 at 03:24 AM.
  #11  
Old 06-06-2004, 06:00 AM
bluesteel bluesteel is offline
Member
 
Join Date: Apr 2004
Posts: 41
Default Re: ported the upcoming events hack

*installed* thanks!

I have a minor problem, in that the events seem to show up in the order that they were entered, rather than by date (see attached, last event should be up the top)
Can anybody help with this?
Thanks.
Attached Images
File Type: jpg calendar.JPG (27.5 KB, 841 views)
  #12  
Old 06-09-2004, 11:39 AM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: ported the upcoming events hack

This is a "bug" in vBulletin that actually works as designed. You can get them to display in date order by changing your options on Forum Home Page Options -> Upcoming Event Type from "Group by Event" to "Group by Date".

When set to Group by Event the events display in the order they were entered (eventid) as opposed to being sorted by the event date - which make a whole lot more sense.
  #13  
Old 06-09-2004, 11:49 AM
bluesteel bluesteel is offline
Member
 
Join Date: Apr 2004
Posts: 41
Default Re: ported the upcoming events hack

Thanks for that Tom. Cheers!

Al
  #14  
Old 06-09-2004, 04:40 PM
Itworx4me Itworx4me is offline
Senior Member
 
Join Date: May 2004
Posts: 145
Default Re: ported the upcoming events hack

Having problems with this hack. Its not pulling the events or linking the calendar dates. Any idea's??? I have reinstalled this hack many times but it just doesn't seem to work right.
  #15  
Old 06-14-2004, 04:36 PM
RetroDreams RetroDreams is offline
Member
 
Join Date: Jun 2004
Posts: 91
Default Re: ported the upcoming events hack

How do you make it pull events from say, the next 30 or 60 days?
  #16  
Old 06-19-2004, 01:12 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: ported the upcoming events hack

You will need to change the number of days via the ACP at Forum Home Page Options -> Display Calendar Events. Simply set the value to the number of days of lookahead you wish displayed.
  #17  
Old 06-19-2004, 01:14 PM
Tom M Tom M is offline
Senior Member
 
Join Date: Jan 2004
Posts: 1,867
Default Re: ported the upcoming events hack

Did you make the modifications needed to the functions.php file? Do events listed on the regular calendar show up as links in the mini-calendar?
  #18  
Old 06-21-2004, 12:54 AM
RetroDreams RetroDreams is offline
Member
 
Join Date: Jun 2004
Posts: 91
Default Re: ported the upcoming events hack

Thanks! Works great!

Can see in action at http://www.ka-alumni.org
  #19  
Old 06-30-2004, 07:23 AM
Watson Watson is offline
Member
 
Join Date: Jun 2004
Posts: 46
Default Re: ported the upcoming events hack

I get this error

Code:
Parse error: parse error in /home/webcust/cwatson/watp/forums/modules/minicalendar.php on line 175
I take it I have added the code to my minicalender.php wrong, can anyone tell me whats up, here is the full code of the above mentioned file

Code:
<?php
// ++=========================================================================++
// || vBadvanced CMPS 1.0.0                                                   ||
// || © 2003-2004 vBadvanced.com & PlurPlanet, LLC - All Rights Reserved      ||
// || This file may not be redistributed in whole or significant part.        ||
// || http://vbadvanced.com                                                   ||
// ++ ========================================================================+
// ######################### Calendar #########################
if ($vba_options['portal_calendarid'])
{
	require_once('./includes/functions_calendar.php');

	if ($vba_options['portal_calendarid'] != -1)
	{
		$calendarinfo = verify_id('calendar', $vba_options['portal_calendarid'], 0, 1);
	}
	if ($bbuserinfo['startofweek'] > 7 OR $bbuserinfo['startofweek'] < 1)
	{
		$bbuserinfo['startofweek'] = $calendarinfo['startofweek'];
	}

	$today = getdate(TIMENOW - $vboptions['hourdiff']);
	$today['month'] = $vbphrase[strtolower($today['month'])];
	$year = $today['year'];
	$month = $today['mon'];

	$usertoday = array('firstday' => gmdate('w', gmmktime(0, 0, 0, $month, 1, $year)), 'month' => $month, 'year' => $year,);

	if ($calendarinfo)
	{
		$calendarinfo = array_merge($calendarinfo, convert_bits_to_array($calendarinfo['options'], $_CALENDAROPTIONS));
		$calendarinfo = array_merge($calendarinfo, convert_bits_to_array($calendarinfo['holidays'], $_CALENDARHOLIDAYS));

		$range = array();
	
		$range['frommonth'] = $month;
		$range['fromyear']= $year;
		$range['nextmonth'] = $month;
		$range['nextyear'] = $year;
	
		$eventcache = cache_events($range);
	}
	if ($vba_options['portal_calendarid'] == -1)
	{
		$calendarinfo['showweekends'] = 1;
	}

	$show['dontshowweek'] = true;

	$calendarbits = construct_calendar_output($today, $usertoday, $calendarinfo, 0, '');

	eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_calendar') . '";');

	unset($calendarinfo, $eventcache, $calendarbits, $usertoday, $range);
}

// ### TODAY'S EVENTS #################################################
if ($vboptions['showevents'])
{
	require_once('./includes/functions_calendar.php');

	$future = gmdate('n-j-Y' , TIMENOW + 43200 + (86400 * ($vboptions['showevents'] - 1)));
	$eventstore = unserialize($datastore['eventcache']);

	if (!is_array($eventstore) OR $future != $eventstore['date'])
	{
		// Need to update!
		require_once('./includes/functions_databuild.php');
		$eventstore = build_events();
		DEVDEBUG('Updated Events');
	}

	unset($eventstore['date']);
	$events = array();
	$eventcount = 0;
	foreach ($eventstore AS $eventid => $eventinfo)
	{
		$offset = iif (!$eventinfo['utc'], $bbuserinfo['tzoffset'], $bbuserinfo['timezoneoffset']);
		$eventinfo['dateline_from_user'] = $eventinfo['dateline_from'] + $offset * 3600;
		$eventinfo['dateline_to_user'] = $eventinfo['dateline_to'] + $offset * 3600;
		$gettime = TIMENOW - $vboptions['hourdiff'];
		$iterations = 0;

		if ($bbuserinfo['calendarpermissions']["$eventinfo[calendarid]"] & CANVIEWCALENDAR OR $eventinfo['holidayid'])
		{
			if ($eventinfo['userid'] == $bbuserinfo['userid'] OR $bbuserinfo['calendarpermissions']["$eventinfo[calendarid]"] & CANVIEWOTHERSEVENT OR $eventinfo['holidayid'])
			{
				while ($iterations < $vboptions['showevents'])
				{
					$todaydate = getdate($gettime);
					if (cache_event_info($eventinfo, $todaydate['mon'], $todaydate['mday'], $todaydate['year']))
					{
						if (!$vboptions['showeventtype'])
						{
							$events["$eventinfo[eventid]"][] = $gettime;
						}
						else
						{
							$events["$gettime"][] = $eventinfo['eventid'];
						}
						$eventcount++;
					}
					$iterations++;
					$gettime += 86400;
				}
			}
		}
	}

	if (!empty($events))
	{
		ksort($events, SORT_NUMERIC);
		foreach($events AS $index => $value)
		{
			$pastevent = 0;
			$pastcount = 0;
			unset($eventdates, $comma, $daysevents);
			if (!$vboptions['showeventtype'])
			{       // Group by Event // $index = $eventid
                                foreach($value AS $key => $dateline)
                                {
                                        if (!isset($comma))
                                        {
                                                $firstdate = $lastdate = $dateline;
                                        }
                                        else
                                        {
                                                $lastdate = $dateline;
                                        }
                                        $comma = ', ';
                                        $eventinfo = $eventstore["$index"];
                                }
                                $eventdates = vbdate($vboptions['dateformat'], $firstdate, false, true, false);
                                if ($firstdate <> $lastdate)
                                {
                                        $eventdates .= ' to ' . vbdate($vboptions['dateformat'], $lastdate, false, true, false);
                                }
                                if ($eventinfo['holidayid'])
                                {
                                        $callink = "$vboptions[blockbullet] " . "<a href=\"$vboptions[bburl]/calendar.php?$session[sessionurl]do=getinfo&amp;holidayid=$eventinfo[holidayid]\">" . $vbphrase['holiday_title_' . $eventinfo['varname']] . "</a>";
                                }
                                else
                                {
                                        $callink = "$vboptions[blockbullet] " . "<a href=\"$vboptions[bburl]/calendar.php?$session[sessionurl]do=getinfo&amp;e=$eventinfo[eventid]&amp;c=$eventinfo[calendarid]\">$eventinfo[title]</a>";
                                }
                        }
                        else
                        {       // Group by Date
                                $comma = "$vboptions[blockbullet] ";
                                $eventdate = vbdate($vboptions['dateformat'], $index, false, true, false);
                                foreach($value AS $key => $eventid)
                                {
                                        $eventinfo = $eventstore["$eventid"];
                                        if ($eventinfo['holidayid'])
                                        {
                                                $daysevents .= $comma . "<a href=\"$vboptions[bburl]/calendar.php?$session[sessionurl]do=getinfo&amp;holidayid=$eventinfo[holidayid]\">" . $vbphrase['holiday_title_' . $eventinfo['varname']] . "</a>";
                                        }
                                        else
                                        {
                                                $daysevents .= $comma . "<a href=\"$vboptions[bburl]/calendar.php?$session[sessionurl]do=getinfo&amp;e=$eventinfo[eventid]&amp;c=$eventinfo[calendarid]\">$eventinfo[title]</a>";
                                        }
                                        $comma = "<br>$vboptions[blockbullet] ";
                                }
                        }
                        eval('$eventstoday .= "' . fetch_template('adv_calendar_todaysevents') . '";');
		}
		// memory saving
		unset($events, $eventstore);
	}
	else
        {
                $eventstoday .= "<tr><td class=\"alt2\" colspan=\"7\" align=\"center\"><span class=\"smallfont\">No events scheduled in<br>the next $vboptions[showevents] days.</span></td></tr>";
        }
}
Just above this line:

eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_calendar') . '";');
?>
  #20  
Old 07-02-2004, 08:52 AM
Watson Watson is offline
Member
 
Join Date: Jun 2004
Posts: 46
Default Re: ported the upcoming events hack

*bump

Still looking for help on this anyone please
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 -4. The time now is 08:05 AM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.