function dev_set_session($var, $value = '', $expire = '3600', $path = '', $secure = false, $httponly = false) { if (session_id() == '') { $domain = $path == '' ? dev_domain() : substr($path, 0, strpos($path, '/')); $dir = $path == '' ? '/' : substr($path, strpos($path, '/'), strlen($path)); $cookiedie = $expire > 0 ? time() + (int) $expire : ''; //expire in one hour $cookiesecure = $secure; session_set_cookie_params($cookiedie, $dir, $domain, $cookiesecure); session_start(); } $status = ($_SESSION[$var] = $value) ? true : false; return $status; }
function dev_email_admin_alert($message = '', $subject = '', $from = '', $rcpt = '') { $message = dev_not_null($message) ? $message : "If you have recieved this email, then the admnistrative alert system on your website has been activated with no status message. Please check your log files.\n"; $subject = dev_not_null($subject) ? $subject : "Automated Email Alert From Your Site!"; $from = dev_not_null($from) ? $from : "admin@" . dev_domain(); $rcpt = dev_not_null($rcpt) ? $rcpt : "admin@" . dev_domain(); $status = dev_send_email($rcpt, $from, $subject, $message); return $status; }
<?php //dev_config.php if (defined("INCLUDE_BASE")) { $status = ''; $config_r = array('SITE_DOMAIN' => dev_domain(), 'SITE_LOG_DIR' => 'logs/', 'SITE_ADMIN_EMAIL' => 'admin@' . dev_domain(), 'PHP_DISPLAY_ERRORS' => 0); //Connect to DB //$link = dev_dbconn("user", "pass", "db", "localhost"); //Load dynamic config content //$status .= dev_config_from_db(DEV_CONFIG_TABLE, DEV_CONFIG_VAR_FIELD, DEV_CONFIG_VALUE_FIELD); $status .= dev_config_from_array($config_r); ini_set('display_errors', PHP_DISPLAY_ERRORS); session_start(); }