Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

cron_alerts.php
Go to the documentation of this file.
1 #!/usr/local/bin/php -q
3 <?
4 //
5 // $Id: cron_alert.php,v 1.14.2.8 2004/09/29 05:58:00 ghb Exp $
6 //
7 // Created on: <29-Sep-2004 05:56:00 ghb>
8 //
9 // This source file is part of Exponential Basic, publishing software.
10 //
11 // Copyright (C) 2001-2004 Brookins Consulting. All rights reserved.
12 //
13 // This program is free software; you can redistribute it and/or
14 // modify it under the terms of the GNU General Public License
15 // as published by the Free Software Foundation; either version 2
16 // of the License, or (at your option) any later version.
17 //
18 // This program is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program; if not, write to the Free Software
25 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
26 //
27
28 //------------------------------------------------
29 // Index Placement Header
30 // Find out, where our files are.
31 //------------------------------------------------
32
33 set_time_limit( 0 );
34
35 if ( ereg( "(.*/)([^\/]+\.php)$", $SCRIPT_FILENAME, $regs ) )
36 $siteDir = $regs[1];
37 elseif ( ereg( "(.*/)([^\/]+\.php)/?", $PHP_SELF, $regs ) )
38 $siteDir = $DOCUMENT_ROOT . $regs[1];
39 else
40 // $siteDir = "./";
41
42 // required: change $siteDir to match your site root
43 $siteDir = "/home/web/ezcommunity/ezcommunity.net/html/";
44 // $siteDir = "/home/web/ezcommunity/beta.ezcommunity/html/";
45
46 $serverDateCMD = "/bin/date";
47 $serverCalendarCronLog = 'bin/logs/calendar_event_notification_cron.log';
48
49 if ( substr( php_uname(), 0, 7) == "Windows" )
50 $separator = ";";
51 else
52 $separator = ":";
53
54 $includePath = ini_get( "include_path" );
55 if ( trim( $includePath ) != "" )
56 $includePath .= $separator . $siteDir;
57 else
58 $includePath = $siteDir;
59 ini_set( "include_path", $includePath );
60
61 // print( $includePath );
62 // print( $siteDir . "\n\n" );
63
64 //------------------------------------------------
65
66 include_once( "classes/INIFile.php" );
67 $ini = new eZINI( "site.ini" );
68 $GlobalSiteIni =& $ini;
69
70 //------------------------------------------------
71 // Send Email Event Notification
72
73 include_once( "ezgroupeventcalendar/classes/ezgroupevent.php" );
74 include_once( "ezgroupeventcalendar/classes/ezgroupeventcategory.php" );
75
76
77 //Adds a "0" in front of the value if it's below 10.
78 function laddZero( $value )
79 {
80 settype( $value, "integer" );
81 $ret = $value;
82 if ( $ret < 10 )
83 {
84 $ret = "0". $ret;
85 }
86 return $ret;
87 }
88
89
90 $events = new eZGroupEvent();
91
92 $current_date = new eZDate();
93 // $current_date = $current_date->timeStamp();
94
95 /*
96 $eventList = $events->getByDate($current_date);
97 $eventList = $events->getAll();
98 */
99
100 // $eventList = $events->getByDate($current_date, new eZUserGroup(0), true);
101 $eventList = $events->getAllByDate( $current_date, true );
102
103 foreach( $eventList as $events )
104 {
105 // $events =& $event->getAll();
106 // print( "event: " . $event->name()."\n" );
107
108 $events->notification(true);
109 }
110 //------------------------------------------------
111
112 //------------------------------------------------
113 // print date to log file (basic trigger log)
114
115 print("\n");
116 $today = date("F j, Y, g:i a");
117
118 //------------------------------------------------
119 // print pre-rc extended logging output
120
121 // print('outputing date to file via cron . . .' );
122 // print("\n" .' creating /home/ladiva/public_html/event_cron_log.txt' ."\n".' date: '. $today . "\n");
123
124
125 //------------------------------------------------
126 // insert date stamp into event cron log
127 // date represents date stamp for each date this
128 // cron schedualed module feature triger runs.
129
130 // What other information would be usefull here.
131 // Emailed Users List Names, Email Adresses, UserID, Date, EventID
132 print("\n executing cmd: $serverDateCMD >> $siteDir$serverCalendarCronLog");
133
134 system( $serverDateCMD .' >> '. $siteDir . $serverCalendarCronLog);
135
136 // print("#---------------------------------------------- \n");
137
138 //------------------------------------------------
139 // print / output log text
140 // system('/usr/bin/cat /home/ladiva/public_html/event_cron_log.txt');
141 //------------------------------------------------
142
143 ?>
eZDate
Definition: ezdate.php:46
eZGroupEvent
Definition: ezgroupevent.php:85
eZINI
Reads and writes .ini style configuration files.
$current_date
$current_date
Definition: cron_alerts.php:92
$events
$events
Definition: cron_alerts.php:90
$serverCalendarCronLog
$serverCalendarCronLog
Definition: cron_alerts.php:47
$includePath
$includePath
Definition: cron_alerts.php:54
$eventList
$eventList
Definition: cron_alerts.php:101
$separator
else $separator
Definition: cron_alerts.php:52
$ini
$ini
Definition: cron_alerts.php:67
$siteDir
else $siteDir
Definition: cron_alerts.php:43
$serverDateCMD
$serverDateCMD
Definition: cron_alerts.php:46
laddZero
laddZero( $value)
Definition: cron_alerts.php:78
$today
$today
Definition: cron_alerts.php:116
$GlobalSiteIni
$GlobalSiteIni
Definition: cron_alerts.php:68
$ret
$ret
Definition: ezsitemanager/admin/filelist.php:88
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.