[ABD] Calendar Alerts MOD v0.0.4

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
User avatar
battye
Extension Customisations
Extension Customisations
Posts: 10933
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia
Contact:

[ABD] Calendar Alerts MOD v0.0.4

Post by battye » Sat Jan 16, 2010 11:27 am

Calendar Alerts MOD
Beta 4 - v0.0.4

MOD Title: Calendar Alerts MOD
MOD Description: Let users keep on top of special events by having the forum alert them. Users can add alerts within the User Control Panel and choose to be notified a week before, a day before and/or on the day of the event. The alerts will appear on the forum index page.

MOD Version: v0.0.4

MOD Download, Screenshots, More Information: http://forums.cricketmx.com/viewtopic.php?f=63&t=4746 (direct download)

Translations (for 0.0.2):
Italian: http://forums.cricketmx.com/viewtopic.p ... 461#p99461 (thanks to plasmino)
German: http://forums.cricketmx.com/viewtopic.p ... 530#p99530 (thanks to darkonia)
Spanish: http://www.phpbb.com/community/viewtopi ... #p12025005 (thanks to Jorup16)

Translations (v0.0.1):
German: http://forums.cricketmx.com/viewtopic.p ... 836#p98836 (thanks to Darkonia)
Italian: http://www.phpbb.com/community/viewtopi ... #p11764845 (thanks to plasmino)
Swedish: http://www.phpbb.com/community/viewtopi ... #p11765625 (thanks to trickoff)
Spanish: http://www.phpbb.com/community/viewtopi ... #p11894295 (thanks to Jorup16)

History:
First release of 0.0.1 on January 16 2010.
Release of 0.0.2 on February 5 2010.
Release of 0.0.3 on February 23 2010.
Release of 0.0.4 on July 24 2011.
Customisations Team Member

User avatar
darkonia
Registered User
Posts: 1901
Joined: Tue May 13, 2008 1:10 pm
Location: Munich, Germany
Contact:

Re: [BETA] Calendar Alerts MOD v0.0.1

Post by darkonia » Sat Jan 16, 2010 11:32 am

nice battye, you are back again to produce new mods for us, thx i will test it. :mrgreen:

here are the German Translation:

Code: Select all

// Calendar Alerts MOD
	'UCP_ALERTS'				=> 'Erinnerungen',
	'UCP_ALERTS_TITLE'			=> 'Setze Kalender Erinnerungen',
	'UCP_ALERTS_INFO'			=> 'Auf dieser Seite kannst Du Kalender Erinnerungen einstellen. Anhand Deiner Einstellungen wirst Du auf dem Forum Index benachrichtigt entweder eine Woche davor, einen Tag davor oder am Tag des von Dir eingetragenen Termins.',
	'UCP_ALERTS_ADD_NEW'		=> 'Füge eine neue Erinnerung hinzu',
	'UCP_ALERTS_ADD_NEW_INFO'	=> 'Hier kannst Du den Text der Erinnerung eingeben, sowie den Zeitraum für die Anzeiges der von Dir erstellten Erinnerung.',
	'UCP_ALERTS_NOTIFY_TEXT'	=> 'Benachrichtigung',
	'UCP_ALERTS_DAY'			=> 'Am selben Tag',
	'UCP_ALERTS_DAY_BEFORE'		=> 'Einen Tag davor',
	'UCP_ALERTS_WEEK_BEFORE'	=> 'Eine Woche davor',
	'UCP_ALERTS_FORM_REDO'		=> 'Bitte überprüfe Deine Angaben ob alles richtig und vollständig eingetragen wurde.<br />%sGehe zur letzten Seite zurück%s.',
	'UCP_ALERTS_SUBMITTED'		=> 'Deine Erinnerung für %s wurde erfolgreich gespeichert. Du wirst für den Termin erinnert bei der von Dir eingestellten Zeit: %s<br />%sGehe zur letzten Seite zurück%s.',
	'UCP_ALERTS_DELETE'			=> 'Lösche die Erinnerung',
	'UCP_ALERTS_DELETE_CONFIRM'	=> 'Bist Du dir sicher das Du diese Erinnerung Löschen willst?',
	'UCP_ALERTS_DELETE_SUCCESS'	=> 'Diese Erinnerung wurde erfolgreich gelöscht.<br />%sGehe zur letzten Seite zurück%s.',
MMOG-Heaven - Das Gaming Portal
Community bedeutet Gleichgesinnte finden - MMOG-Heaven ist Deine Community! Von Spielern für Spieler bietet Dir dieses Portal genau das, was ein Spieler braucht. Bleibe ständig informiert, finde die neuesten MMORPGs, oder suche die frischesten News aus der Welt des Online Gamings - dieses und vieles mehr erwartet Dich auf MMOG-Heaven.

trickoff
Registered User
Posts: 513
Joined: Mon Jan 07, 2008 12:23 am

Re: [BETA] Calendar Alerts MOD v0.0.1

Post by trickoff » Sat Jan 16, 2010 12:29 pm

looks really good! Can this mod be integrated with Calendar mod by Alightner?

User avatar
battye
Extension Customisations
Extension Customisations
Posts: 10933
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia
Contact:

Re: [BETA] Calendar Alerts MOD v0.0.1

Post by battye » Sat Jan 16, 2010 12:32 pm

Thanks darkonia :)

trickoff, I haven't seen the code for that Calendar MOD but I think it should be fairly straight forward to change. As long as the Calendar MOD by Alightner stores some kind of event in the database with a corresponding timestamp, then all you would need to do is make a slight change to the index.php code change. :)
Customisations Team Member

plasmino
Registered User
Posts: 261
Joined: Sat Jul 25, 2009 11:12 am

Re: [BETA] Calendar Alerts MOD v0.0.1

Post by plasmino » Sat Jan 16, 2010 2:21 pm

wow its fantastic , thank for this mod...

the Italian Translation:

Code: Select all

// Calendar Alerts MOD
	'UCP_ALERTS'				=> 'Avvisi',
	'UCP_ALERTS_TITLE'			=> 'Calendario di avvisi',
	'UCP_ALERTS_INFO'			=> 'In questa pagina è possibile inserire avvisi nel calendario. A seconda delle impostazioni quando si invia una segnalazione, si riceverà un avviso di notifica nella pagina indice forum una settimana prima, un giorno prima e il giorno della segnalazione.',
	'UCP_ALERTS_ADD_NEW'		=> 'Aggiungi un Avviso',
	'UCP_ALERTS_ADD_NEW_INFO'	=> 'Qui puoi inserire il testo per l\'avviso, nonché la data di quando si desidera essere informati.',
	'UCP_ALERTS_NOTIFY_TEXT'	=> 'Notifica',
	'UCP_ALERTS_DAY'			=> 'Lo stesso giorno',
	'UCP_ALERTS_DAY_BEFORE'		=> 'Il giorno prima',
	'UCP_ALERTS_WEEK_BEFORE'	=> 'Una settimana prima',
	'UCP_ALERTS_FORM_REDO'		=> 'Prego controllare che la data, il testo avvisi e i tempi di notifica siano stati tutti riempiti correttamente.<br />%sRitorna alla pagina precedente%s.',
	'UCP_ALERTS_SUBMITTED'		=> 'Il tuo avviso per %s è stato inserito nel database. Sarai avvisato molti giorni prima di ogni evento: %s<br />%sRitorna alla pagina precedente%s.',
	'UCP_ALERTS_DELETE'			=> 'Elimina Avviso',
	'UCP_ALERTS_DELETE_CONFIRM'	=> 'Sei sicuro di voler cancellare questo avviso?',
	'UCP_ALERTS_DELETE_SUCCESS'	=> 'L\'avviso è stato cancellato con successo.<br />%sRitorna nella pagina precedente%s.',
Last edited by plasmino on Mon Jan 18, 2010 3:28 pm, edited 1 time in total.

trickoff
Registered User
Posts: 513
Joined: Mon Jan 07, 2008 12:23 am

Re: [BETA] Calendar Alerts MOD v0.0.1

Post by trickoff » Sat Jan 16, 2010 3:18 pm

battye wrote:trickoff, I haven't seen the code for that Calendar MOD but I think it should be fairly straight forward to change. As long as the Calendar MOD by Alightner stores some kind of event in the database with a corresponding timestamp, then all you would need to do is make a slight change to the index.php code change. :)
sweet! Unfortunately I suck at php, so if you wanted to take a look at alightners mod it would be perfect http://www.phpbb.com/community/viewtopi ... =alightner

Thanks for the great job!

Here is a Swedish translation:

Code: Select all

	// Calendar Alerts MOD
	'UCP_ALERTS'				=> 'Larm',
	'UCP_ALERTS_TITLE'			=> 'Ställ in kalender larm',
	'UCP_ALERTS_INFO'			=> 'På denna sidan kan du lägga till kalender larm. Du kommer att få ett meddelande på forumet som påminner dig om händelsen en vecka före, en dag före eller samma dag beroende på dina inställningar när du lägger till ett larm.',
	'UCP_ALERTS_ADD_NEW'		=> 'Lägg till larm',
	'UCP_ALERTS_ADD_NEW_INFO'	=> 'Här kan du fylla i text om påminnelsen, samt vilket datum händelsen är och när du vill ha din påminnelse.',
	'UCP_ALERTS_NOTIFY_TEXT'	=> 'Meddela',
	'UCP_ALERTS_DAY'			=> 'Samma dag',
	'UCP_ALERTS_DAY_BEFORE'		=> 'Dagen innan',
	'UCP_ALERTS_WEEK_BEFORE'	=> 'Sju dagar innan',
	'UCP_ALERTS_FORM_REDO'		=> 'Vänligen kontrollera att datumet, larm texten och påminnelsetiden är korrekt ifyllda.<br />%sÅtergå till föregående sida%s.',
	'UCP_ALERTS_SUBMITTED'		=> 'Ditt larm för %s har sparats i databasen. Så här många dagar före evenemanget kommer du att få en påminnelse: %s<br />%sÅtergå till föregående sida%s.',
	'UCP_ALERTS_DELETE'		=> 'Ta bort lamr',
	'UCP_ALERTS_DELETE_CONFIRM'	=> 'Är du säker på att du vill ta bort detta alrmet?',
	'UCP_ALERTS_DELETE_SUCCESS'	=> 'Larmet har tagits bort.<br />%sÅtergå till föregående sida%s.',

User avatar
battye
Extension Customisations
Extension Customisations
Posts: 10933
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia
Contact:

Re: [BETA] Calendar Alerts MOD v0.0.1

Post by battye » Sat Jan 16, 2010 3:38 pm

trickoff, thanks for the translation.

I haven't tested this, as I don't use the MOD ... so you will need to tell me if this works or not.

OPEN index.php

FIND (essentially, the entire first ADD BEFORE)

Code: Select all

// Calendar Alerts MOD
$time_now 	= getdate(time() + $user->timezone + $user->dst - date('Z'));
$alert_time	= mktime(0, 0, 0, $time_now['mon'], $time_now['mday'], $time_now['year'], date('I'));

$use_calendar_alerts = 0;

$sql = 'SELECT * FROM ' . ALERTS_TABLE . '
		WHERE user_id = ' . $user->data['user_id'] . '
		AND alert_time > ' . ($alert_time - 60*60*24) . '
		AND alert_time < ' . ($alert_time + 60*60*24*8);
$results = $db->sql_query($sql, 3600);

	while( $row = $db->sql_fetchrow($results) )
	{
		// Sort through the alerts
		$day_now 	= date('j', $alert_time);
		$day_alert	= date('j', $row['alert_time']);

		$same_day_alert = $row['alert_day'] && ($day_now == $day_alert);
		$before_day_alert = $row['alert_day_before'] && ($day_now == ($day_alert-1));
		$week_day_alert = $row['alert_week'] && ($day_now == ($day_alert-7));

		if( $same_day_alert || $before_day_alert || $week_day_alert )
		{
			if( $use_calendar_alerts == 0 )	
			{
				$use_calendar_alerts = 1;
			}

			$template->assign_block_vars('alerts', array(
				'U_CALENDAR_ALERT_NOTIFICATION'	=> $row['alert_text'],
				'U_CALENDAR_ALERT_DATE'			=> date('j F Y', $row['alert_time']),
			));
		}
	}
	$db->sql_freeresult($results);

REPLACE WITH

Code: Select all

// Calendar Alerts MOD
$time_now 	= getdate(time() + $user->timezone + $user->dst - date('Z'));
$alert_time	= mktime(0, 0, 0, $time_now['mon'], $time_now['mday'], $time_now['year'], date('I'));

$use_calendar_alerts = 0;

$sql = 'SELECT * FROM ' . CALENDAR_EVENTS_TABLE . '
		WHERE user_id = ' . $user->data['user_id'] . '
		AND event_start_time > ' . ($alert_time - 60*60*24) . '
		AND event_start_time < ' . ($alert_time + 60*60*24*8);
$results = $db->sql_query($sql, 3600);

	while( $row = $db->sql_fetchrow($results) )
	{
		// Sort through the alerts
		$day_now 	= date('j', $alert_time);
		$day_alert	= date('j', $row['event_start_time']);

		$same_day_alert = true;
		$before_day_alert = true;
		$week_day_alert = true;

		if( $same_day_alert || $before_day_alert || $week_day_alert )
		{
			if( $use_calendar_alerts == 0 )	
			{
				$use_calendar_alerts = 1;
			}

			$template->assign_block_vars('alerts', array(
				'U_CALENDAR_ALERT_NOTIFICATION'	=> $row['event_subject'],
				'U_CALENDAR_ALERT_DATE'			=> date('j F Y', $row['event_start_time']),
			));
		}
	}
	$db->sql_freeresult($results);
Customisations Team Member

marian0810
Former Team Member
Posts: 3011
Joined: Mon May 21, 2007 9:17 pm
Location: The Netherlands
Name: Marian
Contact:

Re: [BETA] Calendar Alerts MOD v0.0.1

Post by marian0810 » Sat Jan 16, 2010 5:35 pm

Looks awesome!
battye wrote:Also, feature requests are welcome if you have any suggestions for the MOD.
It would be nice if you could set permissions so that only specified groups can do this :)
You and me, time and space. You watch us run!

lovelysummer
Registered User
Posts: 437
Joined: Fri Mar 20, 2009 1:49 pm

Re: [BETA] Calendar Alerts MOD v0.0.1

Post by lovelysummer » Sat Jan 16, 2010 6:05 pm

Hello,

Very usefull mod.

I made a test in my localhost. User entered event won't show unless admin refresh cache. :?

Secondly, I tested a event to show day before and 7 days before. But the event with 6 days left won't show until the day before. I thought that if I choose to alert 7 days before, the event could be contiunouly show until the final day.Or make one more option to show event from 0 to 7days :)

May I request there is an edit function for entered event in the ucp alert. :)

Will you do also subsilver template :)

Thank you.

User avatar
battye
Extension Customisations
Extension Customisations
Posts: 10933
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia
Contact:

Re: [BETA] Calendar Alerts MOD v0.0.1

Post by battye » Sun Jan 17, 2010 6:30 am

Hi lovelysummer, there is a 60 minute cache on the events - that should explain what you were saying about refreshing the cache.

I don't think there is a need for an edit function (because it only takes about 20 seconds to delete and re-add :)), but having it continuously show for 7 days leading up to it (or an option for this) isn't a bad idea. I will have a think about that one :)

Thanks :)
Customisations Team Member

lovelysummer
Registered User
Posts: 437
Joined: Fri Mar 20, 2009 1:49 pm

Re: [BETA] Calendar Alerts MOD v0.0.1

Post by lovelysummer » Sun Jan 17, 2010 5:53 pm

Hi battye,

Which line to edit so as to turn the 60 minutes cache to 1 minute? :)

Thank you

User avatar
battye
Extension Customisations
Extension Customisations
Posts: 10933
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia
Contact:

Re: [BETA] Calendar Alerts MOD v0.0.1

Post by battye » Wed Jan 20, 2010 7:33 am

OPEN index.php

FIND

Code: Select all

$results = $db->sql_query($sql, 3600);
REPLACE WITH

Code: Select all

$results = $db->sql_query($sql, 60);
:)
Customisations Team Member

lovelysummer
Registered User
Posts: 437
Joined: Fri Mar 20, 2009 1:49 pm

Re: [BETA] Calendar Alerts MOD v0.0.1

Post by lovelysummer » Wed Jan 20, 2010 10:13 am

Tks for the edit, it works nice. :D

User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm
Contact:

Re: [BETA] Calendar Alerts MOD v0.0.1

Post by keith10456 » Wed Jan 20, 2010 2:21 pm

battye wrote:... I don't think there is a need for an edit function (because it only takes about 20 seconds to delete and re-add :)), but having it continuously show for 7 days leading up to it (or an option for this) isn't a bad idea. I will have a think about that one :)

Thanks :)
If you add this it probably would be best to have it as an "option" - and disabled by default.

User avatar
battye
Extension Customisations
Extension Customisations
Posts: 10933
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia
Contact:

Re: [BETA] Calendar Alerts MOD v0.0.1

Post by battye » Wed Jan 20, 2010 2:32 pm

keith10456 wrote:
battye wrote:... I don't think there is a need for an edit function (because it only takes about 20 seconds to delete and re-add :)), but having it continuously show for 7 days leading up to it (or an option for this) isn't a bad idea. I will have a think about that one :)

Thanks :)
If you add this it probably would be best to have it as an "option" - and disabled by default.
I was just thinking of adding another checkbox for this (disabled by default, like the others).
Customisations Team Member

Locked

Return to “[3.0.x] Abandoned MODs”