protected function setDefaultRankData() { e107::coreLan('userclass'); $this->ranks = array('data' => array(), 'special' => array()); $this->ranks['data'][1] = array('name' => '', 'thresh' => 20, 'image' => 'lev1.png', 'lan_pfx' => '', 'id' => 1); $this->ranks['data'][2] = array('name' => '', 'thresh' => 100, 'image' => 'lev2.png', 'lan_pfx' => '', 'id' => 2); $this->ranks['data'][3] = array('name' => '', 'thresh' => 250, 'image' => 'lev3.png', 'lan_pfx' => '', 'id' => 3); $this->ranks['data'][4] = array('name' => '', 'thresh' => 410, 'image' => 'lev4.png', 'lan_pfx' => '', 'id' => 4); $this->ranks['data'][5] = array('name' => '', 'thresh' => 580, 'image' => 'lev5.png', 'lan_pfx' => '', 'id' => 5); $this->ranks['data'][6] = array('name' => '', 'thresh' => 760, 'image' => 'lev6.png', 'lan_pfx' => '', 'id' => 6); $this->ranks['data'][7] = array('name' => '', 'thresh' => 950, 'image' => 'lev7.png', 'lan_pfx' => '', 'id' => 7); $this->ranks['data'][8] = array('name' => '', 'thresh' => 1150, 'image' => 'lev8.png', 'lan_pfx' => '', 'id' => 8); $this->ranks['data'][9] = array('name' => '', 'thresh' => 1370, 'image' => 'lev9.png', 'lan_pfx' => '', 'id' => 9); $this->ranks['data'][10] = array('name' => '', 'thresh' => 1371, 'image' => 'lev10.png', 'lan_pfx' => '', 'id' => 10); // special $this->ranks['special'][1] = array('name' => UC_LAN_6, 'thresh' => 1, 'image' => 'English_main_admin.png', 'lan_pfx' => '1', 'id' => 11); $this->ranks['special'][2] = array('name' => UC_LAN_5, 'thresh' => 2, 'image' => 'English_admin.png', 'lan_pfx' => '1', 'id' => 12); $this->ranks['special'][3] = array('name' => UC_LAN_7, 'thresh' => 3, 'image' => 'English_moderator.png', 'lan_pfx' => '1', 'id' => 13); }
* * Copyright (C) e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * URL and front controller Management * * $URL$ * $Id$ */ require_once '../class2.php'; if (!ADMIN || !getperms('L')) { e107::redirect('admin'); exit; } e107::coreLan('eurl', true); // TODO - admin interface support, remove it from globals $e_sub_cat = 'eurl'; e107::css('inline', " span.e-help { cursor: help } "); class eurl_admin extends e_admin_dispatcher { protected $modes = array('main' => array('controller' => 'eurl_admin_ui', 'path' => null, 'ui' => 'eurl_admin_form_ui', 'uipath' => null)); protected $adminMenu = array('main/config' => array('caption' => LAN_EURL_MENU_CONFIG, 'perm' => 'L'), 'main/alias' => array('caption' => LAN_EURL_MENU_ALIASES, 'perm' => 'L'), 'main/settings' => array('caption' => LAN_EURL_MENU_SETTINGS, 'perm' => 'L'), 'main/simple' => array('caption' => LAN_EURL_MENU_REDIRECTS, 'perm' => 'L')); protected $adminMenuAliases = array(); protected $defaultAction = 'config'; protected $menuTitle = LAN_EURL_MENU; } class eurl_admin_ui extends e_admin_controller_ui { public $api; protected $prefs = array('url_disable_pathinfo' => array('title' => LAN_EURL_SETTINGS_PATHINFO, 'type' => 'boolean', 'help' => LAN_EURL_MODREWR_DESCR), 'url_main_module' => array('title' => LAN_EURL_SETTINGS_MAINMODULE, 'type' => 'dropdown', 'data' => 'string', 'help' => LAN_EURL_SETTINGS_MAINMODULE_HELP), 'url_error_redirect' => array('title' => LAN_EURL_SETTINGS_REDIRECT, 'type' => 'boolean', 'help' => LAN_EURL_SETTINGS_REDIRECT_HELP), 'url_sef_translate' => array('title' => LAN_EURL_SETTINGS_SEFTRANSLATE, 'type' => 'dropdown', 'data' => 'string', 'help' => LAN_EURL_SETTINGS_SEFTRANSLATE_HELP));
function preAction() { e107::coreLan('error'); }
<?php /* * e107 website system * * Copyright 2008-2014 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * Interface for users who have forgotten their password * */ require_once 'class2.php'; e107::coreLan('fpw'); $tp = e107::getParser(); if (USER && !getperms('0')) { header('location:' . e_BASE . 'index.php'); exit; } if ($pref['fpwcode'] && extension_loaded('gd')) { define('USE_IMAGECODE', TRUE); $sec_img = e107::getSecureImg(); } else { define('USE_IMAGECODE', FALSE); } class fpw_shortcodes extends e_shortcode { private $secImg; function __construct() { global $sec_img;
* e107 website system * * Copyright (C) 2008-2012 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * * * $URL$ * $Id$ */ // Mods to show extended field categories if (!defined('e107_INIT')) { exit; } e107::coreLan('signup'); class signup_shortcodes extends e_shortcode { function sc_signup_coppa_form() { if (strpos(LAN_SIGNUP_77, "stage") !== FALSE) { return ""; } else { return "\n\t\t\t<form method='post' action='" . e_SELF . "?stage1' autocomplete='off'>\n\n\t\t\t<div><br />\n\t\t\t<input type='radio' name='coppa' value='0' checked='checked' /> " . LAN_NO . "\n\t\t\t<input type='radio' name='coppa' value='1' /> " . LAN_YES . "<br />\n\t\t\t<br />\n\t\t\t<input class='btn btn-primary button' type='submit' name='newver' value=\"" . LAN_CONTINUE . "\" />\n\t\t\t</div></form>\n\t\t"; } } function sc_signup_xup($param) { switch ($param) { case 'login': return $this->sc_signup_xup_login($param);
/** * Core NEXTPREV shortcode * Comma separated parameters are now deprecated. * Parameter string should be formatted as if it were the query string passed via a URL: * <code>$parm = 'total=10&amount=5¤t=0&type=...'</code> * * Parameter list: * - total (integer) [required]: total records/pages * - amount (integer| string 'all') [required]: Records per page, always 1 when we counting pages (see 'type' parameter), ignored where tmpl_prefix is not set and 'old_np' pref is false * - current (integer)[required]: Current record/page * - type (string page|record) [optional]: What kind of navigation logic we need, default is 'record' (the old way) * * - url (rawurlencode'd string) [required]: URL template, will be rawurldecode'd after parameters are parsed to array, '--AMP--' strings will be replaced with '&' * NOTE: URL should be DOUBLE encoded, which means you need to encode the query only of passed URL (W3C standards) and rawurlencode the whole URL string * The reason to do this is to not break the whole shortcode $parm string, shortcode itself is doing decode once, which means we'll end up with correct, W3C compliant URL string * 'url' now supports url::module/controller/action?id=xxx--AMP--name=yyy--AMP--page=--FROM--::full=1 and route::news/list/category::id=xxx--AMP--name=yyy--AMP--page=--FROM--::full=1 formats * * Preffered 'FROM' template is now '--FROM--' (instead '[FROM]') * - caption (rawurlencode'd string) [optional]: Label, rawurldecode'd after parameters are parsed to array, language constants are supported * - pagetitle (rawurlencode'd string) [optional]: Page labels, rawurldecode'd after parameters are parsed to array, * separated by '|', if present they will be used as lablels instead page numbers; language constants are supported * - plugin (string) [optional]: plugin name used for template loading * - tmpl_prefix (string) [optional]: template keys prefix; core supported are 'default' and 'dropdown', default depends on 'old_np' pref * - navcount (integer) [optional]: number of navigation items to be shown, minimal allowed value is 4, default is 10 * - nonavcount (no value) [optional]: if is set it'll disable navigation counting (navcount will be ignored) * - bullet (string) [optional]: currently it should contain the markup to be prepended to the navigation item title * * WARNING: You have to do rawuldecode() on url, caption and title parameter values (before passing them to the shortcode) * or you'll break the whole script * * TODO - add create URL support when new URL handler is ready * * @param string $parm * @return string page navigation bar HTML */ function nextprev_shortcode($parm = '') { $e107 = e107::getInstance(); $pref = e107::getPref(); $tp = e107::getParser(); e107::coreLan('np'); /** * The NEW way. * New parameter requirements formatted as a GET string. * Template support. */ if (strpos($parm, 'total=') !== false) { parse_str($parm, $parm); // Calculate $total_items = intval($parm['total']); $check_render = true; if (vartrue($parm['glyphs']) && deftrue('BOOTSTRAP')) { $LAN_NP_FIRST = $tp->toGlyph("icon-fast-backward.glyph", false); $LAN_NP_PREVIOUS = $tp->toGlyph("icon-backward.glyph", false); $LAN_NP_NEXT = $tp->toGlyph("icon-forward.glyph", false); $LAN_NP_LAST = $tp->toGlyph("icon-fast-forward", false); } else { $LAN_NP_FIRST = LAN_NP_FIRST; $LAN_NP_PREVIOUS = LAN_NP_PREVIOUS; $LAN_NP_NEXT = LAN_NP_NEXT; $LAN_NP_LAST = LAN_NP_LAST; } // search for template keys - default_start, default_end etc. if (isset($parm['tmpl_prefix'])) { // forced $tprefix = vartrue($parm['tmpl_prefix'], 'default'); //$perpage = $parm['amount'] !== 'all' ? intval($parm['amount']) : $total_items; } elseif (isset($parm['tmpl'])) { // forced $tprefix = vartrue($parm['tmpl'], 'default'); //$perpage = $parm['amount'] !== 'all' ? intval($parm['amount']) : $total_items; } elseif ($pref['old_np']) { $tprefix = 'default'; //$perpage = $parm['amount'] !== 'all' ? intval($parm['amount']) : $total_items; } else { $tprefix = 'dropdown'; //$parm['amount'] = 'all'; } if ($tprefix == 'default' && deftrue('BOOTSTRAP')) { $tprefix = 'bootstrap'; } $tprefix .= '_'; if ($parm['amount'] === 'all') { $perpage = 1; // amount is ignored $check_render = $total_items > 1; } else { $perpage = intval($parm['amount']); } if (!$check_render) { return ''; } // TODO - rename old_np to something more meaningful $current_start = intval($parm['current']); $nptype = varset($parm['type'], 'record'); switch ($nptype) { case 'page': $perpage = 1; $current_page = $current_start; $first_page = 1; $next_page = $current_page + 1; $prev_page = $current_page - 1; $total_pages = $last_page = $total_items; $index_add = 1; break; default: $total_pages = ceil($total_items / $perpage); $last_page = ceil($total_pages * $perpage) - $perpage; $current_page = $current_start / $perpage + 1; $next_page = $current_page * $perpage; $prev_page = $current_start - $perpage; $first_page = 0; $index_add = 0; break; } if ($total_pages <= 1) { return ''; } // urldecoded once by parse_str() if (substr($parm['url'], 0, 7) == 'route::') { // New - use URL assembling engine // Format is: route::module/controller/action::urlParams::urlOptions // Example: route::news/list/category::id=xxx--AMP--name=yyy--AMP--page=--FROM--::full=1 // WARNING - url parameter string have to be rawurlencode-ed BEFORE passed to the shortcode, or it'll break everything $urlParms = explode('::', str_replace('--AMP--', '&', $parm['url'])); $url = str_replace('--FROM--', '[FROM]', $e107->url->create($urlParms[1], $urlParms[2], varset($urlParms[3]))); } elseif (substr($parm['url'], 0, 5) == 'url::') { // New - use URL assembling engine // Format is: url::module/controller/action?id=xxx--AMP--name=yyy--AMP--page=--FROM--::full=1 // WARNING - url parameter string have to be rawurlencode-ed BEFORE passed to the shortcode, or it'll break everything $urlParms = explode('::', str_replace('--AMP--', '&', $parm['url'])); $url = str_replace('--FROM--', '[FROM]', $e107->url->create($urlParms[1], array(), varset($urlParms[2]))); } else { $url = str_replace(array('--FROM--', '--AMP--'), array('[FROM]', '&'), $parm['url']); } // Simple parser vars $e_vars = new e_vars(array('total_pages' => $total_pages, 'current_page' => $current_page)); // urldecoded by parse_str() if (!varset($parm['caption'])) { $e_vars->caption = 'LAN_NP_CAPTION'; } // Advanced multilingual support: 'Page [x] of [y]' -> match the exact argument, result would be 'Page 1 of 20' $e_vars->caption = $tp->lanVars(defset($e_vars->caption, $e_vars->caption), array('x' => $current_page, 'y' => $total_pages)); // sprintXX(defset($e_vars->caption, $e_vars->caption), $current_page, $total_pages); // urldecoded by parse_str() $pagetitle = explode('|', vartrue($parm['pagetitle'])); // new - bullet support $bullet = vartrue($parm['bullet'], ''); // no navigation counter if (isset($parm['nonavcount'])) { $navcount = $total_pages; $navmid = 0; } else { // navigation number settings $navcount = abs(intval(vartrue($parm['navcount'], 10))); // prevent infinite loop! if ($navcount < 4) { $navcount = 4; } $navmid = floor($navcount / 2); } // get template - nextprev_template.php, support for plugin template locations - myplug/templates/nextprev_template.php $tmpl = e107::getTemplate(varset($parm['plugin'], null), 'nextprev'); // init advanced navigation visibility $show_first = $show_prev = $current_page != 1; $show_last = $show_next = $current_page != $total_pages; // Render // Parse via simpleParse() $tp = e107::getParser(); // Nextprev navigation start $ret = $tp->simpleParse($tmpl[$tprefix . 'start'], $e_vars); // caption, e.g. 'Page 1 of 20' box if ($e_vars->caption) { $ret .= $tp->simpleParse($tmpl[$tprefix . 'nav_caption'], $e_vars); } $ret_array = array(); // Show from 1 to $navcount || $total_pages if ($current_page <= $navmid || $total_pages <= $navcount) { $loop_start = 0; $loop_end = $navcount; $show_first = false; if ($navcount >= $total_pages) { $loop_end = $total_pages; $show_last = false; } } else { if ($current_page + $navmid >= $total_pages) { $loop_start = $total_pages - $navcount; if ($loop_start < 0) { $loop_start = 0; } $loop_end = $total_pages; $show_last = false; } else { $loop_start = $current_page - $navmid; $loop_end = $current_page + ($navcount - $navmid); // odd/even $navcount support if ($loop_start < 0) { $loop_start = 0; } elseif ($loop_end > $total_pages) { $loop_end = $total_pages; $show_last = false; } } } // Add 'first', 'previous' navigation if ($show_prev) { if ($show_first && !empty($tmpl[$tprefix . 'nav_first'])) { $e_vars->url = str_replace('[FROM]', $first_page, $url); $e_vars->label = $LAN_NP_FIRST; $e_vars->url_label = LAN_NP_URLFIRST; $ret_array[] = $tp->simpleParse($tmpl[$tprefix . 'nav_first'], $e_vars); } if (!empty($tmpl[$tprefix . 'nav_prev'])) { $e_vars->url = str_replace('[FROM]', $prev_page, $url); $e_vars->label = $LAN_NP_PREVIOUS; $e_vars->url_label = LAN_NP_URLPREVIOUS; $ret_array[] = $tp->simpleParse($tmpl[$tprefix . 'nav_prev'], $e_vars); } } $e_vars_loop = new e_vars(); $e_vars_loop->bullet = stripslashes($bullet); // fix magicquotes $ret_items = array(); for ($c = $loop_start; $c < $loop_end; $c++) { $label = ''; if (varset($pagetitle[$c])) { $label = defset($pagetitle[$c], $pagetitle[$c]); } $e_vars_loop->url = str_replace('[FROM]', $perpage * ($c + $index_add), $url); $e_vars_loop->label = $label ? $tp->toHTML(stripslashes($label), false, 'TITLE') : $c + 1; //quick fix servers with magicquotes - stripslashes() if ($c + 1 == $current_page) { $e_vars_loop->url_label = $label ? $tp->toAttribute($label) : LAN_NP_URLCURRENT; $ret_items[] = $tp->simpleParse($tmpl[$tprefix . 'item_current'], $e_vars_loop); } else { $e_vars_loop->url_label = $label ? $tp->toAttribute($label) : LAN_NP_GOTO; $e_vars_loop->url_label = str_replace("[x]", $c + 1, $e_vars_loop->url_label); $ret_items[] = $tp->simpleParse($tmpl[$tprefix . 'item'], $e_vars_loop); } } $ret_array[] = $tp->simpleParse($tmpl[$tprefix . 'items_start'], $e_vars) . implode($tmpl[$tprefix . 'separator'], $ret_items) . $tp->simpleParse($tmpl[$tprefix . 'items_end'], $e_vars); unset($ret_items, $e_vars_loop); if ($show_next) { if (!empty($tmpl[$tprefix . 'nav_next'])) { $e_vars->url = str_replace('[FROM]', $next_page, $url); $e_vars->label = $LAN_NP_NEXT; $e_vars->url_label = LAN_NP_URLNEXT; $ret_array[] = $tp->simpleParse($tmpl[$tprefix . 'nav_next'], $e_vars); } if ($show_last && !empty($tmpl[$tprefix . 'nav_last'])) { $e_vars->url = str_replace('[FROM]', $last_page, $url); //$last_page $e_vars->label = $LAN_NP_LAST; $e_vars->url_label = LAN_NP_URLLAST; $ret_array[] = $tp->simpleParse($tmpl[$tprefix . 'nav_last'], $e_vars); } } $ret .= implode($tmpl[$tprefix . 'separator'], $ret_array); // Nextprev navigation end $ret .= $tp->simpleParse($tmpl[$tprefix . 'end'], $e_vars); unset($e_vars, $ret_array); return $ret; } else { $parm_count = substr_count($parm, ','); while ($parm_count < 5) { $parm .= ','; $parm_count++; } $p = explode(',', $parm, 6); $total_items = intval($p[0]); $perpage = intval($p[1]); // page number instead record start now supported if (is_numeric($p[2])) { $current_start = intval($p[2]); $current_page = $current_start / $perpage + 1; $total_pages = ceil($total_items / $perpage); $index_add = 0; } else { $perpage = 1; $current_start = intval(array_pop(explode(':', $p[2], 2))); $current_page = $current_start; $total_pages = $total_items; $index_add = 1; } if ($total_items < $perpage) { return ''; } $url = trim($p[3]); $caption = trim($p[4]); $pagetitle = explode('|', trim($p[5])); $caption = !$caption || $caption == 'off' ? LAN_GOPAGE . ' ' : $caption; while (substr($url, -1) == '.') { $url = substr($url, 0, -1); } } if ($total_pages > 1) { if (vartrue($pref['old_np'])) { $NP_PRE_ACTIVE = ''; $NP_POST_ACTIVE = ''; $NP_STYLE = ''; if (!defined('NEXTPREV_NOSTYLE') || NEXTPREV_NOSTYLE == FALSE) { $NP_PRE_ACTIVE = '['; $NP_POST_ACTIVE = '] '; $NP_STYLE = "style='text-decoration:underline'"; } // Use OLD nextprev method $nppage = ''; $nppage .= "\n\n<!-- Start of Next/Prev -->\n\n"; if ($total_pages > 10) { //$current_page = ($current_start/$perpage)+1; for ($c = 0; $c <= 2; $c++) { if ($perpage * ($c + $index_add) == $current_start) { $nppage .= $NP_PRE_ACTIVE . "<span class='nextprev_current' {$NP_STYLE} >" . ($c + 1) . "</span>" . $NP_POST_ACTIVE . "\n"; } else { $link = str_replace("[FROM]", $perpage * ($c + $index_add), $url); $nppage .= "<a class='nextprev_link' href='{$link}'>" . ($c + 1) . "</a> \n"; } } if ($current_page >= 3 && $current_page <= 5) { for ($c = 3; $c <= $current_page; $c++) { if ($perpage * ($c + $index_add) == $current_start) { $nppage .= $NP_PRE_ACTIVE . "<span class='nextprev_current' {$NP_STYLE} >" . ($c + 1) . "</span>" . $NP_POST_ACTIVE . "\n"; } else { $link = str_replace("[FROM]", $perpage * ($c + $index_add), $url); $nppage .= "<a class='nextprev_link' href='{$link}'>" . ($c + 1) . "</a> \n"; } } } else { if ($current_page >= 6 && $current_page <= $total_pages - 5) { $nppage .= " ... "; for ($c = $current_page - 2; $c <= $current_page; $c++) { if ($perpage * ($c + $index_add) == $current_start) { $nppage .= $NP_PRE_ACTIVE . "<span class='nextprev_current' {$NP_STYLE} >" . ($c + 1) . "</span>" . $NP_POST_ACTIVE . "\n"; } else { $link = str_replace("[FROM]", $perpage * ($c + $index_add), $url); $nppage .= "<a class='nextprev_link' href='{$link}'>" . ($c + 1) . "</a> \n"; } } } } $nppage .= " ... "; if ($current_page + 5 > $total_pages && $current_page != $total_pages) { $tmp = $current_page - 2; } else { $tmp = $total_pages - 3; } for ($c = $tmp; $c <= $total_pages - 1; $c++) { if ($perpage * ($c + $index_add) == $current_start) { $nppage .= $NP_PRE_ACTIVE . "<span class='nextprev_current' {$NP_STYLE} >" . ($c + 1) . "</span>" . $NP_POST_ACTIVE . "\n"; } else { $link = str_replace("[FROM]", $perpage * ($c + $index_add), $url); $nppage .= "<a class='nextprev_link' href='{$link}'>" . ($c + 1) . "</a> \n"; } } } else { for ($c = 0; $c < $total_pages; $c++) { if ($perpage * ($c + $index_add) == $current_start) { $nppage .= $NP_PRE_ACTIVE . "<span class='nextprev_current' {$NP_STYLE} >" . ($c + 1) . "</span>" . $NP_POST_ACTIVE . "\n"; } else { $link = str_replace("[FROM]", $perpage * ($c + $index_add), $url); $nppage .= "<a class='nextprev_link' href='{$link}'>" . ($c + 1) . "</a> \n"; } } } $nppage .= "\n\n<!-- End of Next/Prev -->\n\n"; return $caption . $nppage; } // Use NEW nextprev method $np_parm['template'] = "<span class='form-group form-inline'>[PREV] [DROPDOWN] [NEXT]<span>"; $np_parms['prev'] = ' << '; $np_parms['next'] = ' >> '; $np_parms['np_class'] = 'tbox npbutton btn btn-default'; $np_parms['dropdown_class'] = 'tbox npdropdown form-control'; $caption = ''; // legacy has no caption. if ($cached_parms = getcachedvars('nextprev')) { $tmp = $cached_parms; foreach ($tmp as $key => $val) { $np_parms[$key] = $val; } } $prev = ''; $next = ''; if ($current_page > 1) { $prevstart = $current_start - $perpage; if (substr($url, 0, 5) == 'url::') { $urlParms = explode('::', $url); $urlParms[2] = str_replace('[FROM]', $prevstart, $urlParms[2]); $link = $e107->url->create($urlParms[1], $urlParms[2], varset($urlParms[3])); } else { $link = str_replace('[FROM]', $prevstart, $url); } $prev = "<a class='{$np_parms['np_class']}' style='text-decoration:none' href='{$link}'>{$np_parms['prev']}</a>"; } if ($current_page < $total_pages) { $nextstart = $current_start + $perpage; if (substr($url, 0, 5) == 'url::') { $urlParms = explode('::', $url); $urlParms[2] = str_replace('[FROM]', $nextstart, $urlParms[2]); $link = $e107->url->create($urlParms[1], $urlParms[2], varset($urlParms[3])); } else { $link = str_replace('[FROM]', $nextstart, $url); } $next = "<a class='{$np_parms['np_class']}' style='text-decoration:none' href='{$link}'>{$np_parms['next']}</a>"; } $dropdown = "<select class='{$np_parms['dropdown_class']}' name='pageSelect' onchange='location.href=this.options[selectedIndex].value'>"; for ($i = 1; $i <= $total_pages; $i++) { $sel = ''; if ($current_page == $i) { $sel = " selected='selected' "; } $newstart = ($i - 1 + $index_add) * $perpage; if (substr($url, 0, 5) == 'url::') { $urlParms = explode('::', $url); $urlParms[2] = str_replace('[FROM]', $newstart, $urlParms[2]); $link = $e107->url->create($urlParms[1], $urlParms[2], varset($urlParms[3])); } else { $link = str_replace('[FROM]', $newstart, $url); } $c = $i - 1 + $index_add; $title = isset($pagetitle[$c]) && $pagetitle[$c] ? $pagetitle[$c] : $i; $dropdown .= "<option value='{$link}' {$sel}>{$title}</option>\n"; } $dropdown .= '</select>'; $ret = $np_parm['template']; // Set default if (isset($np_parms['template']) && $np_parms['template']) { $ret = $np_parms['template']; // Use override } $ret = str_replace('[DROPDOWN]', $dropdown, $ret); $ret = str_replace('[PREV]', $prev, $ret); $ret = str_replace('[NEXT]', $next, $ret); return $caption . $ret; } }
* @version $Id$; * * Extended user field handler * * @todo: - change some routines to access the cached variables rather than DB * @todo: Remove setting up of _FIELD_TYPES array (may be necessary, since UEF data structure not fixed) * @todo: Consider changing field type constants to class constants * @todo - cache field structure (already done in a different way in e107::user() in class2.php line 1387 or so) * @todo - class variables - confirm whether public/protected assignments are correct * @todo - consider whether to split system and non-system fields Code uses two tables: user_extended_struct - individual field definitions, one record per field user_extended - actual field data, one record per user @todo: Should user_extended_validate_entry() check DB for DB-type fields? */ e107::coreLan('user_extended'); class e107_user_extended { public $user_extended_types; // Text description corresponding to each field type private $extended_xml = FALSE; public $typeArray; // Cross-reference between names of field types, and numeric ID (must be public) private $reserved_names; // List of field names used in main user DB - not allowed in extended DB public $fieldDefinitions; // Array initialised from DB by constructor - currently all fields public $catDefinitions; // Categories private $nameIndex; // Array for field name lookup - initialised by constructor
} public function logout() { if (!e107::getPref('social_login_active', false) || !$this->adapter || !Hybrid_Auth::isConnectedWith($this->getProvider())) { return true; } try { $this->adapter->logout(); $this->adapter = null; } catch (Exception $e) { return $e->getMessage(); } return true; } } e107::coreLan('administrator', true); class e_userperms { protected $core_perms = array(); protected $plugin_perms = array(); protected $language_perms = array(); protected $main_perms = array(); protected $full_perms = array(); protected $permSectionDiz = array('core' => LAN_GENERAL, 'plugin' => ADLAN_CL_7, 'language' => ADLAN_132, 'main' => ADMSLAN_58); function __construct() { $this->core_perms = array("C" => array(ADLAN_74, E_16_CACHE, E_32_CACHE), "F" => array(ADLAN_58, E_16_EMOTE, E_32_EMOTE), "G" => array(ADLAN_60, E_16_FRONT, E_32_FRONT), "L" => array(ADLAN_132, E_16_LANGUAGE, E_32_LANGUAGE), "T" => array(ADLAN_66, E_16_META, E_32_META), "1" => array(LAN_PREFS, E_16_PREFS, E_32_PREFS), "X" => array(LAN_SEARCH, E_16_SEARCH, E_32_SEARCH), "I" => array(ADLAN_138, E_16_LINKS, E_32_LINKS), "8" => array(ADMSLAN_27, E_16_LINKS, E_32_LINKS), "K" => array(ADLAN_159, E_16_EURL, E_32_EURL), "3" => array(ADLAN_8, E_16_ADMIN, E_32_ADMIN), "4" => array(LAN_USER_MANAGEALL, E_16_USER, E_32_USER), "U0" => array(ADLAN_34, E_16_USER, E_32_USER), "U1" => array(LAN_USER_QUICKADD, E_16_USER, E_32_USER), "U2" => array(LAN_USER_OPTIONS, E_16_USER, E_32_USER), "U3" => array(LAN_USER_RANKS, E_16_USER, E_32_USER), "W" => array(ADLAN_136, E_16_MAIL, E_32_MAIL), "5" => array(ADLAN_42, E_16_CUST, E_32_CUST), "J" => array(ADLAN_42, E_16_CUST, E_32_CUST), "H" => array(ADLAN_0, E_16_NEWS, E_32_NEWS), "H0" => array(ADLAN_0 . " (" . LAN_CREATE . ")", E_16_NEWS, E_32_NEWS), "H1" => array(ADLAN_0 . " (" . LAN_EDIT . ")", E_16_NEWS, E_32_NEWS), "H2" => array(ADLAN_0 . " (" . LAN_DELETE . ")", E_16_NEWS, E_32_NEWS), "H3" => array(ADLAN_0 . " (" . LAN_CATEGORY . " - " . LAN_CREATE . ")", E_16_NEWS, E_32_NEWS), "H4" => array(ADLAN_0 . " (" . LAN_CATEGORY . " - " . LAN_EDIT . ")", E_16_NEWS, E_32_NEWS), "H5" => array(ADLAN_0 . " (" . LAN_CATEGORY . " - " . LAN_DELETE . ")", E_16_NEWS, E_32_NEWS), "N" => array(ADLAN_0 . " (" . LAN_SUBMITTED . ")", E_16_NEWS, E_32_NEWS), "V" => array(ADLAN_31, E_16_UPLOADS, E_32_UPLOADS), "M" => array(ADLAN_28, E_16_WELCOME, E_32_WELCOME), "Y" => array(ADLAN_147, E_16_INSPECT, E_32_INSPECT), "9" => array(ADLAN_40, E_16_MAINTAIN, E_32_MAINTAIN), "O" => array(ADLAN_149, E_16_NOTIFY, E_32_NOTIFY), "U" => array(ADLAN_157, E_16_CRON, E_32_CRON), "S" => array(ADLAN_155, E_16_ADMINLOG, E_32_ADMINLOG), "B" => array(LAN_COMMENTMAN, E_16_COMMENT, E_32_COMMENT), "6" => array(LAN_MEDIAMANAGER, E_16_FILE, E_32_FILE), "A" => array(LAN_MEDIAMANAGER . " (" . LAN_ALL . ")", E_16_IMAGES, E_32_IMAGES), "A1" => array(LAN_MEDIAMANAGER . " (" . LAN_UPLOAD . "/" . LAN_IMPORT . ")", E_16_IMAGES, E_32_IMAGES), "A2" => array(LAN_MEDIAMANAGER . " (" . LAN_CATEGORIES . ")", E_16_IMAGES, E_32_IMAGES), "2" => array(ADLAN_6, E_16_MENUS, E_32_MENUS)); $sql = e107::getDb('sql2'); $tp = e107::getParser(); $plg = e107::getPlugin(); $allPlugins = $plg->getall(1);
/* * e107 website system * * Copyright (C) 2008-2011 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * User posts page * * $URL$ * $Id$ * */ require_once 'class2.php'; e107::coreLan('userposts'); require_once e_HANDLER . 'comment_class.php'; $cobj = new comment(); $e107 = e107::getInstance(); $sql = e107::getDb(); $pref = e107::getPref(); $tp = e107::getParser(); $ns = e107::getRender(); require_once HEADERF; $action = 'exit'; if (e_QUERY) { $tmp = explode('.', e_QUERY); $from = intval($tmp[0]); // Always defined $action = varset($tmp[1], 'exit'); if (!isset($tmp[2])) {
* $URL$ * $Id$ */ /** * @package e107 * @subpackage admin * @version $Id$ * * Manage site navigation links */ require_once "../class2.php"; if (!getperms("I")) { header("location:" . e_BASE . "index.php"); exit; } e107::coreLan('links', true); class links_admin extends e_admin_dispatcher { protected $modes = array('main' => array('controller' => 'links_admin_ui', 'path' => null, 'ui' => 'links_admin_form_ui', 'uipath' => null)); protected $adminMenu = array('main/list' => array('caption' => LCLAN_62, 'perm' => 'I'), 'main/create' => array('caption' => LCLAN_63, 'perm' => 'I'), 'main/prefs' => array('caption' => LAN_OPTIONS, 'perm' => 'I'), 'main/sublinks' => array('caption' => LINKLAN_4, 'perm' => 'I')); protected $adminMenuAliases = array('main/edit' => 'main/list'); protected $menuTitle = 'links'; } class links_admin_ui extends e_admin_ui { protected $pluginTitle = "Site links"; protected $pluginName = 'core'; protected $table = "links"; protected $listQry = ''; protected $pid = "link_id"; protected $perPage = 0;
function init() { $sql = e107::getDb(); $tp = e107::getParser(); if (!empty($_POST['resendToAll'])) { $resetPasswords = !empty($_POST['resetPasswords']); $age = vartrue($_POST['resendAge'], 24); $class = vartrue($_POST['resendClass'], false); $this->resend_to_all($resetPasswords, $age, $class); } if ($this->getAction() == 'edit') { $this->fields['user_class']['noedit'] = true; } // Extended fields - FIXME - better field types if ($sql->select('user_extended_struct', '*', "user_extended_struct_type > 0 AND user_extended_struct_text != '_system_' ORDER BY user_extended_struct_parent ASC")) { // TODO FIXME use the handler to build fields and field attributes // FIXME a way to load 3rd party language files for extended user fields e107::coreLan('user_extended'); while ($row = $sql->fetch()) { $field = "user_" . $row['user_extended_struct_name']; // $title = ucfirst(str_replace("user_","",$field)); $label = $tp->toHtml($row['user_extended_struct_text'], false, 'defs'); $this->fields[$field] = array('title' => $label, 'width' => 'auto', 'type' => 'method', 'method' => 'user_extended', 'data' => false, 'tab' => 1, 'noedit' => false); $this->extended[] = $field; $this->extendedData[$field] = $row; } } $this->fields['user_signature']['writeParms']['data'] = e107::getUserClass()->uc_required_class_list("classes"); $this->fields['user_signature'] = array('title' => LAN_USER_09, 'type' => 'textarea', 'data' => 'str', 'width' => 'auto'); $this->fields['options'] = array('title' => LAN_OPTIONS, 'type' => 'method', 'forced' => TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'left'); if (!getperms('4|U0')) { unset($this->fields['checkboxes']); unset($this->fields['options']); } $this->fields['user_image']['writeParms'] = $this->getAvatarList(); if (!empty($_GET['readonly'])) { foreach ($this->fields as $key => $v) { if ($key == 'options' || $key == 'checkboxes') { continue; } $this->fields[$key]['readonly'] = 2; } } // print_a($this->fields); if (!empty($_GET['iframe'])) { define('e_IFRAME', true); } //FIXME - handle user extended search... //$this->_alias_parsed = false; //$this->parseAliases(); // if(isset ($_POST['adduser'])) // { // addUser(); // } }
| Copyright (C) 2008-2009 e107 Inc | http://e107.org | | | Released under the terms and conditions of the | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/print.php,v $ | $Revision$ | $Date$ | $Author$ +----------------------------------------------------------------------------+ */ require_once "class2.php"; //include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); e107::coreLan('print'); $qs = explode(".", e_QUERY, 2); if ($qs[0] == "") { header("location:" . e_BASE . "index.php"); exit; } $CSS = <<<CSS \tbody { background: #fff; color: #000 } @media print { \timg { display: block; } img, table, ul, ol, .code-snippet {
* */ if (isset($_GET['configure'])) { //Switch to Front-end $_GET['configure'] = preg_replace('[^a-z0-9_-]', '', $_GET['configure']); define("USER_AREA", true); //Switch to desired layout define('THEME_LAYOUT', $_GET['configure']); } require_once "../class2.php"; if (!getperms("2")) { e107::redirect('admin'); exit; } e107::coreLan('menus', true); e107::coreLan('admin', true); if (strpos(e_QUERY, 'configure') !== FALSE || vartrue($_GET['enc'])) { //e107::js('core', 'core/jquery.elastic.source.js', 'jquery', 2); //e107::js('core', 'plupload/plupload.full.js', 'jquery', 2); //e107::css('core', 'plupload/jquery.plupload.queue/css/jquery.plupload.queue.css', 'jquery'); //e107::js('core', 'plupload/jquery.plupload.queue/jquery.plupload.queue.js', 'jquery', 2); //e107::css('core', 'chosen/chosen.css', 'jquery'); //e107::js('core', 'chosen/chosen.jquery.min.js', 'jquery', 2); //e107::css('core', 'password/style.css', 'jquery'); //e107::js('core', 'password/jquery.pwdMeter.js', 'jquery', 2); // //e107::js("core", "plupload/customUpload.js","jquery",3); //e107::js("core", "core/mediaManager.js","jquery",3); // e107::css('core', 'core/admin.css', 'jquery'); // e107::js('core', 'core/admin.jquery.js', 'jquery', 4); e107::js('core', 'bootstrap/js/bootstrap-tooltip.js');
/* * e107 website system * * Copyright (C) 2008-2013 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * Plugin administration area * */ require_once "../class2.php"; if (!getperms("Z")) { e107::redirect('admin'); exit; } e107::coreLan('plugin', true); $e_sub_cat = 'plug_manage'; define('PLUGIN_SHOW_REFRESH', FALSE); define('PLUGIN_SCAN_INTERVAL', !empty($_SERVER['E_DEV']) ? 0 : 360); global $user_pref; require_once e_HANDLER . 'plugin_class.php'; require_once e_HANDLER . 'file_class.php'; $plugin = new e107plugin(); $pman = new pluginManager(); define("e_PAGETITLE", ADLAN_98 . " - " . $pman->pagetitle); if (e_AJAX_REQUEST) { print_a($_POST); print_a($_GET); exit; } if (e_AJAX_REQUEST && isset($_GET['action'])) {
* * User signup * */ require_once "class2.php"; if (vartrue($_POST['email2'])) { exit; } $qs = explode(".", e_QUERY); if ($qs[0] != 'activate') { // multi-language fix. e107::coreLan('signup'); //include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); // include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_usersettings.php"); Shouldn't need this now } e107::coreLan('user'); // Generic user-related language defines define('SIGNUP_DEBUG', FALSE); e107::js('core', 'jquery.mailcheck.min.js', 'jquery', 2); include_once e_HANDLER . 'user_extended_class.php'; $usere = new e107_user_extended(); require_once e_HANDLER . 'validator_class.php'; // require_once(e_HANDLER.'user_handler.php'); $userMethods = e107::getUserSession(); $userMethods->deleteExpired(); // Delete time-expired partial registrations require_once e107::coreTemplatePath('signup'); //correct way to load a core template. $signup_shortcodes = e107::getScBatch('signup'); // $facebook_shortcodes = e107::getScBatch('facebook',TRUE); $signup_imagecode = $pref['signcode'] && extension_loaded('gd');
if (!defined('e107_INIT')) { exit; } header('Content-type: text/html; charset=utf-8', TRUE); if (!empty($_GET['iframe'])) { define('e_IFRAME', true); } // .e-sef-generate routine. if (ADMIN && defset('e_ADMIN_UI') && varset($_POST['mode']) == 'sef' && !empty($_POST['source']) && e_AJAX_REQUEST) { $d = array('converted' => eHelper::title2sef($_POST['source'])); echo json_encode($d); exit; } ### Language files e107::coreLan('header', true); e107::coreLan('footer', true); $_globalLans = e107::pref('core', 'lan_global_list'); $_plugins = e107::getPref('plug_installed'); if (!empty($_plugins) && !empty($_globalLans) && is_array($_plugins) && count($_plugins) > 0) { $_plugins = array_keys($_plugins); foreach ($_plugins as $_p) { if (in_array($_p, $_globalLans) && defset('e_CURRENT_PLUGIN') != $_p) { continue; } e107::loadLanFiles($_p, 'admin'); } } // Get Icon constants, theme override (theme/templates/admin_icons_template.php) is allowed include_once e107::coreTemplatePath('admin_icons'); if (!defset('e_ADMIN_UI') && !defset('e_PAGETITLE')) { $array_functions = e107::getNav()->adminLinks('legacy');
/** * Render user email. * Additional user fields: * 'mail_subject' -> required when type is not signup * 'mail_body' -> required when type is not signup * 'mail_copy_to' -> optional, carbon copy, used when type is not signup * 'mail_bcopy_to' -> optional, blind carbon copy, used when type is not signup * 'mail_attach' -> optional, attach files, available for all types, additionally it overrides $SIGNUPEMAIL_ATTACHMENTS when type is signup * 'mail_options' -> optional, available for all types, any additional valid mailer option as described in e107Email::sendEmail() phpDoc help (options above can override them) * All standard user fields from the DB (user_name, user_loginname, etc.) * * @param string $type signup|notify|email|quickadd * @param array $userInfo * @return array */ public function renderEmail($type, $userInfo) { $pref = e107::getPref(); $ret = array(); $tp = e107::getParser(); $mes = e107::getMessage(); // mailer options if (isset($userInfo['mail_options']) && is_array($userInfo['mail_options'])) { $ret = $userInfo['mail_options']; } // required for signup and quickadd email type e107::coreLan('signup'); $EMAIL_TEMPLATE = e107::getCoreTemplate('email'); if (!is_array($EMAIL_TEMPLATE)) { // load from old location. (root of theme folder if it exists) if (file_exists(THEME . 'email_template.php')) { include THEME . 'email_template.php'; } else { // include core default. include e107::coreTemplatePath('email'); } // BC Fixes. $EMAIL_TEMPLATE['signup']['subject'] = $SIGNUPEMAIL_SUBJECT; $EMAIL_TEMPLATE['signup']['cc'] = $SIGNUPEMAIL_CC; $EMAIL_TEMPLATE['signup']['bcc'] = $SIGNUPEMAIL_BCC; $EMAIL_TEMPLATE['signup']['attachments'] = $SIGNUPEMAIL_ATTACHMENTS; $EMAIL_TEMPLATE['signup']['body'] = $SIGNUPEMAIL_TEMPLATE; $EMAIL_TEMPLATE['quickadduser']['body'] = $QUICKADDUSER_TEMPLATE['email_body']; $EMAIL_TEMPLATE['notify']['body'] = $NOTIFY_TEMPLATE['email_body']; } $template = ''; switch ($type) { case 'signup': $template = vartrue($SIGNUPPROVIDEREMAIL_TEMPLATE) ? $SIGNUPPROVIDEREMAIL_TEMPLATE : $EMAIL_TEMPLATE['signup']['body']; $ret['template'] = 'signup'; // // false Don't allow additional headers (mailer) ?? break; case 'quickadd': $template = $EMAIL_TEMPLATE['quickadduser']['body']; $ret['template'] = 'quickadduser'; // Don't allow additional headers (mailer) break; case 'notify': if (vartrue($userInfo['mail_body'])) { $template = $userInfo['mail_body']; } //$NOTIFY_HEADER.$userInfo['mail_body'].$NOTIFY_FOOTER; $ret['template'] = 'notify'; break; case 'email': case 'default': if (vartrue($userInfo['mail_body'])) { $template = $userInfo['mail_body']; } //$EMAIL_HEADER.$userInfo['mail_body'].$EMAIL_FOOTER; $ret['template'] = 'default'; break; } if (!$template) { $mes->addDebug('$template is empty in user_model.php line 1171.'); // Debug only, do not translate. return array(); } $pass_show = varset($userInfo['user_password']); // signup email only if ($type == 'signup') { $HEAD = ''; $FOOT = ''; $ret['e107_header'] = $userInfo['user_id']; if (vartrue($EMAIL_TEMPLATE['signup']['cc'])) { $ret['email_copy_to'] = $EMAIL_TEMPLATE['signup']['cc']; } if (vartrue($EMAIL_TEMPLATE['signup']['bcc'])) { $ret['email_bcopy_to'] = $EMAIL_TEMPLATE['signup']['bcc']; } if (vartrue($userInfo['email_attach'])) { $ret['email_attach'] = $userInfo['mail_attach']; } elseif (vartrue($EMAIL_TEMPLATE['signup']['attachments'])) { $ret['email_attach'] = $EMAIL_TEMPLATE['signup']['attachments']; } $style = vartrue($SIGNUPEMAIL_LINKSTYLE) ? "style='{$SIGNUPEMAIL_LINKSTYLE}'" : ""; if (empty($userInfo['activation_url']) && !empty($userInfo['user_sess']) && !empty($userInfo['user_id'])) { $userInfo['activation_url'] = SITEURL . "signup.php?activate." . $userInfo['user_id'] . "." . $userInfo['user_sess']; } $sc = array(); $sc['LOGINNAME'] = intval($pref['allowEmailLogin']) === 0 ? $userInfo['user_loginname'] : $userInfo['user_email']; $sc['PASSWORD'] = $pass_show ? $pass_show : '******'; $sc['ACTIVATION_LINK'] = strpos($userInfo['activation_url'], 'http') === 0 ? '<a href="' . $userInfo['activation_url'] . '">' . $userInfo['activation_url'] . '</a>' : $userInfo['activation_url']; // $sc['SITENAME'] = SITENAME; $sc['SITEURL'] = "<a href='" . SITEURL . "' {$style}>" . SITEURL . "</a>"; $sc['USERNAME'] = $userInfo['user_name']; $sc['USERURL'] = vartrue($userInfo['user_website']) ? $userInfo['user_website'] : ""; $sc['DISPLAYNAME'] = $userInfo['user_login'] ? $userInfo['user_login'] : $userInfo['user_name']; $sc['EMAIL'] = $userInfo['user_email']; $sc['ACTIVATION_URL'] = $userInfo['activation_url']; $ret['email_subject'] = $EMAIL_TEMPLATE['signup']['subject']; // $subject; $ret['send_html'] = TRUE; $ret['shortcodes'] = $sc; if (!varset($EMAIL_TEMPLATE['signup']['header'])) { $HEAD = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"; $HEAD .= "<html xmlns='http://www.w3.org/1999/xhtml' >\n"; $HEAD .= "<head><meta http-equiv='content-type' content='text/html; charset=utf-8' />\n"; $HEAD .= $SIGNUPEMAIL_USETHEME == 1 ? "<link rel=\"stylesheet\" href=\"" . SITEURLBASE . THEME_ABS . "style.css\" type=\"text/css\" />\n" : ""; $HEAD .= "<title>" . LAN_SIGNUP_58 . "</title>\n"; if ($SIGNUPEMAIL_USETHEME == 2) { $CSS = file_get_contents(THEME . "style.css"); $HEAD .= "<style>\n" . $CSS . "\n</style>"; } $HEAD .= "</head>\n"; if (vartrue($SIGNUPEMAIL_BACKGROUNDIMAGE)) { $HEAD .= "<body background=\"" . $SIGNUPEMAIL_BACKGROUNDIMAGE . "\" >\n"; } else { $HEAD .= "<body>\n"; } } else { $HEAD = ""; // $tp->parseTemplate($EMAIL_TEMPLATE['signup']['header'], true); } if (!varset($EMAIL_TEMPLATE['signup']['footer'])) { $FOOT = "\n</body>\n</html>\n"; } else { $FOOT = ""; // $tp->parseTemplate($EMAIL_TEMPLATE['signup']['footer'], true); } $ret['send_html'] = TRUE; $ret['email_body'] = $HEAD . $template . $FOOT; // e107::getParser()->parseTemplate(str_replace($search,$replace,$HEAD.$template.$FOOT), true); $ret['preview'] = $tp->parseTemplate($ret['email_body'], true, $sc); // Non-standard field $ret['shortcodes'] = $sc; return $ret; } // all other email types if (!$userInfo['mail_subject']) { $mes->addDebug('No Email subject provided to renderEmail() method.'); // Debug only, do not translate. return array(); } $templateName = $ret['template']; $ret['email_subject'] = varset($EMAIL_TEMPLATE[$templateName]['subject'], $EMAIL_TEMPLATE['default']['subject']); // $subject; $ret['e107_header'] = $userInfo['user_id']; if (vartrue($userInfo['email_copy_to'])) { $ret['email_copy_to'] = $userInfo['email_copy_to']; } if (vartrue($userInfo['email_bcopy_to'])) { $ret['email_bcopy_to'] = $userInfo['email_bcopy_to']; } if (vartrue($userInfo['email_attach'])) { $ret['email_attach'] = $userInfo['email_attach']; } $sc = array(); $sc['LOGINNAME'] = intval($pref['allowEmailLogin']) === 0 ? $userInfo['user_loginname'] : $userInfo['user_email']; $sc['DISPLAYNAME'] = $userInfo['user_login'] ? $userInfo['user_login'] : $userInfo['user_name']; $sc['SITEURL'] = "<a href='" . SITEURL . "'>" . SITEURL . "</a>"; $sc['USERNAME'] = $userInfo['user_name']; $sc['USERURL'] = vartrue($userInfo['user_website']) ? $userInfo['user_website'] : ""; $sc['PASSWORD'] = $pass_show ? $pass_show : '******'; $sc['SUBJECT'] = $userInfo['mail_subject']; /* $search[0] = '{LOGINNAME}'; $replace[0] = intval($pref['allowEmailLogin']) === 0 ? $userInfo['user_loginname'] : $userInfo['user_email']; $search[1] = '{DISPLAYNAME}'; $replace[1] = $userInfo['user_login'] ? $userInfo['user_login'] : $userInfo['user_name']; $search[2] = '{EMAIL}'; $replace[2] = $userInfo['user_email']; $search[3] = '{SITENAME}'; $replace[3] = SITENAME; $search[4] = '{SITEURL}'; $replace[4] = "<a href='".SITEURL."'>".SITEURL."</a>"; $search[5] = '{USERNAME}'; $replace[5] = $userInfo['user_name']; $search[6] = '{USERURL}'; $replace[6] = vartrue($userInfo['user_website']) ? $userInfo['user_website'] : ""; $ret['email_subject'] = $subject; // str_replace($search, $replace, $subject); - performed in mail handler. $search[7] = '{PASSWORD}'; $replace[7] = $pass_show ? $pass_show : '******'; */ if (isset($userInfo['activation_url'])) { $sc['ACTIVATION_URL'] = $userInfo['activation_url']; $sc['ACTIVATION_LINK'] = strpos($userInfo['activation_url'], 'http') === 0 ? '<a href="' . $userInfo['activation_url'] . '">' . $userInfo['activation_url'] . '</a>' : $userInfo['activation_url']; /* $search[8] = '{ACTIVATION_URL}'; $replace[8] = $userInfo['activation_url']; $search[9] = '{ACTIVATION_LINK}'; $replace[9] = strpos($userInfo['activation_url'], 'http') === 0 ? '<a href="'.$userInfo['activation_url'].'">'.$userInfo['activation_url'].'</a>' : $userInfo['activation_url']; */ } $ret['send_html'] = TRUE; $ret['email_body'] = $template; // e107::getParser()->parseTemplate(str_replace($search, $replace, $template)); - performed in mail handler. $ret['preview'] = $ret['mail_body']; // Non-standard field $ret['shortcodes'] = $sc; return $ret; }
* * Top page * * $URL$ * $Id$ * */ require_once 'class2.php'; $ns = e107::getRender(); $pref = e107::getPref(); $sql = e107::getDb(); if (!defined('IMODE')) { define('IMODE', 'lite'); } // BC e107::coreLan('top'); $action = 'top'; $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);
* 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_files/shortcode/batch/bbcode_shortcodes.php,v $ * $Revision$ * $Date$ * $Author$ */ if (!defined('e107_INIT')) { exit; } include_once e_HANDLER . 'shortcode_handler.php'; //include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_ren_help.php'); e107::coreLan('ren_help'); $codes = array('bb', 'bb_help', 'bb_preimagedir'); // register_shortcode('bbcode_shortcodes', $codes); class bbcode_shortcodes extends e_shortcode { // The BBcode Buttons. function bb_format($id) { $formats = array(0 => array('[p][/p]', 'Paragraph'), 1 => array('[h=2][/h]', 'Heading 2'), 2 => array('[h=3][/h]', 'Heading 3'), 3 => array('[h=4][/h]', 'Heading 4'), 4 => array('[h=5][/h]', 'Heading 5'), 5 => array('[h=6][/h]', 'Heading 6'), 6 => array('[block][/block]', 'Block'), 7 => array('[blockquote][/blockquote]', 'Quote'), 8 => array('[code][/code]', 'Code Block'), 9 => array('[code=inline][/code]', 'Code Inline')); if (BOOTSTRAP) { $text = '<div class="btn-group">'; $text .= '<a class="btn dropdown-toggle" data-toggle="dropdown" href="#" title="">'; $text .= "Format"; $text .= ' <span class="caret"></span></a>'; $text .= "<ul class='dropdown-menu'>\n"; foreach ($formats as $fm) {
/* * e107 website system * * Copyright (C) 2008-2013 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * Administration Area - Languages */ require_once "../class2.php"; if (!getperms('L')) { header("location:" . e_BASE . "index.php"); exit; } //include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); e107::coreLan('language', true); $e_sub_cat = 'language'; require_once "auth.php"; $frm = e107::getForm(); $mes = e107::getMessage(); include_lan(e_LANGUAGEDIR . e_LANGUAGE . "/admin/lan_lancheck.php"); require_once e_ADMIN . "lancheck.php"; require_once e_HANDLER . "language_class.php"; // $ln = new language; $ln = $lng; $lck = new lancheck(); $tabs = table_list(); // array("news","content","links"); $lanlist = e107::getLanguage()->installed(); // Bugfix - don't use e_LANLIST as it's cached (SESSION) $message = '';
/* * e107 website system * * Copyright (C) 2008-2013 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * News Administration * */ require_once '../class2.php'; if (!getperms('H|N|H0|H1|H2|H3|H4|H5')) { header('Location:' . e_BASE . 'index.php'); exit; } e107::coreLan('newspost', true); class news_admin extends e_admin_dispatcher { protected $modes = array('main' => array('controller' => 'news_admin_ui', 'path' => null, 'ui' => 'news_form_ui', 'uipath' => null, 'perm' => null), 'cat' => array('controller' => 'news_cat_ui', 'path' => null, 'ui' => 'news_cat_form_ui', 'uipath' => null), 'sub' => array('controller' => 'news_sub_ui', 'path' => null, 'ui' => 'news_sub_form_ui', 'uipath' => null, 'perm' => null)); protected $access = array(); // as below, but uses userclasses instead of admin perms eg. e_UC_* or numeric userclass value. //Route access. (equivalent of getperms() for each mode/action ) protected $perm = array('main/list' => 'H|H0|H1|H2', 'main/create' => 'H|H0', 'main/edit' => 'H|H1', 'main/delete' => 'H|H2', 'cat/list' => 'H', 'cat/create' => 'H|H3|H4|H5', 'cat/edit' => 'H|H4', 'cat/delete' => 'H|H5', 'main/settings' => '0', 'sub/list' => 'N'); protected $adminMenu = array('main/list' => array('caption' => LAN_LIST, 'perm' => 'H'), 'main/create' => array('caption' => NWSLAN_45, 'perm' => 'H'), 'cat/list' => array('caption' => LAN_CATEGORIES, 'perm' => 'H'), 'cat/create' => array('caption' => LAN_NEWS_63, 'perm' => 'H'), 'main/settings' => array('caption' => LAN_PREFS, 'perm' => '0'), 'sub/list' => array('caption' => NWSLAN_47, 'perm' => 'N')); protected $adminMenuAliases = array('main/edit' => 'main/list', 'cat/edit' => 'cat/list'); protected $menuTitle = "News"; } class news_cat_ui extends e_admin_ui { protected $pluginTitle = ADLAN_0; // "News"
<?php /* * e107 website system * * Copyright (C) e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * URL and front controller Management * * $URL$ * $Id$ */ require_once "class2.php"; e107::coreLan('page'); $e107CorePage = new pageClass(false); // Important - save request BEFORE any output (header footer) - used in navigation menu if (!e_QUERY) { $e107CorePage->setRequest('listBooks'); $e107CorePage->listBooks(); require_once HEADERF; e107::getRender()->tablerender($e107CorePage->pageOutput['caption'], $e107CorePage->pageOutput['text'], "cpage-full-list"); // $tmp = $e107CorePage->listPages(); //$tmp = $e107CorePage->listBooks(); // $text = $tp->parseTemplate("{PAGE_NAVIGATION=book=2}",true); /*if(is_array($tmp)) { $ns->tablerender($tmp['title'], $text, 'cpage-full-list'); }*/ require_once FOOTERF;
<?php /* * e107 website system * * Copyright (C) 2008-2012 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * $URL$ * $Id$ */ require_once 'class2.php'; //include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); e107::coreLan('search'); if (!check_class($pref['search_restrict'])) { require_once HEADERF; $ns->tablerender(LAN_SEARCH_20, "<div style='text-align: center'>" . LAN_SEARCH_21 . "</div>"); require_once FOOTERF; exit; } if (isset($_GET['t'])) { switch ($_GET['t']) { case '0': $_GET['t'] = 'news'; break; case 1: $_GET['t'] = 'comments'; break; case 2: $_GET['t'] = 'users';