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

61 lines
1.1 KiB
PHP
Raw Normal View History

2006-12-02 04:36:16 +00:00
<?php
/*
2009-11-17 13:48:46 +00:00
* e107 website system
*
2014-09-11 20:57:52 +02:00
* Copyright (C) 2008-2014 e107 Inc (e107.org)
2009-11-17 13:48:46 +00:00
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*/
2006-12-02 04:36:16 +00:00
if (!defined('e107_INIT')) { exit; }
2014-09-11 20:57:52 +02:00
if (!e107::isInstalled('featurebox'))
{
2014-09-11 20:57:52 +02:00
header('location:'.e_BASE.'index.php');
exit;
}
2006-12-02 04:36:16 +00:00
2014-09-11 20:57:52 +02:00
if($sql->select("featurebox", "*", "fb_mode=1 AND fb_class IN (".USERCLASS_LIST.") ORDER BY fb_class ASC"))
2006-12-02 04:36:16 +00:00
{
2014-09-11 20:57:52 +02:00
while($row = $sql->fetch())
2006-12-02 04:36:16 +00:00
{
if($row['fb_class'] > 0 && $row['fb_class'] < 251)
{
extract($row);
continue;
}
else
{
$xentry = $row;
}
}
if(!isset($fb_title))
{
extract($xentry);
}
}
2014-09-11 20:57:52 +02:00
else if($sql->select("featurebox", "*", "fb_mode!=1 AND fb_class IN (".USERCLASS_LIST.")"))
2006-12-02 04:36:16 +00:00
{
2014-09-11 20:57:52 +02:00
$nfArray = $sql->db_getList();
2006-12-02 04:36:16 +00:00
$entry = $nfArray[array_rand($nfArray)];
extract($entry);
}
else
{
return FALSE;
}
$fbcc = $fb_title;
2014-09-11 20:57:52 +02:00
$fb_title = $tp->toHTML($fb_title, TRUE,'title');
$fb_text = $tp->toHTML($fb_text, TRUE,'body');
2006-12-02 04:36:16 +00:00
if(!$fb_rendertype)
{
2014-09-11 20:57:52 +02:00
$ns->tablerender($fb_title, $fb_text, 'featurebox');
2006-12-02 04:36:16 +00:00
}
else
{
require_once(e_PLUGIN."featurebox/templates/".$fb_template.".php");
echo $FB_TEMPLATE;
}
?>