From 53412dacd4cb52f0c1162af7ba66aa01f71147b3 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 27 Feb 2012 23:27:16 -0800 Subject: update globaldir when page-type changes, add spam date field --- library/spam/b8/storage/storage_frndc.php | 54 ++----------------------------- 1 file changed, 2 insertions(+), 52 deletions(-) (limited to 'library/spam/b8/storage/storage_frndc.php') diff --git a/library/spam/b8/storage/storage_frndc.php b/library/spam/b8/storage/storage_frndc.php index cbc6fe81a..7702c108b 100644 --- a/library/spam/b8/storage/storage_frndc.php +++ b/library/spam/b8/storage/storage_frndc.php @@ -147,58 +147,8 @@ class b8_storage_frndc extends b8_storage_base public function connect() { - return TRUE; - - # Are we already connected? - if($this->connected === TRUE) - return TRUE; - - # Are we using an existing passed resource? - if($this->config['connection'] === FALSE) { - # ... yes we are, but the connection is not a resource, so return an error - $this->connected = FALSE; - return self::DATABASE_CONNECTION_BAD_RESOURCE; - } - - elseif($this->config['connection'] === NULL) { - - # ... no we aren't so we have to connect. - - if($this->_connection = mysql_connect($this->config['host'], $this->config['user'], $this->config['pass'])) { - if(mysql_select_db($this->config['database'], $this->_connection) === FALSE) { - $this->connected = FALSE; - return self::DATABASE_SELECT_ERROR . ": " . mysql_error(); - } - } - else { - $this->connected = FALSE; - return self::DATABASE_CONNECTION_ERROR; - } - - } - - else { - # ... yes we are - $this->_connection = $this->config['connection']; - } - - # Just in case ... - if($this->_connection === NULL) { - $this->connected = FALSE; - return self::DATABASE_CONNECTION_FAIL; - } - - # Check to see if the wordlist table exists - if(mysql_query('DESCRIBE ' . $this->config['table_name'], $this->_connection) === FALSE) { - $this->connected = FALSE; - return self::DATABASE_TABLE_ACCESS_FAIL . ": " . mysql_error(); - } - - # Everything is okay and connected $this->connected = TRUE; - - # Let's see if this is a b8 database and the version is okay - return $this->check_database(); + return TRUE; } @@ -235,7 +185,7 @@ class b8_storage_frndc extends b8_storage_base # ... and fetch the data $result = q(' - SELECT token, count + SELECT * FROM ' . $this->config['table_name'] . ' WHERE ' . $where . ' AND uid = ' . $uid ); -- cgit v1.2.3