PDA


View Full Version : ported the upcoming events hack


Pages : 1 2 [3] 4 5

Tom M
01-30-2005, 12:46 PM
Do you have a link? Without seeing what you mean I would guess that you have an error in your template.

DaveSki
01-30-2005, 09:07 PM
Ok I fixed it, I had a duplicate minimap module and it appears that the Upcoming events pulled from both calendar modules. I my idea didn't work.

So now my question is: Is it possible to make a Upcoming event's module that will pull info from only one calendar. I would like to set up calendars for different groups and have separate Upcoming events modules for each module.

oldfan
02-04-2005, 02:26 PM
it works fine on 3.06
http://members.metallifukinca.com/portal.php
I'm still looking to add birthdays :)

IUPFA
02-05-2005, 02:44 AM
Nice addon, installed without problems
without functions modifications :)

Thx a lot

trulylowcarb
02-11-2005, 02:53 PM
wondering how this works with the newest versions, VB3.06 and CMPS1.01 - anyone know?

KW802
02-11-2005, 03:09 PM
wondering how this works with the newest versions, VB3.06 and CMPS1.01 - anyone know?Should work fine.

trulylowcarb
02-11-2005, 03:19 PM
And it does! Yippe! This forum is great and Kevin, THANK YOU. You have no idea (I hope) just how much time I have spent reading here and the stuff you have shared has been most helpful - bless you!!

As for this mod, it is great. I do wish today's birthdays could be included there, instead of under stats.

Tom M
02-11-2005, 09:42 PM
Here's how to have both birthdays and events under the calendar.

In minicalendar.php find
$calendarbits = construct_calendar_output($today, $usertoday, $calendarinfo, 0, '');
Add below that
// ### TODAY'S BIRTHDAYS #################################################
if ($vboptions['showbirthdays'])
{
$today = vbdate('Y-m-d', TIMENOW, false, false);

$birthdaystore = unserialize($datastore['birthdaycache']);
if (!is_array($birthdaystore) OR ($today != $birthdaystore['day1'] AND $today != $birthdaystore['day2']))
{
// Need to update!
require_once('./includes/functions_databuild.php');
$birthdaystore = build_birthdays();
}
switch($today)
{
case $birthdaystore['day1']:
$birthdays = $birthdaystore['users1'];
break;

case $birthdaystore['day2'];
$birthdays = $birthdaystore['users2'];
break;
}
// memory saving
unset($birthdaystore);

$birthdays = str_replace( "member.php", "$vboptions[bburl]/member.php", $birthdays);
$birthdays = ereg_replace( " \([0-9]{1,2}\)", "", $birthdays); // strip the ' (age)' portion

$show['birthdays'] = iif ($birthdays, true, false);
}
else
{
$show['birthdays'] = false;
}

// ### 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();
}

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;
}
}
}
}

$eventstoday = "";
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 = "$vba_options[portal_blockbullet] " . "<a href=\"$vboptions[bburl]/calendar.php?$session[sessionurl]do=getinfo&amp;holidayid=$eventinfo[holidayid]\">" . $vbphrase['holiday_title_' . $eventinfo['varname']] . "</a>";
}
else
{
$callink = "$vba_options[portal_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 = "$vba_options[portal_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 />$vba_options[portal_blockbullet] ";
}
}
eval('$eventstoday .= "' . fetch_template('adv_portal_todaysevents') . '";');
}
// memory saving
unset($events, $eventstore);
}
}
Replace the adv_portal_calendar template with
<!-- Mini Calendar -->

<table align="center" border="0" cellpadding="4" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">

$calendarbits

<if condition="$vboptions['showbirthdays'] AND $birthdays">
<tr><td class="thead" colspan="7" align="center"><span class="smallfont"><strong>Today's Birthdays</strong></span></td></tr>
<tr><td class="alt1" colspan="7">
$birthdays
</td></tr>
</if>

<if condition="$vboptions['showevents'] AND $eventstoday">
<tr><td class="thead" colspan="7" align="center"><span class="smallfont"><strong>Upcoming Events</strong></span></td></tr>
$eventstoday
</if>

</table>

<br />

<!-- End Mini Calendar -->

Enjoy :D

trulylowcarb
02-11-2005, 10:12 PM
YOU ARE A PRINCE!

*dancing around because I am so happy to be almost ready to stop dinking with things*

oldfan
02-12-2005, 01:45 PM
the birthdays work, but now the upcoming events are gone :(

Here's how to have both birthdays and events under the calendar.

In minicalendar.php find
$calendarbits = construct_calendar_output($today, $usertoday, $calendarinfo, 0, '');
Add below that
// ### TODAY'S BIRTHDAYS #################################################
if ($vboptions['showbirthdays'])
{
$today = vbdate('Y-m-d', TIMENOW, false, false);

$birthdaystore = unserialize($datastore['birthdaycache']);
if (!is_array($birthdaystore) OR ($today != $birthdaystore['day1'] AND $today != $birthdaystore['day2']))
{
// Need to update!
require_once('./includes/functions_databuild.php');
$birthdaystore = build_birthdays();
}
switch($today)
{
case $birthdaystore['day1']:
$birthdays = $birthdaystore['users1'];
break;

case $birthdaystore['day2'];
$birthdays = $birthdaystore['users2'];
break;
}
// memory saving
unset($birthdaystore);

$birthdays = str_replace( "member.php", "$vboptions[bburl]/member.php", $birthdays);
$birthdays = ereg_replace( " \([0-9]{1,2}\)", "", $birthdays); // strip the ' (age)' portion

$show['birthdays'] = iif ($birthdays, true, false);
}
else
{
$show['birthdays'] = false;
}

// ### 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();
}

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;
}
}
}
}

$eventstoday = "";
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 = "$vba_options[portal_blockbullet] " . "<a href=\"$vboptions[bburl]/calendar.php?$session[sessionurl]do=getinfo&amp;holidayid=$eventinfo[holidayid]\">" . $vbphrase['holiday_title_' . $eventinfo['varname']] . "</a>";
}
else
{
$callink = "$vba_options[portal_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 = "$vba_options[portal_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 />$vba_options[portal_blockbullet] ";
}
}
eval('$eventstoday .= "' . fetch_template('adv_portal_todaysevents') . '";');
}
// memory saving
unset($events, $eventstore);
}
}
Replace the adv_portal_calendar template with
<!-- Mini Calendar -->

<table align="center" border="0" cellpadding="4" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">

$calendarbits

<if condition="$vboptions['showbirthdays'] AND $birthdays">
<tr><td class="thead" colspan="7" align="center"><span class="smallfont"><strong>Today's Birthdays</strong></span></td></tr>
<tr><td class="alt1" colspan="7">
$birthdays
</tr></td>
</if>

<if condition="$vboptions['showevents'] AND $eventstoday">
<tr><td class="thead" colspan="7" align="center"><span class="smallfont"><strong>Upcoming Events</strong></span></td></tr>
$eventstoday
</if>

</table>

<br />

<!-- End Mini Calendar -->

Enjoy :D

Tom M
02-12-2005, 02:03 PM
the birthdays work, but now the upcoming events are gone :(It's a silly question... do they display properly on your FORUMHOME page?

Also, this above assumed that you already had this change made and thus, the template for adv_portal_todaysevents already existed. If that's not the case then this is the template for that.
<tr><td class="alt2" colspan="7"><span class="smallfont"><if condition="!$vboptions['showeventtype']">
<strong>$eventdates</strong><br />$callink
<else />
<strong>$eventdate</strong><br />$daysevents
</if></span></td></tr>

Oh, and also... if there are no events to display then nothing shows up - including the "Upcoming Events" header. If you'd like something to display then add in
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>";
}
right before the closing culrly brace at the end of the code segment.

oldfan
02-13-2005, 02:27 AM
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>";
}

where would I add this?

rbl
02-13-2005, 02:34 AM
minicalendar.php

Tom M
02-13-2005, 02:45 AM
To clarify a bit... after adding the code section from a couple posts prior to this one to minicalendar.php change
// memory saving
unset($events, $eventstore);
}
}
to
// 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>";
}
}Now, when there are no scheduled events in the specified period you will get the "No events scheduled in the next nn days." message.

oldfan
02-13-2005, 12:21 PM
thanks you sir, works great
/me installs

Tom M
02-13-2005, 04:01 PM
OK - Here's what I hope will be the final change to this.

Have you noticed how if things are configured to display Grouped by Event vs. Grouped by Date they display in the eventid order? Well this change makes it so they display based on the beginning date of the event!

To make things easy here's the entire portion of the code. Simply copy this and replace the previous bits with this. If you aren't using the Birthday portion then start copying at TODAY'S EVENTS. After your editing is finished go ahead and set your events to display Grouped by Event via the ACP. This won't fix the fact they display "wrong" on the FORUMHOME page though :(
// ### TODAY'S BIRTHDAYS #################################################
if ($vboptions['showbirthdays'])
{
$today = vbdate('Y-m-d', TIMENOW, false, false);

$birthdaystore = unserialize($datastore['birthdaycache']);
if (!is_array($birthdaystore) OR ($today != $birthdaystore['day1'] AND $today != $birthdaystore['day2']))
{
// Need to update!
require_once('./includes/functions_databuild.php');
$birthdaystore = build_birthdays();
}
switch($today)
{
case $birthdaystore['day1']:
$birthdays = $birthdaystore['users1'];
break;

case $birthdaystore['day2'];
$birthdays = $birthdaystore['users2'];
break;
}
// memory saving
unset($birthdaystore);

$birthdays = str_replace( "member.php", "$vboptions[bburl]/member.php", $birthdays);
$birthdays = ereg_replace( " \([0-9]{1,2}\)", "", $birthdays); // strip the ' (age)' portion

$show['birthdays'] = iif ($birthdays, true, false);
}
else
{
$show['birthdays'] = false;
}

// ### TODAY'S EVENTS #################################################

function compare_dates($a, $b) {
// only used when sorting events grouped by event id
if ($a[0] > $b[0])
return 1;
if ($a[0] < $b[0])
return -1;
return 0;
}

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();
}

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;
}
}
}
}

$eventstoday = "";
if (!empty($events))
{
if ($vboptions['showeventtype'])
ksort($events, SORT_NUMERIC);
else
uasort($events, 'compare_dates');

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 = "$vba_options[portal_blockbullet] " . "" . $vbphrase['holiday_title_' . $eventinfo['varname']] . "";
}
else
{
$callink = "$vba_options[portal_blockbullet] " . "$eventinfo[title]";
}
}
else
{ // Group by Date
$comma = "$vba_options[portal_blockbullet] ";
$eventdate = vbdate($vboptions['dateformat'], $index, false, true, false);
foreach($value AS $key => $eventid)
{
$eventinfo = $eventstore["$eventid"];
if ($eventinfo['holidayid'])
{
$daysevents .= $comma . "" . $vbphrase['holiday_title_' . $eventinfo['varname']] . "";
}
else
{
$daysevents .= $comma . "$eventinfo[title]";
}
$comma = "
$vba_options[portal_blockbullet] ";
}
}
eval('$eventstoday .= "' . fetch_template('adv_portal_todaysevents') . '";');
}
// memory saving
unset($events, $eventstore);
}
else
{
// $eventstoday .= "No events scheduled in
the next $vboptions[showevents] days.";
}
}
If you want something to display even if no events are scheduled simply uncomment the lines near the bottom of the change.

To fix it on FORUMHOME see http://www.vbulletin.org/forum/showthread.php?t=76264

rbl
02-13-2005, 07:51 PM
Any way of displaying the name of the calendar with the event title?

Tom M
02-13-2005, 09:40 PM
Any way of displaying the name of the calendar with the event title?It's certainly possible. However it may take another query or the info may already be in the cache. At this point it would take someone a bit more familiar with the datastore.

rbl
02-13-2005, 09:47 PM
It's in the cache I believe. Taking code from functions_calendar.php I could make the calendar name appear in every event but seems that I'm not getting it "reset", I mean, it always repeats the last event calendar name.
I display my events grouped by event, so I've placed the following code in the "group by event" section of minicalendar.php file.
foreach ($calendarcache AS $calendarid => $title)
{
...
(place $title in the end of $callink line)
}

Tom M
02-22-2005, 08:46 PM
For those interested in getting user defined holidays to show properly in the Upcoming Events list... this works for CMPS 1.0.1 - In your modified global.php file find
$phrasegroups = array_merge($phrasegroups,
array(
'calendar',
'adv_portal',
'adv_gallery',
'postbit'
)
);
Replace with
$phrasegroups = array_merge($phrasegroups,
array(
'calendar',
'holiday',
'adv_portal',
'adv_gallery',
'postbit'
)
);

rbl
02-22-2005, 09:30 PM
Tom, I'm sorry, is the above post related to my calendar name question?

Tom M
02-22-2005, 09:33 PM
Tom, I'm sorry, is the above post related to my calendar name question?Sorry, no.

It's related to getting user defined holidays to show in the Upcoming Events list.

I titled the post that way but should have made it a bit more clear.

rbl
02-22-2005, 09:35 PM
I titled the post that way but should have made it a bit more clear.
Oops! Didn't see it! Sorry! =)

Tom M
02-22-2005, 11:15 PM
OK, here's the calendar name solution.

In minicaledar.php find

$pastevent = 0;
$pastcount = 0;

Replace with

$calendarinfo = verify_id('calendar', $eventstore["$index"]['calendarid'], 1, 1);

$pastevent = 0;
$pastcount = 0;


Modify the links that are further down the file to include the calendar name information. What I did is to change

"... $eventinfo[holidayid]\">

in all 4 locations to

"... $eventinfo[holidayid]\" title=\"$calendarinfo[title]\">

A bit further down the file replace

unset($events, $eventstore);
With
unset($events, $eventstore, $calendarinfo);

When you place the cursor on the link the Calendar name shows up.

Feel free to modify it any way you need to.

PS - This will add 1 query for each event that is shown in the upcoming events list.

rbl
02-23-2005, 04:33 AM
Thanks Tom! I appreciate it! =)
But one query per event is a high price specially when my events list is always full. I have 17 events for the next 7 days right now and it's not too crowded.

Tom M
02-23-2005, 07:05 AM
It could be recoded so that more work was done after a single query but it would be several lines of code. Since I don't need the calendar name I'll leave it to some other enterprisind individual as an exercise.

interfx
02-26-2005, 03:03 PM
I installed this, and it works great...

I now installed MicroStats from VB.org and see the following...

Uncached templates: adv_calendar_todaysevents (4)

How do I cache this template I created with this hack??? is this a big thing?

Thanks -
InterFX

interfx
02-27-2005, 02:56 PM
One more simple question, how I say the unregistered user views changes from...

No events scheduled in
the next 30 days.

to...

Only Registered members can see upcoming events. (and make registered link to the new memebr registeration form)

Any ideas?

interfx
03-01-2005, 08:49 PM
Any ideas?

Tom M
03-01-2005, 09:54 PM
One more simple question, how I say the unregistered user views changes from...

No events scheduled in
the next 30 days.

to...

Only Registered members can see upcoming events. (and make registered link to the new memebr registeration form)

Any ideas?One way to change it is to edit the module (I'll leave the details to you ;) ) as follows.

if ($bbuserinfo['userid'] > 0)
{ // Registered users
do registered user stuff here
}
else
{ // Guest user
do unregistered stuff here
}

interfx
03-01-2005, 10:01 PM
Might be stupid question, but which file/module do I need to look for this in?

Tom M
03-01-2005, 10:24 PM
Might be stupid question, but which file/module do I need to look for this in?The file that needs to be modified will be minicalendar.php - assuming it's had the upcoming events changes made to it already ;)

interfx
03-01-2005, 10:56 PM
Here's how I did it... Thanks for the hint, this is very easy to add...


$eventstoday .= "<tr><td class=\"alt2\" colspan=\"7\" align=\"center\"><span class=\"smallfont\"> <a href=\"http://www.domain.com/forums/register.php?\">Registered</a> users can<br>see upcoming events.</span></td></tr>";

wlanni
03-14-2005, 09:25 PM
*EDIT* reread this thread again and now things make sense.

HOwever,

I just tried to create a new module for the upcoming events, and was unsuccessful. I'm going to read through the documentation, but if someone has created a module PURELY for the upcoming events, can you post how you did it? Otherwise, I'll post later if I figure it out.

Sal Collaziano
03-29-2005, 07:59 PM
Installed...

Webber
03-30-2005, 02:25 PM
Also I have a question what code do I remove to keep the events but not the mini calendar? I removed this $calendarbits from the template but it still shows both the mini calendar and the events list underneath.

Tom M
03-30-2005, 03:28 PM
Also I have a question what code do I remove to keep the events but not the mini calendar? I removed this $calendarbits from the template but it still shows both the mini calendar and the events list underneath.If you removed that from the adv_portal_calendar template then I'm not sure why it would still be showing. Do you have more than 1 style? Is the template inherited or separate?

s2kca
03-31-2005, 10:27 AM
This is a great hack but I'm having a bit of trouble. I installed and it works great but now I have users complaining that either the dates are out of sequence or there are multiple listings of ranged events (sort by date or sort by event). I found in this thread the perfect answer here (http://www.vbadvanced.com/forum/showpost.php?p=13470&postcount=43) but can't get a response via PM. Did I miss something in this thread that would get the results that I'm looking for?

Tom M
03-31-2005, 12:38 PM
This is a great hack but I'm having a bit of trouble. I installed and it works great but now I have users complaining that either the dates are out of sequence or there are multiple listings of ranged events (sort by date or sort by event). I found in this thread the perfect answer here (http://www.vbadvanced.com/forum/showpost.php?p=13470&postcount=43) but can't get a response via PM. Did I miss something in this thread that would get the results that I'm looking for?I just read your PM (a person's gotta sleep sometime :eek: ) which is on a different topic. The answer on how I did the News section is right here (http://www.vbadvanced.com/forum/showpost.php?p=38973&postcount=9).

Sorting the events when Grouped by Event can be found in this thread, though it's a little bit up the chain. If you applied this change (http://www.vbadvanced.com/forum/showpost.php?p=30592&postcount=116) and it's not working properly what is it doing? Also, instructions for just editing your existing files are over at vb.org (http://www.vbulletin.org/forum/showthread.php?t=76264). The same instructions work for editing vB index.php in the fourm directory as well as vBa minicalendar.php for CMPS if you've added the upcoming events change. The changes need to be made in both places if you want to see it sorted by date on both the CMPS page and on FORUMHOME.

EricR
04-05-2005, 02:30 PM
*EDIT* reread this thread again and now things make sense.

HOwever,

I just tried to create a new module for the upcoming events, and was unsuccessful. I'm going to read through the documentation, but if someone has created a module PURELY for the upcoming events, can you post how you did it? Otherwise, I'll post later if I figure it out.
I've been thru it a few times now, but no luck. My CMPS page becomes a blank page as soon as I make the change to minicalendar.php.

However, I too am interested in using this solely as an events notice and still retain the separate minicalendar. I also tried to create a standalone module with no luck, I got the same blank page result.

Running VB 3.07 and CMPS 1.01.

Tom M
04-05-2005, 03:07 PM
I've been thru it a few times now, but no luck. My CMPS page becomes a blank page as soon as I make the change to minicalendar.php.There are now so many different set of instructions in the thread, which did you follow? There's a set on page 6 that is fairly comprehensive but assumes you already have all the template changes. :(

Once the next version of CMPS gets released I'll try to do a single update so it's all back in one place again.

EricR
04-05-2005, 03:14 PM
There are now so many different set of instructions in the thread, which did you follow? There's a set on page 6 that is fairly comprehensive but assumes you already have all the template changes. :(

Once the next version of CMPS gets released I'll try to do a single update so it's all back in one place again.
I tried following the instructions in the initial post (minus the functions portion), and I tried substituting your code (just the events section) from this post (http://www.vbadvanced.com/forum/showpost.php?p=30592&postcount=116).

My settings have this as page five, so I don't know which post you're referring to. Is it post #116? As soon as I paste either of those into my minicalendar.php file (inserted just above the eval line as instructed) my CMPS goes blank.

wlanni
04-06-2005, 02:43 AM
There are now so many different set of instructions in the thread, which did you follow? There's a set on page 6 that is fairly comprehensive but assumes you already have all the template changes. :(

Once the next version of CMPS gets released I'll try to do a single update so it's all back in one place again.

Heh, yeah, I read through and just said to myself, "yikes."

Tom, if you get a chance with the next cmps release to put it all together, I'd dig it. I definitely appreciate this hack as it is, great work man.

w

Sal Collaziano
04-07-2005, 11:24 AM
I wonder if my situation is unique.. I have the calendar working perfectly on the cmps page and on the forum front page - but once you're inside a forum or thread, the events don't show up. It says "No events scheduled in the next 7 days." in place of the links that appear on other pages. Did I miss something or do I need to add something?

Thanks in advance!

Tom M
04-07-2005, 01:32 PM
I wonder if my situation is unique.. I have the calendar working perfectly on the cmps page and on the forum front page - but once you're inside a forum or thread, the events don't show up. It says "No events scheduled in the next 7 days." in place of the links that appear on other pages. Did I miss something or do I need to add something?I know this seems obvious - but you're probably missing a variable definition. From your description it sounds like you have the forum wrapped by the CMPS page. If that's correct you may want to ask for help about that in a separate thread as I've never done that. If that's not whats going on then a link to your site may help with the diagnosis. ;)

Sal Collaziano
04-07-2005, 01:58 PM
I'm not sure if this will help or not, but in the title on top (the top blue bar in IE) I see "include" (title of a page from CMPS) on the forum front page - where this is working.. On the topic listing page and thread page, it's not there.. Does that shed any light? :p

FragMaster B
04-14-2005, 07:07 PM
OK. I got lost here somewhere... I almost got it working (http://www.lagxbl.com/forum/), but it always says "No events scheduled in..." when there are in fact events scheduled (see bottom of http://www.lagxbl.com/forum/forum.php). What did I miss? Any idea? I followed the txt file in the first post, minus the functions.php change.

BTW - Thanks for this hack. It's just what I need.

Tom M
04-14-2005, 07:27 PM
Need to be registered to see the calendar :(

FragMaster B
04-14-2005, 08:12 PM
Need to be registered to see the calendar :(

DOH. OK, now unregistered can view events and calendar.

It looks like a few people in this long winded thread had this same problem as I do... but thier fixes haven't helped me. Any help?

Tom M
04-14-2005, 08:38 PM
Here's a complete set of templates and the code mod I'm using on my site. This incorporates upcoming events and birthdays to display under the mini calendar. If you don't want either one you can either modify the template or the code or both.

I'm running a security patched version of vb 3.0.3 along with CMPS 1.0.1 and this works fine. I also have the necessary modifications to the other files like functions.php, etc. This should work with vb 3.0.7 even though there were some very minor modifications to the calendar display code for FORUMHOME.

This also has the modification in it to properly display Grouped Events by date instead of eventid.