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

#4299: Wrap more potentially undefined constants

In:
* Forums
* /e107_admin/menus.php
This commit is contained in:
Nick Liu 2021-07-13 12:49:05 +02:00
parent bc1340af12
commit ccf0f037aa
No known key found for this signature in database
GPG Key ID: 1167C5F9C9897637
7 changed files with 18 additions and 13 deletions

View File

@ -1200,8 +1200,12 @@ function check_email($email)
* @param int $uid * @param int $uid
* @return bool * @return bool
*/ */
function check_class($var, $userclass = USERCLASS_LIST, $uid = 0) function check_class($var, $userclass = null, $uid = 0)
{ {
if ($userclass === null)
{
$userclass = defset('USERCLASS_LIST', '0');
}
$e107 = e107::getInstance(); $e107 = e107::getInstance();
if ($var === e_LANGUAGE) if ($var === e_LANGUAGE)
{ {

View File

@ -1818,7 +1818,7 @@ $columnInfo = array(
// See if any mirrors defined // See if any mirrors defined
// Need to check all the possible mirror names - might have deleted the first one if we're in edit mode // Need to check all the possible mirror names - might have deleted the first one if we're in edit mode
if(count($_POST['download_mirror_name'])) if(is_array($_POST['download_mirror_name']))
{ {
foreach ($_POST['download_mirror_name'] as $mn) foreach ($_POST['download_mirror_name'] as $mn)
{ {

View File

@ -16,8 +16,8 @@ class forum_dashboard // include plugin-folder in the name.
$sql = e107::getDb(); $sql = e107::getDb();
$forum_posts = $sql->count('forum_post'); $forum_posts = $sql->count('forum_post');
$var[0]['icon'] = E_16_FORUM; $var[0]['icon'] = defset('E_16_FORUM');
$var[0]['title'] = LAN_PLUGIN_FORUM_POSTS; $var[0]['title'] = defset('LAN_PLUGIN_FORUM_POSTS');
$var[0]['url'] = e_PLUGIN."forum/forum_admin.php"; $var[0]['url'] = e_PLUGIN."forum/forum_admin.php";
$var[0]['total'] = $forum_posts; $var[0]['total'] = $forum_posts;
@ -30,8 +30,8 @@ class forum_dashboard // include plugin-folder in the name.
$sql = e107::getDb(); $sql = e107::getDb();
$reported_posts = $sql->count('generic', '(*)', "WHERE gen_type='reported_post' OR gen_type='Reported Forum Post'"); $reported_posts = $sql->count('generic', '(*)', "WHERE gen_type='reported_post' OR gen_type='Reported Forum Post'");
$var[0]['icon'] = E_16_FORUM; $var[0]['icon'] = defset('E_16_FORUM');
$var[0]['title'] = ADLAN_LAT_6; $var[0]['title'] = defset('ADLAN_LAT_6');
$var[0]['url'] = e_PLUGIN."forum/forum_admin.php?mode=report&action=list"; $var[0]['url'] = e_PLUGIN."forum/forum_admin.php?mode=report&action=list";
$var[0]['total'] = $reported_posts; $var[0]['total'] = $reported_posts;

View File

@ -17,6 +17,7 @@ if (!getperms('P'))
} }
e107::lan('forum', 'global', true);
e107::lan('forum', 'admin', true); e107::lan('forum', 'admin', true);
e107::lan('forum', 'front', true); e107::lan('forum', 'front', true);

View File

@ -460,7 +460,7 @@ class forumStats
$frm = e107::getForm(); $frm = e107::getForm();
$breadarray = array( $breadarray = array(
array('text'=> e107::pref('forum','title', LAN_PLUGIN_FORUM_NAME), 'url' => e107::url('forum','index') ), array('text'=> e107::pref('forum','title', defset('LAN_PLUGIN_FORUM_NAME')), 'url' => e107::url('forum','index') ),
array('text'=>LAN_FORUM_6013, 'url'=>null) array('text'=>LAN_FORUM_6013, 'url'=>null)
); );

View File

@ -12,7 +12,7 @@ if (!defined('e107_INIT')) { exit; }
if(!defined("USER_WIDTH") && !deftrue('BOOTSTRAP')){ define("USER_WIDTH","width:95%;margin-left:auto;margin-right:auto"); } if(!defined("USER_WIDTH") && !deftrue('BOOTSTRAP')){ define("USER_WIDTH","width:95%;margin-left:auto;margin-right:auto"); }
$FORUM_PREVIEW = "<div> $FORUM_PREVIEW = "<div>
<table style='".USER_WIDTH."' class='fborder table'> <table style='".defset('USER_WIDTH')."' class='fborder table'>
<tr> <tr>
<td colspan='2' class='fcaption' style='vertical-align:top'>".LAN_FORUM_3005. <td colspan='2' class='fcaption' style='vertical-align:top'>".LAN_FORUM_3005.
($action != "nt" ? "</td>" : " ( ".LAN_FORUM_3011.": {PREVIEW_SUBJECT} )</td>")." ($action != "nt" ? "</td>" : " ( ".LAN_FORUM_3011.": {PREVIEW_SUBJECT} )</td>")."

View File

@ -61,7 +61,7 @@ if (isset($_POST['update_theme']))
$cfg->set('allow_theme_select', $themeeditclass); $cfg->set('allow_theme_select', $themeeditclass);
$cfg->save(true,true,true); $cfg->save(true,true,true);
$woffle = LAN_UMENU_THEME_8.$pref['allowed_themes'].'[!br!]'.LAN_UMENU_THEME_9.$pref['allow_theme_select']; $woffle = defset('LAN_UMENU_THEME_8').$pref['allowed_themes'].'[!br!]'.defset('LAN_UMENU_THEME_9').$pref['allow_theme_select'];
e107::getLog()->add('UTHEME_01',$woffle,E_LOG_INFORMATIVE,''); e107::getLog()->add('UTHEME_01',$woffle,E_LOG_INFORMATIVE,'');
} }
} }
@ -79,7 +79,7 @@ $themeeditclass = varset($pref['allow_theme_select'],e_UC_NOBODY);
$text = " $text = "
<form method='post' action='".e_SELF."' id='menu_conf_form'> <form method='post' action='".e_SELF."' id='menu_conf_form'>
<fieldset id='core-user_menu-usertheme'> <fieldset id='core-user_menu-usertheme'>
<legend class='e-hideme'>".LAN_UMENU_THEME_6."</legend> <legend class='e-hideme'>".defset('LAN_UMENU_THEME_6')."</legend>
<table class='table adminlist'> <table class='table adminlist'>
<colgroup span='2'> <colgroup span='2'>
<col style='width: 50%' /> <col style='width: 50%' />
@ -87,7 +87,7 @@ $text = "
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
<th colspan='2'>".LAN_UMENU_THEME_4."</th> <th colspan='2'>".defset('LAN_UMENU_THEME_4')."</th>
</tr> </tr>
</thead> </thead>
<tbody>"; <tbody>";
@ -103,7 +103,7 @@ $text = "
} }
$text .= " $text .= "
<tr> <tr>
<td>".LAN_UMENU_THEME_7."</td> <td>".defset('LAN_UMENU_THEME_7')."</td>
<td>".$e_userclass->uc_dropdown("themeeditclass", $themeeditclass, "main,member,admin,classes,matchclass,nobody")."</td> <td>".$e_userclass->uc_dropdown("themeeditclass", $themeeditclass, "main,member,admin,classes,matchclass,nobody")."</td>
</tr>"; </tr>";
@ -118,7 +118,7 @@ $text = "
"; ";
$mes = e107::getMessage(); $mes = e107::getMessage();
$ns->tablerender(LAN_UMENU_THEME_6,$mes->render().$text); $ns->tablerender(defset('LAN_UMENU_THEME_6'),$mes->render().$text);
require_once(e_ADMIN."footer.php"); require_once(e_ADMIN."footer.php");