本文整理汇总了PHP中e107::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP e107::getConfig方法的具体用法?PHP e107::getConfig怎么用?PHP e107::getConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类e107
的用法示例。
在下文中一共展示了e107::getConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Retrieve menus, check visibility against
* current user classes and current page url
*
*/
public function init()
{
global $_E107;
if (vartrue($_E107['cli'])) {
return;
}
// print_a($eMenuArea);
if (varset($_SERVER['E_DEV_MENU']) == 'true') {
$layouts = e107::getPref('menu_layouts');
if (!is_array($layouts)) {
$converted = $this->convertMenuTable();
e107::getConfig('core')->set('menu_layouts', $converted)->save();
}
$eMenuArea = $this->getData(THEME_LAYOUT);
//print_a($eMenuArea);
} else {
$eMenuArea = $this->getDataLegacy();
}
$total = array();
foreach ($eMenuArea as $area => $val) {
foreach ($val as $row) {
if ($this->isVisible($row)) {
$path = str_replace("/", "", $row['menu_path']);
if (!isset($total[$area])) {
$total[$area] = 0;
}
$this->eMenuActive[$area][] = $row;
$total[$area]++;
}
}
}
e107::getRender()->eMenuTotal = $total;
}
示例2: 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();
}
示例3: data
/**
* Generate the Feed Data
* @param string $parms
* @return array
*/
function data($parms = '')
{
$pref = e107::getConfig()->getPref();
$tp = e107::getParser();
$this->showImages = vartrue($pref['rss_shownewsimage'], false);
$this->summaryDescription = vartrue($pref['rss_summarydiz'], false);
$render = $pref['rss_othernews'] != 1 ? "AND (FIND_IN_SET('0', n.news_render_type) OR FIND_IN_SET(1, n.news_render_type))" : "";
$nobody_regexp = "'(^|,)(" . str_replace(",", "|", e_UC_NOBODY) . ")(,|\$)'";
$topic = !empty($parms['id']) && is_numeric($parms['id']) ? " AND news_category = " . intval($parms['id']) : '';
$limit = vartrue($parms['limit'], 10);
$rssQuery = "SELECT n.*, u.user_id, u.user_name, u.user_email, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n\n\t\t\t\tLEFT JOIN #user AS u ON n.news_author = u.user_id\n\t\t\t\tLEFT JOIN #news_category AS nc ON n.news_category = nc.category_id\n\t\t\t\tWHERE n.news_class IN (" . USERCLASS_LIST . ") AND NOT (n.news_class REGEXP " . $nobody_regexp . ") AND n.news_start < " . time() . " AND (n.news_end=0 || n.news_end>" . time() . ") {$render} {$topic} ORDER BY n.news_datestamp DESC LIMIT 0," . $limit;
$sql = e107::getDb();
$sql->gen($rssQuery);
$tmp = $sql->db_getList();
$rss = array();
$i = 0;
foreach ($tmp as $value) {
$rss[$i]['title'] = $value['news_title'];
$rss[$i]['link'] = e107::getUrl()->create('news/view/item', $value, 'full=1');
$rss[$i]['author'] = $value['user_name'];
$rss[$i]['author_email'] = $value['user_email'];
$rss[$i]['category_name'] = $tp->toHTML($value['category_name'], TRUE, 'defs');
$rss[$i]['category_link'] = SITEURL . "news.php?cat." . $value['news_category'];
//TODO SEFURL.
$rss[$i]['datestamp'] = $value['news_datestamp'];
$rss[$i]['description'] = $this->getDescription($value);
if ($value['news_allow_comments'] && $pref['comments_disabled'] != 1) {
$rss[$i]['comment'] = "http://" . $_SERVER['HTTP_HOST'] . e_HTTP . "comment.php?comment.news." . $value['news_id'];
}
$rss[$i]['media'] = $this->getMedia($value);
$i++;
}
return $rss;
}
示例4: process
function process()
{
$pref = e107::getConfig();
$theme_pref = array();
$theme_pref['example'] = $_POST['_blank_example'];
$theme_pref['fb_tabs_cols'] = intval($_POST['fb_tabs_cols']);
$pref->set('sitetheme_pref', $theme_pref);
return $pref->dataHasChanged();
}
示例5: process
function process()
{
$pref = e107::getConfig();
$theme_pref = array();
$theme_pref['example'] = $_POST['e1074a_example'];
$theme_pref['example2'] = $_POST['e1074a_example2'];
$pref->set('sitetheme_pref', $theme_pref);
return $pref->dataHasChanged();
}
示例6: process
function process()
{
$pref = e107::getConfig();
$tp = e107::getParser();
$theme_pref = array();
$theme_pref['example'] = $tp->toDb($_POST['_blank_example']);
$theme_pref['example2'] = $tp->toDb($_POST['_blank_example2']);
$pref->set('sitetheme_pref', $theme_pref);
return $pref->dataHasChanged();
}
示例7: checkTimezone
function checkTimezone()
{
$mes = e107::getMessage();
$timezone = e107::pref('core', 'timezone');
if (e107::getDate()->isValidTimezone($timezone) == false) {
$mes->addWarning("Your timezone setting (" . $timezone . ") is invalid. It has been reset to UTC. To Modify, please go to Admin -> Preferences -> Date Display Options.", 'default', true);
e107::getConfig()->set('timezone', 'UTC')->save(false, true, false);
$this->refresh = true;
}
}
示例8: upgrade_required
function upgrade_required()
{
$list = e107::getConfig()->get('e_meta_list');
if (in_array('tinymce4', $list)) {
return true;
}
if (file_exists(e_PLUGIN . "tinymce4/e_meta.php")) {
e107::getMessage()->addInfo("Please delete the outdated file <b>" . e_PLUGIN . "tinymce4/e_meta.php</b> and then run the updating process.");
// print_a(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,8));
return true;
}
return false;
}
示例9: sc_cm_comment
function sc_cm_comment($parm = '')
{
$menu_pref = e107::getConfig('menu')->getPref();
$tp = e107::getParser();
$COMMENT = '';
if ($menu_pref['comment_characters'] > 0) {
$COMMENT = strip_tags($tp->toHTML($this->var['comment_comment'], TRUE, "emotes_off, no_make_clickable", "", e107::getPref('menu_wordwrap')));
if ($tp->ustrlen($COMMENT) > $menu_pref['comment_characters']) {
$COMMENT = $tp->text_truncate($COMMENT, $menu_pref['comment_characters'], '') . ($this->var['comment_url'] ? " <a href='" . $this->var['comment_url'] . "'>" : "") . defset($menu_pref['comment_postfix'], $menu_pref['comment_postfix']) . ($this->var['comment_url'] ? "</a>" : "");
}
}
return $COMMENT;
}
示例10: 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');
}
示例11: __construct
function __construct()
{
$mes = e107::getMessage();
$frm = e107::getForm();
$tp = e107::getParser();
// $this->simulation();
$mailoutPlugins = e107::getConfig()->get('e_mailout_list');
if (empty($_GET['id'])) {
return;
}
$tmp = base64_decode($_GET['id']);
parse_str($tmp, $data);
$data['plugin'] = $tp->filter($data['plugin'], 'str');
$data['email'] = $tp->filter($data['email'], 'email');
e107::getMessage()->addDebug(print_a($data, true));
$plugin = vartrue($data['plugin'], false);
if (empty($data) || !e107::isInstalled($plugin) || !in_array($plugin, $mailoutPlugins)) {
$this->invalidURL();
return;
}
$ml = e107::getAddon($plugin, 'e_mailout');
if (!empty($data['userclass'])) {
$data['userclass'] = intval($data['userclass']);
$listName = e107::getUserClass()->getName($data['userclass']);
} else {
$listName = $ml->mailerName;
}
if (vartrue($_POST['remove']) && !empty($data)) {
if ($ml->unsubscribe('process', $data) != false) {
$text = "<p><b>" . $data['email'] . "</b> has been removed from " . $listName . ".</p>";
$mes->addSuccess($text);
} else {
$text = "<p>There was a problem when attempting to remove <b>" . $data['email'] . "</b> from " . $listName . ".</p>";
$mes->addError($text);
}
echo "<div class='container'>" . $mes->render() . "</div>";
return;
}
if ($ml->unsubscribe('check', $data) != false) {
$text = "<p>We are very sorry for the inconvenience. <br />Please click the button below to remove <b>" . $data['email'] . "</b> from <i>" . $listName . "</i>.</p>";
$text .= $frm->open('unsub', 'post', e_REQUEST_URI);
$text .= $frm->button('remove', 'Remove ', 'submit');
$text .= $frm->close();
$mes->setTitle('Unsubscribe', E_MESSAGE_INFO)->addInfo($text);
echo "<div class='container'>" . $mes->render() . "</div>";
return;
} else {
$this->invalidURL();
return;
}
}
示例12: __construct
function __construct()
{
$pref = e107::getPref();
$this->use_imagecode = e107::getConfig()->get('logcode');
$this->sec = e107::getSecureImg();
$this->usernameLabel = '';
$this->allowEmailLogin = $pref['allowEmailLogin'];
if ($pref['allowEmailLogin'] == 1) {
$this->usernameLabel = LAN_LOGINMENU_49;
}
if ($pref['allowEmailLogin'] == 2) {
$this->usernameLabel = LAN_LOGINMENU_50;
}
}
示例13: e_emotefilter
function e_emotefilter()
{
$pref = e107::getPref();
if (!$pref['emotepack']) {
$pref['emotepack'] = "default";
save_prefs();
}
$this->emotes = e107::getConfig("emote")->getPref();
if (!vartrue($this->emotes)) {
return;
}
foreach ($this->emotes as $key => $value) {
$value = trim($value);
if ($value) {
// Only 'activate' emote if there's a substitution string set
$key = preg_replace("#!(\\w{3,}?)\$#si", ".\\1", $key);
// Next two probably to sort out legacy issues - may not be required any more
$key = preg_replace("#_(\\w{3})\$#", ".\\1", $key);
$key = str_replace("!", "_", $key);
$filename = e_IMAGE . "emotes/" . $pref['emotepack'] . "/" . $key;
$fileloc = SITEURLBASE . e_IMAGE_ABS . "emotes/" . $pref['emotepack'] . "/" . $key;
if (file_exists($filename)) {
if (strstr($value, " ")) {
$tmp = explode(" ", $value);
foreach ($tmp as $code) {
$this->search[] = " " . $code;
$this->search[] = "\n" . $code;
//TODO CSS class?
$this->replace[] = " <img src='" . $fileloc . "' alt='' style='vertical-align:middle; border:0' /> ";
$this->replace[] = "\n <img src='" . $fileloc . "' alt='' style='vertical-align:middle; border:0' /> ";
}
unset($tmp);
} else {
if ($value) {
$this->search[] = " " . $value;
$this->search[] = "\n" . $value;
//TODO CSS class?
$this->replace[] = " <img src='" . $filename . "' alt='' style='vertical-align:middle; border:0' /> ";
$this->replace[] = "\n <img src='" . $filename . "' alt='' style='vertical-align:middle; border:0' /> ";
}
}
}
} else {
unset($this->emotes[$key]);
}
}
}
示例14: upgrade_required
function upgrade_required()
{
if (!e107::getDb()->isTable('forum_thread')) {
return true;
}
if (!e107::getDb()->field('forum_thread', 'thread_id')) {
return true;
// true to trigger an upgrade alert, and false to not.
}
if (e107::getDb()->field('forum_thread', 'thread_sef')) {
e107::getDb()->gen("ALTER TABLE `#forum_thread` DROP `thread_sef` ");
}
$legacyMenuPref = e107::getConfig('menu')->getPref();
if (isset($legacyMenuPref['newforumposts_caption'])) {
}
return false;
}
示例15: sc_logo
function sc_logo($parm)
{
parse_str($parm);
// Optional {LOGO=file=file_name} or {LOGO=link=url} or {LOGO=file=file_name&link=url}
// Paths to image file, link are relative to site base
$tp = e107::getParser();
$logopref = e107::getConfig('core')->get('sitelogo');
$logo = $tp->replaceConstants($logopref);
if (vartrue($logopref) && is_readable($logo)) {
$logo = $tp->replaceConstants($logopref, 'abs');
$path = $tp->replaceConstants($logopref);
} elseif (isset($file) && $file && is_readable($file)) {
$logo = e_HTTP . $file;
// HTML path
$path = e_BASE . $file;
// PHP path
} else {
if (is_readable(THEME . 'images/e_logo.png')) {
$logo = THEME_ABS . 'images/e_logo.png';
// HTML path
$path = THEME . 'images/e_logo.png';
// PHP path
} else {
$logo = e_IMAGE_ABS . 'logo.png';
// HTML path
$path = e_IMAGE . 'logo.png';
// PHP path
}
}
$dimensions = getimagesize($path);
$image = "<img class='logo' src='" . $logo . "' style='width: " . $dimensions[0] . "px; height: " . $dimensions[1] . "px' alt='" . SITENAME . "' />\n";
if (isset($link) && $link) {
if ($link == 'index') {
$image = "<a href='" . e_HTTP . "index.php'>" . $image . "</a>";
} else {
$image = "<a href='" . e_HTTP . $link . "'>" . $image . "</a>";
}
}
return $image;
}