summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/flag.inc132
-rw-r--r--templates/show_flag.inc.php136
-rw-r--r--templates/show_songs.inc26
3 files changed, 144 insertions, 150 deletions
diff --git a/templates/flag.inc b/templates/flag.inc
deleted file mode 100644
index fde096ab..00000000
--- a/templates/flag.inc
+++ /dev/null
@@ -1,132 +0,0 @@
-<?php
-/*
-
- Copyright (c) 2001 - 2005 Ampache.org
- All rights reserved.
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-*/
-
-/*!
- @header
-
- A template file
-
-*/
-$web_path = conf('web_path');
-// let's put a couple of things in this file
-
-if ($type == 'show_flagged_form') {
- $song = new Song($song_id);
- $song->format_song();
- if (!preg_match('/\.mp3$/', $song->file)) {
- echo "<p>Ampache can only edit MP3 file tags currently.<br/>";
- echo "<a href=\"".$_SERVER['HTTP_REFERER']."\">Back</a>";
- return;
- } // end if (!preg_match('/\.mp3$/',$song->file))
-?>
-
- <p style="font-size: 10pt; font-weight: bold;"><?php echo _("Flag song"); ?></p>
- <p><?php echo _("Flag the following song as having one of the problems listed below. Site admins will then take the appropriate action for the flagged files."); ?></p>
-
- <?php if ($flag_text) { ?>
- <p style="color: red;"><?php echo $flag_text ; ?></p>
- <?php } ?>
-
- <form name="flag_song" method="post" action="<?php echo $web_path; ?>/flag.php">
- <table class="tabledata" cellpadding="3" cellspacing="1">
- <tr class="even">
- <td><?php echo _("File"); ?>:</td>
- <td><?php echo $song->file; ?></td>
- </tr>
- <tr class="even">
- <td><?php echo _("Song"); ?>:</td>
- <td><b><?php echo $song->f_title; ?></b> by <?php echo $song->f_artist_full; ?></td>
- </tr>
- <tr class="even">
- <td><?php echo _("Reason to flag"); ?>:</td>
- <td><?php show_flagged_popup($reason); ?></td>
- </tr>
- <tr class="even">
- <td><?php echo _("Comment"); ?>:</td>
- <td><input name="comment" type="text" size="50" value="<?php echo $comment; ?>"></input>
- </td>
- </tr>
- <tr class="odd">
- <td> &nbsp; </td>
- <td>
- <input type="submit" value="<?php echo _("Flag Song"); ?>" />
- <input type="hidden" name="action" value="flag_song" />
- </td>
- </tr>
- </table>
- <input type="hidden" name="song" value="<?php echo $song->id; ?>" />
- </form>
-
-<?php
-} // end if ($type == 'show_flagged_form')
-elseif ($type == 'show_flagged_songs') {
- $flags = get_flagged();
-?>
- <p style="font-size: 10pt; font-weight: bold;">View Flagged Songs</p>
- <p>This is the list of songs that have been flagged by your Ampache users. Use
- this list to determine what songs you need to re-rip or tags you need to update.</p>
- <?php
- if ($flags) { ?>
- <form name="flag_update" action="<?php echo $web_path; ?>/flag.php" method="post">
- <table class="tabledata" cellspacing="0" cellpadding="0" border="1">
- <tr class="table-header">
- <td>&nbsp;</td>
- <td>Song</td>
- <td>Flag</td>
- <td>New Flag:</td>
- <td>Flagged by</td>
- <td>ID3 Update:</td>
- </tr>
- <?php
- foreach ($flags as $flag) {
- $song = new Song($flag->song);
- $song->format_song();
- $alt_title = $song->title;
- $artist = $song->f_artist;
- $alt_artist = $song->f_full_artist;
-
- echo "<tr class=\"even\">".
- "<td><input type=\"checkbox\" id=\"flag_".$flag->id."\" name=\"flag[]\" value=\"".$flag->id."\"></input></td>".
- "<td><a href=\"".$web_path."/song.php?song=$flag->song\" title=\"$alt_title\">$song->f_title</a> by ".
- "<a href=\"".$web_path."/artist.php?action=show&amp;artist=$song->artist_id\" title=\"$alt_artist\">$artist</a></td>".
- "<td>$flag->type</td><td>";
- $onchange = "onchange=\"document.getElementById('flag_".$flag->id."').checked='checked';\"";
- show_flagged_popup($flag->type, 'type', $flag->id."_newflag", $onchange);
- echo "</td><td>".$flag->username."<br />".date('m/d/y',$flag->date)."</td>";
- /*echo "<td><a href=\"catalog.php?action=fixed&flag=$flag->id\">Fixed</a></td></tr>\n";*/
- if ($flag->type === 'newid3') {
- echo "<td><input type=\"radio\" name=\"accept_".$flag->id."\" value=\"accept\" />Accept";
- echo "<input type=\"radio\" name=\"accept_".$flag->id."\" value=\"reject\" />Reject</td></tr>";
- } else {
- echo "<td><a href=\"".$web_path."/admin/song.php?action=edit&amp;song=".$flag->song."\">edit/view</a></td>";
- echo "</tr>\n";
- } // end if ($flag->type === 'newid3') and else
- } // end foreach ($flags as $flag)
- ?>
- <tr class="even"><td colspan="6"><input type="submit" name="action" value="Update Flags"></input></td></tr>
- </table>
- </form>
-<?php } else { ?>
- <p> You don't have any flagged songs. </p>
-<?php } // end if ($flags) and else
-} // end elseif ($type == 'show_flagged_songs')
-?>
diff --git a/templates/show_flag.inc.php b/templates/show_flag.inc.php
new file mode 100644
index 00000000..571d822d
--- /dev/null
+++ b/templates/show_flag.inc.php
@@ -0,0 +1,136 @@
+<?php
+/*
+
+ Copyright (c) 2001 - 2006 Ampache.org
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+$web_path = conf('web_path');
+$type = scrub_in($_REQUEST['type']);
+
+switch ($type) {
+ case 'song':
+ $song = new Song($_REQUEST['id']);
+ $song->format_song();
+ $title = scrub_out($song->f_title . " by " . $song->f_artist_full);
+ $file = scrub_out($song->file);
+ break;
+ case 'album':
+ break;
+ case 'artist':
+ break;
+ default:
+ break;
+} // end type switch
+?>
+
+<p class="header1"><?php echo _('Flag song'); ?></p>
+<p><?php echo _('Flag the following song as having one of the problems listed below. Site admins will then take the appropriate action for the flagged files.'); ?></p>
+
+<form name="flag" method="post" action="<?php echo $web_path; ?>/flag.php" enctype="multipart/form-data">
+<table class="text-box">
+<tr class="<?php echo flip_class(); ?>">
+ <td><?php echo _('File'); ?>:</td>
+ <td><?php echo $file; ?></td>
+</tr>
+<tr class="<?php echo flip_class(); ?>">
+ <td><?php echo _('Item'); ?>:</td>
+ <td><strong><?php echo $title; ?></strong></td>
+</tr>
+<tr class="<?php echo flip_class(); ?>">
+ <td><?php echo _('Reason to flag'); ?>:</td>
+ <td>
+ <select name="flag_type">
+ <option value="delete"><?php echo _('Delete'); ?></option>
+ <option value="retag"><?php echo _('Incorrect Tags'); ?></option>
+ <option value="reencode"><?php echo _('Re-encode'); ?></option>
+ <option value="other"><?php echo _('Other'); ?></option>
+ </select>
+ </td>
+</tr>
+<tr class="<?php echo flip_class(); ?>">
+ <td><?php echo _('Comment'); ?>:</td>
+ <td><input name="comment" type="text" size="50" maxlength="128" value="" /></td>
+</tr>
+<tr class="<?php echo flip_class(); ?>">
+ <td> &nbsp; </td>
+ <td>
+ <input type="submit" value="<?php echo _('Flag'); ?>" />
+ <input type="hidden" name="id" value="<?php echo scrub_out($_REQUEST['id']); ?>" />
+ <input type="hidden" name="action" value="flag" />
+ <input type="hidden" name="type" value="<?php echo scrub_out($type); ?>" />
+ </td>
+</tr>
+</table>
+</form>
+<?php
+// NOT USED YET!
+if ($type == 'pigsfly') {
+//elseif ($type == 'show_flagged_songs') {
+ $flags = get_flagged();
+
+?>
+<p style="font-size: 10pt; font-weight: bold;">View Flagged Songs</p>
+<p>This is the list of songs that have been flagged by your Ampache users. Use
+this list to determine what songs you need to re-rip or tags you need to update.</p>
+<?php
+if ($flags) { ?>
+ <form name="flag_update" action="<?php echo $web_path; ?>/flag.php" method="post">
+ <table class="tabledata" cellspacing="0" cellpadding="0" border="1">
+ <tr class="table-header">
+ <td>&nbsp;</td>
+ <td>Song</td>
+ <td>Flag</td>
+ <td>New Flag:</td>
+ <td>Flagged by</td>
+ <td>ID3 Update:</td>
+ </tr>
+ <?php
+ foreach ($flags as $flag) {
+ $song = new Song($flag->song);
+ $song->format_song();
+ $alt_title = $song->title;
+ $artist = $song->f_artist;
+ $alt_artist = $song->f_full_artist;
+
+ echo "<tr class=\"even\">".
+ "<td><input type=\"checkbox\" id=\"flag_".$flag->id."\" name=\"flag[]\" value=\"".$flag->id."\"></input></td>".
+ "<td><a href=\"".$web_path."/song.php?song=$flag->song\" title=\"$alt_title\">$song->f_title</a> by ".
+ "<a href=\"".$web_path."/artist.php?action=show&amp;artist=$song->artist_id\" title=\"$alt_artist\">$artist</a></td>".
+ "<td>$flag->type</td><td>";
+ $onchange = "onchange=\"document.getElementById('flag_".$flag->id."').checked='checked';\"";
+ show_flagged_popup($flag->type, 'type', $flag->id."_newflag", $onchange);
+ echo "</td><td>".$flag->username."<br />".date('m/d/y',$flag->date)."</td>";
+ /*echo "<td><a href=\"catalog.php?action=fixed&flag=$flag->id\">Fixed</a></td></tr>\n";*/
+ if ($flag->type === 'newid3') {
+ echo "<td><input type=\"radio\" name=\"accept_".$flag->id."\" value=\"accept\" />Accept";
+ echo "<input type=\"radio\" name=\"accept_".$flag->id."\" value=\"reject\" />Reject</td></tr>";
+ } else {
+ echo "<td><a href=\"".$web_path."/admin/song.php?action=edit&amp;song=".$flag->song."\">edit/view</a></td>";
+ echo "</tr>\n";
+ } // end if ($flag->type === 'newid3') and else
+ } // end foreach ($flags as $flag)
+ ?>
+ <tr class="even"><td colspan="6"><input type="submit" name="action" value="Update Flags"></input></td></tr>
+ </table>
+ </form>
+?php } else { ?>
+<p> You don't have any flagged songs. </p>
+<?php } // end if ($flags) and else
+} // end elseif ($type == 'show_flagged_songs')
+?>
diff --git a/templates/show_songs.inc b/templates/show_songs.inc
index e8078231..df1bfeba 100644
--- a/templates/show_songs.inc
+++ b/templates/show_songs.inc
@@ -21,9 +21,6 @@
*/
$web_path = conf('web_path');
-// Need to set the username for the song ratings.
-$username = $GLOBALS['user']->username;
-
/* If it's a playlist and they've got rights */
if (is_object($playlist) && ($GLOBALS['user']->username == $playlist->user || $GLOBALS['user']->has_access('100'))) {
$tab = 1;
@@ -46,7 +43,6 @@ if (is_object($playlist) && ($GLOBALS['user']->username == $playlist->user || $G
<th><?php echo _("Size"); ?></th>
<th><?php echo _("Bitrate"); ?></th>
<th><?php echo _("Genre"); ?></th>
- <th><?php echo _("Flag"); ?></th>
<th><?php echo _("Action"); ?></th>
<?php if (conf('ratings') || conf('ratings')=="false") { ?>
<th><?php echo _("Rating"); ?></th>
@@ -97,6 +93,7 @@ foreach ($song_ids as $song_id) {
<?php $tab++;
} ?>
<td>
+ <?php if ($song->has_flag()) { echo "<strong>**</strong>"; } ?>
<a href="<?php echo $web_path; ?>/song.php?action=m3u&amp;song=<?php echo $song->id; ?>" title="<?php echo scrub_out($song->title); ?>" <?php echo $text_class; ?>><?php echo scrub_out($song->f_title); ?></a>
</td>
<td>
@@ -120,25 +117,21 @@ foreach ($song_ids as $song_id) {
<td>
<?php echo $song->f_genre; ?>
</td>
- <td <?php echo $song->f_style; ?> title="<?php echo $song->flagcomment; ?>">
- <?php echo $song->flagtype; ?>
- </td>
<td>
- <?php if ($user->has_access('100')) { ?>
- <a href="<?php echo $web_path; ?>/admin/song.php?action=edit&amp;song=<?php echo $song->id; ?>">Edit</a> | <a href="<?php echo $web_path; ?>/flag.php?song=<?php echo $song->id; ?>&amp;action=flag">Flag</a> |
+ <a href="<?php echo $web_path; ?>/flag.php?action=show_flag&amp;type=song&amp;id=<?php echo $song->id; ?>">Flag</a>
+ <?php if ($GLOBALS['user']->has_access('100')) { ?>
+ | <a href="<?php echo $web_path; ?>/admin/song.php?action=edit&amp;song=<?php echo $song->id; ?>">Edit</a> |
<?php if ($song->enabled) { ?>
<a href="<?php echo $web_path; ?>/admin/song.php?action=disable&amp;song_ids=<?php echo $song->id; ?>">Disable</a>
<?php } else { ?>
<a href="<?php echo $web_path; ?>/admin/song.php?action=enabled&amp;song_ids=<?php echo $song->id; ?>">Enable</a>
<?php } //status ?>
- <?php } else { ?>
- <a href="<?php echo $web_path; ?>/flag.php?song=<?php echo $song->id; ?>&amp;action=flag">Flag</a>
<?php } //access ?>
- <?php if ($user->prefs['download']) { ?>
+ <?php if ($GLOBALS['user']->prefs['download']) { ?>
| <a href="<?php echo $web_path; ?>/download/index.php?action=download&amp;song_id=<?php echo $song->id; ?>&amp;fn=<?php echo rawurlencode($song->f_artist_full . " - " . $song->title . "." . $song->type); ?>"><?php echo _("Download"); ?></a>
<?php } ?>
- <?php if ($user->prefs['direct_link']) { ?>
- | <a href="<?php echo $web_path; ?>/play/index.php?song=<?php echo $song->id; ?>&amp;uid=<?php echo $user->username . "&amp;sid=" . session_id(); ?>&amp;fn=<?php echo rawurlencode($song->f_artist_full . " - " . $song->title . "." . $song->type); ?>"><?php echo _("Direct Link"); ?></a>
+ <?php if ($GLOBALS['user']->prefs['direct_link']) { ?>
+ | <a href="<?php echo $web_path; ?>/play/index.php?song=<?php echo $song->id; ?>&amp;uid=<?php echo $GLOBALS['user']->username . "&amp;sid=" . session_id(); ?>&amp;fn=<?php echo rawurlencode($song->f_artist_full . " - " . $song->title . "." . $song->type); ?>"><?php echo _("Direct Link"); ?></a>
<?php } ?>
</td>
<?php if(conf('ratings')) { ?>
@@ -150,9 +143,6 @@ foreach ($song_ids as $song_id) {
<?php
}// foreach loop
-//
-// Another here doc
-//
$time = floor($totaltime/60) . ":" . sprintf("%02d", ($totaltime%60) );
$megs = sprintf("%.2f", ($totalsize/1048576));
$num = count($song_ids);
@@ -168,10 +158,10 @@ $num = count($song_ids);
<td align="right" nowrap="nowrap"><?php echo $megs; ?> MB</td>
<td></td>
<td></td>
- <td></td>
<td colspan="2"></td>
</tr>
</table>
+<p class="header2"><?php echo _('** Indicates flagged songs'); ?></p>
<br />
<?php show_play_selected(); ?>
</form>