1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-16 20:28:28 +01:00

Frontend scripts tests. (may break some things)

This commit is contained in:
Cameron 2021-01-19 18:52:56 -08:00
parent ce1273f8a4
commit b19f9ffbc3
41 changed files with 312 additions and 395 deletions

View File

@ -25,8 +25,10 @@ require_once(e_HANDLER."secure_img_handler.php");
$sec_img = new secure_image;
e107::lan('core','contact');
define('PAGE_NAME', LANCONTACT_00);
if(!defined('PAGE_NAME'))
{
define('PAGE_NAME', LANCONTACT_00); // FIX ME
}
e107::canonical('contact');
require_once(HEADERF);
@ -292,5 +294,4 @@ elseif($active == e_UC_MEMBER && ($pref['sitecontacts'] != e_UC_NOBODY))
require_once(FOOTERF);
exit;
?>

View File

@ -575,7 +575,10 @@ function getAlert()
// Header included notification, from this point header includes are not possible
define('HEADER_INIT', TRUE);
if(!defined('HEADER_INIT'))
{
define('HEADER_INIT', TRUE);
}
e107::getDebug()->logTime("End Head, Start Body");

View File

@ -13,7 +13,7 @@
if (!defined('e107_INIT')) { exit; }
class admin_shortcodes
class admin_shortcodes extends e_shortcode
{
const ADMIN_NAV_HOME = 'enav_home'; // Must match with admin_template. ie. {ADMIN_NAVIGATION=enav_home} and $E_ADMIN_NAVIGATION['button_enav_home']

View File

@ -40,7 +40,7 @@ class login_shortcodes extends e_shortcode
return null;
}
return LOGINMESSAGE;
return defset('LOGINMESSAGE');
}
/* example: {LOGIN_TABLE_USERNAME} */

View File

@ -952,9 +952,9 @@ class news_shortcodes extends e_shortcode
function sc_news_video($parm=null)
{
$tmp = $this->handleMultiple($parm,'video');
$file = $tmp['file'];
$file = varset($tmp['file']);
if($video = e107::getParser()->toVideo($file, array('class'=> 'news-video-'.$tmp['count'])))
if($video = e107::getParser()->toVideo($file, array('class'=> 'news-video-'.varset($tmp['count']))))
{
return $video;
}

View File

@ -16,7 +16,10 @@ if(!defined('USER_AREA'))
//overload is now possible, prevent warnings
define('USER_AREA',TRUE);
}
define('ADMIN_AREA', FALSE);
if(!defined('ADMIN_AREA'))
{
define('ADMIN_AREA', false);
}
$e107 = e107::getInstance();
$sql = e107::getDb();
@ -730,7 +733,10 @@ if(deftrue('BOOTSTRAP'))
// Header included notification, from this point header includes are not possible
define('HEADER_INIT', TRUE);
if(!defined('HEADER_INIT'))
{
define('HEADER_INIT', TRUE);
}
e107::getDebug()->logTime("Main Page Body");

View File

@ -967,11 +967,11 @@ class cronScheduler
*/
public function __construct()
{
global $_E107, $pref;
global $_E107;
$this->cron = new CronParser();
$this->debug = $_E107['debug'];
$this->pref = $pref;
$this->pref = e107::getPref();
}
/**
@ -1157,7 +1157,7 @@ class cronScheduler
$pwd = str_replace('token=', '', $pwd);
}
if(($this->pref['e_cron_pwd'] != $pwd) || empty($this->pref['e_cron_pwd']))
if(empty($this->pref['e_cron_pwd']) || (varset($this->pref['e_cron_pwd']) != $pwd))
{
if(!empty($pwd))
{
@ -1165,7 +1165,7 @@ class cronScheduler
$msg .= "<br /><br />";
$msg .= "Sent from cron: " . $pwd;
$msg .= "<br />";
$msg .= "Stored in e107: " . $this->pref['e_cron_pwd'];
$msg .= "Stored in e107: " . varset($this->pref['e_cron_pwd'], "(none set)");
$msg .= "<br /><br />";
$msg .= "You should regenerate the cron command in admin and enter it again in your server configuration.";

View File

@ -213,6 +213,7 @@ class e107
'e_profanity' => '{e_HANDLER}e_profanity_class.php',
'e_ranks' => '{e_HANDLER}e_ranks_class.php',
'e_render' => '{e_HANDLER}e_render_class.php',
'e_search' => '{e_HANDLER}search_class.php',
'e_shortcode' => '{e_HANDLER}shortcode_handler.php',
'e_system_user' => '{e_HANDLER}user_model.php',
'e_theme' => '{e_HANDLER}theme_handler.php',
@ -1459,6 +1460,16 @@ class e107
return self::getSingleton('e_parse_shortcode');
}
/**
* Retrieve search class singleton object
*
* @return array|Object|secure_image
*/
public static function getSearch()
{
return self::getSingleton('e_search'); // more flexible.
// return self::getObject('secure_image');
}
/**
* Retrieve secure_image singleton object
@ -3854,6 +3865,11 @@ class e107
*/
public static function canonical($plugin = '', $key = 'index', $row = array())
{
if($plugin === '_RESET_') // for testing only, may be removed in future.
{
e107::setRegistry('core/e107/canonical');
}
$alreadyDone = e107::getRegistry('core/e107/canonical');

View File

@ -37,9 +37,10 @@ class e_parse
// 'Hooked' parsers (array)
private $e_hook = array();
private $search = array('&amp;#039;', '&#039;', '&#39;', '&quot;', 'onerror', '&gt;', '&amp;quot;', ' & ');
// Used in search_class.php (move??)
public $search = array('&amp;#039;', '&#039;', '&#39;', '&quot;', 'onerror', '&gt;', '&amp;quot;', ' & ');
private $replace = array("'", "'", "'", '"', 'one<i></i>rror', '>', '"', ' &amp; ');
public $replace = array("'", "'", "'", '"', 'one<i></i>rror', '>', '"', ' &amp; ');
// Set to TRUE or FALSE once it has been calculated
protected $e_highlighting;

View File

@ -4494,7 +4494,10 @@ class e107plugin
if (file_exists($_path . 'plugin.xml'))
{
unset($_POST['uninstall_confirm']);
if(isset($_POST['uninstall_confirm']))
{
unset($_POST['uninstall_confirm']);
}
$this->install_plugin_xml($plug, 'uninstall', $options); //$_POST must be used.
}
else

View File

@ -50,7 +50,7 @@ $search_fields = array('c.comment_comment', 'c.comment_author_name');
$weights = array('1.2', '0.6');
$no_results = LAN_198;
$where = "comment_type IN (".implode(',', $in).") AND".$advanced_where;
$order = array('comment_datestamp' => DESC);
$order = array('comment_datestamp' => 'DESC');
$table = "comments AS c ".implode(' ', $join);
$ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_comment', $no_results, $where, $order);

View File

@ -335,8 +335,8 @@ class e_search
foreach ($matches as $this -> text)
{
$this -> text = nl2br($this -> text);
$t_search = $tp -> search;
$t_replace = $tp -> replace;
$t_search = $tp->search;
$t_replace = $tp->replace;
$s_search = array('<br />', '[', ']');
$s_replace = array(' ', '<', '>');
$search = array_merge($t_search, $s_search);

View File

@ -1266,12 +1266,14 @@ class e_parse_shortcode
$_class = strtolower($code);
$_path = e_CORE.'shortcodes/single/'.strtolower($code).'.php';
include_once(e_CORE.'shortcodes/single/'.strtolower($code).'.php');
include_once($_path);
if (class_exists($_class, false)) // prevent __autoload - performance
{
// SecretR - fix array(parm, sc_mode) causing parm to become an array, see issue 424
$ret = call_user_func(array($_class, $_function), $parm, $sc_mode);
// $ret = call_user_func(array($_class, $_function), $parm, $sc_mode);
$ret = e107::callMethod($_class, $_function, $parm, $sc_mode); // v2.3.1
}
elseif (function_exists($_function))
{

View File

@ -14,7 +14,7 @@ define("NWSLAN_4", "News - Existing News");
define("NWSLAN_6", "Category");
// define("NWSLAN_9", "tick to confirm");
define("NWSLAN_10", "No news categories");
// define("NWSLAN_10", "No news categories");
// define("NWSLAN_11", "Add/Edit Categories");
//define("NWSLAN_12", "Title");
define("NWSLAN_13", "Body");

View File

@ -7,7 +7,10 @@
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*/
define("PAGE_NAME", "Submit News");
if(!defined('PAGE_NAME'))
{
define("PAGE_NAME", "Submit News");
}
//define("LAN_7", "Name: ");//LAN_NAME
//define("LAN_62", "News Title: ");//LAN_TITLE
//define("LAN_112", "Email Address: ");//LAN_EMAIL

View File

@ -2,14 +2,13 @@
/*
+ ----------------------------------------------------------------------------+
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/lan_upload.php,v $
| $Revision$
| $Date$
| $Author$
+----------------------------------------------------------------------------+
*/
define("PAGE_NAME", "Upload");
if(!defined('PAGE_NAME'))
{
define("PAGE_NAME", "Upload");
}
define("LAN_UL_001","Invalid email address");
define("LAN_UL_002", "You do not have the correct permissions to upload files to this server."); // LAN_403
@ -47,12 +46,12 @@ define("LAN_411", "File");
define("LAN_413", "Description");
define("LAN_414", "Working demo");
define("LAN_415", "enter URL to site where demo can be viewed");
define("LAN_416", "Submit and Upload");
define("LAN_417", "Upload File");
// define("LAN_417", "Upload File");
define("LAN_418", "Absolute maximum file size: ");
define("DOWLAN_11", "Category");
define("LAN_419", "Allowed filetypes");
define("LAN_420", "fields are required");
define("LAN_UL_039", "Submit and Upload"); // LAN_416

View File

@ -20,7 +20,7 @@ if (!e107::isInstalled('banner'))
exit;
}
e107::includeLan(e_PLUGIN."banner/languages/".e_LANGUAGE."_banner.php"); // TODO
// e107::includeLan(e_PLUGIN."banner/languages/".e_LANGUAGE."_banner.php"); // TODO
e107::lan('banner');

View File

@ -92,8 +92,18 @@ define('IMAGE_admin_unlock', 'src="'.img_path('admin_unlock.png').'" alt="'.LAN_
// Multi Language Images
define('IMAGE_newthread', '<img src="'.img_path('newthread.png').'" alt="'.LAN_FORUM_2005.'" title="'.LAN_FORUM_2005.'" />');
define('IMAGE_reply', '<img src="'.img_path('reply.png').'" alt="'.LAN_FORUM_2006.'" title="'.LAN_FORUM_2006.'" />');
define('IMAGE_rank_moderator_image', '<img src="'.img_path('moderator.png', '', 'rank_moderator_image').'" alt="" />');
define('IMAGE_rank_main_admin_image', '<img src="'.img_path('main_admin.png', '', 'rank_main_admin_image').'" alt="" />');
define('IMAGE_rank_admin_image', '<img src="'.img_path('admin.png', '', 'rank_admin_image').'" alt="" />');
if(!defined('IMAGE_rank_moderator_image'))
{
define('IMAGE_rank_moderator_image', '<img src="'.img_path('moderator.png', '', 'rank_moderator_image').'" alt="" />');
}
if(!defined('IMAGE_rank_main_admin_image'))
{
define('IMAGE_rank_main_admin_image', '<img src="'.img_path('main_admin.png', '', 'rank_main_admin_image').'" alt="" />');
}
if(!defined('IMAGE_rank_admin_image'))
{
define('IMAGE_rank_admin_image', '<img src="'.img_path('admin.png', '', 'rank_admin_image').'" alt="" />');
}

View File

@ -22,7 +22,7 @@ if (!defined('e107_INIT')) { exit; }
//register_shortcode('list_shortcodes', true);
//initShortcodeClass('list_shortcodes');
class list_shortcodes
class list_shortcodes extends e_shortcode
{
var $rc; // list class.
var $e107;

View File

@ -1894,78 +1894,3 @@ if(E107_DBG_BASIC && ADMIN)
$newsObj->debug();
}
require_once(FOOTERF);
exit;
//require_once(e_HANDLER."comment_class.php");
//$cobj = new comment;
//------------------------------------------------------
// DISPLAY NEWS IN 'CATEGORY' LIST FORMAT HERE
//------------------------------------------------------
// Just title and a few other details
//------------------------------------------------------
// DISPLAY SINGLE ITEM IN EXTENDED FORMAT HERE
//------------------------------------------------------
//------------------------------------------------------
// DISPLAY NEWS IN LIST FORMAT HERE
//------------------------------------------------------
// Show title, author, first part of news item...
// ##### --------------------------------------------------------------------------------------------------------------
// #### new: news archive ---------------------------------------------------------------------------------------------
// #### END -----------------------------------------------------------------------------------------------------------
if ($action != "item") {
if (is_numeric($action)){
$action = "";
}
// $parms = $news_total.",".ITEMVIEW.",".$newsfrom.",".e_SELF.'?'."[FROM].".$action.(isset($sub_action) ? ".".$sub_action : "");
// $nextprev = $tp->parseTemplate("{NEXTPREV={$parms}}");
// echo ($nextprev ? "<div class='nextprev'>".$nextprev."</div>" : "");
}
if(is_dir("remotefile")) {
require_once(e_HANDLER."file_class.php");
$file = new e_file;
// $reject = array('$.','$..','/','CVS','thumbs.db','*._$', 'index', 'null*', 'Readme.txt');
// $crem = $file -> get_files(e_BASE."remotefile", "", $reject);
$crem = $file -> get_files(e_BASE."remotefile", '~Readme\.txt');
if(count($crem)) {
foreach($crem as $loadrem) {
if(strpos($loadrem['fname'], "load_") !== false) {
require_once(e_BASE."remotefile/".$loadrem['fname']);
}
}
}
}
if (isset($this->pref['nfp_display']) && $this->pref['nfp_display'] == 2 && is_readable(e_PLUGIN."newforumposts_main/newforumposts_main.php"))
{
require_once(e_PLUGIN."newforumposts_main/newforumposts_main.php");
}
render_newscats();
require_once(FOOTERF);
// =========================================================================

View File

@ -167,7 +167,7 @@ class siteinfo_shortcodes // must match the folder name of the plugin.
if((isset($parm['w']) || isset($parm['h'])))
{
//
$dimensions[0] = $parm['w'];
$dimensions[0] = isset($parm['w']) ? $parm['w'] : 0;
$dimensions[1] = !empty($parm['h']) ? $parm['h'] : 0;
if(empty($parm['noresize']) && !empty($logopref)) // resize by default - avoiding large files.

View File

@ -848,7 +848,7 @@ class e107Test extends \Codeception\Test\Unit
{
// Make sure nothing else loaded the language files.
$this->assertFalse(defined('BANNERLAN_19'), 'BANNERLAN_19 is already defined!');
// $this->assertFalse(defined('BANNERLAN_19'), 'BANNERLAN_19 is already defined!');
// $this->assertFalse(defined('LAN_FORUM_0002'), 'LAN_FORUM_0002 is already defined!');
$this->assertFalse(defined('LAN_GALLERY_ADMIN_01'), 'LAN_GALLERY_ADMIN_01 is already defined!');
$this->assertFalse(defined('CM_L1'), 'Comment Menu English file already defined');
@ -970,7 +970,7 @@ class e107Test extends \Codeception\Test\Unit
public function testCanonical()
{
$e107 = $this->e107;
$e107::canonical('_RESET_');
$e107::canonical('news');
$result = $e107::canonical();

View File

@ -168,6 +168,9 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
$this->fail($e->getMessage());
}
$sc->__construct();
$this->processShortcodeMethods($sc);
}
@ -185,6 +188,8 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
$this->fail($e->getMessage());
}
$sc->__construct();
$this->processShortcodeMethods($sc);
}
@ -230,6 +235,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
'user_join' => 1518441749
);
$sc->__construct();
$sc->setVars($values);
$this->processShortcodeMethods($sc);
@ -251,6 +257,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
$this->fail($e->getMessage());
}
$sc->__construct();
$this->processShortcodeMethods($sc);
}
@ -269,6 +276,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
$this->fail($e->getMessage());
}
$sc->__construct();
$this->processShortcodeMethods($sc);
}
@ -287,6 +295,8 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
$this->fail($e->getMessage());
}
$sc->__construct();
$this->processShortcodeMethods($sc);
}
@ -321,6 +331,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
'link_owner' => 'news'
);
$sc->__construct();
$sc->setVars($vars);
$this->processShortcodeMethods($sc);
@ -389,6 +400,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
'user_name' => 'admin'
);
$sc->__construct();
$sc->setVars($vars);
$this->processShortcodeMethods($sc);
@ -502,7 +514,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
'menu_button_text' => ''
);
$sc->__construct();
$sc->setVars($vars);
$exclude = array('sc_cpagemessage'); // system messages
@ -569,7 +581,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
)
;
$sc->__construct();
$sc->setVars($vars);
// $exclude = array('sc_cpagemessage'); // system messages
@ -613,6 +625,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
$this->fail($e->getMessage());
}
$sc->__construct();
$this->processShortcodeMethods($sc);
}
@ -662,8 +675,10 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
);
$sc->__construct();
$sc->setVars($vars);
$exclude = array('sc_user_email'); // uses random obfiscation.
$this->processShortcodeMethods($sc, null, $exclude);
@ -742,6 +757,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
$this->fail($e->getMessage());
}
$vars = array(
'cb_id' => '11',
'cb_nick' => '1.admin',
@ -751,6 +767,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
'cb_ip' => '0000:0000:0000:0000:0000:ffff:7f00:0001'
);
$sc->__construct();
$sc->setVars($vars);
$this->processShortcodeMethods($sc);
@ -804,6 +821,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
);
$sc->__construct();
$sc->setVars($values);
$this->processShortcodeMethods($sc);
@ -903,6 +921,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
);
$sc->__construct();
$sc->setVars($vars);
$this->processShortcodeMethods($sc);
@ -1177,7 +1196,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
);
$sc->__construct();
$sc->setVars($vars);
$exclude = array('sc_gallery_slides'); // uses a counter.
$this->processShortcodeMethods($sc, null, $exclude);
@ -1259,7 +1278,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
);
$sc->__construct();
$sc->setVars($vars);
// $exclude = array('sc_gallery_slides'); // uses a counter.
$this->processShortcodeMethods($sc);
@ -1281,7 +1300,7 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
$this->fail($e->getMessage());
}
$sc->__construct();
$this->processShortcodeMethods($sc);
@ -1415,12 +1434,15 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
{
/** @var list_shortcodes $sc */
$sc = $this->make('list_shortcodes');
}
catch (Exception $e)
{
$this->fail($e->getMessage());
}
$sc->__construct();
$sc->rc = new listclass;
$vars = array (
@ -1464,6 +1486,8 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
private function processShortcodeMethods($sc, $parms=array(), $exclude=array())
{
$sc->wrapper('non-existent/wrapper');
$list = get_class_methods($sc);
foreach($list as $meth)

View File

@ -35,7 +35,58 @@
}
private function loadScripts($folder, $exclude= array())
public function testFrontend()
{
e107::getConfig()->setPref('plug_installed/gsitemap', '1.0');
$include = array (
0 => 'banner.php',
// 1 => 'class2.php',
// 2 => 'comment.php',
3 => 'contact.php',
// 5 => 'cron.php',
// 6 => 'download.php',
// 7 => 'e107_config.php',
// 12 => 'email.php',
13 => 'error.php',
15 => 'fpw.php',
16 => 'gsitemap.php',
// 17 => 'index.php', // redirects
// 18 => 'install.php', // not compatible with core.
20 => 'login.php',
21 => 'membersonly.php',
// 22 => 'metaweblog.php',
23 => 'news.php',
24 => 'online.php',
25 => 'page.php',
// 26 => 'print.php',
// 27 => 'rate.php', // has a redirect.
// 28 => 'request.php', // redirects
29 => 'search.php',
// 30 => 'signup.php', too many 'exit';
31 => 'sitedown.php',
32 => 'submitnews.php',
// 34 => 'thumb.php', // separate test.
35 => 'top.php',
36 => 'unsubscribe.php',
// 37 => 'upload.php', // FIXME LAN conflict.
38 => 'user.php',
// 39 => 'userposts.php', // FIXME needs a rework
40 => 'usersettings.php',
);
$this->loadScripts(e_BASE, array(), $include);
}
private function loadScripts($folder, $exclude= array(), $include=array())
{
// $globalList = e107::getPref('lan_global_list');
@ -67,12 +118,12 @@
{
$ext = pathinfo($folder.$file, PATHINFO_EXTENSION);
if($ext !== 'php' || in_array($file, $exclude))
if($ext !== 'php' || in_array($file, $exclude) || (!empty($include) && !in_array($file,$include)))
{
continue;
}
// echo " --- ".$file." --- \n";
echo " --- ".$file." --- \n";
ob_start();
// test for PHP Notice/Warning etc.
$error = false;

View File

@ -19,7 +19,7 @@
require_once('class2.php');
if (!check_class(varset($pref['email_item_class'],e_UC_MEMBER)))
{
header('Location: '.e_BASE.'index.php');
e107::redirect('Location: '.e_BASE.'index.php');
exit();
}
@ -255,4 +255,3 @@ $text .= "
$ns->tablerender(LAN_EMAIL_5, $text);
require_once(FOOTERF);
?>

View File

@ -121,6 +121,3 @@ if (!USER || getperms('0'))
require_once(FOOTERF);
exit;
?>

View File

@ -3,94 +3,101 @@
+ ----------------------------------------------------------------------------+
| e107 website system
|
| Copyright (C) 2008-2009 e107 Inc
| Copyright (C) 2008-2021
| http://e107.org
|
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/membersonly.php,v $
| $Revision$
| $Date$
| $Author$
+----------------------------------------------------------------------------+
*/
require_once("class2.php");
e107::coreLan('membersonly');
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
//e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
if(deftrue('BOOTSTRAP')) //v2.x
if(deftrue('BOOTSTRAP')) //v2.x
{
$MEMBERSONLY_TEMPLATE = e107::getCoretemplate('membersonly');
}
else // Legacy
{
if(is_readable(THEME . "membersonly_template.php"))
{
$MEMBERSONLY_TEMPLATE = e107::getCoretemplate('membersonly');
require_once(THEME . "membersonly_template.php");
}
else // Legacy
else
{
if(is_readable(THEME."membersonly_template.php"))
{
require_once(THEME."membersonly_template.php");
}
else
{
require_once(e_CORE."templates/membersonly_template.php");
}
$MEMBERSONLY_TEMPLATE['default']['caption'] = $MEMBERSONLY_CAPTION;
$MEMBERSONLY_TEMPLATE['default']['header'] = $MEMBERSONLY_BEGIN;
$MEMBERSONLY_TEMPLATE['default']['body'] = $MEMBERSONLY_TABLE;
$MEMBERSONLY_TEMPLATE['default']['footer'] = $MEMBERSONLY_END;
require_once(e_CORE . "templates/membersonly_template.php");
}
define('e_IFRAME',true);
$MEMBERSONLY_TEMPLATE['default']['caption'] = $MEMBERSONLY_CAPTION;
$MEMBERSONLY_TEMPLATE['default']['header'] = $MEMBERSONLY_BEGIN;
$MEMBERSONLY_TEMPLATE['default']['body'] = $MEMBERSONLY_TABLE;
$MEMBERSONLY_TEMPLATE['default']['footer'] = $MEMBERSONLY_END;
}
if(!defined('e_IFRAME'))
{
define('e_IFRAME', true);
}
class membersonly
{
function sc_membersonly_signup()
{
$pref = e107::pref('core');
if (intval($pref['user_reg'])===1)
if(intval($pref['user_reg']) === 1)
{
$srch = array("[","]");
$repl = array("<a class='alert-link' href='".e_SIGNUP."'>","</a>");
return str_replace($srch,$repl, LAN_MEMBERS_3);
$srch = array("[", "]");
$repl = array("<a class='alert-link' href='" . e_SIGNUP . "'>", "</a>");
return str_replace($srch, $repl, LAN_MEMBERS_3);
}
}
function sc_membersonly_returntohome()
{
$pref = e107::pref('core');
if($pref['membersonly_redirect'] == 'login')
{
return "<a class='alert-link' href='".e_HTTP."index.php'>".LAN_MEMBERS_4."</a>";
return "<a class='alert-link' href='" . e_HTTP . "index.php'>" . LAN_MEMBERS_4 . "</a>";
}
}
function sc_membersonly_restricted_area()
{
return LAN_MEMBERS_1;
}
function sc_membersonly_login()
{
$srch = array("[","]");
$repl = array("<a class='alert-link' href='".e_LOGIN."'>","</a>");
return str_replace($srch,$repl, LAN_MEMBERS_2);
$srch = array("[", "]");
$repl = array("<a class='alert-link' href='" . e_LOGIN . "'>", "</a>");
return str_replace($srch, $repl, LAN_MEMBERS_2);
}
}
require_once(HEADERF);
$mem = new membersonly;
require_once(HEADERF);
$BODY = e107::getParser()->parseTemplate( $MEMBERSONLY_TEMPLATE['default']['body'],true,$mem);
$mem = new membersonly;
echo $MEMBERSONLY_TEMPLATE['default']['header'];
e107::getRender()->tablerender($MEMBERSONLY_TEMPLATE['default']['caption'], $BODY, 'membersonly');
echo $MEMBERSONLY_TEMPLATE['default']['footer'];
$BODY = e107::getParser()->parseTemplate($MEMBERSONLY_TEMPLATE['default']['body'], true, $mem);
require_once(FOOTERF);
?>
echo $MEMBERSONLY_TEMPLATE['default']['header'];
e107::getRender()->tablerender($MEMBERSONLY_TEMPLATE['default']['caption'], $BODY, 'membersonly');
echo $MEMBERSONLY_TEMPLATE['default']['footer'];
require_once(FOOTERF);

View File

@ -21,8 +21,5 @@
require_once("class2.php");
require_once(e_PLUGIN."news/news.php");
exit;
?>

View File

@ -26,15 +26,15 @@
*/
require_once('class2.php');
e107::includeLan(e_LANGUAGEDIR . e_LANGUAGE . '/lan_' . e_PAGE);
e107::coreLan('online');
require_once(HEADERF);
if(!$pref['track_online'])
if(!isset($pref['track_online']))
{
$ns->tablerender(ONLINE_EL4, ONLINE_EL16);
require_once(FOOTERF);
exit;
return;
}
$ONLINE_TABLE = '';
@ -322,7 +322,7 @@
}
$scArray['ONLINE_TABLE_MEMBERS_ONLINE'] = ONLINE_EL1 . GUESTS_ONLINE;
$scArray['ONLINE_TABLE_MEMBERS_ONLINE'] = defset('ONLINE_EL1') . GUESTS_ONLINE;
$scArray['ONLINE_TABLE_GUESTS_ONLINE'] = ONLINE_EL2 . MEMBERS_ONLINE;
if(!isset($gen) || !is_object($gen))

View File

@ -33,7 +33,7 @@ if(!e_QUERY)
}*/
require_once(FOOTERF);
exit;
}
elseif(vartrue($_GET['bk'])) // List Chapters within a specific Book
{
@ -44,7 +44,7 @@ elseif(vartrue($_GET['bk'])) // List Chapters within a specific Book
require_once(HEADERF);
e107::getRender()->tablerender($e107CorePage->pageOutput['caption'], $e107CorePage->pageOutput['text'], 'cpage-chapter-list');
require_once(FOOTERF);
exit;
}
elseif(vartrue($_GET['ch'])) // List Pages within a specific Chapter
{
@ -56,7 +56,7 @@ elseif(vartrue($_GET['ch'])) // List Pages within a specific Chapter
require_once(HEADERF);
e107::getRender()->tablerender($e107CorePage->pageOutput['caption'], $e107CorePage->pageOutput['text'], 'cpage-page-list');
require_once(FOOTERF);
exit;
}
else
{
@ -78,7 +78,7 @@ else
$ns->tablerender($e107CorePage->pageOutput['caption'], $e107CorePage->pageOutput['text'], $e107CorePage->pageOutput['mode']);
require_once(FOOTERF);
exit;
}
/* EOF */

View File

@ -16,9 +16,11 @@ require_once("class2.php");
e107::coreLan('print');
$qs = explode(".", e_QUERY,2);
if ($qs[0] == "") {
if ($qs[0] == "")
{
e107::redirect();
exit;
exit;
}
$CSS = <<<CSS
@ -65,7 +67,7 @@ if(strpos($source,'plugin:') !== FALSE)
else
{
echo LAN_FILE_NOT_FOUND;
exit;
return;
}
}
else
@ -134,6 +136,7 @@ else
<div style='text-align:".$align."'>".$print_text."</div><br /><br />
<form action='#'><div class='hidden-print' style='text-align:center'><input class='btn btn-primary ' type='button' value='".LAN_PRINT_307."' onclick='window.print()' /></div></form></div>";
}
require_once(FOOTERF);
?>

View File

@ -64,7 +64,7 @@ else // Ajax Used.
echo e107::getRate()->submitVote($table,$itemid,$rate);
}
exit;
exit;
}

View File

@ -10,7 +10,7 @@
require_once('class2.php');
e107::coreLan('search');
e107_require(e_HANDLER.'search_class.php');
if (!check_class($pref['search_restrict']))
{
@ -75,9 +75,9 @@ class search extends e_shortcode
$SEARCH_TOP_TABLE = $tmp['start'];
$SEARCH_BOT_TABLE = $tmp['end'];
$SEARCH_CATS = $tmp['category'];
$SEARCH_TYPE = $tmp['type'];
$SEARCH_TYPE = varset($tmp['type']);
$SEARCH_ADV = $tmp['advanced'];
$SEARCH_ENHANCED = $tmp['enhanced'];
$SEARCH_ENHANCED = varset($tmp['enhanced']);
$SEARCH_ADV_COMBO = $tmp['advanced-combo'];
$this->template = $tmp;
@ -265,7 +265,7 @@ class search extends e_shortcode
$search_count = count($this->search_info);
$google_id = $search_count + 1;
$checkboxes = '';
if ($this->search_prefs['selector'] == 2)
{
@ -276,10 +276,7 @@ class search extends e_shortcode
$dropdown .= "<option value='all'>".LAN_SEARCH_22."</option>";
}
}
else
{
$checkboxes = '';
}
foreach($this->search_info as $key => $value)
{
@ -354,7 +351,7 @@ class search extends e_shortcode
{
$var['ENHANCED_TEXT'] = $ENHANCED_TEXT;
$var['ENHANCED_DISPLAY_ID'] = "en_".$en_id;
$var['ENHANCED_FIELD'] = "<input class='tbox form-control' type='text' id='".$en_id."' name='".$en_id."' size='35' value='".$tp->post_toForm($_GET[$en_id])."' maxlength='50' />";
$var['ENHANCED_FIELD'] = "<input class='tbox form-control' type='text' id='".$en_id."' name='".$en_id."' size='35' value='".$tp->post_toForm(varset($_GET[$en_id]))."' maxlength='50' />";
$text .= $tp->simpleParse($this->template['enhanced'], $var);
}
@ -383,7 +380,7 @@ class search extends e_shortcode
$tp = e107::getParser();
$sql = e107::getDb();
$sql2 = e107::getDb('search');
$advanced = array();
if(!$parm)
{
@ -509,7 +506,7 @@ class search extends e_shortcode
{
$search_info = array();
require_once($plug_require);
$ret = $search_info[0];
$ret = varset($search_info[0]);
}
else
{
@ -606,6 +603,10 @@ class search extends e_shortcode
*/
$e_searchList = e107::getConfig('core')->get('e_search_list');
if(empty($this->search_prefs['plug_handlers']))
{
return array();
}
//plugin search routines // plugin folder is used as the search key. ie. $_GET['t'] = 'chatbox';
foreach ($this->search_prefs['plug_handlers'] as $plug_dir => $active)
@ -619,7 +620,7 @@ class search extends e_shortcode
{
if ($search_info[$plug_dir] = $this->search_info($plug_dir, 'plug', e_PLUGIN.$plug_dir."/e_search.php"))
{
$search_info[$plug_dir]['listorder'] = $active['order'];
$search_info[$plug_dir]['listorder'] = varset($active['order']);
// $search_id++;
}
else
@ -763,13 +764,13 @@ class search extends e_shortcode
$con = e107::getDateConvert(); // BC Fix
$sch = new e_search; // BC Fix
$sch = e107::getSearch(); // new e_search; // BC Fix
$query = $this->query;
$_GET['q'] = rawurlencode($_GET['q']);
$_GET['t'] = preg_replace('/[^\w\-]/i', '', $_GET['t']);
$_GET['q'] = rawurlencode(varset($_GET['q']));
$_GET['t'] = preg_replace('/[^\w\-]/i', '', varset($_GET['t']));
$search_prefs = $this->search_prefs;
$result_flag = $this->result_flag;
@ -1049,7 +1050,7 @@ $enhanced_types['ex'] = LAN_SEARCH_25.':';
$enhanced_types['ep'] = LAN_SEARCH_26.':';
$enhanced_types['be'] = LAN_SEARCH_27.':';
$SEARCH_VARS->ENHANCED_DISPLAY = $enhanced ? "" : "style='display: none'";
$SEARCH_VARS->ENHANCED_DISPLAY = isset($enhanced) ? "" : "style='display: none'";
// advanced search config
if (!vartrue($_GET['adv']) || $_GET['t'] == 'all')
@ -1093,7 +1094,7 @@ if ($perform_search)
{
$con = e107::getDate();
$sch = new e_search;
$sch = e107::getSearch();
// omitted words message
$stop_count = count($sch -> stop_keys);
@ -1132,7 +1133,7 @@ if(deftrue('BOOTSTRAP'))
$SEARCH_TOP_TABLE = $tmp['start'];
$SEARCH_BOT_TABLE = $tmp['end'];
$SEARCH_CATS = $tmp['category'];
$SEARCH_TYPE = $tmp['type'];
$SEARCH_TYPE = varset($tmp['type']);
$SEARCH_ADV = $tmp['advanced'];
$SEARCH_ENHANCED = $tmp['enhanced'];
$SEARCH_ADV_COMBO = $tmp['advanced-combo'];
@ -1217,14 +1218,13 @@ function parsesearch($text, $match)
}
function headerjs() {
global $search_count, $google_id, $search_prefs, $js_adv, $search_info;
if ($search_prefs['selector'] == 1) {
$script= '';
if (varset($search_prefs['selector']) == 1) {
$types = array_keys($search_info);
$types = implode("', '", $types);
$script = "<script type='text/javascript'>
$script = "
<!--
var i;
var stypes = new Array('".$types."');
@ -1248,15 +1248,15 @@ function headerjs() {
}
$script .= "// -->
</script>";
";
}
if(!empty($script))
{
e107::js('inline', $script);
}
return $script;
}
require_once(FOOTERF);
?>

View File

@ -12,7 +12,7 @@
require_once("class2.php");
if(vartrue($_POST['email2'])) // spam-trap.
if(!empty($_POST['email2'])) // spam-trap.
{
exit;
}
@ -26,6 +26,21 @@ if($qs[0] != 'activate')
// include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_usersettings.php"); Shouldn't need this now
}
e107::js('inline', "
function addtext3(sc){
document.getElementById('signupform').image.value = sc;
}
function addsig(sc){
document.getElementById('signupform').signature.value += sc;
}
function help(help){
document.getElementById('signupform').helpb.value = help;
}
");
e107::coreLan('user'); // Generic user-related language defines
$bcLans = array(
@ -155,6 +170,7 @@ if(e_QUERY && e_QUERY != 'stage1')
$suObj = new e_signup;
$suObj->run(e_QUERY);
require_once(FOOTERF);
return;
exit;
}
@ -643,7 +659,7 @@ function req($field)
return ($field == 2 ? "<span class='required'></span>" : "");
}
//----------------------------------
/*
function headerjs()
{
return "
@ -660,4 +676,4 @@ function headerjs()
}
</script>\n";
}
}*/

View File

@ -28,7 +28,7 @@ e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
$sitedown_shortcodes= e107::getScBatch('sitedown');
if (!$SITEDOWN_TABLE)
if (!isset($SITEDOWN_TABLE))
{
if (file_exists(THEME.'templates/sitedown_template.php')) //v2.x location.
{

View File

@ -15,7 +15,8 @@ if(!empty($_POST) && !isset($_POST['e-token']))
$_POST['e-token'] = '';
}
require_once("class2.php");
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
e107::coreLan('submitnews');
// e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
require_once(HEADERF);
@ -353,7 +354,7 @@ class submitNews
<tr>
<td colspan='2' style='text-align:center' class='forumheader'>
<input class='btn btn-success button' type='submit' name='submitnews_submit' value='".LAN_136."' />
<input type='hidden' name='e-token' value='".e_TOKEN."' />
<input type='hidden' name='e-token' value='".defset('e_TOKEN')."' />
</td>
</tr>
</table>
@ -387,7 +388,7 @@ class submitNewsForm extends e_form
{
$help = (isset($placeholders[$i])) ? $placeholders[$i] : '';
$text .= "<div class='form-group'>";
$text .= $this->text('submitnews_media['.$i.']', $_POST['submitnews_media'][$i], 255, array('placeholder'=>$help) );
$text .= $this->text('submitnews_media['.$i.']', varset($_POST['submitnews_media'][$i]), 255, array('placeholder'=>$help) );
$text .= "</div>";
}

15
top.php
View File

@ -137,10 +137,19 @@ if ($action == 'top')
{
//require_once (e_HANDLER.'level_handler.php');
$rank = e107::getRank();
if(!defined('IMAGE_rank_main_admin_image'))
{
define('IMAGE_rank_main_admin_image', (!empty($pref['rank_main_admin_image']) && file_exists(THEME."forum/".$pref['rank_main_admin_image']) ? "<img src='".THEME_ABS."forum/".$pref['rank_main_admin_image']."' alt='' />" : "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/main_admin.png' alt='' />"));
}
define('IMAGE_rank_main_admin_image', ($pref['rank_main_admin_image'] && file_exists(THEME."forum/".$pref['rank_main_admin_image']) ? "<img src='".THEME_ABS."forum/".$pref['rank_main_admin_image']."' alt='' />" : "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/main_admin.png' alt='' />"));
define('IMAGE_rank_admin_image', ($pref['rank_admin_image'] && file_exists(THEME."forum/".$pref['rank_admin_image']) ? "<img src='".THEME_ABS."forum/".$pref['rank_admin_image']."' alt='' />" : "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/admin.png' alt='' />"));
define('IMAGE_rank_moderator_image', ($pref['rank_moderator_image'] && file_exists(THEME."forum/".$pref['rank_moderator_image']) ? "<img src='".THEME_ABS."forum/".$pref['rank_moderator_image']."' alt='' />" : "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/moderator.png' alt='' />"));
if(!defined('IMAGE_rank_main_admin_image'))
{
define('IMAGE_rank_admin_image', (!empty($pref['rank_admin_image']) && file_exists(THEME."forum/".$pref['rank_admin_image']) ? "<img src='".THEME_ABS."forum/".$pref['rank_admin_image']."' alt='' />" : "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/admin.png' alt='' />"));
}
if(!defined('IMAGE_rank_main_admin_image'))
{
define('IMAGE_rank_moderator_image', (!empty($pref['rank_moderator_image']) && file_exists(THEME."forum/".$pref['rank_moderator_image']) ? "<img src='".THEME_ABS."forum/".$pref['rank_moderator_image']."' alt='' />" : "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/moderator.png' alt='' />"));
}
if ($subaction == 'forum' || $subaction == 'all')
{

View File

@ -4,8 +4,10 @@ if (!defined('e107_INIT'))
{
require_once("class2.php");
}
define('e_IFRAME', true);
if(!defined('e_IFRAME'))
{
define('e_IFRAME', true);
}
require_once(HEADERF);
class e_unsubscribe
@ -139,10 +141,7 @@ class e_unsubscribe
new e_unsubscribe;
require_once(FOOTERF);
exit;

View File

@ -9,12 +9,12 @@
*/
require_once("class2.php");
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
e107::coreLan('upload');
if (!$pref['upload_enabled'] || $pref['upload_class'] == 255)
if (!isset($pref['upload_enabled']) ||( varset($pref['upload_class']) == 255))
{
e107::redirect();
exit;
exit;
}
if (!defined("USER_WIDTH") && defset('BOOTSTRAP')==false){ define("USER_WIDTH","width:97%"); }
@ -400,7 +400,7 @@ class userUpload
</tr>
<tr>
<td style='text-align:center' colspan='2' class='forumheader'><input class='btn btn-primary button' type='submit' name='upload' value='".LAN_416."' /></td>
<td style='text-align:center' colspan='2' class='forumheader'><input class='btn btn-primary button' type='submit' name='upload' value=\"".defset('LAN_UL_039', "Submit and Upload")."\" /></td>
</tr>
</table>
</form>
@ -415,7 +415,7 @@ class userUpload
//TODO Shortcodes for the form elements above.
function sc_author()
{
$poster = '';
return "<input class='tbox' style='width:90%' name='file_poster' type='text' size='50' maxlength='100' value='{$poster}' />";
}
@ -428,165 +428,7 @@ require_once(HEADERF);
$up->init();
require_once(FOOTERF);
exit;
/*
if (!check_class($pref['upload_class']))
{
$text = "<div style='text-align:center'>".LAN_UL_002."</div>";
$ns->tablerender(LAN_UL_020, $text);
require_once(FOOTERF);
exit;
}
*/
/*
$text = "<div style='text-align:center'>
<form enctype='multipart/form-data' method='post' onsubmit='return frmVerify()' action='".e_SELF."'>
<table style='".USER_WIDTH."' class='table fborder'>
<colgroup>
<col style='width:30%' />
<col style='width:70%' />
</colgroup>
<tr>
<td class='forumheader3'>".DOWLAN_11.":</td>
<td class='forumheader3'>";
require_once(e_CORE."shortcodes/batch/download_shortcodes.php");
$dlparm = (isset($download_category)) ? $download_category : "";
$text .= $tp->parseTemplate("{DOWNLOAD_CATEGORY_SELECT={$dlparm}}",true,$download_shortcodes);
$text .= "
</td>
</tr>
<tr>
<td style='text-align:center' colspan='2' class='forumheader3'>";
$text .= "<b>".LAN_406."</b><br />".LAN_419.":";
require_once(e_HANDLER.'upload_handler.php');
$a_filetypes = get_filetypes();
if (count($a_filetypes) == 0)
{
$text .= LAN_UL_025."</td></tr></table>
</form>
</div>";
$ns->tablerender(LAN_417, $text);
require_once(FOOTERF);
}
$max_upload_size = calc_max_upload_size(-1); // Find overriding maximum upload size
$max_upload_size = set_max_size($a_filetypes, $max_upload_size);
if (ADMIN)
{
$upper_limit = calc_max_upload_size();
$allowed_filetypes = "<table><tr><td>".LAN_UL_023."&nbsp;&nbsp;</td><td style='text-align:right'>".LAN_UL_024."</td></tr>";
foreach ($a_filetypes as $type => $size)
{
$allowed_filetypes .= "<tr><td>{$type}</td><td style='text-align:right'>".$e107->parseMemorySize($size,0)."</td></tr>";
}
$allowed_filetypes .= "</table>";
}
else
{
$a_filetypes = array_keys($a_filetypes);
$allowed_filetypes = implode(' | ', $a_filetypes);
}
$text .= " ".$allowed_filetypes."<br />".LAN_407."<br />
".LAN_418.$e107->parseMemorySize($max_upload_size,0)." (".LAN_UL_022.")<br />";
$text .= "<span style='text-decoration:underline'>".LAN_408."</span> ".LAN_420."</td>
</tr>";
if (!USER)
{ // Prompt for name, email
$text .= "<tr>
<td class='forumheader3'>".LAN_61."</td>
<td class='forumheader3'><input class='tbox' style='width:90%' name='file_poster' type='text' size='50' maxlength='100' value='{$poster}' /></td>
</tr>
<tr>
<td class='forumheader3'><span style='text-decoration:underline'>".LAN_112."</span></td>
<td class='forumheader3'><input class='tbox' style='width:90%' name='file_email' id='user_email' type='text' size='50' maxlength='100' value='".$postemail."' /></td>
</tr>";
}
$text .= "
<tr>
<td class='forumheader3'><span style='text-decoration:underline'>".LAN_409."</span></td>
<td class='forumheader3'><input class='tbox' style='width:90%' name='file_name' id='file_name' type='text' size='50' maxlength='100' /></td>
</tr>
<tr>
<td class='forumheader3'>".LAN_410."</td>
<td class='forumheader3'><input class='tbox' style='width:90%' name='file_version' type='text' size='10' maxlength='10' /></td>
</tr>
<tr>
<td class='forumheader3'><span style='text-decoration:underline'>".LAN_411."</span></td>
<td class='forumheader3'><input class='tbox' style='width:90%' id='file_realpath' name='file_userfile[]' type='file' size='47' /></td>
</tr>
<tr>
<td class='forumheader3'>".LAN_412."</td>
<td class='forumheader3'><input class='tbox' style='width:90%' name='file_userfile[]' type='file' size='47' /></td>
</tr>
<tr>
<td class='forumheader3'><span style='text-decoration:underline'>".LAN_413."</span></td>
<td class='forumheader3'><textarea class='tbox' style='width:90%' name='file_description' id='file_description' cols='59' rows='6'></textarea></td>
</tr>
<tr>
<td class='forumheader3'>".LAN_144."</td>
<td class='forumheader3'><input class='tbox' style='width:90%' name='file_website' type='text' size='50' maxlength='100' value='".(defined(USERURL) ? USERURL : "")."' /></td>
</tr>
<tr>
<td class='forumheader3'>".LAN_414."<br /><span class='smalltext'>".LAN_415."</span></td>
<td class='forumheader3'><input class='tbox' style='width:90%' name='file_demo' type='text' size='50' maxlength='100' /></td>
</tr>
<tr>
<td style='text-align:center' colspan='2' class='forumheader'><input class='btn btn-default button' type='submit' name='upload' value='".LAN_416."' /></td>
</tr>
</table>
</form>
</div>";
$ns->tablerender(LAN_417, $text);
require_once(FOOTERF);
*/
?>

View File

@ -279,6 +279,9 @@ else
exit;
}
require_once(FOOTERF);
@ -310,4 +313,4 @@ function parse_userposts_comments_table($row, $template)
return e107::getParser()->simpleParse($template, $vars);
}
?>