1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-26 01:11:28 +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_admin/plugin.php,v $
| $Revision: 1.2 $
| $Date: 2006-12-07 15:41:50 $
| $Author: sweetas $
| $Revision: 1.3 $
| $Date: 2006-12-31 14:46:30 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -195,7 +195,7 @@ if ($action == 'uninstall')
}
if (is_array($eplug_user_prefs)) {
$sql = new db;
if (!is_object($sql)){ $sql = new db; }
$sql->db_Select("core", " e107_value", " e107_name='user_entended'");
$row = $sql->db_Fetch();
$user_entended = unserialize($row[0]);
@@ -318,7 +318,7 @@ if ($action == 'upgrade') {
}
if (is_array($upgrade_add_user_prefs)) {
$sql = new db;
if (!is_object($sql)){ $sql = new db; }
$sql->db_Select("core", " e107_value", " e107_name='user_entended'");
$row = $sql->db_Fetch();
$user_entended = unserialize($row[0]);
@@ -335,7 +335,7 @@ if ($action == 'upgrade') {
}
if (is_array($upgrade_remove_user_prefs)) {
$sql = new db;
if (!is_object($sql)){ $sql = new db; }
$sql->db_Select("core", " e107_value", " e107_name='user_entended'");
$row = $sql->db_Fetch();
$user_entended = unserialize($row[0]);

View File

@@ -12,9 +12,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/login.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:45 $
| $Author: mcfly_e107 $
| $Revision: 1.2 $
| $Date: 2006-12-31 14:46:30 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -37,7 +37,10 @@ class userlogin {
# - scope public
*/
global $pref, $e_event, $sql, $e107, $tp;
if(!is_object($sql)){
$sql = new db;
}
$fip = $e107->getip();
if($sql -> db_Select("banlist", "*", "banlist_ip='{$fip}' ")) {

View File

@@ -12,9 +12,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/content/admin_content_config.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:52 $
| $Author: mcfly_e107 $
| $Revision: 1.2 $
| $Date: 2006-12-31 14:46:30 $
| $Author: e107coders $
+---------------------------------------------------------------+
*/
@@ -494,7 +494,7 @@ function admin_content_config_adminmenu(){
$var['general']['text'] = CONTENT_ADMIN_MENU_LAN_10;
$var['menu']['text'] = CONTENT_ADMIN_MENU_LAN_14;
$sql = new db;
if (!is_object($sql)){ $sql = new db; }
$category_total = $sql -> db_Select($plugintable, "content_heading", "content_id='".$qs[1]."' ");
list($content_heading) = $sql -> db_Fetch();
@@ -514,7 +514,7 @@ function admin_content_config_adminmenu(){
}else{
if($showadmincat){
$sql2 = new db;
if (!is_object($sql2)){ $sql2 = new db; }
if($category_total = $sql2 -> db_Select($plugintable, "content_id, content_heading", "content_parent='0' ")){
while($row = $sql2 -> db_Fetch()){

View File

@@ -12,9 +12,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/content/content.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:54 $
| $Author: mcfly_e107 $
| $Revision: 1.2 $
| $Date: 2006-12-31 14:46:30 $
| $Author: e107coders $
+---------------------------------------------------------------+
*/
@@ -1178,7 +1178,7 @@ function show_content_item(){
}else{
$contentrefernew = ($refertmp[0]+1)."^".$refertmp[1];
}
$sql = new db;
if (!is_object($sql)){ $sql = new db; }
$sql -> db_Update($plugintable, "content_refer='".$contentrefernew."' WHERE content_id='".intval($qs[1])."' ");
$e107cache->clear("$plugintable.content.$qs[1]");

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/content/content_update.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:56 $
| $Author: mcfly_e107 $
| $Revision: 1.2 $
| $Date: 2006-12-31 14:46:30 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
@@ -90,7 +90,7 @@ if($newcontent == 0){
//article: $content_type == "0" || $content_type == "15"
// ##### STAGE 1 : ANALYSE OLD CONTENT --------------------------------------------------------
$sql = new db;
if (!is_object($sql)){ $sql = new db; }
$totaloldcontentrows = $sql -> db_Count("content");
$totaloldrowscat_article = $sql -> db_Count("content", "(*)", "WHERE content_parent = '0' AND content_type = '6'");
$totaloldrowscat_review = $sql -> db_Count("content", "(*)", "WHERE content_parent = '0' AND content_type = '10'");

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/links_page/links.php,v $
| $Revision: 1.2 $
| $Date: 2006-12-29 12:58:37 $
| $Author: e107steved $
| $Revision: 1.3 $
| $Date: 2006-12-31 14:46:30 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
require_once('../../class2.php');
@@ -283,7 +283,7 @@ function displayPersonalManager(){
if (isset($delete) && $delete == 'main') {
$sql->db_Select("links_page", "link_order", "link_id='".intval($del_id)."'");
$row = $sql->db_Fetch();
$sql2 = new db;
if (!is_object($sql2)){ $sql2 = new db; }
$sql->db_Select("links_page", "link_id", "link_order>'".$row['link_order']."' && link_category='".intval($id)."'");
while ($row = $sql->db_Fetch()) {
$sql2->db_Update("links_page", "link_order=link_order-1 WHERE link_id='".$row['link_id']."'");

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();