当前位置: 首页>>代码示例>>PHP>>正文


PHP e107::redirect方法代码示例

本文整理汇总了PHP中e107::redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP e107::redirect方法的具体用法?PHP e107::redirect怎么用?PHP e107::redirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在e107的用法示例。


在下文中一共展示了e107::redirect方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

 * e107 website system
 *
 * Copyright (C) 2008-2009 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 *
 *
 * $Source: /cvs_backup/e107_0.8/e107_admin/phpinfo.php,v $
 * $Revision$
 * $Date$
 * $Author$
 */
require_once "../class2.php";
if (!getperms("0")) {
    e107::redirect('admin');
    exit;
}
$e_sub_cat = 'phpinfo';
require_once "auth.php";
ob_start();
phpinfo();
$phpinfo .= ob_get_contents();
$phpinfo = preg_replace("#^.*<body>#is", "", $phpinfo);
$phpinfo = str_replace("font", "span", $phpinfo);
$phpinfo = str_replace("</body></html>", "", $phpinfo);
$phpinfo = str_replace('border="0"', '', $phpinfo);
//$phpinfo = str_replace('<table ','<table class="table table-striped adminlist" ',$phpinfo);
$phpinfo = str_replace('name=', 'id=', $phpinfo);
$phpinfo = str_replace('class="e"', 'class="forumheader2 text-left"', $phpinfo);
$phpinfo = str_replace('class="v"', 'class="forumheader3 text-left"', $phpinfo);
开发者ID:gitter-badger,项目名称:e107,代码行数:31,代码来源:phpinfo.php

示例2: checkAllowed

/**
 *	See whether a user class is editable.
 *
 *	(Note: On fixed classes, only some fields are editable)
 *
 * @param integer $class_id
 * @param boolean $redirect - if TRUE, will redirect to site home page if class not editable.
 * @param boolean $fullEdit - set TRUE if full editing required, FALSE if some editing permitted
 *
 * @return boolean - TRUE if class editable (fully or partially), FALSE if not.
 */
function checkAllowed($classID, $redirect = true, $fullEdit = FALSE)
{
    global $e_userclass;
    // TODO: Get rid of this (we need the system admin object; not the user-level object)
    $editLevel = $fullEdit ? 2 : 1;
    if ($e_userclass->queryCanEditClass($classID) >= $editLevel) {
        return TRUE;
    }
    if ($redirect) {
        e107::redirect();
        exit;
    }
    return FALSE;
    // Next bit probably redundant - editing of some parts of system class data is allowed.
    if (!$uc->isEditableClass($class_id)) {
        if (!$redirect) {
            return false;
        }
        e107::getMessage()->addSession(UCSLAN_90, E_MESSAGE_ERROR);
        header('location:' . e_SELF);
        exit;
    }
    return true;
}
开发者ID:gitter-badger,项目名称:e107,代码行数:35,代码来源:userclass2.php

示例3: explode

$subaction = 'all';
$from = 0;
$view = 10;
if (e_QUERY) {
    $tmp = explode('.', e_QUERY);
    $from = intval(varset($tmp[0], 0));
    $action = varset($tmp[1], 'top');
    $subaction = varset($tmp[2], 'all');
    $view = isset($tmp[3]) ? intval($tmp[3]) : 10;
}
if ($action == 'top') {
    define('e_PAGETITLE', LAN_8);
} elseif ($action == 'active') {
    define('e_PAGETITLE', LAN_7);
} else {
    e107::redirect();
    exit;
}
require_once HEADERF;
if ($action == 'active') {
    require_once e_HANDLER . 'userclass_class.php';
    require_once e_PLUGIN . 'forum/forum_class.php';
    $forum = new e107forum();
    $forumList = implode(',', $forum->getForumPermList('view'));
    $qry = "\r\n\tSELECT\r\n\t\tt.*, u.user_name, ul.user_name AS user_last, f.forum_name\r\n\tFROM `#forum_thread` as t\r\n\tLEFT JOIN `#forum` AS f ON f.forum_id = t.thread_forum_id\r\n\tLEFT JOIN `#user` AS u ON u.user_id = t.thread_user\r\n\tLEFT JOIN `#user` AS ul ON ul.user_id = t.thread_lastuser\r\n\tWHERE t.thread_forum_id IN ({$forumList})\r\n\tORDER BY t.thread_views DESC\r\n\tLIMIT\r\n\t\t{$from}, {$view}\r\n\t";
    if ($sql->gen($qry)) {
        $text = "<div>\n<table style='width:auto' class='table fborder'>\n";
        $gen = e107::getDate();
        $text .= "<tr>\r\n\t\t\t<th style='width:5%' class='forumheader'>&nbsp;</th>\r\n\t\t\t<th style='width:45%' class='forumheader'>" . LAN_1 . "</th>\r\n\t\t\t<th style='width:15%; text-align:center' class='forumheader'>" . LAN_2 . "</th>\r\n\t\t\t<th style='width:5%; text-align:center' class='forumheader'>" . LAN_3 . "</th>\r\n\t\t\t<th style='width:5%; text-align:center' class='forumheader'>" . LAN_4 . "</th>\r\n\t\t\t<th style='width:25%; text-align:center' class='forumheader'>" . LAN_5 . "</th>\r\n\t\t\t</tr>\n";
        while ($row = $sql->db_Fetch(MYSQL_ASSOC)) {
            if ($row['user_name']) {
开发者ID:gitter-badger,项目名称:e107,代码行数:31,代码来源:top.php

示例4: displayPersonalManager

function displayPersonalManager()
{
    global $qs, $lc, $link_shortcodes, $cobj, $row, $from, $linkspage_pref;
    $db = e107::getDb();
    $db2 = e107::getDb('db2');
    $template = e107::getTemplate('links_page', 'links_page');
    $tp = e107::getParser();
    if (!(isset($linkspage_pref['link_manager']) && $linkspage_pref['link_manager'])) {
        //jsx_location(e107::url('links_page', 'index'));
        $url = e107::url('links_page', 'index');
        e107::getRedirect()->go($url);
    }
    //delete link
    if (isset($linkspage_pref['link_directdelete']) && $linkspage_pref['link_directdelete']) {
        if (isset($_POST['delete'])) {
            $tmp = array_pop(array_flip($_POST['delete']));
            list($delete, $del_id) = explode("_", $tmp);
        }
        if (isset($delete) && $delete == 'main') {
            $db->select("links_page", "link_category, link_order, link_author", "link_id='" . intval($del_id) . "'");
            // Get the position of target in the order
            $row = $db->fetch();
            if ($row['link_author'] != USERID) {
                e107::redirect();
                exit;
            }
            $db->select("links_page", "link_id", "link_order>'" . $row['link_order'] . "' && link_category='" . intval($row['link_category']) . "'");
            while ($row = $db->fetch()) {
                $db2->update("links_page", "link_order=link_order-1 WHERE link_id='" . $row['link_id'] . "'");
            }
            if ($db->delete("links_page", "link_id='" . intval($del_id) . "'")) {
                $mes->addSuccess(LCLAN_ADMIN_10 . " #" . $del_id . " " . LCLAN_ADMIN_11);
            }
        }
    }
    //show existing links
    if (!check_class($linkspage_pref['link_manager_class'])) {
        //jsx_location(e107::url('links_page', 'index'));
        $url = e107::url('links_page', 'index');
        e107::getRedirect()->go($url);
    } else {
        $qry = "\n\t\tSELECT l.*, lc.*\n\t\tFROM #links_page AS l\n\t\tLEFT JOIN #links_page_cat AS lc ON lc.link_category_id = l.link_category\n\t\tWHERE /* l.link_active = 1 AND */  l.link_author = '" . USERID . "'\n\t\tORDER BY l.link_name\n\t\t";
        $link_table_manage = "";
        if (!($manager_total = $db->gen($qry))) {
            $text = LAN_LINKS_MANAGER_4;
        } else {
            $link_table_manage_start = $tp->parseTemplate($template['LINK_TABLE_MANAGE_START'], FALSE, $link_shortcodes);
            while ($row = $db->fetch()) {
                $link_shortcodes->setVars($row);
                $link_table_manage .= $tp->parseTemplate($template['LINK_TABLE_MANAGE'], FALSE, $link_shortcodes);
            }
            $link_table_manage_end = $tp->parseTemplate($template['LINK_TABLE_MANAGE_END'], FALSE, $link_shortcodes);
            $text = $link_table_manage_start . $link_table_manage . $link_table_manage_end;
        }
        $navigator = displayNavigator();
        $text = $navigator . $text;
        e107::getRender()->tablerender(LAN_LINKS_35, $text);
        //show link create
        $lc->show_link_create();
    }
    return;
}
开发者ID:Jimmi08,项目名称:links_page,代码行数:62,代码来源:links.php

示例5: processFunction

 /**
  * @return bool|null|string|void
  */
 function processFunction()
 {
     global $forum, $thread;
     //	$e107 = e107::getInstance();
     $ns = e107::getRender();
     $sql = e107::getDb();
     $tp = e107::getParser();
     $frm = e107::getForm();
     if (empty($_GET['f'])) {
         return;
     }
     $function = trim($_GET['f']);
     switch ($function) {
         case 'post':
             $postId = varset($_GET['id']);
             $postInfo = $forum->postGet($postId, 'post');
             $postNum = $forum->postGetPostNum($postInfo['post_thread'], $postId);
             $postPage = ceil($postNum / $forum->prefs->get('postspage'));
             $url = e107::url('forum', 'topic', $postInfo, array('query' => array('p' => $postPage), 'fragment' => 'post-' . $postId, 'mode' => 'full'));
             e107::redirect($url);
             exit;
             break;
         case 'last':
             $pages = ceil(($thread->threadInfo['thread_total_replies'] + 1) / $thread->perPage);
             $thread->page = $_GET['p'] = $pages;
             break;
             /*              // Now linked directly - no more redirect.
             			case 'next':
             				$next = $forum->threadGetNextPrev('next', $this->threadId, $this->threadInfo['forum_id'], $this->threadInfo['thread_lastpost']);
             				if ($next)
             				{
             					$url = e107::getUrl()->create('forum/thread/view', array('id' => $next), array('encode' => false, 'full' => 1)); // no thread name info at this time
             					header("location: {$url}");
             					exit;
             				}
             				$this->message = LAN_FORUM_2013;
             				break;
             
             			case 'prev':
             				$prev = $forum->threadGetNextPrev('prev', $this->threadId, $this->threadInfo['forum_id'], $this->threadInfo['thread_lastpost']);
             				if ($prev)
             				{
             					$url = e107::getUrl()->create('forum/thread/view', array('id' => $prev), array('encode' => false, 'full' => 1));// no thread name info at this time
             					header("location: {$url}");
             					exit;
             				}
             				$this->message = LAN_FORUM_2012;
             				break;
             */
             // Moved to form_post.php
             /*
             			case 'report':
             				$threadId 	= (int)$_GET['id'];
             				$postId 	= (int)$_GET['post'];
             				$postInfo 	= $forum->postGet($postId, 'post');
             
             				if(!empty($_POST['report_thread']))
             				{
             					$report_add = $tp->toDB($_POST['report_add']);
             
             					if($forum->prefs->get('reported_post_email'))
             					{
             						require_once(e_HANDLER.'mail.php');
             						$report = LAN_FORUM_2018." ".SITENAME." : ".(substr(SITEURL, -1) == "/" ? SITEURL : SITEURL."/") . $e107->getFolder('plugins') . "forum/forum_viewtopic.php?" . $this->threadId . ".post\n
             						".LAN_FORUM_2019.": ".USERNAME. "\n" . $report_add;
             						$subject = LAN_FORUM_2020." ". SITENAME;
             						sendemail(SITEADMINEMAIL, $subject, $report);
             					}
             					// no reference of 'head' $threadInfo['head']['thread_name']
             
             					$insert = array(
             						'gen_id'        =>	0,
             						'gen_type'      =>	'reported_post',
             						'gen_datestamp' =>	time(),
             						'gen_user_id'   =>	USERID,
             						'gen_ip'        =>	$tp->toDB($postInfo['thread_name']),
             						'gen_intdata'   =>	intval($this->threadId),
             						'gen_chardata'  =>	$report_add,
             
             
             
             					);
             
             					$url = e107::getUrl()->create('forum/thread/post', array('id' => $postId, 'name' => $postInfo['thread_name'], 'thread' => $threadId)); // both post info and thread info contain thread name
             
             					$result = $sql->insert('generic', $insert);
             
             					if($result)
             					{
             						$text = "<div class='alert alert-block alert-success'><h4>".LAN_FORUM_2021 . "</h4><a href='{$url}'>".LAN_FORUM_2022.'</a></div>';
             					}
             					else
             					{
             						$text = "<div class='alert alert-block alert-error'><h4>".LAN_FORUM_2021 . "</h4><a href='{$url}'>".LAN_FORUM_2022.'</a></div>';
             					}
             
             					define('e_PAGETITLE', LAN_FORUM_1001 . " / " . LAN_FORUM_2021);
//.........这里部分代码省略.........
开发者ID:KonzolozZ,项目名称:e107,代码行数:101,代码来源:forum_viewtopic.php

示例6: show_content_author

function show_content_author()
{
    global $qs, $plugindir, $ns, $plugintable, $sql, $aa, $e107cache, $tp, $pref, $content_pref, $cobj;
    global $nextprevquery, $from, $number, $content_icon_path;
    global $CONTENT_RECENT_TABLE, $datequery, $crumb, $mainparent;
    $newcontent_shortcodes = e107::getScBatch('content', TRUE);
    $mainparent = $aa->getMainParent(intval($qs[1]));
    $content_pref = $aa->getContentPref($mainparent);
    show_content_search_menu("author", $mainparent);
    //show navigator/search/order menu
    $cachestr = "{$plugintable}.author.{$qs['1']}";
    $cachecheck = CachePre($cachestr);
    if ($cachecheck) {
        echo $cachecheck;
        return;
    }
    $content_icon_path = $tp->replaceConstants($content_pref["content_icon_path"]);
    $array = $aa->getCategoryTree("", $mainparent, TRUE);
    if (array_key_exists($qs[1], $array)) {
        $validparent = "0,0." . implode(",0.", array_keys($array));
    } else {
        $validparent = implode(",", array_keys($array));
    }
    $order = $aa->getOrder();
    $number = isset($content_pref["content_nextprev_number"]) && $content_pref["content_nextprev_number"] ? $content_pref["content_nextprev_number"] : "5";
    $nextprevquery = isset($content_pref["content_nextprev"]) && $content_pref["content_nextprev"] ? "LIMIT " . intval($from) . "," . intval($number) : "";
    $qry = " content_parent REGEXP '" . $aa->CONTENTREGEXP($validparent) . "' ";
    $sqla = "";
    if (!is_object($sqla)) {
        $sqla = new db();
    }
    if (!($author = $sqla->db_Select($plugintable, "content_author", "content_refer !='sa' AND " . $qry . " " . $datequery . " AND content_id = '" . intval($qs[1]) . "' AND content_class REGEXP '" . e_CLASS_REGEXP . "' "))) {
        $row['url_content_id'] = $mainparent;
        $url = e107::url("content", "authors", $row, "full");
        //header("location:".e_SELF."?authorx.xlist.".$mainparent); exit;
        e107::redirect($url);
    } else {
        list($content_author) = $sqla->db_Fetch();
        $sqlb = new db();
        $authordetails = $aa->getAuthor($content_author);
        $query = " content_author = '" . $authordetails[3] . "' || content_author REGEXP '^" . $authordetails[1] . "^' " . (is_numeric($content_author) ? " || content_author = '" . $authordetails[0] . "' " : "") . " ";
        $validparent = implode(",", array_keys($array));
        $qry = " content_refer !='sa' AND content_parent REGEXP '" . $aa->CONTENTREGEXP($validparent) . "' " . $datequery . " AND content_class REGEXP '" . e_CLASS_REGEXP . "' AND (" . $query . ") ";
        $contenttotal = $sqlb->db_Count($plugintable, "(*)", "WHERE " . $qry . " ");
        $authorqry = $qry . " " . $order . " " . $nextprevquery;
        $text = displayPreview($authorqry);
        $text = $aa->getCrumbPage("author", $array, $mainparent) . $text;
        $caption = $content_pref['content_author_caption'];
        if (isset($content_pref['content_author_caption_append_name']) && $content_pref['content_author_caption_append_name']) {
            $caption .= " " . $authordetails[1];
        }
        $pagination = $aa->ShowNextPrev("", $from, $number, $contenttotal);
        $ns->tablerender($caption, $text . $pagination);
    }
    $cachecheck = CachePost($cachestr);
}
开发者ID:Jimmi08,项目名称:content,代码行数:56,代码来源:content.php


注:本文中的e107::redirect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。