1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-13 10:04:35 +02:00

Featurebox plugin - Code cleanup

This commit is contained in:
Moc
2014-09-11 20:57:52 +02:00
parent 7987a15ec7
commit 096f4d08db
5 changed files with 18 additions and 19 deletions

View File

@@ -2,21 +2,23 @@
/*
* e107 website system
*
* Copyright (C) 2008-2009 e107 Inc (e107.org)
* Copyright (C) 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)
*
*/
if (!defined('e107_INIT')) { exit; }
if (!plugInstalled('featurebox'))
if (!e107::isInstalled('featurebox'))
{
return '';
header('location:'.e_BASE.'index.php');
exit;
}
if($sql -> db_Select("featurebox", "*", "fb_mode=1 AND fb_class IN (".USERCLASS_LIST.") ORDER BY fb_class ASC"))
if($sql->select("featurebox", "*", "fb_mode=1 AND fb_class IN (".USERCLASS_LIST.") ORDER BY fb_class ASC"))
{
while($row = $sql->db_Fetch())
while($row = $sql->fetch())
{
if($row['fb_class'] > 0 && $row['fb_class'] < 251)
{
@@ -33,9 +35,9 @@ if($sql -> db_Select("featurebox", "*", "fb_mode=1 AND fb_class IN (".USERCLASS_
extract($xentry);
}
}
else if($sql -> db_Select("featurebox", "*", "fb_mode!=1 AND fb_class IN (".USERCLASS_LIST.")"))
else if($sql->select("featurebox", "*", "fb_mode!=1 AND fb_class IN (".USERCLASS_LIST.")"))
{
$nfArray = $sql -> db_getList();
$nfArray = $sql->db_getList();
$entry = $nfArray[array_rand($nfArray)];
extract($entry);
}
@@ -45,11 +47,11 @@ else
}
$fbcc = $fb_title;
$fb_title = $tp -> toHTML($fb_title, TRUE,'title');
$fb_text = $tp -> toHTML($fb_text, TRUE,'body');
$fb_title = $tp->toHTML($fb_title, TRUE,'title');
$fb_text = $tp->toHTML($fb_text, TRUE,'body');
if(!$fb_rendertype)
{
$ns -> tablerender($fb_title, $fb_text, 'featurebox');
$ns->tablerender($fb_title, $fb_text, 'featurebox');
}
else
{