本文整理汇总了PHP中varset函数的典型用法代码示例。如果您正苦于以下问题:PHP varset函数的具体用法?PHP varset怎么用?PHP varset使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了varset函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: create
/**
*
*/
public function create($route, $params = array())
{
if (!$params) {
return 'page.php';
}
if (is_string($route)) {
$route = explode('/', $route, 2);
}
if (!varset($route[1])) {
$route[1] = 'index';
}
## aliases as retrieved from the DB, map vars to proper values
if (isset($params['page_title']) && !empty($params['page_title'])) {
$params['name'] = $params['page_title'];
}
if (isset($params['page_id']) && !empty($params['page_id'])) {
$params['id'] = $params['page_id'];
}
$url = 'page.php?';
if ('--FROM--' != vartrue($params['page'])) {
$page = varset($params['page']) ? intval($params['page']) : '0';
} else {
$page = '--FROM--';
}
$url .= intval($params['id']) . ($page ? '.' . $page : '');
return $url;
}
开发者ID:notzen,项目名称:e107,代码行数:30,代码来源:url.php
示例2: init
function init()
{
$pref = e107::getPref();
$sql = e107::getDb();
if (vartrue($_POST['cron_execute'])) {
$executeID = key($_POST['cron_execute']);
$this->cronExecute($executeID);
}
if (!vartrue(e107::getPref('e_cron_pwd')) || varset($_POST['generate_pwd'])) {
$pwd = $this->setCronPwd();
}
$sql->gen("SELECT cron_function,cron_active FROM #cron ");
while ($row = $sql->fetch(MYSQL_ASSOC)) {
$this->curCrons[] = $row['cron_function'];
if ($row['cron_active'] == 1) {
$this->activeCrons++;
}
}
$this->lastRefresh();
// Import Core and Plugin e_cron data
$cronDefaults['_system'] = array(0 => array('name' => LAN_CRON_01_1, 'function' => 'sendEmail', 'category' => 'mail', 'description' => str_replace("[eml]", $pref['siteadminemail'], LAN_CRON_01_2) . "<br />" . LAN_CRON_01_3), 1 => array('name' => LAN_CRON_02_1, 'category' => 'mail', 'function' => 'procEmailQueue', 'description' => LAN_CRON_02_2), 2 => array('name' => LAN_CRON_03_1, 'category' => 'mail', 'function' => 'procEmailBounce', 'description' => LAN_CRON_03_2), 3 => array('name' => LAN_CRON_04_1, 'category' => 'user', 'function' => 'procBanRetrigger', 'description' => LAN_CRON_04_2 . "<br />" . LAN_CRON_04_3, 'available' => e107::getPref('ban_retrigger')), 4 => array('name' => LAN_CRON_05_1, 'category' => 'backup', 'function' => 'dbBackup', 'description' => LAN_CRON_05_2 . ' ' . e_SYSTEM . 'backups/'), 5 => array('name' => LAN_CRON_06_1, 'category' => 'user', 'function' => 'procBanRetrigger', 'description' => LAN_CRON_06_2 . "<br />" . LAN_CRON_06_3), 6 => array('name' => LAN_CRON_20_1, 'category' => 'update', 'function' => 'checkCoreUpdate', 'description' => LAN_CRON_20_2 . "<br />" . LAN_CRON_20_3));
if (is_dir(e_BASE . ".git")) {
$cronDefaults['_system'][7] = array('name' => LAN_CRON_20_4, 'category' => 'update', 'function' => 'gitrepo', 'description' => LAN_CRON_20_5 . "<br />" . LAN_CRON_20_6 . "<br /><span class='label label-warning'>" . LAN_CRON_20_7 . "</span> " . LAN_CRON_20_8);
}
if (!vartrue($_GET['action']) || $_GET['action'] == 'refresh') {
$this->cronImport($cronDefaults);
// import Core Crons (if missing)
$this->cronImport(e107::getAddonConfig('e_cron'));
// Import plugin Crons
$this->cronImportLegacy();
// Import Legacy Cron Tab Settings
}
}
开发者ID:gitter-badger,项目名称:e107,代码行数:33,代码来源:cron.php
示例3: sc_gallery_thumb
/**
* All possible parameters
* {GALLERY_THUMB=w=200&h=200&thumburl&thumbsrc&imageurl&orig}
* w and h - optional width and height of the thumbnail
* thumburl - return only the URL of the destination image (large one)
* thumbsrc - url to the thumb, as it's written in the src attribute of the image
* imageurl - full path to the destination image (no proxy)
* actualPreview - large preview will use the original path to the image (no proxy)
*/
function sc_gallery_thumb($parm = '')
{
$tp = e107::getParser();
$parms = eHelper::scParams($parm);
$w = vartrue($parms['w']) ? $parms['w'] : $tp->thumbWidth();
// 190; // 160;
$h = vartrue($parms['h']) ? $parms['h'] : $tp->thumbHeight();
// 130;
$class = $this->slideMode == TRUE ? 'gallery-slideshow-thumb img-responsive img-rounded' : varset($parms['class'], 'gallery-thumb img-responsive');
// $rel = ($this->slideMode == TRUE) ? 'lightbox.SlideGallery' : 'lightbox.Gallery';
$rel = $this->slideMode == TRUE ? 'prettyPhoto[slide]' : 'prettyPhoto[gal]';
$att = 'aw=' . $w . '&ah=' . $h . '&x=1';
// 'aw=190&ah=150';
$srcFull = $tp->thumbUrl($this->var['media_url'], $this->attFull);
if (vartrue($parms['actualPreview'])) {
$srcFull = $tp->replaceConstants($this->var['media_url'], 'full');
}
if (isset($parms['thumburl'])) {
return $srcFull;
} elseif (isset($parms['thumbsrc'])) {
return $tp->thumbUrl($this->var['media_url'], $att);
} elseif (isset($parms['imageurl'])) {
return $tp->replaceConstants($this->var['media_url'], 'full');
}
$caption = $tp->toAttribute($this->var['media_caption']);
$description = $this->downloadable ? " <a class='btn btn-xs btn-default btn-mini e-tip' title='Right-click > Save Link As' href='" . $srcFull . "'>Download</a>" : "";
$description .= $tp->toAttribute($this->var['media_description']);
$text = "<a class='" . $class . "' title=\"" . $description . "\" href='" . $srcFull . "' data-gal='{$rel}' >";
$text .= "<img class='" . $class . "' src='" . $tp->thumbUrl($this->var['media_url'], $att) . "' alt=\"" . $caption . "\" />";
$text .= "</a>";
return $text;
}
开发者ID:armpit,项目名称:e107,代码行数:41,代码来源:e_shortcode.php
示例4: beforeUpdate
public function beforeUpdate($new_data)
{
if (!varset($new_data['fb_category_template'])) {
$new_data['fb_category_template'] = 'default';
}
return $new_data;
}
开发者ID:notzen,项目名称:e107,代码行数:7,代码来源:admin_config.php
示例5: registerEvents
/**
* Register core and plugin notification events.
*/
public function registerEvents()
{
$active = e107::getConfig()->get('notify');
if (empty($active) && e_PAGE == 'notify.php') {
e107::getMessage()->addDebug('Notify is disabled!');
return false;
}
$e_event = e107::getEvent();
if (varset($this->notify_prefs['event'])) {
foreach ($this->notify_prefs['event'] as $id => $status) {
$include = null;
if ($status['class'] != e_UC_NOBODY) {
if (varset($status['include'])) {
$include = e_PLUGIN . $status['include'] . "/e_notify.php";
if (varset($status['legacy']) != 1) {
$class = $status['include'] . "_notify";
$method = $id;
$e_event->register($id, array($class, $method), $include);
} else {
$e_event->register($id, 'notify_' . $id, $include);
}
} else {
if (method_exists($this, 'notify_' . $id)) {
$e_event->register($id, array('notify', 'notify_' . $id));
} else {
$e_event->register($id, array('notify', 'generic'));
// use generic notification.
}
}
}
}
}
// e107::getEvent()->debug();
}
开发者ID:armpit,项目名称:e107,代码行数:37,代码来源:notify_class.php
示例6: iconpicker_shortcode
function iconpicker_shortcode($parm)
{
$parms = array();
parse_str($parm, $parms);
$name = varset($parms['id']);
$sql = e107::getDb();
$frm = e107::getForm();
$tp = e107::getParser();
// $sc_parameters is currently being used to select the media-category.
$qry = "SELECT * FROM `#core_media` WHERE media_userclass IN (" . USERCLASS_LIST . ") ";
$qry .= vartrue($sc_parameters) ? " AND media_category = '" . $sc_parameters . "' " : " AND `media_category` REGEXP '_icon_16|_icon_32|_icon_48|_icon_64' ";
$qry .= "ORDER BY media_category,media_name";
$str = "";
$size_section = array();
$lastsize = "16";
if ($sql->db_Select_gen($qry)) {
while ($row = $sql->db_Fetch()) {
list($tmp, $tmp2, $size) = explode("_", $row['media_category']);
if ($str != '' && $size != $lastsize) {
$size_section[] = $str;
$str = "";
}
$str .= "<a href='#" . $row['media_url'] . "' title='{$filepath}' onclick=\"e107Helper.insertText('{$row['media_url']}','{$name}','{$name}-iconpicker'); return false; \"><img class='icon picker list%%size%%' src='" . $tp->replaceConstants($row['media_url'], 'abs') . "' alt='{$row['media_name']}' /></a>";
$lastsize = $size;
}
return '<div id="' . $name . '-iconpicker-ajax"><div class="field-spacer iconpicker">' . str_replace('%%size%%', '', implode('</div><div class="field-spacer iconpicker">', $size_section)) . '</div></div>';
}
}
开发者ID:armpit,项目名称:e107,代码行数:28,代码来源:iconpicker.php
示例7: __construct
/**
* Constructor - init paths
* @todo FIX e107 (new folder structure), simplify all this, e.g. e107::getInstance()->initMinimal($path_to_e107_config);
*
* @return void
*/
public function __construct()
{
// initial path
$self = realpath(dirname(__FILE__));
// Config
include $self . '/e107_config.php';
$tmp = $self . '/' . $HANDLERS_DIRECTORY;
//Core functions - now API independent
@(require $tmp . '/core_functions.php');
//e107 class
@(require $tmp . '/e107_class.php');
$e107_paths = compact('ADMIN_DIRECTORY', 'FILES_DIRECTORY', 'IMAGES_DIRECTORY', 'THEMES_DIRECTORY', 'PLUGINS_DIRECTORY', 'HANDLERS_DIRECTORY', 'LANGUAGES_DIRECTORY', 'HELP_DIRECTORY', 'DOWNLOADS_DIRECTORY', 'UPLOADS_DIRECTORY', 'MEDIA_DIRECTORY', 'CACHE_DIRECTORY', 'LOGS_DIRECTORY', 'WEB_DIRECTORY', 'SYSTEM_DIRECTORY', 'CORE_DIRECTORY');
// $sql_info = array(); //compact('mySQLserver', 'mySQLuser', 'mySQLpassword', 'mySQLdefaultdb', 'mySQLprefix', 'mySQLcharset');
//e107::getInstance()->initCore($e107_paths, $self, $sql_info, varset($e107_CONFIG, array()));
$e107 = e107::getInstance();
$e107->site_path = substr(md5($mySQLdefaultdb . "." . $mySQLprefix), 0, 10);
$e107->prepare_request();
$e107->setDirs($e107_paths, varset($E107_CONFIG, array()));
$e107->set_constants();
$e107->set_paths();
$e107->file_path = $e107->fix_windows_paths($self) . "/";
$e107->set_base_path();
$e107->set_request(false);
$e107->set_urls(false);
unset($tmp, $self);
// basic Admin area detection - required for proper path parsing
define('ADMIN', strpos(e_SELF, $e107->getFolder('admin') !== false || strpos(e_PAGE, 'admin') !== false));
$e107->set_urls(false);
$pref = $e107->getPref();
//TODO optimize/benchmark
$this->_watermark = array('activate' => vartrue($pref['watermark_activate'], false), 'text' => vartrue($pref['watermark_text']), 'size' => vartrue($pref['watermark_size'], 20), 'pos' => vartrue($pref['watermark_pos'], "BR"), 'color' => vartrue($pref['watermark_color'], 'fff'), 'font' => vartrue($pref['watermark_font']), 'margin' => vartrue($pref['watermark_margin'], 30), 'shadowcolor' => vartrue($pref['watermark_shadowcolor'], '000000'), 'opacity' => vartrue($pref['watermark_opacity'], 20));
$this->_thumbQuality = vartrue($pref['thumbnail_quality'], 65);
// parse request
$this->parseRequest();
}
开发者ID:JBeezygit,项目名称:e107,代码行数:41,代码来源:thumb.php
示例8: init
/**
* Process submitted form data.
*/
function init()
{
if (isset($_POST['saveConfig']) && (int) $_POST['saveConfig'] === 1) {
$prefs = e107::getPlugConfig('google_analytics');
$prefs->set('account', varset($_POST['account'], ''))->save();
$prefs->set('domain_mode', (int) vartrue($_POST['domain_mode'], 0))->save();
$prefs->set('cross_domains', varset($_POST['cross_domains'], ''))->save();
$prefs->set('visibility_pages', (int) vartrue($_POST['visibility_pages'], 0))->save();
$prefs->set('pages', varset($_POST['pages'], ''))->save();
$prefs->set('visibility_roles', (int) vartrue($_POST['visibility_roles'], 0))->save();
$prefs->set('track_user_id', (int) vartrue($_POST['track_user_id'], 0))->save();
$prefs->set('track_outbound', (int) vartrue($_POST['track_outbound'], 0))->save();
$prefs->set('track_mailto', (int) vartrue($_POST['track_mailto'], 0))->save();
$prefs->set('track_files', (int) vartrue($_POST['track_files'], 0))->save();
$prefs->set('track_files_extensions', varset($_POST['track_files_extensions']))->save();
$prefs->set('track_link_id', (int) vartrue($_POST['track_link_id'], 0))->save();
$prefs->set('track_url_fragments', (int) vartrue($_POST['track_url_fragments'], 0))->save();
$prefs->set('track_adsense', (int) vartrue($_POST['track_adsense'], 0))->save();
$prefs->set('track_double_click', (int) vartrue($_POST['track_double_click'], 0))->save();
$prefs->set('tracker_anonymize_ip', (int) vartrue($_POST['tracker_anonymize_ip'], 0))->save();
$prefs->set('privacy_do_not_track', (int) vartrue($_POST['privacy_do_not_track'], 0))->save();
$prefs->set('cache', (int) vartrue($_POST['cache'], 0))->save();
$prefs->set('debug', (int) vartrue($_POST['debug'], 0))->save();
}
}
开发者ID:lonalore,项目名称:google_analytics,代码行数:28,代码来源:admin_config.php
示例9: pm_getInfo
/**
* Get the box-related information for inbox or outbox - limits, message count etc
* The information read from the DB is cached internally for efficiency
*
* @param string $which = inbox|outbox|clear
*
* @return array
*
*/
function pm_getInfo($which = 'inbox')
{
static $pm_info;
if ('clear' == $which) {
unset($pm_info['inbox']);
unset($pm_info['outbox']);
return;
}
if ('inbox' == $which) {
$qry = "SELECT count(pm.pm_id) AS total, SUM(pm.pm_size)/1024 size, SUM(pm.pm_read = 0) as unread FROM `#private_msg` as pm WHERE pm.pm_to = " . USERID . " AND pm.pm_read_del = 0";
} else {
$qry = "SELECT count(pm.pm_from) AS total, SUM(pm.pm_size)/1024 size, SUM(pm.pm_read = 0) as unread FROM `#private_msg` as pm WHERE pm.pm_from = " . USERID . " AND pm.pm_sent_del = 0";
}
if (!isset($pm_info[$which]['total'])) {
$this->pmDB->gen($qry);
$pm_info[$which] = $this->pmDB->fetch();
if ($which == 'inbox' && ($this->pmPrefs['animate'] == 1 || $this->pmPrefs['popup'] == 1)) {
if ($new = $this->pmDB->db_Count('private_msg', '(*)', "WHERE pm_sent > '" . USERLV . "' AND pm_read = 0 AND pm_to = '" . USERID . "' AND pm_read_del != 1")) {
$pm_info['inbox']['new'] = $new;
} else {
$pm_info['inbox']['new'] = 0;
}
}
}
if (!isset($pm_info[$which]['limit'])) {
if (varset($this->pmPrefs['pm_limits'], 0) > 0) {
if ($this->pmPrefs['pm_limits'] == 1) {
$qry = "SELECT MAX(gen_user_id) AS inbox_limit, MAX(gen_ip) as outbox_limit FROM `#generic` WHERE gen_type='pm_limit' AND gen_datestamp IN (" . USERCLASS_LIST . ")";
} else {
$qry = "SELECT MAX(gen_intdata) AS inbox_limit, MAX(gen_chardata) as outbox_limit FROM `#generic` WHERE gen_type='pm_limit' AND gen_datestamp IN (" . USERCLASS_LIST . ")";
}
if ($this->pmDB->gen($qry)) {
$row = $this->pmDB->fetch();
$pm_info['inbox']['limit'] = $row['inbox_limit'];
$pm_info['outbox']['limit'] = $row['outbox_limit'];
}
$pm_info['inbox']['limit_val'] = $this->pmPrefs['pm_limits'] == 1 ? varset($pm_info['inbox']['total'], '') : varset($pm_info['inbox']['size'], '');
if (!$pm_info['inbox']['limit'] || !$pm_info['inbox']['limit_val']) {
$pm_info['inbox']['filled'] = 0;
} else {
$pm_info['inbox']['filled'] = number_format($pm_info['inbox']['limit_val'] / $pm_info['inbox']['limit'] * 100, 2);
}
$pm_info['outbox']['limit_val'] = $this->pmPrefs['pm_limits'] == 1 ? varset($pm_info['outbox']['total'], '') : varset($pm_info['outbox']['size'], '');
if (!$pm_info['outbox']['limit'] || !$pm_info['outbox']['limit_val']) {
$pm_info['outbox']['filled'] = 0;
} else {
$pm_info['outbox']['filled'] = number_format($pm_info['outbox']['limit_val'] / $pm_info['outbox']['limit'] * 100, 2);
}
} else {
$pm_info['inbox']['limit'] = '';
$pm_info['outbox']['limit'] = '';
$pm_info['inbox']['filled'] = '';
$pm_info['outbox']['filled'] = '';
}
}
return $pm_info;
}
开发者ID:armpit,项目名称:e107,代码行数:66,代码来源:pm_func.php
示例10: init
function init()
{
if (!empty($_GET['filter'])) {
$action = $_GET['filter'];
$this->adminMenu['main/' . $action]['selected'] = true;
}
$pref = e107::pref('faqs');
$this->access = array('main/create' => varset($pref['admin_faq_create'], e_UC_ADMIN), 'main/edit' => varset($pref['admin_faq_edit'], e_UC_ADMIN), 'main/delete' => varset($pref['admin_faq_delete'], e_UC_ADMIN), 'cat/list' => check_class($pref['admin_cat_create']) || check_class($pref['admin_cat_edit']) ? e_UC_ADMIN : e_UC_NOBODY, 'cat/create' => varset($pref['admin_cat_create'], e_UC_ADMIN), 'cat/edit' => varset($pref['admin_cat_edit'], e_UC_ADMIN), 'cat/delete' => varset($pref['admin_cat_delete'], e_UC_ADMIN));
}
开发者ID:armpit,项目名称:e107,代码行数:9,代码来源:admin_config.php
示例11: sc_login_table_password
function sc_login_table_password($parm = '')
{
$pref = e107::getPref();
$text = "<input class='tbox form-control input-block-level' type='password' name='userpass' id='userpass' size='40' maxlength='100' placeholder=\"" . LAN_LOGIN_2 . "\" />";
if (!USER && e107::getSession()->is('challenge') && varset($pref['password_CHAP'], 0)) {
$text .= "<input type='hidden' name='hashchallenge' id='hashchallenge' value='" . e107::getSession()->get('challenge') . "' />\n\n";
}
return $text;
}
开发者ID:armpit,项目名称:e107,代码行数:9,代码来源:login_shortcodes.php
示例12: sc_contact_body
function sc_contact_body($parm = '')
{
parse_str($parm, $parm);
$rows = vartrue($parm['rows'], 10);
$cols = vartrue($parm['cols'], 70);
if ($cols > 60) {
$size = 'input-xxlarge';
}
return "<textarea cols='{$cols}' style='max-width:99%' id='contactBody' rows='{$rows}' name='body' required='required' class='tbox {$size} form-control'>" . stripslashes(varset($_POST['body'])) . "</textarea>";
}
开发者ID:JBeezygit,项目名称:e107,代码行数:10,代码来源:contact_shortcodes.php
示例13: navigation_shortcode
function navigation_shortcode($parm = '')
{
$types = array('main' => 1, 'side' => 2, 'footer' => 3, 'alt' => 4, 'alt5' => 5, 'alt6' => 6);
$category = varset($types[$parm], 1);
$tmpl = vartrue($parm, 'main');
$nav = e107::getNav();
$template = e107::getCoreTemplate('navigation', $tmpl);
$data = $nav->initData($category);
// $data = $nav->collection($category);
return $nav->render($data, $template);
}
开发者ID:armpit,项目名称:e107,代码行数:11,代码来源:navigation.php
示例14: create
/**
* Query mapping in format route?params:
* - profile/view?id=xxx -> user.php?id.xxx
* - profile/list?page=xxx -> user.php?xxx
* - myprofile/view -> user.php
* - profile/edit?id=xxx -> usersettings.php?xxx
* - myprofile/edit -> usersettings.php
* - login/index (or just 'login') -> login.php
* - register/index (or just 'register') -> signup.php
*/
public function create($route, $params = array())
{
if (!$params) {
return 'user.php';
}
if (is_string($route)) {
$route = explode('/', $route, 2);
}
if (!varset($route[1])) {
$route[1] = 'index';
}
## aliases as retrieved from the DB, map vars to proper values
if (isset($params['user_name']) && !empty($params['user_name'])) {
$params['id'] = $params['user_name'];
}
if (isset($params['user_id']) && !empty($params['user_id'])) {
$params['id'] = $params['user_id'];
}
$url = 'user.php';
$page = vartrue($params['page']) ? intval($params['page']) : '0';
if ($route[0] == 'profile') {
switch ($route[1]) {
case '':
case 'view':
$url .= '?id.' . $params['id'];
break;
case 'list':
$url .= $page ? '?' . $page : '';
break;
case 'edit':
$url = e_ADMIN_ABS . "user.php?mode=main&action=edit&id=" . $params['id'];
// 'usersettings.php?'.$params['id'];
break;
}
} elseif ($route[0] == 'myprofile') {
switch ($route[1]) {
case '':
case 'view':
// user.php
break;
case 'edit':
$url = 'usersettings.php';
break;
}
} elseif ($route[0] == 'login') {
$url = 'login.php';
} elseif ($route[0] == 'register') {
$url = 'signup.php';
}
// XXX signup URL parameters
return $url;
}
开发者ID:armpit,项目名称:e107,代码行数:62,代码来源:url.php
示例15: __construct
function __construct()
{
$this->request = e107::getRegistry('core/pages/request');
$action = varset($this->request['action']);
if (($action == 'listPages' || $action == 'listChapters') && vartrue($this->request['id'])) {
$this->var = e107::getDb()->retrieve('page_chapters', 'chapter_name, chapter_meta_description, chapter_sef', 'chapter_id = ' . intval($this->request['id']) . ' LIMIT 1');
}
if ($action == 'showPage' && vartrue($this->request['id'])) {
$query = "SELECT p.page_id,c.chapter_name,c.chapter_meta_description FROM #page AS p LEFT JOIN #page_chapters AS c ON p.page_chapter = c.chapter_id WHERE p.page_id = " . intval($this->request['id']) . " LIMIT 1 ";
$rows = e107::getDb()->retrieve($query, true);
$this->var = $rows[0];
}
}
开发者ID:armpit,项目名称:e107,代码行数:13,代码来源:e_shortcode.php
示例16: notify
function notify()
{
global $e_event;
$this->notify_prefs = e107::getConfig("notify")->getPref();
if (varset($this->notify_prefs['event'])) {
foreach ($this->notify_prefs['event'] as $id => $status) {
if ($status['class'] != 255) {
$e_event->register($id, 'notify_' . $id);
}
}
}
include_lan(e_LANGUAGEDIR . e_LANGUAGE . '/lan_notify.php');
}
开发者ID:notzen,项目名称:e107,代码行数:13,代码来源:notify_class.php
示例17: procEmailQueue
function procEmailQueue()
{
//global $pref;
if (CRON_MAIL_DEBUG) {
$e107 = e107::getInstance();
$e107->admin_log->e_log_event(10, debug_backtrace(), 'DEBUG', 'CRON Email', 'Email run started', FALSE, LOG_TO_ROLLING);
}
require_once e_HANDLER . 'mail_manager_class.php';
$mailManager = new e107MailManager();
$mailManager->doEmailTask(varset($pref['mail_workpertick'], 5));
if (CRON_MAIL_DEBUG) {
$e107->admin_log->e_log_event(10, debug_backtrace(), 'DEBUG', 'CRON Email', 'Email run completed', FALSE, LOG_TO_ROLLING);
}
}
开发者ID:notzen,项目名称:e107,代码行数:14,代码来源:cron_class.php
示例18: save_preset
/**
* Save preset
*
* @param string $exclude_fields Comma separated list of fields not to save
* @param bool $output output message or use message handler. NOTE - default value will be changed to false, update your code.
*/
function save_preset($exclude_fields = '', $output = true)
{
global $sql, $ns, $tp;
$qry = explode(".", e_QUERY);
$unique_id = is_array($this->id) ? $this->id : array($this->id);
$uid = $tp->toDB(varset($qry[1], 0));
if ($_POST && $qry[0] == "savepreset") {
$saveID = $tp->toDB($unique_id[$uid], true);
$exclude_array = explode(',', $exclude_fields);
$existing = $sql->db_Count("preset", "(*)", " WHERE preset_name='" . $saveID . "' ") ? TRUE : FALSE;
foreach ($_POST as $key => $value) {
if (in_array($key, $exclude_array) || $tp->toDB($key) != $key) {
unset($_POST[$key]);
// Remove any fields excluded from preset, and those with potentially dubious key names
} else {
$_POST[$key] = $tp->toDB($value);
}
}
if ($existing) {
// Delete any existing entries for this preset (else checkbox settings not updated)
$sql->db_Delete("preset", "preset_name ='" . $saveID . "' ");
}
foreach ($_POST as $key => $value) {
$sql->db_Insert("preset", "0, '" . $saveID . "', '{$key}', '{$value}' ");
}
if (!$output) {
$ns->tablerender(LAN_SAVED, LAN_PRESET_SAVED);
return;
}
require_once e_HANDLER . "message_handler.php";
$emessage =& eMessage::getInstance();
$emessage->add(LAN_PRESET_SAVED, E_MESSAGE_SUCCESS);
}
if ($_POST['delete_preset'] && e_QUERY == "clr_preset") {
$del = $tp->toDB($_POST['del_id']);
$check = $sql->db_Delete("preset", "preset_name ='" . $unique_id[$del] . "' ");
if ($output) {
$ns->tablerender(LAN_SAVED, $check ? LAN_PRESET_DELETED : LAN_DELETED_FAILED);
return;
}
require_once e_HANDLER . "message_handler.php";
$emessage =& eMessage::getInstance();
if ($check) {
$emessage->add(LAN_PRESET_DELETED, E_MESSAGE_SUCCESS);
} else {
$emessage->add(LAN_DELETED_FAILED, E_MESSAGE_ERROR);
}
}
}
开发者ID:notzen,项目名称:e107,代码行数:55,代码来源:preset_class.php
示例19: plugin_forum_admin_events
function plugin_forum_admin_events($type, $parms)
{
//We currently only care about system cache, so just return if it's not
if (!isset($parms['syscache']) || !$parms['syscache']) {
return '';
}
switch ($type) {
case 'cache_clear':
$which = varset($parms['cachetag']);
if ('nomd5_classtree' == $which) {
return 'plugin_forum_admin_events_clear_moderators';
}
break;
}
}
开发者ID:notzen,项目名称:e107,代码行数:15,代码来源:e_admin_events.php
示例20: compile
function compile($tags, $parm = array())
{
$sql = e107::getDb();
$items = array();
$tag_regexp = "'(^|,)(" . str_replace(",", "|", $tags) . ")(,|\$)'";
$query = "SELECT * FROM #news WHERE news_id != " . $parm['current'] . " AND news_class REGEXP '" . e_CLASS_REGEXP . "' AND news_meta_keywords REGEXP " . $tag_regexp . " ORDER BY news_datestamp DESC LIMIT " . $parm['limit'];
if ($sql->gen($query)) {
while ($row = $sql->fetch()) {
$items[] = array('title' => varset($row['news_title']), 'url' => e107::getUrl()->create('news/view/item', $row), 'body' => varset($row['news_summary']), 'image' => varset($row['news_image']));
}
return $items;
} elseif (ADMIN) {
// return array(array('title'=>$query,'url'=>''));
}
}
开发者ID:armpit,项目名称:e107,代码行数:15,代码来源:e_related.php
注:本文中的varset函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论