1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

63 lines
1.3 KiB
PHP
Raw Normal View History

2020-12-05 14:13:18 -08:00
<?php
2008-12-20 21:48:06 +00:00
/*
* e107 website system
*
* 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
*
*/
if (!defined('e107_INIT')) { exit; }
2009-10-23 09:08:15 +00:00
class gsitemap_cron // include plugin-folder in the name.
{
2009-10-23 09:08:15 +00:00
function config()
{
global $pref;
$cron = array();
2009-10-23 09:08:15 +00:00
$cron[] = array(
'name' => "Update Records",
'function' => "myfunction",
'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",
'category' => 'mail', // mail, user, content, notify, backup
2009-10-23 09:08:15 +00:00
'description' => "Sends a test email to ".$pref['siteadminemail']
);
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
}
}