本文整理汇总了PHP中e107::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP e107::getInstance方法的具体用法?PHP e107::getInstance怎么用?PHP e107::getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类e107
的用法示例。
在下文中一共展示了e107::getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: forum_post_rep
function forum_post_rep($data)
{
$e107 = e107::getInstance();
include_lan(e_PLUGIN . 'forum/languages/' . e_LANGUAGE . '/lan_forum_notify.php');
$message = 'todo';
$e107->notify->send('forum_post_rep', FORUM_NT_9, $message);
}
示例2: listclass
/**
* constructor
*
* @param string $mode the mode of the caller (default, admin)
* @return void
*
*/
function listclass($mode = '')
{
global $TEMPLATE_LIST_NEW, $list_shortcodes;
$this->plugin_dir = e_PLUGIN . "list_new/";
$this->e107 = e107::getInstance();
//language
include_lan($this->plugin_dir . "languages/" . e_LANGUAGE . ".php");
//template
if (is_readable(THEME . "list_template.php")) {
require_once THEME . "list_template.php";
} else {
require_once $this->plugin_dir . "list_template.php";
}
$this->template = $TEMPLATE_LIST_NEW;
//shortcodes
require_once $this->plugin_dir . "list_shortcodes.php";
// $this->shortcodes = $list_shortcodes;
$this->shortcodes = new list_shortcodes();
$this->shortcodes->rc = $this;
if ($mode == 'admin') {
require_once $this->plugin_dir . "list_admin_class.php";
$this->admin = new list_admin($this);
}
//default sections (present in this list plugin)
$this->defaultArray = array("news", "comment", "members");
}
示例3: __construct
public function __construct()
{
$tp = e107::getParser();
$ns = e107::getRender();
$mes = e107::getMessage();
$this->e107 = e107::getInstance();
// TODO remove?
foreach ($_POST as $key => $value) {
$key = $tp->toDB($key);
if (strpos($key, 'nlmailnow') === 0) {
$this->releaseIssue($key);
break;
}
}
if (isset($_POST['delete'])) {
$this->deleteNewsletter();
}
if (isset($_POST['createNewsletter'])) {
$this->createNewsletter();
}
if (isset($_POST['createIssue'])) {
$this->createIssue();
}
if ($mes) {
$ns->tablerender($caption, $mes->render() . $text);
}
}
示例4: __construct
public function __construct($override = FALSE)
{
global $pref;
$this->e107 = e107::getInstance();
if ($override === FALSE || !is_array($override)) {
// Set up from prefs
$override['mail_bounce_user'] = $pref['mail_bounce_user'];
$override['mail_bounce_pass'] = $pref['mail_bounce_pass'];
$override['mail_bounce_email'] = $pref['mail_bounce_email'];
$override['mail_bounce_pop3'] = $pref['mail_bounce_pop3'];
$override['mail_bounce_type'] = varset($pref['mail_bounce_type'], 'pop3');
}
if ($override['mail_bounce_type'] == 'imap') {
$port = varset($override['mail_bounce_port'], '143');
$strConnect = '{' . $override['mail_bounce_pop3'] . ':' . $port . '}INBOX';
} else {
$port = varset($override['mail_bounce_port'], '110');
// POP3 port
$servertype = '/' . varset($override['mail_bounce_type'], 'pop3');
$strConnect = '{' . $override['mail_bounce_pop3'] . ':' . $port . $servertype . '}INBOX';
}
$this->server = $strConnect;
$this->username = $override['mail_bounce_user'];
$this->password = $override['mail_bounce_pass'];
$this->email = $override['mail_bounce_email'];
$this->delBounce = $pref['mail_bounce_delete'] ? true : false;
}
示例5: __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();
}
示例6: forum_thread_moderate
function forum_thread_moderate($p)
{
$e107 = e107::getInstance();
$sql = e107::getDb();
foreach ($p as $key => $val) {
if (preg_match("#(.*?)_(\\d+)_x#", $key, $matches)) {
$act = $matches[1];
$id = (int) $matches[2];
switch ($act) {
case 'lock':
$sql->update('forum_thread', 'thread_active=0 WHERE thread_id=' . $id);
return LAN_FORUM_CLOSE;
break;
case 'unlock':
$sql->update('forum_thread', 'thread_active=1 WHERE thread_id=' . $id);
return LAN_FORUM_OPEN;
break;
case 'stick':
$sql->update('forum_thread', 'thread_sticky=1 WHERE thread_id=' . $id);
return LAN_FORUM_STICK;
break;
case 'unstick':
$sql->update('forum_thread', 'thread_sticky=0 WHERE thread_id=' . $id);
return LAN_FORUM_UNSTICK;
break;
case 'deleteThread':
return forumDeleteThread($id);
break;
case 'deletePost':
return forumDeletePost($id);
break;
}
}
}
}
示例7: e_tagwords_download
function e_tagwords_download()
{
$this->e107 = e107::getInstance();
$this->settings = array();
$this->settings['plugin'] = "";
$this->settings['table'] = "download";
$this->settings['db_id'] = "download_id";
$this->settings['caption'] = "download";
}
示例8: e_tagwords_news
function e_tagwords_news()
{
$this->e107 = e107::getInstance();
$this->settings = array();
$this->settings['plugin'] = "";
$this->settings['table'] = "news";
$this->settings['db_id'] = "news_id";
$this->settings['caption'] = "LAN_TAG_CORE_NEWS_1";
}
示例9: e_tagwords_page
function e_tagwords_page()
{
$this->e107 = e107::getInstance();
$this->settings = array();
$this->settings['plugin'] = "";
$this->settings['table'] = "page";
$this->settings['db_id'] = "page_id";
$this->settings['caption'] = "LAN_TAG_CORE_CPAGES_1";
}
示例10: __construct
function __construct($eVars = null)
{
parent::__construct($eVars);
$this->e107 = e107::getInstance();
$pref = e107::getPref();
$this->commentsDisabled = vartrue($pref['comments_disabled']);
if (!empty($pref['comments_engine'])) {
$this->commentsEngine = $pref['comments_engine'];
}
}
示例11: procBanRetrigger
function procBanRetrigger()
{
//global $pref;
if (CRON_RETRIGGER_DEBUG) {
$e107 = e107::getInstance();
$e107->admin_log->e_log_event(10, debug_backtrace(), 'DEBUG', 'CRON Ban retrigger', 'Retrigger processing started', FALSE, LOG_TO_ROLLING);
}
require_once e_HANDLER . 'iphandler_class.php';
$ipManager = new banlistManager();
$ipManager->banRetriggerAction();
if (CRON_RETRIGGER_DEBUG) {
$e107->admin_log->e_log_event(10, debug_backtrace(), 'DEBUG', 'CRON Ban Retrigger', 'Retrigger processing completed', FALSE, LOG_TO_ROLLING);
}
}
示例12: process
/**
* Process Posted Data.
* @param $ui admin-ui object
*/
public function process($ui)
{
$data = $ui->getPosted();
e107::getMessage()->addDebug(print_a($data, true));
if ($data['news_id'] && $this->active) {
$excerpt = e107::getParser()->text_truncate(strip_tags(e107::getParser()->post_toHTML($data['news_body'])), 100, '...');
// $id=mysql_insert_id();
$permLink = e107::getInstance()->base_path . "comment.php?comment.news." . intval($data['news_id']);
require_once e_PLUGIN . "trackback/trackbackClass.php";
$trackback = new trackbackClass();
if ($data['x_trackback_urls']) {
$urlArray = explode("\n", $data['x_trackback_urls']);
foreach ($urlArray as $pingurl) {
if (!($terror = $trackback->sendTrackback($permLink, $pingurl, $data['news_title'], $excerpt))) {
e107::getMessage()->add("Successfully pinged {$pingurl}.", E_MESSAGE_SUCCESS);
} else {
e107::getMessage()->add("was unable to ping {$pingurl}<br />[ Error message returned was : '{$terror}'. ]", E_MESSAGE_ERROR);
}
}
}
/*
if(isset($_POST['pingback_urls']))
{
if ($urlArray = $trackback->getPingUrls($data['news_body'])) //FIXME - missing method!!!
{
foreach($urlArray as $pingurl)
{
if ($trackback->sendTrackback($permLink, $pingurl, $data['news_title'], $excerpt))
{
e107::getMessage()->add("Successfully pinged {$pingurl}.", E_MESSAGE_SUCCESS);
}
else
{
e107::getMessage()->add("Pingback to {$pingurl} failed ...", E_MESSAGE_ERROR);
}
}
}
else
{
e107::getMessage()->add("No pingback addresses were discovered", E_MESSAGE_INFO, $smessages);
}
}
*/
}
/* end trackback */
}
示例13: theme_adminmenu
function theme_adminmenu()
{
global $mode;
$mode = e_QUERY;
$e107 =& e107::getInstance();
$var['main']['text'] = TPVLAN_33;
$var['main']['link'] = e_SELF;
$var['admin']['text'] = TPVLAN_34;
$var['admin']['link'] = e_SELF . "?admin";
$var['choose']['text'] = TPVLAN_51;
$var['choose']['link'] = e_SELF . "?choose";
$var['upload']['text'] = TPVLAN_38;
$var['upload']['link'] = e_SELF . "?upload";
$selected = e_QUERY ? e_QUERY : "main";
e_admin_menu(TPVLAN_26, $selected, $var);
}
示例14: create
/**
* Describe all pm routes.
* Routes vs legacy queries:
* list/ -> {no query}
* list/category -> download.php?action=list&id={category-id}
* view/item -> download.php?action=view&id={download-id}
* request/item -> request.php?{download-id}
*/
public function create($route, $params = array(), $options = array())
{
if (is_string($route)) {
$route = explode('/', $route, 2);
}
if (!varset($route[0]) || 'index' == $route[0]) {
$route[0] = 'list';
}
$base = e107::getInstance()->getFolder('plugins') . 'download/';
// var_dump($options, $route, $params);
// print_a($route);
if ($route[0] == 'list') {
if (!isset($params['id']) && isset($params['download_category_id'])) {
$params['id'] = $params['download_category_id'];
}
switch ($route[1]) {
case 'index':
$this->legacyQueryString = '';
return $base . 'download.php';
break;
case 'category':
$url = 'action=list&id=' . $params['id'];
if (isset($params['from'])) {
$url .= "&from=" . $params['from'] . "&view=" . $params['view'] . "&order=" . $params['order'] . "&sort=" . $params['sort'];
}
$this->legacyQueryString = $url;
return $base . 'download.php?' . $url;
break;
}
} elseif ($route[0] == 'view') {
if (!isset($params['id']) && isset($params['download_id'])) {
$params['id'] = $params['download_id'];
}
switch ($route[1]) {
case 'item':
$this->legacyQueryString = 'action=view&id=' . $params['id'];
return $base . 'download.php?action=view&id=' . $params['id'];
break;
}
} elseif ($route[0] == 'request') {
$this->legacyQueryString = $params['id'];
return $base . 'request.php?' . $params['id'];
}
return false;
}
示例15: sc_banner
function sc_banner($parm = '')
{
$e107 = e107::getInstance();
$sql = e107::getDb();
$tp = e107::getParser();
$ret = '';
$text = '';
mt_srand((double) microtime() * 1000000);
$seed = mt_rand(1, 2000000000);
$time = time();
$query = " (banner_startdate=0 OR banner_startdate <= {$time}) AND (banner_enddate=0 OR banner_enddate > {$time}) AND (banner_impurchased=0 OR banner_impressions<=banner_impurchased)" . ($parm ? " AND banner_campaign='" . $tp->toDB($parm) . "'" : '') . "\n\t\tAND banner_active IN (" . USERCLASS_LIST . ")\n\t\tORDER BY RAND({$seed}) LIMIT 1";
if ($sql->select('banner', 'banner_id, banner_image, banner_clickurl, banner_description', $query)) {
$row = $sql->fetch();
return $this->renderBanner($row);
} else {
return ' ';
}
}