本文整理汇总了PHP中e107::getRedirect方法的典型用法代码示例。如果您正苦于以下问题:PHP e107::getRedirect方法的具体用法?PHP e107::getRedirect怎么用?PHP e107::getRedirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类e107
的用法示例。
在下文中一共展示了e107::getRedirect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: upgrade_pre
function upgrade_pre($var)
{
$sql = e107::getDb();
if (!$sql->isTable('forum_t')) {
return false;
// e107::getSingleton('e107plugin')->refresh('forum');
} else {
e107::getRedirect()->go(e_PLUGIN_ABS . 'forum/forum_update.php');
//Redirect upgrade to customized upgrade routine
}
//header('Location: '.e_PLUGIN.'forum/forum_update.php');
}
示例2: __construct
function __construct()
{
$this->checkPaths();
$this->checkTimezone();
$this->checkWritable();
$this->checkHtmlarea();
$this->checkIncompatiblePlugins();
$this->checkFileTypes();
$this->checkSuspiciousFiles();
$this->checkDeprecated();
if ($this->refresh == true) {
e107::getRedirect()->go(e_SELF);
}
}
示例3: actionLogin
public function actionLogin()
{
$allow = true;
$session = e107::getSession();
if ($session->get('HAuthError')) {
$allow = false;
$session->set('HAuthError', null);
}
if ($allow && vartrue($_GET['provider'])) {
require_once e_HANDLER . "user_handler.php";
$provider = new e_user_provider($_GET['provider']);
try {
$provider->login($this->backUrl);
// redirect to test page is expected, if true - redirect to SITEURL
} catch (Exception $e) {
e107::getMessage()->addError('[' . $e->getCode() . ']' . $e->getMessage(), 'default', true);
}
}
e107::getRedirect()->redirect(true === $this->backUrl ? SITEURL : $this->backUrl);
}
示例4: actionLogin
public function actionLogin()
{
//echo 'Login controller';
// FIXME - pref for default XUP - e.g. Facebook, use it when GET is empty
if (vartrue($_GET['provider'])) {
require_once e_HANDLER . "user_handler.php";
$provider = new e_user_provider($_GET['provider']);
//$provider->setBackUrl(e107::getUrl()->create('system/xup/endpoint', array(), array('full' => true)));
try {
$provider->login($this->backUrl);
// redirect to test page is expected, if true - redirect to SITEURL
} catch (Exception $e) {
e107::getMessage()->addError('[' . $e->getCode() . ']' . $e->getMessage());
// print_a($provider->getUserProfile());
// echo '<br /><br /><a href="'.e107::getUrl()->create($this->backUrl).'">Test page</a>';
return;
}
// print_a($provider->getUserProfile());
//return;
}
e107::getRedirect()->redirect(e107::getUrl()->create($this->backUrl));
}
示例5: array_flip
if (strpos($row['user_perms'], '0') === 0) {
$class_list[] = e_UC_MAINADMIN;
}
}
$class_list[] = e_UC_MEMBER;
$class_list[] = e_UC_PUBLIC;
$user_logging_opts = array_flip(explode(',', varset($pref['user_audit_opts'], '')));
if (isset($user_logging_opts[USER_AUDIT_LOGIN]) && in_array(varset($pref['user_audit_class'], ''), $class_list)) {
// Need to note in user audit trail
e107::getAdminLog()->user_audit(USER_AUDIT_LOGIN, '', $user_id, $user_name);
}
$edata_li = array("user_id" => $row['user_id'], "user_name" => $row['user_name'], 'class_list' => implode(',', $class_list), 'user_admin' => $row['user_admin']);
// Fix - set cookie before login trigger
session_set(e_COOKIE, $cookieval, time() + 3600 * 24 * 30);
e107::getEvent()->trigger("login", $edata_li);
e107::getRedirect()->redirect(e_ADMIN_ABS . 'admin.php');
//echo "<script type='text/javascript'>document.location.href='admin.php'</script>\n";
}
}
$e_sub_cat = 'logout';
if (ADMIN == FALSE) {
define("e_IFRAME", TRUE);
}
if (!defset('NO_HEADER')) {
require_once e_ADMIN . "header.php";
}
if (ADMIN == FALSE) {
// Needs help from Deso, Vesko and Stoev! :-)
e107::css('inline', "\n\t\t\n\t\t\tbody \t\t\t\t{ \ttext-align: left; font-size:15px; line-height:1.5em; font-weight:normal; font-family:Arial, Helvetica, sans-serif; background:#081D28 url(" . e_IMAGE . "logo_template_large.png) no-repeat 50% 40px; }\n\t\t\ta\t\t\t\t\t{ \tcolor:#F6931E; text-decoration:none; }\n\t\t\ta:hover\t\t\t\t{ \tcolor:silver; text-decoration:none; }\n\t\t\t.bold\t\t\t\t{ \tfont-weight:bold; }\n\t\t\t.field\t\t\t\t{ \ttext-align:center;padding:5px }\n\t\t\t.field input\t\t{\tpadding:5px; \n\t\t\t\t\t\t\t\t\tborder-width:1px;\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\tborder-style:solid;\n \t\t\t\t\t\t\t\tborder-color:#aaa #c8c8c8 #c8c8c8 #aaa;\n\t\t\t\t\t\t\t\t\tbackground:#fff;\n\t\t\t\t\t\t\t\t\tfont:16px arial, helvetica, sans-serif;\n\t\t\t\t\t\t\t\t\t-moz-border-radius: 4px;\n\t\t\t\t\t\t\t\t\t-webkit-border-radius: 4px;\n\t\t\t\t\t\t\t\t\tborder-radius: 4px;\n\t\t\t\t\t\t\t\t\t-moz-box-shadow: 1px 1px 2px #999 inset;\n\t\t\t\t\t\t\t\t\t-webkit-box-shadow: 1px 1px 2px #999 inset;\n\t\t\t\t\t\t\t\t\tbox-shadow: 1px 1px 2px #999 inset;\n\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t.field input:focus\t{\n\t\t\t\t\t\t\t\t\tborder:1px solid #F6931E;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t.field input:hover\t{\n\t\t\t\t\t\t\t\t\tborder:1px solid #F6931E;\n\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t#login-admin \t\t{\n\t\t\t\t\t\t\t\t\tmargin-left:auto;\n\t\t\t\t\t\t\t\t\tmargin-right:auto;\n\t\t\t\t\t\t\t\t\tmargin-top:12%;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\twidth:400px; \n\t\t\t\t\t\t\t\t\t/*\t\n\t\t\t\t\t\t\t\t\tpadding: 10px 20px 0 20px;\n\t\t\t\t\t\t\t\t\t-moz-border-radius:5px;\n\t\t\t\t\t\t\t\t\t-webkit-border-radius:5px;\n\t\t\t\t\t\t\t\t\tborder-radius:5px;\n\t\t\t\t\t\t\t\t\t-moz-box-shadow:5px 5px 20px #000000;\n\t\t\t\t\t\t\t\t\t-webkit-box-shadow:5px 5px 20px #000000;\n\t\t\t\t\t\t\t\t\tbox-shadow:5px 5px 20px #000000;\t\n\t\t\t\t\t\t\t\t\tbackground-color: #FEFEFE;\n\t\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t#login-admin label \t{ \tdisplay: none; text-align: right\t}\n\t\t\t\t\n\t\t\t\n\t\t\t.admin-submit \t\t{ \ttext-align: center; \tpadding:20px;\t}\n\t\t\t\n\t\t\t.submit\t\t\t\t{ }\n\t\t\t\n\t\t\n\t\t\t.placeholder \t\t{\tcolor: #bbb; font-style:italic\t}\n\t\n\t\t\t::-webkit-input-placeholder { font-style:italic;\tcolor: #bbb; \t}\n\t\t\n\t\t\t:-moz-placeholder \t{ font-style:italic;\tcolor: #bbb; \t\t}\n\t\t\t\n\t\t\th2\t\t\t\t\t{ text-align: center; color: #FAAD3D; }\n\t\t\t\n\t\t\t#username\t\t\t{background: url(" . e_IMAGE . "admin_images/admins_16.png) no-repeat scroll 7px 7px; padding-left:30px; }\n\t\t\t\t \n\t\t\t#userpass\t\t\t{background: url(" . e_IMAGE . "admin_images/lock_16.png) no-repeat scroll 7px 7px; padding-left:30px; }\n\t\t\t\n\t\t\tinput[disabled] \t{\tcolor: silver;\t}\n\t\t\tbutton[disabled] span\t{\tcolor: silver;\t}\n\t\t\n\t\t");
$obj = new auth();
$obj->authform();
示例6: varset
}
//$newsfrom = (!is_numeric($action) || !e_QUERY ? 0 : ($action ? $action : e_QUERY));
// Usually the first query parameter is the action.
// For any of the 'list' modes (inc month, day), the action being second is a legacy situation
// .... which can hopefully go sometime
//SecretR: Gone, gone...
if (is_numeric($action) && isset($tmp[1]) && ($tmp[1] == 'list' || $tmp[1] == 'month' || $tmp[1] == 'day')) {
$action = $tmp[1];
$sub_action = varset($tmp[0], '');
}
if ($action == 'all' || $action == 'cat') {
$sub_action = intval(varset($tmp[1], 0));
}
if ($action == 'extend' && empty($sub_action)) {
$defaultUrl = e107::getUrl()->create('news/list/items');
e107::getRedirect()->go($defaultUrl, null, 301);
exit;
}
/*
Variables Used:
$action - the basic display format/filter
$sub_action - category number or news item number
$newsfrom - first item number in list (default 0) - derived from nextprev
$order - sets the listing order for 'list' format
*/
$ix = new news();
$nobody_regexp = "'(^|,)(" . str_replace(",", "|", e_UC_NOBODY) . ")(,|\$)'";
// URL settings (nextprev)
$newsUrlparms = array('page' => '--FROM--');
if ($sub_action) {
switch ($action) {
示例7: init
function init()
{
global $forum;
$e107 = e107::getInstance();
$this->threadId = (int) varset($_GET['id']);
$this->perPage = varset($_GET['perpage']) ? (int) $_GET['perpage'] : $forum->prefs->get('postspage');
$this->page = varset($_GET['p']) ? (int) $_GET['p'] : 1;
if (!$this->threadId && e_QUERY) {
list($id, $page) = explode(".", e_QUERY);
$this->threadId = intval($id);
$this->page = intval($page);
}
//If threadId doesn't exist, or not given, redirect to main forum page
if (!$this->threadId || !($this->threadInfo = $forum->threadGet($this->threadId))) {
if (E107_DEBUG_LEVEL > 0) {
e107::getMessage()->addError("Thread not found or query error: " . __METHOD__ . ' Line: ' . __LINE__);
return;
// exit;
}
$url = e107::url('forum', 'index', 'full');
e107::getRedirect()->go($url);
// header('Location:' . $e107->url->create('forum/forum/main', array(), 'encode=0&full=1'));
exit;
}
//If not permitted to view forum, redirect to main forum page
if (!$forum->checkPerm($this->threadInfo['thread_forum_id'], 'view')) {
if (E107_DEBUG_LEVEL > 0) {
echo __METHOD__ . ' Line: ' . __LINE__;
exit;
}
$url = e107::url('forum', 'index', 'full');
e107::getRedirect()->go($url);
// header('Location:' . $e107->url->create('forum/forum/main', array(), 'encode=0&full=1'));
exit;
}
$totalPosts = $this->threadInfo['thread_total_replies'];
// + 1; // add 1 for the original post . ie. not a reply.
$this->pages = ceil($totalPosts / $this->perPage);
$this->noInc = false;
}
示例8: pluginXml
function pluginXml()
{
//TODO Plugin.xml Form Fields. .
$data = array('main' => array('name', 'lang', 'version', 'date', 'compatibility'), 'author' => array('name', 'url'), 'summary' => array('summary'), 'description' => array('description'), 'keywords' => array('one', 'two'), 'category' => array('category'), 'copyright' => array('copyright'));
// Load old plugin.php file if it exists;
$legacyFile = e_PLUGIN . $this->pluginName . "/plugin.php";
if (file_exists($legacyFile)) {
$eplug_name = $eplug_author = $eplug_url = $eplug_description = "";
$eplug_tables = array();
require_once $legacyFile;
$mes = e107::getMessage();
$mes->addInfo("Loading plugin.php file");
$defaults = array("main-name" => $eplug_name, "author-name" => $eplug_author, "author-url" => $eplug_url, "description-description" => $eplug_description, "summary-summary" => $eplug_description);
if (count($eplug_tables) && !file_exists(e_PLUGIN . $this->pluginName . "/" . $this->pluginName . "_sql.php")) {
$cont = '';
foreach ($eplug_tables as $tab) {
if (strpos($tab, "INSERT INTO") !== FALSE) {
continue;
}
$cont .= "\n" . str_replace("\t", " ", $tab);
}
if (file_put_contents(e_PLUGIN . $this->pluginName . "/" . $this->pluginName . "_sql.php", $cont)) {
$info = str_replace('[x]', $this->pluginName . "_sql.php", EPL_ADLAN_132);
$mes->addInfo($info, 'default', true);
$red = e107::getRedirect();
$red->redirect(e_REQUEST_URL, true);
// $red->redirect(e_SELF."?mode=create&newplugin=".$this->pluginName."&createFiles=1&step=2",true);
} else {
$msg = str_replace('[x]', $this->pluginName . "_sql.php", EPL_ADLAN_133) . "<br />";
$msg .= str_replace(array('[x]', '[y]'), array($this->pluginName . "_sql.php", $cont), EPL_ADLAN_134);
$mes->addWarning($msg);
}
}
}
$existingXml = e_PLUGIN . $this->pluginName . "/plugin.xml";
if (file_exists($existingXml)) {
$p = e107::getXml()->loadXMLfile($existingXml, true);
// print_a($p);
$defaults = array("main-name" => varset($p['@attributes']['name']), "author-name" => varset($p['author']['@attributes']['name']), "author-url" => varset($p['author']['@attributes']['url']), "description-description" => varset($p['description']), "summary-summary" => varset($p['summary'], $p['description']), "category-category" => varset($p['category']), "keywords-one" => varset($p['keywords']['word'][0]), "keywords-two" => varset($p['keywords']['word'][1]));
unset($p);
}
$text = "<table class='table adminform'>";
foreach ($data as $key => $val) {
$text .= "<tr><td>{$key}</td><td>\n\t\t\t\t<div class='controls'>";
foreach ($val as $type) {
$nm = $key . '-' . $type;
$name = "xml[{$nm}]";
$size = count($val) == 1 ? 'span7 col-md-7' : 'span2 col-md-2';
$text .= "<div class='{$size}'>" . $this->xmlInput($name, $key . "-" . $type, vartrue($defaults[$nm])) . "</div>";
}
$text .= "</div></td></tr>";
}
$text .= "</table>";
return $text;
}
示例9: str_replace
e107::redirect();
}
if ($adminEdit && $message) {
$mes->addSuccess($message);
}
if (isset($USERSETTINGS_MESSAGE)) {
$message = str_replace("{MESSAGE}", $message, $USERSETTINGS_MESSAGE);
} elseif (!deftrue('BOOTSTRAP')) {
$message = "<div style='text-align:center'>" . $message . '</div>';
}
$caption = isset($USERSETTINGS_MESSAGE_CAPTION) ? $USERSETTINGS_MESSAGE_CAPTION : LAN_OK;
}
// End - if (!$error)...
if (!$error && !$promptPassword) {
if (isset($_POST) && vartrue($changedUserData['user_name'])) {
$redirect = e107::getRedirect();
$url = e107::getUrl();
$to = $_uid ? $url->create('user/profile/edit', array('id' => $_uid, 'name' => $changedUserData['user_name'])) : $url->create('user/myprofile/edit');
if ($message) {
e107::getMessage()->addSuccess($message, 'default', true);
}
$redirect->redirect($to);
}
unset($_POST);
}
if ($error) {
// require_once (e_HANDLER.'message_handler.php');
$temp = array();
if (count($extraErrors)) {
$temp[] = implode('<br />', $extraErrors);
}
示例10: sc_admin_lang
function sc_admin_lang($parm)
{
if (!ADMIN || !e107::getPref('multilanguage')) {
return '';
}
$e107 = e107::getInstance();
$sql = e107::getDb();
$pref = e107::getPref();
$ns = e107::getRender();
e107::plugLan('user_menu', '', true);
$params = array();
parse_str($parm, $params);
$lanlist = explode(',', e_LANLIST);
sort($lanlist);
$text = '';
$lanperms = array();
foreach ($lanlist as $langval) {
if (getperms($langval)) {
$lanperms[] = $langval;
}
}
$slng = e107::getLanguage();
if (!getperms($sql->mySQLlanguage) && $lanperms) {
$slng->set($lanperms[0]);
if ($pref['user_tracking'] == "session" && $pref['multilanguage_subdomain']) {
e107::getRedirect()->redirect($slng->subdomainUrl($lanperms[0]));
}
/*$sql->mySQLlanguage = ($lanperms[0] != $pref['sitelanguage']) ? $lanperms[0] : "";
if ($pref['user_tracking'] == "session")
{
$_SESSION['e107language_'.$pref['cookie_name']] = $lanperms[0];
if($pref['multilanguage_subdomain']){
header("Location:".$slng->subdomainUrl($lanperms[0]));
}
}
else
{
setcookie('e107language_'.$pref['cookie_name'], $lanperms[0], time() + 86400, '/');
$_COOKIE['e107language_'.$pref['cookie_name']]= $lanperms[0];
}*/
}
if (varset($GLOBALS['mySQLtablelist'])) {
foreach ($GLOBALS['mySQLtablelist'] as $tabs) {
$clang = strtolower($sql->mySQLlanguage);
if (strpos($tabs, "lan_" . $clang) && $clang != "") {
$aff[] = str_replace(MPREFIX . "lan_" . $clang . "_", "", $tabs);
}
}
}
$text .= "\n\t\t<div>\n\t\t";
if (isset($aff)) {
$text .= $sql->mySQLlanguage;
$text .= " (" . $slng->convert($sql->mySQLlanguage) . ")\n\t\t\t: <span class='btn btn-default button' style='cursor: pointer;' onclick='expandit(\"lan_tables\");'><a style='text-decoration:none' title='' href=\"javascript:void(0);\" > " . count($aff) . " " . UTHEME_MENU_L3 . " </a></span><br />\n\t\t\t<span style='display:none' id='lan_tables'>\n\t\t\t";
$text .= implode('<br />', $aff);
$text .= '</span>';
} elseif ($sql->mySQLlanguage && $sql->mySQLlanguage != $pref['sitelanguage']) {
$text .= $sql->mySQLlanguage;
$text .= ' (' . $slng->convert($sql->mySQLlanguage) . '): ' . LAN_INACTIVE;
} else {
$text .= $pref['sitelanguage'];
}
$text .= "<br /><br /></div>";
$select = '';
if (isset($pref['multilanguage_subdomain']) && $pref['multilanguage_subdomain']) {
// TODO - JS independent
$select .= "\n\t\t\t<select class='tbox' name='lang_select' id='sitelanguage' onchange=\"location.href=this.options[selectedIndex].value\">";
foreach ($lanperms as $lng) {
$selected = $lng == $sql->mySQLlanguage || $lng == $pref['sitelanguage'] && !$sql->mySQLlanguage ? " selected='selected'" : "";
$urlval = $slng->subdomainUrl($lng);
$select .= "<option value='" . $urlval . "' {$selected}>{$lng}</option>\n";
}
$select .= "</select>";
} else {
$select .= "\n\t\t\t<form method='post' action='" . e_SELF . (e_QUERY ? '?' . e_QUERY : '') . "'>\n\t\t\t<div>\n\t\t\t<select name='sitelanguage' id='sitelanguage' class='tbox' onchange='this.form.submit()'>";
foreach ($lanperms as $lng) {
// FIXME - language detection is a mess - db handler, mysql handler, session handler and language handler + constants invlolved
// Too complex, doesn't work!!! SIMPLIFY!!!
//$langval = ($lng == $pref['sitelanguage'] && $lng == 'English') ? "" : $lng;
//$selected = ($lng == $sql->mySQLlanguage || ($lng == $pref['sitelanguage'] && !$sql->mySQLlanguage)) ? " selected='selected'" : "";
//$select .= "<option value='".$langval."'{$selected}>$lng</option>\n";
$selected = $lng == e_LANGUAGE ? " selected='selected'" : "";
$select .= "<option value='" . $lng . "'{$selected}>{$lng}</option>\n";
}
$select .= "</select> " . (!isset($params['nobutton']) ? "<button class='update e-hide-if-js' type='submit' name='setlanguage' value='no-value'><span>" . UTHEME_MENU_L1 . "</span></button>" : '') . "\n\t\t\t" . e107::getForm()->hidden('setlanguage', '1') . "\n\t\t\t</div>\n\t\t\t</form>\n\t\t\t";
}
if (isset($params['nomenu'])) {
return $select;
}
if ($select) {
$text .= "<div class='center'>{$select}</div>";
}
return $ns->tablerender(UTHEME_MENU_L2, $text, '', true);
}
示例11: sendFile
function sendFile($data)
{
$sql = e107::getDb();
$post_id = intval($data['id']);
// forum (post) id
$file_id = intval($data['dl']);
// file id
$forum_id = $sql->retrieve('forum_post', 'post_forum', 'post_id=' . $post_id);
// Check if user is allowed to download this file (has 'view' permissions to forum)
if (!$this->checkPerm($forum_id, 'view')) {
if (E107_DEBUG_LEVEL > 0) {
echo "You don't have 'view' access to forum-id: : " . $forum_id;
print_a($this->permList);
return;
}
$url = e107::url('forum', 'index', 'full');
e107::getRedirect()->go($url);
// header('Location:'.e107::getUrl()->create('forum/forum/main')); // FIXME needs proper redirect and 403 header
exit;
}
$array = $sql->retrieve('forum_post', 'post_user,post_attachments', 'post_id=' . $post_id);
$attach = e107::unserialize($array['post_attachments']);
$file = $this->getAttachmentPath($array['post_user']) . varset($attach['file'][$file_id]);
// Check if file exists. Send file for download if it does, return 404 error code when file does not exist.
if (file_exists($file)) {
e107::getFile()->send($file);
} else {
if (E107_DEBUG_LEVEL > 0) {
echo "Couldn't find file: " . $file;
return;
}
$url = e107::url('forum', 'index', 'full');
e107::getRedirect()->go($url);
// header('Location:'.e107::getUrl()->create('forum/forum/main', TRUE, 404)); // FIXME needs proper redirect and 404 header
exit;
}
}
示例12: upgrade_pre
function upgrade_pre($var)
{
//Redirect upgrade to customized upgrade routine
e107::getRedirect()->redirect(e_PLUGIN_ABS . 'forum/forum_update.php');
//header('Location: '.e_PLUGIN.'forum/forum_update.php');
}
示例13: manager_category
function manager_category()
{
global $plugintable, $qs, $sql, $ns, $rs, $aa;
if (!getperms("0")) {
//jsx_location(e_SELF);
$url = e_SELF;
e107::getRedirect()->go($url);
}
if (!is_numeric($qs[1])) {
//jsx_location(e_SELF);
$url = e_SELF;
e107::getRedirect()->go($url);
}
if (!is_object($sql)) {
$sql = new db();
}
if (!$sql->db_Select($plugintable, "content_id, content_heading, content_pref", "content_id='" . intval($qs[1]) . "' ")) {
//js_location(e_SELF."?manager");
$url = e_SELF . "?manager";
e107::getRedirect()->go($url);
} else {
$row = $sql->db_Fetch();
$caption = CONTENT_ADMIN_CAT_LAN_30 . " : " . $row['content_heading'];
}
//$content_pref = e107::unserialize($row['content_pref']);
$content_pref = e107::unserialize($row['content_pref']);
$qs[1] = intval($qs[1]);
$text = "\n\t\t\t<div class='text-left'>\n\t\t\t" . $rs->form_open("post", e_SELF . "?" . e_QUERY, "managerform", "", "enctype='multipart/form-data'") . "\n\t\t\t<table class='table adminform' id='manager_category_01'>\n\t\t\t<tr>\n\t\t\t\t<td class='forumheader3' style='text-align:left'>\n\t\t\t\t\t" . CONTENT_ADMIN_MANAGER_LAN_0 . "<br />" . CONTENT_ADMIN_MANAGER_LAN_1 . "<br />\n\t\t\t\t</td>\n\t\t\t\t<td class='forumheader3' style='text-align:left'>\n\t\t\t\t\t" . r_userclass("content_manager_approve", $content_pref["content_manager_approve"], 'off', "nobody,member,admin,classes") . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class='forumheader3' style='text-align:left'>\n\t\t\t\t\t" . CONTENT_ADMIN_MANAGER_LAN_2 . "<br />" . CONTENT_ADMIN_MANAGER_LAN_3 . "<br />\n\t\t\t\t</td>\n\t\t\t\t<td class='forumheader3' style='text-align:left'>\n\t\t\t\t\t" . r_userclass("content_manager_personal", $content_pref["content_manager_personal"], 'off', "nobody,member,admin,classes") . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class='forumheader3' style='text-align:left'>\n\t\t\t\t\t" . CONTENT_ADMIN_MANAGER_LAN_4 . "<br />" . CONTENT_ADMIN_MANAGER_LAN_5 . "<br />\n\t\t\t\t</td>\n\t\t\t\t<td class='forumheader3' style='text-align:left'>\n\t\t\t\t\t" . r_userclass("content_manager_category", $content_pref["content_manager_category"], 'off', "nobody,member,admin,classes") . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td colspan='2' class='fcaption' style='text-align:center'>\n\t\t\t\t\t" . $rs->form_button("submit", "update_manager", LAN_SAVE) . "\n\t\t\t\t\t" . $rs->form_hidden("options_type", $qs[1]) . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t" . $rs->form_close() . "\n\t\t\t</div>";
$ns->tablerender($caption, $text);
}
示例14: show_links
/**
* Display list of links within a particular category
*/
function show_links()
{
global $qs, $rs, $tp, $from;
$db = e107::getDb();
$number = "20";
$LINK_CAT_NAME = '';
// May be appropriate to add a shortcode later
if ($qs[2] == "all") {
// Show all categories
$caption = LCLAN_ITEM_38;
$qry = " link_id != '' ORDER BY link_category ASC, link_order ASC";
} else {
// Show single category
if ($db->select("links_page_cat", "link_category_name", "link_category_id='" . intval($qs[2]) . "' ")) {
$row = $db->fetch();
$caption = LCLAN_ITEM_2 . " " . $row['link_category_name'];
}
$qry = " link_category=" . intval($qs[2]) . " ORDER BY link_order, link_id ASC";
}
$link_total = $db->select("links_page", "*", " " . $qry . " ");
if (!$db->select("links_page", "*", " " . $qry . " LIMIT " . intval($from) . "," . intval($number) . " ")) {
//jsx_location(e107::url('links_page', 'index'));
$url = e107::url('links_page', 'index');
e107::getRedirect()->go($url);
} else {
// Display the individual links
$text = $rs->form_open("post", e_SELF . (e_QUERY ? "?" . e_QUERY : ""), "myform_{$row['link_id']}", "", "");
$text .= "<div style='text-align:center'>\n <table class='fborder' style='" . ADMIN_WIDTH . "'>\n <tr>\n <td class='fcaption' style='width:5%'>" . LCLAN_ITEM_25 . "</td>\n <td class='fcaption' style='width:65%'>" . LCLAN_ITEM_26 . "</td>\n <td class='fcaption' style='width:10%'>" . LCLAN_ITEM_27 . "</td>\n <td class='fcaption' style='width:10%'>" . LCLAN_ITEM_28 . "</td>\n <td class='fcaption' style='width:10%'>" . LCLAN_ITEM_29 . "</td>\n </tr>";
while ($row = $db->fetch()) {
$linkid = $row['link_id'];
$img = "";
if ($row['link_button']) {
if (strpos($row['link_button'], "http://") !== FALSE) {
$img = "<img style='border:0;' src='" . $row['link_button'] . "' alt='" . $LINK_CAT_NAME . "' />";
} else {
if (strstr($row['link_button'], "/")) {
$img = "<img style='border:0;' src='" . e_BASE . $row['link_button'] . "' alt='" . $LINK_CAT_NAME . "' />";
} else {
$img = "<img style='border:0' src='" . e_PLUGIN_ABS . "links_page/link_images/" . $row['link_button'] . "' alt='" . $LINK_CAT_NAME . "' />";
}
}
}
$name_suffix = URL_SEPARATOR . $linkid . URL_SEPARATOR . $row['link_order'] . URL_SEPARATOR . $row['link_category'];
if ($row['link_order'] == "1") {
$up = " ";
} else {
//$up = "<input type='image' src='".LINK_ICON_ORDER_UP_BASE."' value='".$linkid.".".$row['link_order'].".".$row['link_category']."' name='inc' />";
$up = "<input type='image' src='" . LINK_ICON_ORDER_UP_BASE . "' name='inc" . $name_suffix . "' />";
}
if ($row['link_order'] == $link_total) {
$down = " ";
} else {
//$down = "<input type='image' src='".LINK_ICON_ORDER_DOWN_BASE."' value='".$linkid.".".$row['link_order'].".".$row['link_category']."' name='dec' />";
$down = "<input type='image' src='" . LINK_ICON_ORDER_DOWN_BASE . "' name='dec" . $name_suffix . "' />";
}
$text .= "\n <tr>\n <td class='forumheader3' style='width:5%; text-align: center; vertical-align: middle'>" . $img . "</td>\n <td style='width:65%' class='forumheader3'>\n <a href='" . e_PLUGIN_ABS . "links_page/links.php?" . $row['link_id'] . "' rel='external'>" . LINK_ICON_LINK . "</a> " . $row['link_name'] . "\n </td>\n <td style='width:10%; text-align:center; white-space: nowrap' class='forumheader3'>\n <a href='" . e_SELF . "?link.edit." . $linkid . "' title='" . LCLAN_ITEM_31 . "'>" . LINK_ICON_EDIT . "</a>\n <input type='image' title='delete' name='delete[main_{$linkid}]' alt='" . LCLAN_ITEM_32 . "' src='" . LINK_ICON_DELETE_BASE . "' onclick=\"return jsconfirm('" . $tp->toJS(LCLAN_ITEM_33 . " [ " . $row['link_name'] . " ]") . "')\" />\n </td>\n <td style='width:10%; text-align:center; white-space: nowrap' class='forumheader3'>\n " . $up . "\n " . $down . "\n </td>\n <td style='width:10%; text-align:center' class='forumheader3'>\n <select name='link_order[]' class='tbox'>";
//".$rs -> form_select_open("link_order[]");
for ($a = 1; $a <= $link_total; $a++) {
$text .= $rs->form_option($a, $row['link_order'] == $a ? "1" : "0", $linkid . "." . $a, "");
}
$text .= $rs->form_select_close() . "\n </td>\n </tr>";
}
$text .= "\n <tr>\n <td class='forumheader' colspan='4'> </td>\n <td class='forumheader' style='width:5%; text-align:center'>\n " . $rs->form_button("submit", "update_order", LCLAN_ITEM_30) . "\n </td>\n </tr>\n </table></div>\n " . $rs->form_close();
}
e107::getRender()->tablerender($caption, $text);
$this->ShowNextPrev($from, $number, $link_total);
}
示例15: Copyright
+ ----------------------------------------------------------------------------+
| e107 website system
|
| Copyright (C) 2008-2013 e107 Inc
| http://e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| Generic File Request Script.
|
+----------------------------------------------------------------------------+
*/
require_once "class2.php";
if (!e_QUERY || isset($_POST['userlogin'])) {
header("location: " . SITEURL);
// $e107->base_path
exit;
}
// Media-Manager direct file download.
if (vartrue($_GET['file']) && is_numeric($_GET['file'])) {
$sql = e107::getDb();
if ($sql->select('core_media', 'media_url', "media_id= " . intval($_GET['file']) . " AND media_userclass IN (" . USERCLASS_LIST . ") LIMIT 1 ")) {
$row = $sql->fetch();
// $file = $tp->replaceConstants($row['media_url'],'rel');
e107::getFile()->send($row['media_url']);
}
} else {
e107::getRedirect()->redirect(e_PLUGIN . "download/request.php?" . e_QUERY);
}
exit;