summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-12-26 04:32:08 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-12-26 04:32:08 +0000
commit97c78343ae899e59226ecbeb88dc4805b5ddc751 (patch)
tree500c4e90ddfe0c245cb7b30050d59fa1de6488e8
parent00417ad9658bd68f347f45e1ef8c5327fed95648 (diff)
downloadampache-97c78343ae899e59226ecbeb88dc4805b5ddc751.tar.gz
ampache-97c78343ae899e59226ecbeb88dc4805b5ddc751.tar.bz2
ampache-97c78343ae899e59226ecbeb88dc4805b5ddc751.zip
two file pattern fixes and some more work on the flagged stuff as well as some minor cleanup on the album art links
-rw-r--r--bin/print_tags.inc2
-rwxr-xr-xdocs/CHANGELOG4
-rw-r--r--lib/class/flag.class.php56
-rw-r--r--lib/class/vainfo.class.php2
-rw-r--r--templates/show_album.inc.php2
-rw-r--r--templates/show_big_art.inc.php2
-rw-r--r--templates/show_flagged.inc.php18
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 "<span title=\"" . $this->title . "\">" . $this->name . "</span>";
-
- } // 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) . '&nbsp;(' . $album->year . ')&nbsp;--&nbsp;'
if ($album_name != _('Unknown (Orphaned)')) {
$aa_url = $web_path . "/image.php?id=" . $album->id . "&amp;type=popup&amp;sid=" . session_id();
echo "<a target=\"_blank\" href=\"$aa_url\" onclick=\"popup_art('$aa_url'); return false;\">";
- echo "<img src=\"" . $web_path . "/image.php?id=" . $album->id . "&amp;thumb=2&amp;sid=" . session_id() . "\" alt=\"Album Art\" height=\"128\" />";
+ echo "<img src=\"" . $web_path . "/image.php?id=" . $album->id . "&amp;thumb=2\" alt=\"Album Art\" height=\"128\" width=\"128\" />";
echo "</a>\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'));
<body onLoad="self.resizeTo(document.images[0].width+30, document.images[0].height+70)">
<?php
echo "<a href=\"javascript:window.close()\" title=\"" . _('Click to close window') . "\">";
-echo "<img src=\"" . Config::get('web_path') . "/image.php?id=" . scrub_out($_GET['id']) . "&amp;sid=" . session_id() . "\" />";
+echo "<img src=\"" . Config::get('web_path') . "/image.php?id=" . scrub_out($_GET['id']) . "&amp;sid=" . session_id() . "\" border=\"0\" alt=\"\" />";
echo "</a>";
?>
</body>
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');
<th class="cel_status"><?php echo _('Status'); ?></th>
<th class="cel_action"><?php echo _('Action'); ?></th>
</tr>
-<?php foreach ($object_ids as $flag_id) { $flag = new Flag($flag_id); ?>
+<?php
+foreach ($object_ids as $flag_id) {
+ $flag = new Flag($flag_id);
+ $flag->format();
+?>
<tr class="<?php echo flip_class(); ?>">
- <td class="cel_object"><a href="<?php echo Config::get('web_path'); ?>/admin/flag.php?action=show_edit_song&song=<?php echo $flag->object_id; ?>"><?php $flag->print_name(); ?></a></td>
- <td class="cel_username"><?php echo scrub_out($flag->f_user_username); ?></td>
+ <td class="cel_object"><?php echo $flag->f_name; ?></td>
+ <td class="cel_username"><?php echo $flag->f_user; ?></td>
<td class="cel_flag"><?php $flag->print_flag(); ?></td>
<td class="cel_comment"><?php echo scrub_out($flag->comment); ?></td>
<td class="cel_status"><?php $flag->print_status(); ?></td>
<td class="cel_action">
<?php if ($flag->approved) { ?>
- <a href="<?php echo $web_path; ?>/admin/flag.php?action=reject_flag&amp;flag_id=<?php echo $flag->id; ?>">
- <?php echo get_user_icon('disable'); ?>
- </a>
+ <?php echo Ajax::button('?page=flag&action=reject&flag_id=' . $flag->id,'disable',_('Reject'),'reject_flag_' . $flag->id); ?>
<?php } else { ?>
- <a href="<?php echo $web_path; ?>/admin/flag.php?action=approve_flag&amp;flag_id=<?php echo $flag->id; ?>">
- <?php echo get_user_icon('enable'); ?>
- </a>
+ <?php echo Ajax::button('?page=flag&action=accept&flag_id=' . $flag->id,'enable',_('Enable'),'enable_flag_' . $flag->id); ?>
<?php } ?>
</td>
</tr>