mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 11:50:30 +02:00
Code clean-up - remove empty space
This commit is contained in:
@@ -19,8 +19,6 @@ if (!getperms('P'))
|
||||
|
||||
e107::lan('forum', 'admin', true);
|
||||
e107::lan('forum', 'front', true);
|
||||
//e107::includeLan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/English_admin.php');
|
||||
//e107::lan('forum','', 'front');
|
||||
|
||||
|
||||
e107::css('inline',"
|
||||
@@ -45,7 +43,6 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
|
||||
class forum_admin extends e_admin_dispatcher
|
||||
{
|
||||
|
||||
protected $modes = array(
|
||||
|
||||
'main' => array(
|
||||
@@ -75,23 +72,22 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
|
||||
);
|
||||
|
||||
|
||||
protected $adminMenu = array(
|
||||
|
||||
'main/list' => array('caption' => LAN_MANAGE, 'perm' => 'P'),
|
||||
'main/create' => array('caption' => LAN_CREATE, 'perm' => 'P'),
|
||||
'main/opt1' => array('divider'=>true),
|
||||
|
||||
'main/opt1' => array('divider' => true),
|
||||
|
||||
'main/rules' => array('caption' => WMGLAN_5, 'perm' => 'P'),
|
||||
'mods/list' => array('caption' => LAN_FORUM_2003, 'perm'=>'P'),
|
||||
'main/prefs' => array('caption' => LAN_PREFS, 'perm' => 'P'),
|
||||
|
||||
'main/opt2' => array('divider' => true),
|
||||
|
||||
'report/list' => array('caption' => FORLAN_116, 'perm'=>'P'),
|
||||
'post/list' => array('caption' => LAN_PLUGIN_FORUM_LATESTPOSTS, 'perm'=>'P'),
|
||||
'main/prune' => array('caption' => LAN_PRUNE, 'perm' => 'P'),
|
||||
'main/tools' => array('caption' => FORLAN_153, 'perm'=>'p')
|
||||
|
||||
);
|
||||
|
||||
protected $adminMenuAliases = array(
|
||||
@@ -100,24 +96,15 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
|
||||
protected $menuTitle = LAN_PLUGIN_FORUM_NAME;
|
||||
|
||||
|
||||
function init()
|
||||
{
|
||||
if(E107_DEBUG_LEVEL > 0)
|
||||
{
|
||||
$this->adminMenu['opt3'] = array('divider'=>true);
|
||||
$this->adminMenu['main/update'] = array('caption'=>"Redo v1.x Forum Upgrade", 'perm'=>0, 'uri'=>'{e_PLUGIN}forum/forum_update.php');
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class forum_ui extends e_admin_ui
|
||||
{
|
||||
@@ -191,16 +178,11 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
'reported_post_email' => array('title' => FORLAN_116, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_122),
|
||||
'tooltip' => array('title' => FORLAN_126, 'type'=>'boolean', 'data' => 'int','help'=>FORLAN_127),
|
||||
'ranks' => array('title' => FORLAN_63, 'type'=>'boolean', 'data' => 'int','help'=>''),
|
||||
|
||||
'tiplength' => array('title' => FORLAN_128, 'type'=>'number', 'data' => 'int','help'=>FORLAN_129),
|
||||
'eprefix' => array('title' => FORLAN_53, 'type'=>'text', 'data' => 'string','help'=>FORLAN_54),
|
||||
'popular' => array('title' => FORLAN_55, 'type'=>'number', 'data' => 'int','help'=>FORLAN_56),
|
||||
'postspage' => array('title' => FORLAN_57, 'type'=>'number', 'data' => 'int','help'=>FORLAN_58),
|
||||
'threadspage' => array('title' => FORLAN_186, 'type'=>'number', 'data' => 'int','help'=>FORLAN_187),
|
||||
|
||||
|
||||
|
||||
|
||||
);
|
||||
|
||||
public $forumParents = array();
|
||||
@@ -234,11 +216,7 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
|
||||
$sql2->update('forum', 'forum_order = '.$c.' WHERE forum_id = '.$row['forum_id'].' LIMIT 1');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -247,13 +225,11 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
|
||||
$this->checkOrder();
|
||||
|
||||
|
||||
if(e107::isInstalled('poll') == false)
|
||||
{
|
||||
$this->prefs['poll']['writeParms']['post'] = " <span class='label label-important label-danger'>".FORLAN_215."</span>";
|
||||
}
|
||||
|
||||
|
||||
if($this->getMode() == 'mods')
|
||||
{
|
||||
$this->fieldpref = array('forum_name', 'forum_moderators');
|
||||
@@ -264,7 +240,6 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
$this->fields['forum_postclass']['batch'] = false;
|
||||
$this->fields['forum_threadclass']['batch'] = false;
|
||||
$this->fields['forum_moderators']['batch'] = true;
|
||||
|
||||
}
|
||||
|
||||
require_once(e_PLUGIN.'forum/forum_class.php');
|
||||
@@ -275,7 +250,6 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
$this->forumObj->upgradeLegacyPrefs();
|
||||
}
|
||||
|
||||
|
||||
if (!empty($_POST['do_prune']) && !empty($_POST['prune_days']) && !empty($_POST['pruneForum']))
|
||||
{
|
||||
$msg = $this->forumObj->forumPrune($_POST['prune_type'], $_POST['prune_days'], $_POST['pruneForum']);
|
||||
@@ -287,15 +261,11 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
$this->saveRules();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if($this->getAction() == 'edit')
|
||||
{
|
||||
$this->fields['forum_order']['noedit'] = true;
|
||||
}
|
||||
|
||||
|
||||
$data = e107::getDb()->retrieve('forum', 'forum_id,forum_name,forum_parent', 'forum_id != 0',true);
|
||||
$this->forumParents[0] = FORLAN_216;
|
||||
$forumSubParents = array();
|
||||
@@ -318,7 +288,6 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
$this->fields['forum_parent']['writeParms'] = $this->forumParents;
|
||||
$this->fields['forum_sub']['writeParms']['optArray'] = $forumSubParents;
|
||||
$this->fields['forum_sub']['writeParms']['default'] = 'blank';
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -326,7 +295,6 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
|
||||
public function afterSort($result, $selected)
|
||||
{
|
||||
|
||||
return;
|
||||
|
||||
$sql = e107::getDb();
|
||||
@@ -336,7 +304,6 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
{
|
||||
$id = $val['forum_id'];
|
||||
$parent[$id] = $val['forum_order'];
|
||||
|
||||
}
|
||||
|
||||
$previous = 0;
|
||||
@@ -356,9 +323,7 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
|
||||
// echo "<br />".$row['forum_name']." with parent: ".$p." old: ".$row['forum_order']." new: ".$c;
|
||||
$sql->update('forum','forum_order = '.$c.' WHERE forum_id = '.intval($row['forum_id']).' LIMIT 1');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -486,10 +451,6 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
</form>";
|
||||
|
||||
return $text;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -498,7 +459,6 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
$tp = e107::getParser();
|
||||
$sql = e107::getDb();
|
||||
|
||||
|
||||
$guestrules = $tp->toDB($_POST['guestrules']);
|
||||
$memberrules = $tp->toDB($_POST['memberrules']);
|
||||
$adminrules = $tp->toDB($_POST['adminrules']);
|
||||
@@ -516,15 +476,10 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
$sql->insert("generic", "0, 'forum_rules_admin', '".time()."', 0, '', '".$_POST['admin_active']."', '$adminrules' ");
|
||||
}
|
||||
|
||||
|
||||
e107::getMessage()->addSuccess(LAN_SAVED);
|
||||
return null;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function rulesPage()
|
||||
{
|
||||
|
||||
@@ -544,7 +499,6 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
list($id, $adminrules, $wm_active6) = $sql->fetch();
|
||||
*/
|
||||
|
||||
|
||||
if($sql->select('generic','*',"gen_type='forum_rules_guest'"))
|
||||
{
|
||||
$guest_rules = $sql->fetch();
|
||||
@@ -633,7 +587,6 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
|
||||
$ns->tablerender(WMGLAN_5, $text);
|
||||
|
||||
|
||||
/*
|
||||
echo "
|
||||
<script type=\"text/javascript\">
|
||||
@@ -657,12 +610,8 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
}
|
||||
</script>
|
||||
";*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function modsPage()
|
||||
{
|
||||
|
||||
@@ -720,19 +669,10 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
</form>";
|
||||
|
||||
return $txt;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function toolsPageProcess()
|
||||
{
|
||||
|
||||
$mes = e107::getMessage();
|
||||
|
||||
$fList = array();
|
||||
@@ -780,11 +720,8 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
$mes->addSuccess($msg);
|
||||
// $ns->tablerender($caption, $mes->render().$text);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//TODO Add SEF-url generation for forum and threads where missing.
|
||||
function toolsPage()
|
||||
{
|
||||
@@ -860,20 +797,13 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
|
||||
return $txt;
|
||||
// $ns->tablerender(FORLAN_166, $txt);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
class forum_form_ui extends e_admin_form_ui
|
||||
{
|
||||
|
||||
function forum_name($curVal,$mode,$parm)
|
||||
{
|
||||
|
||||
$frm = e107::getForm();
|
||||
|
||||
if($mode == 'read')
|
||||
@@ -884,8 +814,6 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
$id = $this->getController()->getListModel()->get('forum_id');
|
||||
$sub = $this->getController()->getListModel()->get('forum_sub');
|
||||
|
||||
|
||||
|
||||
$level = 1;
|
||||
|
||||
if(!empty($sub))
|
||||
@@ -896,8 +824,6 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
$linkQ = e_SELF."?searchquery=&filter_options=page_chapter__".$id."&mode=page&action=list";
|
||||
$level_image = $parent ? '<img src="'.e_IMAGE_ABS.'generic/branchbottom.gif" class="icon" alt="" style="margin-left: '.($level * 20).'px" /> ' : '';
|
||||
|
||||
|
||||
|
||||
return ($parent) ? $level_image.$curVal : $curVal;
|
||||
}
|
||||
|
||||
@@ -986,10 +912,6 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Custom Method/Function
|
||||
function forum_lastpost_info($curVal,$mode)
|
||||
{
|
||||
@@ -1012,7 +934,6 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Custom Method/Function
|
||||
function forum_options($curVal,$mode)
|
||||
{
|
||||
@@ -1038,8 +959,6 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
class reported_ui extends e_admin_ui
|
||||
{
|
||||
|
||||
@@ -1064,7 +983,6 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
|
||||
protected $fieldpref = array('gen_datestamp', 'gen_ip', 'gen_user_id', 'gen_chardata');
|
||||
|
||||
|
||||
// optional
|
||||
public function init()
|
||||
{
|
||||
@@ -1081,15 +999,11 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
return array('caption'=>LAN_HELP, 'text'=>FORLAN_189);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
class reported_form_ui extends e_admin_form_ui
|
||||
{
|
||||
|
||||
|
||||
// Custom Method/Function
|
||||
function gen_intdata($curVal,$mode)
|
||||
{
|
||||
@@ -1114,7 +1028,6 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Custom Method/Function
|
||||
function gen_chardata($curVal,$mode)
|
||||
{
|
||||
@@ -1153,12 +1066,8 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
return $text;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
class post_ui extends e_admin_ui
|
||||
{
|
||||
|
||||
@@ -1208,14 +1117,11 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
{
|
||||
// $sql2->db_Delete('banlist', "banlist_ip='{$banIP}'");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
class post_form_ui extends e_admin_form_ui
|
||||
{
|
||||
|
||||
function post_attachments($curVal,$mode)
|
||||
{
|
||||
|
||||
@@ -1227,7 +1133,6 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
$tp = e107::getParser();
|
||||
$fl = e107::getFile();
|
||||
|
||||
|
||||
$text = '';
|
||||
|
||||
if(!empty($data['img']))
|
||||
@@ -1266,13 +1171,8 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
new forum_admin();
|
||||
|
||||
require_once(e_ADMIN."auth.php");
|
||||
@@ -1280,11 +1180,10 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
|
||||
require_once(e_ADMIN."footer.php");
|
||||
exit;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
$e_sub_cat = 'forum';
|
||||
|
||||
|
Reference in New Issue
Block a user