1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +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,14 +2,12 @@
/* /*
* e107 website system * 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 * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
* Featurebox administration * Featurebox administration
* *
* $URL$
* $Id$
*/ */
require_once("../../class2.php"); require_once("../../class2.php");
if (!getperms("P") || !plugInstalled('featurebox')) if (!getperms("P") || !plugInstalled('featurebox'))
@@ -238,7 +236,7 @@ class fb_main_ui extends e_admin_ui
if(e107::getDb()->db_Select('featurebox_category')) if(e107::getDb()->db_Select('featurebox_category'))
{ {
//$categories[0] = LAN_SELECT; //$categories[0] = LAN_SELECT;
while ($row = e107::getDb()->db_Fetch()) while ($row = e107::getDb()->fetch())
{ {
$id = $row['fb_category_id']; $id = $row['fb_category_id'];
$tmpl = $row['fb_category_template']; $tmpl = $row['fb_category_template'];

View File

@@ -19,9 +19,9 @@ $eplug_rss_feed[] = $feed;
//##### create rss data, return as array $eplug_rss_data ----------------------------------- //##### create rss data, return as array $eplug_rss_data -----------------------------------
$rss = array(); $rss = array();
$sqlrss = new db; $sqlrss = new db;
if($items = $sqlrss -> db_Select('featurebox', "*", "fb_class = 0 DESC LIMIT 0,".$this->limit )){ if($items = $sqlrss->select('featurebox', "*", "fb_class = 0 DESC LIMIT 0,".$this->limit )){
$i=0; $i=0;
while($rowrss = $sqlrss -> db_Fetch()){ while($rowrss = $sqlrss->fetch()){
$rss[$i]['author'] = ''; $rss[$i]['author'] = '';
$rss[$i]['author_email'] = ''; $rss[$i]['author_email'] = '';
$rss[$i]['link'] = ''; $rss[$i]['link'] = '';

View File

@@ -1,7 +1,6 @@
<?php <?php
/* /*
* Copyright (c) e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt) * Copyright (c) e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id$
* *
* Featurebox shortcode batch class - shortcodes available site-wide. ie. equivalent to multiple .sc files. * Featurebox shortcode batch class - shortcodes available site-wide. ie. equivalent to multiple .sc files.
*/ */

View File

@@ -2,21 +2,23 @@
/* /*
* e107 website system * 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 * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
*/ */
if (!defined('e107_INIT')) { exit; } 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) 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); 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)]; $entry = $nfArray[array_rand($nfArray)];
extract($entry); extract($entry);
} }
@@ -45,11 +47,11 @@ else
} }
$fbcc = $fb_title; $fbcc = $fb_title;
$fb_title = $tp -> toHTML($fb_title, TRUE,'title'); $fb_title = $tp->toHTML($fb_title, TRUE,'title');
$fb_text = $tp -> toHTML($fb_text, TRUE,'body'); $fb_text = $tp->toHTML($fb_text, TRUE,'body');
if(!$fb_rendertype) if(!$fb_rendertype)
{ {
$ns -> tablerender($fb_title, $fb_text, 'featurebox'); $ns->tablerender($fb_title, $fb_text, 'featurebox');
} }
else else
{ {

View File

@@ -1,10 +1,10 @@
<?php <?php
/* /*
* Copyright (c) 2013 e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt) * Copyright (c) 2014 e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id: e_shortcode.php 12438 2011-12-05 15:12:56Z secretr $
* *
* Gallery Template * Gallery Template
*/ */
if (!defined('e107_INIT')) { exit; } if (!defined('e107_INIT')) { exit; }
// e107::Lan('featurebox', 'front'); // e107::Lan('featurebox', 'front');