From 97c78343ae899e59226ecbeb88dc4805b5ddc751 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Wed, 26 Dec 2007 04:32:08 +0000 Subject: two file pattern fixes and some more work on the flagged stuff as well as some minor cleanup on the album art links --- bin/print_tags.inc | 2 +- docs/CHANGELOG | 4 +++ lib/class/flag.class.php | 56 +++++++++++++++--------------------------- lib/class/vainfo.class.php | 2 +- templates/show_album.inc.php | 2 +- templates/show_big_art.inc.php | 2 +- templates/show_flagged.inc.php | 18 +++++++------- 7 files changed, 37 insertions(+), 49 deletions(-) diff --git a/bin/print_tags.inc b/bin/print_tags.inc index 63c19303..67c56ebb 100644 --- a/bin/print_tags.inc +++ b/bin/print_tags.inc @@ -33,7 +33,7 @@ else { echo "Reading: $filename\n"; /* Attempt to figure out what catalog it comes from */ -$sql = "SELECT `catalog`.`id` FROM `song` INNER JOIN `catalog` ON `song`.`catalog`=`catalog`.`id` WHERE `song`.`file`='" . Dba::escape($filename) . "'"; +$sql = "SELECT `catalog`.`id` FROM `song` INNER JOIN `catalog` ON `song`.`catalog`=`catalog`.`id` WHERE `song`.`file`='%" . Dba::escape($filename) . "'"; $db_results = Dba::query($sql); $results = Dba::fetch_assoc($db_results); diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 71e58b7c..a7357dc6 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,10 @@ -------------------------------------------------------------------------- v.3.4-Beta2 + - Fixed print_tags.inc file to catalog matching, now fuzzy like it + should be + - Fixed bug where file pattern would be ignored if there were no + tags in file - Replaced " " with "\s" on Pattern Match Logic - Removed extra space on default Last.FM username/password - Fixed LastFM plugin username and password checking to not even try diff --git a/lib/class/flag.class.php b/lib/class/flag.class.php index f27d7fc6..d3f5ba56 100644 --- a/lib/class/flag.class.php +++ b/lib/class/flag.class.php @@ -43,12 +43,10 @@ class Flag { * Constructor * This takes a flagged.id and then pulls in the information for said flag entry */ - public function __construct($flag_id=0) { - - if (!$flag_id) { return false; } + public function __construct($flag_id) { $info = $this->_get_info($flag_id); - + foreach ($info as $key=>$value) { $this->$key = $value; } @@ -61,7 +59,7 @@ class Flag { * _get_info * Private function for getting the information for this object from the database */ - private function _get_info() { + private function _get_info($flag_id) { $id = Dba::escape($flag_id); @@ -209,49 +207,35 @@ class Flag { return true; - } // approve - + } // approve + /** - * format_name - * This function formats and sets the $this->name variable and $this->title + * format + * This function figures out what kind of object we've got and sets up all the + * vars all nice and fuzzy like */ - function format_name() { + public function format() { switch ($this->object_type) { - case 'song': + case 'song': $song = new Song($this->object_id); - $song->format(); - $name = $song->f_title . " - " . $song->f_artist; - $title = $song->title . " - " . $song->get_artist_name(); + $song->format(); + $this->f_name = $song->f_link; break; - default: - - break; - } // end switch on object type - - $this->title = $title; - $this->name = $name; - } // format_name() - - /** - * print_name - * This function formats and prints out a userfriendly name of the flagged - * object - */ - function print_name() { - - $this->format_name(); - echo "title . "\">" . $this->name . ""; - - } // print_name + } // end switch on type + $client = new User($this->user); + $client->format(); + $this->f_user = $client->f_link; + } // format + /** * print_status * This prints out a userfriendly version of the current status for this flagged * object */ - function print_status() { + public function print_status() { if ($this->approved) { echo _('Approved'); } else { echo _('Pending'); } @@ -262,7 +246,7 @@ class Flag { * print_flag * This prints out a userfriendly version of the current flag type */ - function print_flag() { + public function print_flag() { switch ($this->flag) { case 'delete': diff --git a/lib/class/vainfo.class.php b/lib/class/vainfo.class.php index 5a595f2b..e83310e8 100644 --- a/lib/class/vainfo.class.php +++ b/lib/class/vainfo.class.php @@ -181,7 +181,7 @@ class vainfo { * any tags to look at */ if (!is_array($this->_raw['tags'])) { - return false; + return $results; } /* The tags can come in many different shapes and colors diff --git a/templates/show_album.inc.php b/templates/show_album.inc.php index 4bfd05e7..45cb95bc 100644 --- a/templates/show_album.inc.php +++ b/templates/show_album.inc.php @@ -31,7 +31,7 @@ $title = scrub_out($album->name) . ' (' . $album->year . ') -- ' if ($album_name != _('Unknown (Orphaned)')) { $aa_url = $web_path . "/image.php?id=" . $album->id . "&type=popup&sid=" . session_id(); echo ""; - echo "\"Album"; + echo "\"Album"; echo "\n"; } ?> diff --git a/templates/show_big_art.inc.php b/templates/show_big_art.inc.php index e1cbdcaf..4121fff3 100644 --- a/templates/show_big_art.inc.php +++ b/templates/show_big_art.inc.php @@ -31,7 +31,7 @@ $htmllang = str_replace("_","-",Config::get('lang')); "; -echo ""; +echo "\"\""; echo ""; ?> diff --git a/templates/show_flagged.inc.php b/templates/show_flagged.inc.php index 218226a2..82c5d138 100644 --- a/templates/show_flagged.inc.php +++ b/templates/show_flagged.inc.php @@ -39,22 +39,22 @@ $web_path = Config::get('web_path'); - +format(); +?> - print_name(); ?> - f_user_username); ?> + f_name; ?> + f_user; ?> print_flag(); ?> comment); ?> print_status(); ?> approved) { ?> - - - + id,'disable',_('Reject'),'reject_flag_' . $flag->id); ?> - - - + id,'enable',_('Enable'),'enable_flag_' . $flag->id); ?> -- cgit