![]() |
|
#1
|
|||
|
|||
|
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 Last edited by Dragon_IBA; 05-19-2004 at 09:58 PM. |
|
#2
|
|||
|
|||
|
tnx for this
|
|
#3
|
|||
|
|||
|
thanks
|
|
#4
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
hows it work with a clean install though ? I'm assuming your talking about the warning if you uninstall vbadvanced 1.1?
|
|
#7
|
|||
|
|||
|
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
|
|||
|
|||
|
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:
PHP Code:
|
|
#9
|
|||
|
|||
|
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
|
|||
|
|||
|
Quote:
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. Last edited by -Chef-; 06-05-2004 at 03:24 AM. |
|
#11
|
|||
|
|||
|
*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. |
|
#12
|
|||
|
|||
|
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
|
|||
|
|||
|
Thanks for that Tom. Cheers!
Al |
|
#14
|
|||
|
|||
|
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
|
|||
|
|||
|
How do you make it pull events from say, the next 30 or 60 days?
|
|
#16
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
|
|
#19
|
|||
|
|||
|
I get this error
Code:
Parse error: parse error in /home/webcust/cwatson/watp/forums/modules/minicalendar.php on line 175 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&holidayid=$eventinfo[holidayid]\">" . $vbphrase['holiday_title_' . $eventinfo['varname']] . "</a>"; } else { $callink = "$vboptions[blockbullet] " . "<a href=\"$vboptions[bburl]/calendar.php?$session[sessionurl]do=getinfo&e=$eventinfo[eventid]&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&holidayid=$eventinfo[holidayid]\">" . $vbphrase['holiday_title_' . $eventinfo['varname']] . "</a>"; } else { $daysevents .= $comma . "<a href=\"$vboptions[bburl]/calendar.php?$session[sessionurl]do=getinfo&e=$eventinfo[eventid]&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
|
|||
|
|||
|
*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 | |
|
|