summaryrefslogtreecommitdiffstats
path: root/lib/class/genre.class.php
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/class/genre.class.php
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/class/genre.class.php')
-rw-r--r--lib/class/genre.class.php27
1 files changed, 25 insertions, 2 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