2020-12-05 14:13:18 -08:00
|
|
|
<?php
|
2008-12-20 21:48:06 +00:00
|
|
|
/*
|
|
|
|
* e107 website system
|
|
|
|
*
|
2013-09-16 12:46:52 +02:00
|
|
|
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
2008-12-20 21:48:06 +00:00
|
|
|
* Released under the terms and conditions of the
|
|
|
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
|
|
|
*
|
|
|
|
* Plugin configuration module - gsitemap
|
|
|
|
*
|
|
|
|
*/
|
2008-06-17 05:39:46 +00:00
|
|
|
|
|
|
|
if (!defined('e107_INIT')) { exit; }
|
|
|
|
|
2009-10-23 09:08:15 +00:00
|
|
|
class gsitemap_cron // include plugin-folder in the name.
|
2008-06-17 05:39:46 +00:00
|
|
|
{
|
2009-10-23 09:08:15 +00:00
|
|
|
function config()
|
|
|
|
{
|
|
|
|
global $pref;
|
|
|
|
|
|
|
|
$cron = array();
|
2009-11-22 14:10:09 +00:00
|
|
|
|
2009-10-23 09:08:15 +00:00
|
|
|
$cron[] = array(
|
|
|
|
'name' => "Update Records",
|
|
|
|
'function' => "myfunction",
|
2011-05-11 22:25:02 +00:00
|
|
|
'category' => '',
|
2009-10-23 09:08:15 +00:00
|
|
|
'description' => "Dummy example."
|
|
|
|
);
|
2009-10-23 14:16:08 +00:00
|
|
|
|
2009-10-23 09:08:15 +00:00
|
|
|
$cron[] = array(
|
|
|
|
'name' => "Test Email",
|
|
|
|
'function' => "sendEmail",
|
2011-05-11 22:25:02 +00:00
|
|
|
'category' => 'mail', // mail, user, content, notify, backup
|
2009-10-23 09:08:15 +00:00
|
|
|
'description' => "Sends a test email to ".$pref['siteadminemail']
|
2009-11-22 14:10:09 +00:00
|
|
|
);
|
2009-10-23 09:08:15 +00:00
|
|
|
|
|
|
|
return $cron;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function myfunction()
|
|
|
|
{
|
|
|
|
// Whatever code you wish.
|
2011-05-06 07:00:21 +00:00
|
|
|
e107::getMessage()->add("Executed dummy function within gsitemap/e_cron.php");
|
2009-10-23 09:08:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function sendEmail()
|
|
|
|
{
|
2013-06-17 15:41:11 -07:00
|
|
|
|
|
|
|
$adminEmail = e107::getPref('siteadminemail');
|
|
|
|
$adminName = e107::getPref('siteadmin');
|
|
|
|
|
2009-10-23 09:08:15 +00:00
|
|
|
require_once(e_HANDLER."mail.php");
|
2013-06-17 15:41:11 -07:00
|
|
|
|
2009-10-23 09:08:15 +00:00
|
|
|
$message = "Your Cron Job worked correctly. Sent at ".date("r").".";
|
2013-06-17 15:41:11 -07:00
|
|
|
sendemail($adminEmail, "e107 - Crong Test Email", $message, $adminName, $adminEmail, $adminName);
|
2009-10-23 09:08:15 +00:00
|
|
|
}
|
2008-06-17 05:39:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|