コード例 #1
0
ファイル: phpinfo.php プロジェクト: gitter-badger/e107
 * 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);
コード例 #2
0
ファイル: userclass2.php プロジェクト: gitter-badger/e107
/**
 *	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;
}
コード例 #3
0
ファイル: top.php プロジェクト: gitter-badger/e107
$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']) {
コード例 #4
0
ファイル: links.php プロジェクト: Jimmi08/links_page
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;
}
コード例 #5
0
ファイル: forum_viewtopic.php プロジェクト: KonzolozZ/e107
 /**
  * @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);
             
             					return $ns->tablerender(LAN_FORUM_2023, $text, array('forum_viewtopic', 'report'), true);
             				}
             				else
             				{
             					$thread_name = e107::getParser()->toHTML($postInfo['thread_name'], true, 'no_hook, emotes_off');
             					define('e_PAGETITLE', LAN_FORUM_1001.' / '.LAN_FORUM_2024.': '.$thread_name);
             					$url = e107::getUrl()->create('forum/thread/post', array('id' => $postId, 'name' => $postInfo['thread_name'], 'thread' => $threadId));
             					$actionUrl = e107::getUrl()->create('forum/thread/report', "id={$threadId}&post={$postId}");
             
             
             					if(deftrue('BOOTSTRAP')) //v2.x
             					{
             						$text = $frm->open('forum-report-thread','post');
             						$text .= "
             							<div>
             								<div class='alert alert-block alert-warning'>
             								<h4>".LAN_FORUM_2025.': '.$thread_name."</h4>
             									".LAN_FORUM_2027."<br />".str_replace(array('[', ']'), array('<b>', '</b>'), LAN_FORUM_2028)."
             								<a class='pull-right btn btn-xs btn-primary e-expandit' href='#post-info'>View Post</a>
             								</div>
             								<div id='post-info' class='e-hideme alert alert-block alert-danger'>
             									".$tp->toHtml($postInfo['post_entry'],true)."
             								</div>
             								<div class='form-group' >
             									<div class='col-md-12'>
             								".$frm->textarea('report_add','',10,35,array('size'=>'xxlarge'))."
             									</div>
             								</div>
             								<div class='form-group'>
             									<div class='col-md-12'>
             									".$frm->button('report_thread',1,'submit',LAN_FORUM_2029)."
             									</div>
             								</div>
             
             							</div>";
             
             						$text .= $frm->close();
             					//	$text .= print_a($postInfo['post_entry'],true);
             
             					}
             					else //v1.x legacy layout.
             					{
             						$text = "<form action='".$actionUrl."' method='post'>
             						<table class='table' style='width:100%'>
             						<tr>
             							<td  style='width:50%'>
             							".LAN_FORUM_2025.': '.$thread_name." <a href='".$url."'><span class='smalltext'>".LAN_FORUM_2026."</span></a>
             							</td>
             							<td style='text-align:center;width:50%'></td>
             						</tr>
             						<tr>
             							<td>".LAN_FORUM_2027."<br />".str_replace(array('[', ']'), array('<b>', '</b>'), LAN_FORUM_2028)."</td>
             						</tr>
             						<tr>
             							<td style='text-align:center;'><textarea cols='40' rows='10' class='tbox' name='report_add'></textarea></td>
             						</tr>
             						<tr>
             							<td colspan='2' style='text-align:center;'><br /><input class='btn btn-default button' type='submit' name='report_thread' value='".LAN_FORUM_2029."' /></td>
             						</tr>
             						</table>
             						</form>";
             
             
             
             					}
             
             
             					return e107::getRender()->tablerender(LAN_FORUM_2023, $text, array('forum_viewtopic', 'report2'), true);
             				}
             
             				exit;
             				break;*/
     }
 }
コード例 #6
0
ファイル: content.php プロジェクト: Jimmi08/content
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);
}