1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-12 01:25:01 +02:00

cleanup redeclaration of db objects - similar issue to bugs #3632 and #3412

This commit is contained in:
CaMer0n
2006-12-31 14:46:30 +00:00
parent 02576e0037
commit 82a700cdef
7 changed files with 118 additions and 115 deletions

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/list_class.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:35:26 $
| $Author: mcfly_e107 $
| $Revision: 1.2 $
| $Date: 2006-12-31 14:46:30 $
| $Author: e107coders $
+---------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
@@ -47,7 +47,7 @@ class listclass {
global $sql,$eArrayStorage;
//check preferences from database
$sql = new db;
if (!is_object($sql)){ $sql = new db; }
$num_rows = $sql -> db_Select("core", "*", "e107_name='list' ");
$row = $sql -> db_Fetch();
@@ -138,7 +138,7 @@ class listclass {
$titles[] = $content_name." : ".$row['content_heading'];
}
}
}
}
$content_types = array_unique($content_types);
return;
@@ -247,7 +247,7 @@ class listclass {
$list_pref["$sections[$i]_new_page_order"] = ($i+1);
$list_pref["$sections[$i]_new_page_icon"] = "1";
}
//new menu preferences
$list_pref['new_menu_caption'] = LIST_ADMIN_15;
$list_pref['new_menu_icon_use'] = "1";
@@ -343,7 +343,7 @@ class listclass {
$menutext = "";
$start = "";
$end = "";
$LIST_ICON = "";
$LIST_DATE = "";
$LIST_HEADING = "";
@@ -356,29 +356,29 @@ class listclass {
if(is_array($LIST_DATA)){ //if it is an array, data exists and data is not empty
for($i=0;$i<count($LIST_DATA[$mode]);$i++)
{
{
$LIST_ICON = $LIST_DATA[$mode][$i][0];
$LIST_HEADING = $LIST_DATA[$mode][$i][1];
$LIST_AUTHOR = $LIST_DATA[$mode][$i][2];
$LIST_CATEGORY = $LIST_DATA[$mode][$i][3];
$LIST_DATE = $LIST_DATA[$mode][$i][4];
$LIST_INFO = $LIST_DATA[$mode][$i][5];
if($mode == "recent_menu"){
global $sc_style;
$LIST_AUTHOR = ($LIST_AUTHOR ? $sc_style['LIST_AUTHOR']['pre'].$LIST_AUTHOR.$sc_style['LIST_AUTHOR']['post'] : "");
$LIST_CATEGORY = ($LIST_CATEGORY ? $sc_style['LIST_CATEGORY']['pre'].$LIST_CATEGORY.$sc_style['LIST_CATEGORY']['post'] : "");
$LIST_AUTHOR = ($LIST_AUTHOR ? $sc_style['LIST_AUTHOR']['pre'].$LIST_AUTHOR.$sc_style['LIST_AUTHOR']['post'] : "");
$LIST_CATEGORY = ($LIST_CATEGORY ? $sc_style['LIST_CATEGORY']['pre'].$LIST_CATEGORY.$sc_style['LIST_CATEGORY']['post'] : "");
$menutext .= preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_RECENT);
}elseif($mode == "new_menu"){
global $sc_style;
$LIST_AUTHOR = ($LIST_AUTHOR ? $sc_style['LIST_AUTHOR']['pre'].$LIST_AUTHOR.$sc_style['LIST_AUTHOR']['post'] : "");
$LIST_CATEGORY = ($LIST_CATEGORY ? $sc_style['LIST_CATEGORY']['pre'].$LIST_CATEGORY.$sc_style['LIST_CATEGORY']['post'] : "");
$LIST_AUTHOR = ($LIST_AUTHOR ? $sc_style['LIST_AUTHOR']['pre'].$LIST_AUTHOR.$sc_style['LIST_AUTHOR']['post'] : "");
$LIST_CATEGORY = ($LIST_CATEGORY ? $sc_style['LIST_CATEGORY']['pre'].$LIST_CATEGORY.$sc_style['LIST_CATEGORY']['post'] : "");
$menutext .= preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_NEW);
}elseif($mode == "recent_page"){
$menutext .= $tp -> parseTemplate($LIST_PAGE_RECENT, FALSE, $list_shortcodes);
}elseif($mode == "new_page"){
$menutext .= $tp -> parseTemplate($LIST_PAGE_NEW, FALSE, $list_shortcodes);
}
@@ -415,13 +415,13 @@ class listclass {
$start = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_RECENT_START);
$end = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_RECENT_END);
}
}elseif($mode == "new_menu"){
if($list_pref[$mode."_showempty"] || $menutext){
$start = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_NEW_START);
$end = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_NEW_END);
}
}elseif($mode == "recent_page"){
if($list_pref[$mode."_showempty"] || $menutext){
$start = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_PAGE_RECENT_START);
@@ -497,7 +497,7 @@ class listclass {
function parse_heading($heading, $mode){
global $list_pref;
if($list_pref[$mode."_char_heading"] && strlen($heading) > $list_pref[$mode."_char_heading"]){
$heading = substr($heading, 0, $list_pref[$mode."_char_heading"]).$list_pref[$mode."_char_postfix"];
}
@@ -506,7 +506,7 @@ class listclass {
function getListDate($datestamp, $mode){
global $list_pref;
$datestamp += TIMEOFFSET;
$todayarray = getdate();
@@ -548,4 +548,4 @@ class listclass {
}
?>
?>