summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-07-08 07:59:21 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-07-08 07:59:21 +0000
commit3a289531c38e4a7c1b0199b5ade8dae433e77166 (patch)
tree5e79949f91a904be5b7dcb40ed631bab199886dd /lib
parentbb0e979ad50c4b97178b10db00fb346d275de4fc (diff)
downloadampache-3a289531c38e4a7c1b0199b5ade8dae433e77166.tar.gz
ampache-3a289531c38e4a7c1b0199b5ade8dae433e77166.tar.bz2
ampache-3a289531c38e4a7c1b0199b5ade8dae433e77166.zip
fixed some typos that prevented genre stats from being tracked at all
Diffstat (limited to 'lib')
-rw-r--r--lib/class/genre.class.php27
-rw-r--r--lib/class/update.class.php11
-rw-r--r--lib/class/user.class.php2
-rw-r--r--lib/general.lib.php12
4 files changed, 49 insertions, 3 deletions
diff --git a/lib/class/genre.class.php b/lib/class/genre.class.php
index 9d5e4d4e..a0e5b240 100644
--- a/lib/class/genre.class.php
+++ b/lib/class/genre.class.php
@@ -35,10 +35,33 @@ class Genre {
* @package Genre
* @catagory Constructor
*/
- function Genre() {
+ function Genre($genre_id=0) {
+ if ($genre_id > 0) {
+ $this->id = $genre_id;
+ $info = $this->_get_info();
+ $this->name = $info['name'];
+ }
- } // genre
+
+ } // Genre
+
+ /**
+ * Private Get Info
+ * This simply returns the information for this genre
+ * @package Genre
+ * @catagory Class
+ */
+ function _get_info() {
+
+ $sql = "SELECT * FROM " . tbl_name('genre') . " WHERE id='$this->id'";
+ $db_results = mysql_query($sql, dbh());
+
+ $results = mysql_fetch_assoc($db_results);
+
+ return $results;
+
+ } // _get_info()
} //end of genre class
diff --git a/lib/class/update.class.php b/lib/class/update.class.php
index 7f6a76c1..1cb8f10b 100644
--- a/lib/class/update.class.php
+++ b/lib/class/update.class.php
@@ -949,5 +949,16 @@ class Update {
} // update_332001
+ function update_332002() {
+
+// $sql = "CREATE TABLE `ip_history` (`username` VARCHAR(128), `ip` INT(11) UNSIGNED NOT NULL DEFAULT '0', " .
+// "`connections` INT(11) UNSIGNED NOT NULL DEFAULT '1', `date` INT(11) UNSIGNED NOT NULL DEFAULT '0')";
+
+
+
+
+ } // update_332002
+
+
} // end update class
?>
diff --git a/lib/class/user.class.php b/lib/class/user.class.php
index 8f45cfed..c3736c78 100644
--- a/lib/class/user.class.php
+++ b/lib/class/user.class.php
@@ -431,7 +431,7 @@ class User {
$rows = mysql_affected_rows();
if (!$rows) {
$sql = "INSERT INTO object_count (`object_type`,`object_id`,`date`,`count`,`userid`)" .
- "VALUES ('genre','" . $song_info->genre."','$time','1'1,'$user')";
+ " VALUES ('genre','" . $song_info->genre."','$time','1','$user')";
$db_results = mysql_query($sql, $dbh);
}
diff --git a/lib/general.lib.php b/lib/general.lib.php
index e04f4f26..38afb2e8 100644
--- a/lib/general.lib.php
+++ b/lib/general.lib.php
@@ -698,6 +698,18 @@ ECHO;
} // show_info_box
+/**
+ * tbl_name
+ * This function takes a SQL table name and returns it with any prefix
+ * that might be needed to make it work,
+ * @package General
+ * @catagory Database
+ */
+function tbl_name($table) {
+
+ /* For now we just return the table name */
+ return $table;
+} // table
?>