Example #1
0
		
		Unicode Reminder ..

		Ggf. muss die Location des php-Binaries angepasst werden.
		
		Dieses Script sucht nach neuen Logs und Caches, die von Usern beobachtet
		werden und verschickt dann die Emails.
		
	***************************************************************************/
$rootpath = '/mnt/opencaching/www.opencaching.de/html/';
require_once '/mnt/opencaching/www.opencaching.de/html/lib/clicompatbase.inc.php';
require_once 'settings.inc.php';
require_once '/mnt/opencaching/www.opencaching.de/html/lib/consts.inc.php';
require_once $rootpath . 'lib2/html2text.class.php';
// use posix pid-files to lock process
if (!CreatePidFile($watchpid)) {
    CleanupAndExit($watchpid, "Another instance is running!");
    exit;
}
/* begin with some constants */
$sDateformat = 'Y-m-d H:i:s';
/* end with some constants */
/* begin db connect */
db_connect();
if ($dblink === false) {
    echo 'Unable to connect to database';
    exit;
}
/* end db connect */
/* begin owner notifies */
$rsNewLogs = sql("SELECT cache_logs.id log_id, caches.user_id user_id FROM cache_logs, caches WHERE cache_logs.cache_id=caches.cache_id AND cache_logs.owner_notified=0");
Example #2
0
		Unicode Reminder メモ

		Ggf. muss die Location des php-Binaries angepasst werden.

		Arbeitet die Tabelle `notify_waiting` ab und verschickt
		Benachrichtigungsmails ueber neue Caches.

	***************************************************************************/
$rootpath = '../../';
// chdir to proper directory (needed for cronjobs)
chdir(substr(realpath($_SERVER['PHP_SELF']), 0, strrpos(realpath($_SERVER['PHP_SELF']), '/')));
require_once $rootpath . 'lib/clicompatbase.inc.php';
require_once 'settings.inc.php';
require_once $rootpath . 'lib/consts.inc.php';
// use posix pid-files to lock process
if (!CreatePidFile($notifypid)) {
    CleanupAndExit($notifypid, "Another instance is running!");
    exit;
}
/* begin with some constants */
$sDateformat = 'Y-m-d H:i:s';
/* end with some constants */
/* begin db connect */
db_connect();
if ($dblink === false) {
    echo 'Unable to connect to database';
    exit;
}
/* end db connect */
$rsNotify = sql("\tSELECT  `notify_waiting`.`id`, `notify_waiting`.`cache_id`, `notify_waiting`.`type`,\n\t\t\t\t`user`.`username`,\n\t\t\t\t`user2`.`email`, `user2`.`username` as `recpname`, `user2`.`latitude` as `lat1`, `user2`.`longitude` as `lon1`, `user2`.`user_id` as `recid`,\n\t\t\t\t`caches`.`name` as `cachename`, `caches`.`date_hidden`, `caches`.`latitude` as `lat2`, `caches`.`longitude` as `lon2`, `caches`.`wp_oc`,\n\t\t\t\t`cache_type`.`de` as `cachetype`,\n\t\t\t\t`cache_size`.`de` as `cachesize`\n\t\t\tFROM `notify_waiting`, `caches`, `user`, `user` `user2`, `cache_type`, `cache_size`, `cache_status`\n\t\t\tWHERE `notify_waiting`.`cache_id`=`caches`.`cache_id`\n\t\t\t  AND `notify_waiting`.`user_id`=`user2`.`user_id`\n\t\t\t  AND `caches`.`user_id`=`user`.`user_id`\n\t\t\t  AND `caches`.`type`=`cache_type`.`id`\n\t\t\t  AND `caches`.`status`=`cache_status`.`id`\n\t\t\t  AND `caches`.`size`=`cache_size`.`id`\n\t\t\t  AND `cache_status`.`allow_user_view`=1");
while ($rNotify = sql_fetch_array($rsNotify)) {
/****************************************************************************
	     
   Unicode Reminder メモ
                                    				                                
	 refresh the search-index of all modified descriptions
	
 ****************************************************************************/
//prepare the templates and include all neccessary
$rootpath = '../../';
$pidfile = '/var/www/www.opencaching.de/html/cache/search.pid';
// chdir to proper directory (needed for cronjobs)
chdir(substr(realpath($_SERVER['PHP_SELF']), 0, strrpos(realpath($_SERVER['PHP_SELF']), '/')));
require_once $rootpath . 'lib/clicompatbase.inc.php';
require_once $rootpath . 'lib/ftsearch.inc.php';
// use posix pid-files to lock process
if (!CreatePidFile($pidfile)) {
    CleanupAndExit($pidfile, "Another instance is running!");
    exit;
}
db_connect();
ftsearch_refresh();
CleanupAndExit($pidfile);
//
// checks if other instance is running, creates pid-file for locking
//
function CreatePidFile($PidFile)
{
    if (!CheckDaemon($PidFile)) {
        return false;
    }
    if (file_exists($PidFile)) {