summaryrefslogtreecommitdiffstats
path: root/lib/class/song.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-12-18 09:16:20 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-12-18 09:16:20 +0000
commitce284d7a8329ab68ae6c12cc6f68f1d34d90d863 (patch)
tree8d5bdbc640009c5582d8d3feae02787a78f138aa /lib/class/song.class.php
parentc6feba1f33ce8352606cf07715037976abecb9df (diff)
downloadampache-ce284d7a8329ab68ae6c12cc6f68f1d34d90d863.tar.gz
ampache-ce284d7a8329ab68ae6c12cc6f68f1d34d90d863.tar.bz2
ampache-ce284d7a8329ab68ae6c12cc6f68f1d34d90d863.zip
last commit pre beta1 release
Diffstat (limited to 'lib/class/song.class.php')
-rw-r--r--lib/class/song.class.php41
1 files changed, 36 insertions, 5 deletions
diff --git a/lib/class/song.class.php b/lib/class/song.class.php
index a5f2b95e..59af5f80 100644
--- a/lib/class/song.class.php
+++ b/lib/class/song.class.php
@@ -33,7 +33,6 @@ class Song {
var $artist; // artist.id (Int)
var $title;
var $year;
- var $comment;
var $bitrate;
var $rate;
var $mode;
@@ -123,10 +122,30 @@ class Song {
*/
function _get_ext_info() {
+ $sql = "SELECT comment,lyrics FROM song_ext_data WHERE song_id='" . sql_escape($this->id) . "'";
+ $db_results = mysql_query($sql,dbh());
+ $results = mysql_fetch_assoc($db_results);
+
+ return $results;
} // _get_ext_info
+ /**
+ * fill_ext_info
+ * This calls the _get_ext_info and then sets the correct vars
+ */
+ function fill_ext_info() {
+
+ $info = $this->_get_ext_info();
+
+ $this->comment = $info['comment'];
+ $this->lyrics = $info['lyrics'];
+
+ return true;
+
+ } // fill_ext_info
+
/*!
@function format_type
@discussion gets the type of song we are trying to
@@ -372,10 +391,10 @@ class Song {
$array['change'] = true;
$array['text'] .= "<br />" . _("Year") . " [$song->year] " . _("updated to") . " [$new_song->year]\n";
} // if year
- //if (trim(stripslashes($song->comment)) != trim(stripslashes($new_song->comment))) {
- // $array['change'] = true;
- // $array['text'] .= "<br />" . _("Comment") . " [$song->comment] " . _("updated to") . " [$new_song->comment]\n";
- //} // if comment
+ if (trim(stripslashes($song->comment)) != trim(stripslashes($new_song->comment))) {
+ $array['change'] = true;
+ $array['text'] .= "<br />" . _("Comment") . " [$song->comment] " . _("updated to") . " [$new_song->comment]\n";
+ } // if comment
if ($song->genre != $new_song->genre) {
$array['change'] = true;
$name = $song->get_genre_name();
@@ -611,6 +630,18 @@ class Song {
*/
function _update_ext_item($field,$value,$song_id,$level) {
+ /* Check them rights boy! */
+ if (!$GLOBALS['user']->has_access($level)) { return false; }
+
+ if (!$song_id) { $song_id = $this->id; }
+
+ $value = sql_escape($value);
+
+ $sql = "UPDATE song SET `$field`='$value' WHERE song_id='$song_id'";
+ $db_results = mysql_query($sql,dbh());
+
+ $this->{$field} = $value;
+
return true;
} // _update_ext_item