diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/class/browse.class.php | 4 | ||||
-rw-r--r-- | lib/class/shoutbox.class.php | 46 | ||||
-rw-r--r-- | lib/class/user.class.php | 4 | ||||
-rw-r--r-- | lib/rss.php | 2 | ||||
-rw-r--r-- | lib/stream.lib.php | 4 |
5 files changed, 55 insertions, 5 deletions
diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php index 2b04db39..bf72bbe9 100644 --- a/lib/class/browse.class.php +++ b/lib/class/browse.class.php @@ -219,7 +219,7 @@ class Browse { $valid_array = array('name','user'); break; case 'shoutbox': - $valud_array = array('date','user','sticky'); + $valid_array = array('date','user','sticky'); break; case 'live_stream': $valid_array = array('name','call_sign','frequency'); @@ -393,7 +393,7 @@ class Browse { $sql = "SELECT `flagged`.`id` FROM `flagged` "; break; case 'shoutbox': - $sql - "SELECT `user_shout`.`id` FROM `user_shout` "; + $sql = "SELECT `user_shout`.`id` FROM `user_shout` "; break; case 'playlist_song': case 'song': diff --git a/lib/class/shoutbox.class.php b/lib/class/shoutbox.class.php index 98d14548..9e4eafd6 100644 --- a/lib/class/shoutbox.class.php +++ b/lib/class/shoutbox.class.php @@ -173,5 +173,51 @@ class shoutBox { } // create + /** + * update + * This takes a key'd array of data as input and updates a shoutbox entry + */ + public static function update($data) { + + $id = Dba::escape($data['shout_id']); + $text = Dba::escape(strip_tags($data['comment'])); + $sticky = make_bool($data['sticky']); + + $sql = "UPDATE `user_shout` SET `text`='$text', `sticky`='$sticky' WHERE `id`='$id'"; + $db_results = Dba::query($sql); + + return true; + + } // create + + /** + * format + * this function takes the object and reformats some values + */ + + public function format() { + + if ( $this->sticky == "0" ) { $this->sticky = "No"; } else { $this->sticky = "Yes"; } + + $this->date = date("m\/d\/Y - H:i",$this->date); + + return true; + + } //format + + /** + * delete + * this function deletes a specific shoutbox entry + */ + + public function delete($shout_id) { + + // Delete the shoutbox post + + $sql = "DELETE FROM `user_shout` WHERE `id`='$shout_id'"; + $db_results = Dba::query($sql); + + } // delete + } // shoutBox class ?> diff --git a/lib/class/user.class.php b/lib/class/user.class.php index 9f4e6715..d548f1f3 100644 --- a/lib/class/user.class.php +++ b/lib/class/user.class.php @@ -883,6 +883,10 @@ class User { $sql = "DELETE FROM `user_vote` WHERE `user`='$this->id'"; $db_results = Dba::query($sql); + // Delete their shoutbox posts + $sql = "DELETE FROM `user_shout` WHERE `user='$this->id'"; + $db_results = Dba::query($sql); + // Delete the user itself $sql = "DELETE FROM `user` WHERE `id`='$this->id'"; $db_results = Dba::query($sql); diff --git a/lib/rss.php b/lib/rss.php index 7f583380..99c7ebaf 100644 --- a/lib/rss.php +++ b/lib/rss.php @@ -201,7 +201,7 @@ switch ($type) { $song = new Song($item['object_id']); $song->format(); $user = new User($item['user']); - $user->format_user(); + $user->format(); echo " <title><![CDATA[$song->title]]></title>\n"; echo " <link>$web_path/stream.php?action=single_song&song_id=".$item['object_id']."</link>\n"; echo " <description><![CDATA[$user->fullname played $song->title - $song->f_artist $time_string]]></description>\n"; diff --git a/lib/stream.lib.php b/lib/stream.lib.php index 588f9251..89ba2b87 100644 --- a/lib/stream.lib.php +++ b/lib/stream.lib.php @@ -26,8 +26,8 @@ function show_now_playing() { // GC! - Stream::gc_session(); - Stream::gc_now_playing(); +// Stream::gc_session(); +// Stream::gc_now_playing(); $web_path = Config::get('web_path'); $results = get_now_playing(); |