1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-05 10:49:37 +02:00

Commit, still no internet paying for it.. curse you free.fr

This commit is contained in:
Karl 'vollmerk' Vollmer 2008-10-27 09:24:34 +00:00
parent 14019e88c5
commit f593f18131
77 changed files with 1261 additions and 1340 deletions

View file

@ -33,7 +33,7 @@ switch($_REQUEST['action']) {
$object_ids = $artist->get_albums(); $object_ids = $artist->get_albums();
$object_type = 'album'; $object_type = 'album';
require_once Config::get('prefix') . '/templates/show_artist.inc.php'; require_once Config::get('prefix') . '/templates/show_artist.inc.php';
break; break;
case 'show_all_songs': case 'show_all_songs':
$artist = new Artist($_REQUEST['artist']); $artist = new Artist($_REQUEST['artist']);
$artist->format(); $artist->format();

View file

@ -33,7 +33,6 @@ require_once 'lib/init.php';
// This page is a little wonky we don't want the sidebar until we know what type we're dealing with // This page is a little wonky we don't want the sidebar until we know what type we're dealing with
// so we've got a little switch here that creates the type.. this feels hackish... // so we've got a little switch here that creates the type.. this feels hackish...
switch ($_REQUEST['action']) { switch ($_REQUEST['action']) {
case 'tag': case 'tag':
case 'file': case 'file':
@ -56,25 +55,21 @@ switch($_REQUEST['action']) {
case 'album': case 'album':
Browse::set_sort('name','ASC'); Browse::set_sort('name','ASC');
$album_ids = Browse::get_objects(); $album_ids = Browse::get_objects();
Album::build_cache($album_ids,'extra');
Browse::show_objects(); Browse::show_objects();
break; break;
case 'tag': case 'tag':
Browse::set_sort('count','ASC'); Browse::set_sort('count','ASC');
$tags = Browse::get_objects(); $tags = Browse::get_objects();
Tag::build_cache($tags);
Browse::show_objects(); Browse::show_objects();
break; break;
case 'artist': case 'artist':
Browse::set_sort('name','ASC'); Browse::set_sort('name','ASC');
$artist_ids = Browse::get_objects(); $artist_ids = Browse::get_objects();
Artist::build_cache($artist_ids,'extra');
Browse::show_objects(); Browse::show_objects();
break; break;
case 'song': case 'song':
Browse::set_sort('title','ASC'); Browse::set_sort('title','ASC');
$song_ids = Browse::get_objects(); $song_ids = Browse::get_objects();
Song::build_cache($song_ids);
Browse::show_objects(); Browse::show_objects();
break; break;
case 'live_stream': case 'live_stream':
@ -89,7 +84,6 @@ switch($_REQUEST['action']) {
Browse::set_sort('type','ASC'); Browse::set_sort('type','ASC');
Browse::set_filter('playlist_type','1'); Browse::set_filter('playlist_type','1');
$playlist_ids = Browse::get_objects(); $playlist_ids = Browse::get_objects();
Playlist::build_cache($playlist_ids);
Browse::show_objects(); Browse::show_objects();
break; break;
default: default:

View file

@ -191,8 +191,8 @@ require_session = "true"
; POSSIBLE VALUES: id3v1 id3v2 file vorbiscomment ; POSSIBLE VALUES: id3v1 id3v2 file vorbiscomment
; quicktime ape asf ; quicktime ape asf
; DEFAULT: id3v2,id3v1 vorbiscomment quicktime ape ; DEFAULT: id3v2,id3v1 vorbiscomment quicktime ape
; asf ; asf file
tag_order = "id3v2,id3v1,vorbiscomment,quicktime,ape,asf" tag_order = "id3v2,id3v1,vorbiscomment,quicktime,ape,asf,file"
; Un comment if don't want ampache to follow symlinks ; Un comment if don't want ampache to follow symlinks
; DEFAULT: false ; DEFAULT: false
@ -230,8 +230,8 @@ ratings = "true"
; This defines the "Min" memory limit for PHP if your php.ini ; This defines the "Min" memory limit for PHP if your php.ini
; has a lower value set Ampache will set it up to this. If you ; has a lower value set Ampache will set it up to this. If you
; set it below 16MB getid3() will not work! ; set it below 16MB getid3() will not work!
; DEFAULT: 24 ; DEFAULT: 32
;memory_limit = 24 ;memory_limit = 32
; Album Art Preferred Filename ; Album Art Preferred Filename
; Specify a filename to look for if you always give the same filename ; Specify a filename to look for if you always give the same filename
@ -254,8 +254,8 @@ ratings = "true"
; ampache to search if you want to disable one of the search ; ampache to search if you want to disable one of the search
; method simply comment it out valid values are ; method simply comment it out valid values are
; POSSIBLE VALUES: db id3 folder amazon lastfm ; POSSIBLE VALUES: db id3 folder amazon lastfm
; DEFAULT: db,id3,folder,lastfm,amazon ; DEFAULT: db,id3,folder,lastfm
album_art_order = "db,id3,folder,lastfm,amazon" album_art_order = "db,id3,folder,lastfm"
; Album Art ; Album Art
; Set this to true if you want album art displayed on pages besides the ; Set this to true if you want album art displayed on pages besides the
@ -464,25 +464,15 @@ refresh_limit = "60"
; DEFAULT: 48 ; DEFAULT: 48
;min_bit_rate = 48 ;min_bit_rate = 48
;######################################################
; These options control how searching works #
;######################################################
; choices are: artist,album,song_title,song_genre,song_year,song_bitrate,song_min_bitrate,song_filename
; DEFAULT: song_title
search_field = song_title
; choices are: exact,fuzzy
; DEFAULT: fuzzy
search_type = fuzzy
;###################################################### ;######################################################
; These are commands used to transcode non-streaming ; These are commands used to transcode non-streaming
; formats to the target file type for streaming. ; formats to the target file type for streaming.
; This can be useful in re-encoding file types that don't stream ; This can be useful in re-encoding file types that don't stream
; very well, or if your player doesn't support some file types. ; very well, or if your player doesn't support some file types.
; This is also the string used when 'downsampling' is selected ; This is also the string used when 'downsampling' is selected
; as some people have complained its not bloody obvious, any programs
; referenced in the downsample commands must be installed manually and in
; the web server path, and executable by the web server
; REQUIRED variables ; REQUIRED variables
; transcode_TYPE = true/false ## True to force transcode regardless of prefs ; transcode_TYPE = true/false ## True to force transcode regardless of prefs
; transcode_TYPE_target = TARGET_FILE_TYPE ; transcode_TYPE_target = TARGET_FILE_TYPE
@ -500,55 +490,26 @@ transcode_flac_target = mp3
;transcode_mp3 = false ;transcode_mp3 = false
transcode_mp3_target = mp3 transcode_mp3_target = mp3
;transcode_ogg = false ;transcode_ogg = false
transcode_ogg = ogg transcode_ogg_target = ogg
; These are the commands that will be run to transcode the file ; These are the commands that will be run to transcode the file
transcode_cmd_flac = "flac -dc %FILE% | lame -b %SAMPLE% -S - - " transcode_cmd_flac = "flac -dc %FILE% | lame -b %SAMPLE% -S - - "
transcode_cmd_m4a = "faad -f 2 -w %FILE% | lame -r -b %SAMPLE% -S - -" transcode_cmd_m4a = "faad -f 2 -w %FILE% | lame -r -b %SAMPLE% -S - -"
transcode_cmd_mp3 = "mp3splt -qnf %FILE% %OFFSET% %EOF% -o - | lame --mp3input -q 3 -b %SAMPLE% -S - -" transcode_cmd_mp3 = "mp3splt -qnf %FILE% %OFFSET% %EOF% -o - | lame --mp3input -q 3 -b %SAMPLE% -S - -"
;transcode_cmd_ogg = "mp3splt -qn %FILE% %OFFSET% %EOF% -o - | oggdec -Q -o - - | lame -S -q 3 -b %SAMPLE% -S - -" transcode_cmd_ogg = "oggsplt -qn %FILE% %OFFSET% %EOF% -o - | oggdec -Q -o - - | lame -S -q 3 -b %SAMPLE% -S - -"
transcode_cmd_ogg = "oggsplt -qn %FILE% %OFFSET% %EOF% -o - | oggdec -Q -o - - | lame -S -q 3 -b %SAMPLE% -S - -"
; Alternative command works better for some people ; Alternative command works better for some people
;transcode_cmd_m4a = "alac %FILE% | lame -h -b %SAMPLE% -S - -" ;transcode_cmd_m4a = "alac %FILE% | lame -h -b %SAMPLE% -S - -"
;transcode_cmd_ogg = "mp3splt -qn %FILE% %OFFSET% %EOF% -o - | oggdec -Q -o - - | lame -S -q 3 -b %SAMPLE% -S - -"
; This line seems to work better for windows, switch if needed ; This line seems to work better for windows, switch if needed
;transcode_cmd_mp3 = "lame -q 3 -b %SAMPLE% -S %FILE% - -" ;transcode_cmd_mp3 = "lame -q 3 -b %SAMPLE% -S %FILE% - -"
;###################################################### ;######################################################
; these options allow you to configure your rss-feed ; these options allow you to configure your rss-feed
; layout. rss exists of two parts, main and song ; layout. rss exists of two parts, main and song main is the information about the feed
; main is the information about the feed ; song is the information in the feed. can be multiple items.
; song is the information in the feed. can be multiple
; items.
;
; use_rss = false (values true | false) ; use_rss = false (values true | false)
;
;DEFAULT: use_rss = true ;DEFAULT: use_rss = true
use_rss = true use_rss = true
;
;
; rss_main_title = the title for your feed.
; DEFAULT: Ampache for the love of Music
rss_main_title = Ampache for the love of Music
; rss_main_description = the description for your feed
; DEFAULT: Rss feed for Ampache so you can monitor who is listening to what
rss_main_description = Rss feed for Ampache so you can monitor who is listening to what
; rss_main_copyright = here you can enter copyright information if you wish
; DEFAULT: copyright (c) Speedy B for Ampache
rss_main_copyright = copyright (c) Speedy B for Ampache
; rss_song_description = The description of the song.
; It has to start with <![CDATA[
; and end with ]]>. this is because xml wont parse if strange
; characters are used in the id3-tag
; usable items:
; $song->f_title
; $song->f_album
; $user->fullname
; $artist
; $album
; DEFAULT: <![CDATA[$song->f_title @ $album played by $user->fullname]]>
; FIXME it's hardcoded in lib/rss.lib.php now
;rss_song_description = <![CDATA[$song->f_title @ $album played by $user->fullname]]>
;##################################################### ;#####################################################

View file

@ -4,6 +4,18 @@
-------------------------------------------------------------------------- --------------------------------------------------------------------------
v.3.5-Alpha1 v.3.5-Alpha1
- Many other minor improvements (Thx Dipsol)
- Fixed warnings in caching code (Thx Dipsol)
- Massive text cleanup (Thx Dipsol)
- Fixed tag searching and improved some other search methods to
prevent SQL warnings on no results
- Improved Test page checks to more accuratly verify putENV support
- Make network downsampling a little more sane, don't require
access level
- Added caching to Playlist dropdown
- Fixed double caching on some objects
- Added base.css and 4 tag 'font' sizes depending on weight/count
- Fixed inline song edit
- Updated registration multi-byte mail. - Updated registration multi-byte mail.
- Fixed vainfo.class.php didn't catch exception for first analyze. - Fixed vainfo.class.php didn't catch exception for first analyze.
- Fixed iconv() returns an empty strings (Thx abs0) - Fixed iconv() returns an empty strings (Thx abs0)

View file

@ -1,7 +1,7 @@
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
----------------- INSTALL - Ampache v.3.4 ---------------------- ----------------- INSTALL - Ampache v.3.5 ----------------------
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
www.ampache.org
I'm assuming that you have Apache, PHP and MySQL running when you I'm assuming that you have Apache, PHP and MySQL running when you
get to this point. get to this point.
@ -219,13 +219,13 @@
3.6 Ampache Wiki 3.6 Ampache Wiki
Ampache.org has a wiki set up at http://trac.ampache.org/wiki/ which is Ampache.org has a wiki set up at http://ampache.org/wiki/ which is
full of additional information. Such as specific install instructions full of additional information. Such as specific install instructions
for different OS's like Debian, Slackware, FreeBSD and Windows. It for different OS's like Debian, Slackware, FreeBSD and Windows. It
also explains how to use the additional features and options such as also explains how to use the additional features and options such as
downsampling and transcoding, Access Control Lists, Ampache and XML-RPC, downsampling and transcoding, Access Control Lists, Ampache and XML-RPC,
Ampache + Amarok, Localplay, Democratic Playback and much much more. Ampache + Amarok, Localplay, Democratic Playback and much much more.
http://trac.ampache.org/wiki/ http://ampache.org/wiki/
3.7 Repositories 3.7 Repositories

View file

@ -1,5 +1,5 @@
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
--------- MIGRATION - Ampache v.3.4 ----------- --------- MIGRATION - Ampache v.3.5 -----------
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
-- Upgrading ALL VERSIONS -- -- Upgrading ALL VERSIONS --
@ -9,8 +9,14 @@
your old install is copied into the new directory, then follow any your old install is copied into the new directory, then follow any
instructions provided via the web interface. instructions provided via the web interface.
*** If you have any tag issues always run a verify after upgrading **
Specifics for upgrading between versions are provided below Specifics for upgrading between versions are provided below
- Migrating from Ampache 3.4.x --> 3.5
* No special instructions
- Migrating from Ampache 3.3.x --> 3.4 - Migrating from Ampache 3.3.x --> 3.4
The config file format has changed, please follow the instructions The config file format has changed, please follow the instructions
@ -50,6 +56,4 @@
The tools to migrate Ampache 3.0 to 3.1 Are no longer supported The tools to migrate Ampache 3.0 to 3.1 Are no longer supported
and will not work against the newest versions of the software. and will not work against the newest versions of the software.
Sorry for any inconvience. If you would like to upgrade from 3.0 Sorry for any inconvience.
to 3.1 without losing your data please download Ampache 3.1.
http://www.ampache.org/downloads/ampache.3.1.tar.gz

View file

@ -1,5 +1,5 @@
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
--------- README - Ampache v.3.4 ----------- --------- README - Ampache v.3.5 -----------
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Contents: Contents:
@ -69,8 +69,10 @@ Contents:
- Localplay - Localplay
- Music Player Daemon (MPD) - Music Player Daemon (MPD)
- Winamp using (HTTPQ) - Winamp using (HTTPQ)
- Shoutcast
- Icecast2
- Democratic Vote based playback - Democratic Vote based playback
- 3rd Party clients using API (Amarok,Coherence) - 3rd Party clients using API (Amarok,Coherence,Quickplay)
C) Current Translations C) Current Translations
@ -90,12 +92,11 @@ Contents:
- French (fr_FR) - French (fr_FR)
D) A Special Thanks: D) A Special Thanks:
Thanx to those who've helped us make Ampache so useable: Thanks to those who've helped us make Ampache so useable:
Scott Kveton - Head Nacho, inventer of all that is Ampache Scott Kveton - Head Nacho, inventer of all that is Ampache
Robert Hopson - Libglue, Playlists, Ogg support.. and much more Robert Hopson - Libglue, Playlists, Ogg support.. and much more
Andy Morgan - Protagonist Andy Morgan - Sage / Voice of Reason
RosenSama - Previous Developer RosenSama - Previous Developer
Ben Shields - Ampache Logo
Randall Ehren (Initial XML-RPC) Randall Ehren (Initial XML-RPC)
s1amson (lots of beta testing) s1amson (lots of beta testing)
Caleb Crome (bug fixes and enhancements) Caleb Crome (bug fixes and enhancements)
@ -151,7 +152,7 @@ Contents:
IRC: irc.ampache.org #ampache (Freenode) IRC: irc.ampache.org #ampache (Freenode)
Forums: http://ampache.org/forums Forums: http://ampache.org/forums
Bugs: http://ampache.org/bugs Bugs: http://ampache.org/bugs
Wiki: http://ampache.org/bugs/wiki Wiki: http://ampache.org/wiki
Demo: http://ampache.org/demo Demo: http://ampache.org/demo
Ampache Development Team Ampache Development Team

View file

@ -997,6 +997,7 @@ class Browse {
show_box_bottom(); show_box_bottom();
break; break;
case 'playlist': case 'playlist':
Playlist::build_cache($object_ids);
show_box_top(_('Playlists') . $match, $class); show_box_top(_('Playlists') . $match, $class);
require_once Config::get('prefix') . '/templates/show_playlists.inc.php'; require_once Config::get('prefix') . '/templates/show_playlists.inc.php';
show_box_bottom(); show_box_bottom();
@ -1026,6 +1027,12 @@ class Browse {
require_once Config::get('prefix') . '/templates/show_flagged.inc.php'; require_once Config::get('prefix') . '/templates/show_flagged.inc.php';
show_box_bottom(); show_box_bottom();
break; break;
case 'tag':
Tag::build_cache($tags);
show_box_top(_('Tag Cloud'),$class);
require_once Config::get('prefix') . '/templates/show_tagcloud.inc.php';
show_box_bottom();
break;
default: default:
// Rien a faire // Rien a faire
break; break;

File diff suppressed because it is too large Load diff

View file

@ -31,6 +31,14 @@ abstract class database_object {
// Statistics for debugging // Statistics for debugging
public static $cache_hit = 0; public static $cache_hit = 0;
/**
* get_info
* retrieves the info from the database and puts it in the cache
*
* @param string $id
* @param string $table_name
* @return array
*/
public function get_info($id,$table_name='') { public function get_info($id,$table_name='') {
$table_name = $table_name ? Dba::escape($table_name) : Dba::escape(strtolower(get_class($this))); $table_name = $table_name ? Dba::escape($table_name) : Dba::escape(strtolower(get_class($this)));
@ -58,19 +66,26 @@ abstract class database_object {
*/ */
public static function is_cached($index,$id) { public static function is_cached($index,$id) {
$is_cached = isset(self::$object_cache[$index][$id]); return isset(self::$object_cache[$index][$id]);
return $is_cached;
} // is_cached } // is_cached
/** /**
* get_from_cache * get_from_cache
* This attempts to retrive the specified object from the cache we've got here * This attempts to retrive the specified object from the cache we've got here
*
* @param string $index
* @param string $id
* @return array
*/ */
public static function get_from_cache($index,$id) { public static function get_from_cache($index,$id) {
if (isset(self::$object_cache[$index][$id])) { // Check if the object is set
if (isset(self::$object_cache)
&& isset(self::$object_cache[$index])
&& isset(self::$object_cache[$index][$id])
) {
self::$cache_hit++; self::$cache_hit++;
return self::$object_cache[$index][$id]; return self::$object_cache[$index][$id];
} }
@ -82,12 +97,22 @@ abstract class database_object {
/** /**
* add_to_cache * add_to_cache
* This adds the specified object to the specified index in the cache * This adds the specified object to the specified index in the cache
*
* @param string $index
* @param string $id
* @param array $data
* @return boolean
*/ */
public static function add_to_cache($index,$id,$data) { public static function add_to_cache($index,$id,$data) {
$hasbeenset = false;
self::$object_cache[$index][$id] = $data;
// Set the data if it is set
return true; if (isset($data)) {
self::$object_cache[$index][$id] = $data;
$hasbeenset = true;
}
return $hasbeenset;
} // add_to_cache } // add_to_cache

View file

@ -43,7 +43,7 @@ class Playlist extends database_object {
*/ */
public function __construct($id) { public function __construct($id) {
$info = $this->get_info($id); $info = $this->get_info($id);
foreach ($info as $key=>$value) { foreach ($info as $key=>$value) {
$this->$key = $value; $this->$key = $value;

View file

@ -25,7 +25,7 @@
* This handles the internet radio stuff, that is inserted into live_stream * This handles the internet radio stuff, that is inserted into live_stream
* this can include podcasts or what-have-you * this can include podcasts or what-have-you
*/ */
class Radio { class Radio extends database_object {
/* DB based variables */ /* DB based variables */
public $id; public $id;
@ -42,11 +42,7 @@ class Radio {
*/ */
public function __construct($id) { public function __construct($id) {
$this->id = intval($id); $info = $this->get_info($id,'live_stream');
if (!$this->id) { return false; }
$info = $this->_get_info();
// Set the vars // Set the vars
foreach ($info as $key=>$value) { foreach ($info as $key=>$value) {
@ -55,23 +51,6 @@ class Radio {
} // constructor } // constructor
/**
* _get_info
* Private function for getting the information for this object from the database
*/
private function _get_info() {
$id = Dba::escape($this->id);
$sql = "SELECT * FROM `live_stream` WHERE `id`='$id'";
$db_results = Dba::query($sql);
$results = Dba::fetch_assoc($db_results);
return $results;
} // _get_info
/** /**
* format * format
* This takes the normal data from the database and makes it pretty * This takes the normal data from the database and makes it pretty

View file

@ -94,7 +94,9 @@ class Song extends database_object {
parent::add_to_cache('song',$row['id'],$row); parent::add_to_cache('song',$row['id'],$row);
$artists[$row['artist']] = $row['artist']; $artists[$row['artist']] = $row['artist'];
$albums[$row['album']] = $row['album']; $albums[$row['album']] = $row['album'];
$tags[$row['tag_id']] = $row['tag_id']; if ($row['tag_id']) {
$tags[$row['tag_id']] = $row['tag_id'];
}
} }
Artist::build_cache($artists); Artist::build_cache($artists);
@ -362,6 +364,15 @@ class Song extends database_object {
foreach ($data as $key=>$value) { foreach ($data as $key=>$value) {
switch ($key) { switch ($key) {
case 'artist':
// Don't do anything if we've negative one'd this baby
if ($value == '-1') {
$value = Catalog::check_artist($data['artist_name']);
}
case 'album':
if ($value == '-1') {
$value = Catalog::check_album($data['album_name']);
}
case 'title': case 'title':
case 'track': case 'track':
// Check to see if it needs to be updated // Check to see if it needs to be updated
@ -372,8 +383,6 @@ class Song extends database_object {
$updated = 1; $updated = 1;
} }
break; break;
case 'artist':
case 'album':
default: default:
// Rien a faire // Rien a faire
break; break;
@ -677,11 +686,12 @@ class Song extends database_object {
// Get the top tags // Get the top tags
$tags = Tag::get_top_tags('song',$this->id); $tags = Tag::get_top_tags('song',$this->id);
$this->f_tags = ''; $this->f_tags = '';
foreach ($tags as $tag_id) {
foreach ($tags as $tag_id=>$values) {
$tag = new Tag($tag_id); $tag = new Tag($tag_id);
$this->f_tags .= $tag->name . ', '; $tag->format('song',$this->id);
$this->f_tags .= $tag->f_name . ', ';
} }
$this->f_tags = rtrim($this->f_tags,', '); $this->f_tags = rtrim($this->f_tags,', ');
@ -909,7 +919,7 @@ class Song extends database_object {
$conf_var = 'transcode_' . $this->type; $conf_var = 'transcode_' . $this->type;
$conf_type = 'transcode_' . $this->type . '_target'; $conf_type = 'transcode_' . $this->type . '_target';
if (Config::get($conf_var)) { if (Config::get($conf_var)) {
$this->_transcode = true; $this->_transcode = true;
debug_event('auto_transcode','Transcoding to ' . $this->type,'5'); debug_event('auto_transcode','Transcoding to ' . $this->type,'5');

View file

@ -1,7 +1,7 @@
<?php <?php
/* /*
Copyright (c) 2001 - 2007 Ampache.org Copyright (c) Ampache.org
All rights reserved. All rights reserved.
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
@ -227,11 +227,12 @@ class Stats {
$sql = "SELECT DISTINCT($type) FROM `song` ORDER BY `addition_time` DESC " . $sql = "SELECT DISTINCT($type) FROM `song` ORDER BY `addition_time` DESC " .
"LIMIT $limit"; "LIMIT $limit";
$db_results = Dba::query($sql); $db_results = Dba::read($sql);
while ($r = Dba::fetch_row($db_results)) { $items = array();
$object = new $object_name($r['0']);
$items[] = $object; while ($row = Dba::fetch_row($db_results)) {
$items[] = $row['0'];
} // end while results } // end while results
return $items; return $items;

View file

@ -28,6 +28,11 @@ class Tag extends database_object {
public $id; public $id;
public $name; public $name;
// constructed
public $weight=0;
public $count=0;
public $owner=0;
/** /**
* constructor * constructor
* This takes a tag id and returns all of the relevent information * This takes a tag id and returns all of the relevent information
@ -50,39 +55,82 @@ class Tag extends database_object {
*/ */
public static function construct_from_name($name) { public static function construct_from_name($name) {
$name = Dba::escape($name); $tag_id = self::tag_exists($name);
$sql = "SELECT * FROM `tag` WHERE `name`='$name'"; $tag = new Tag($tag_id);
$db_results = Dba::query($sql);
$row = Dba::fetch_assoc($db_results);
if (!$row['id']) { return false; }
parent::add_to_cache('tag',$row['id'],$row);
$tag = new Tag(0);
foreach ($row as $key=>$value) {
$tag->$key = $value;
}
return $tag; return $tag;
} // construct_from_name } // construct_from_name
/**
* format
* This makes the tag presentable to the great humans that use this program, other life forms
* will just have to fend for themselves
*/
public function format($type=0,$object_id=0) {
if (!self::validate_type($type)) { return false; }
if ($type) {
$this->set_object($type,$object_id);
}
$size = 3 + ($this->weight-1) - ($this->count-1);
if ($size > 4) { $size = 4; }
if ($this->owner == $GLOBALS['user']->id) {
$action = '?page=tag&action=remove_tag&type=' . scrub_out($type) . '&tag_id=' . intval($this->id) . '&object_id=' . intval($object_id);
$class = "hover-remove ";
}
else {
$action = '?page=tag&action=add_tag&type=' . scrub_out($type) . '&tag_id=' . intval($this->id) . '&object_id=' . intval($object_id);
$class = "hover-add ";
}
$class .= 'tag_size' . $size;
$this->f_name = Ajax::text($action,$this->name,'modify_tag_' . $this->id . '_' . $object_id,'',$class);
} // format
/**
* set_object
* This assoicates the tag with a specified object, we try to get the data
* from the map cache, otherwise I guess we'll just have to look it up
*/
public function set_object($type,$object_id) {
if (parent::is_cached('tag_top_' . $type,$object_id)) {
$data = parent::get_from_cache('tag_top_' . $type,$object_id);
}
else {
$data = self::get_top_tags($type,$object_id);
}
$this->weight = $data[$this->id]['count'];
if (in_array($GLOBALS['user']->id,$data[$this->id]['users'])) {
$this->owner = $GLOBALS['user']->id;
}
$this->count = count($data);
} // set_object
/** /**
* build_cache * build_cache
* This takes an array of object ids and caches all of their information * This takes an array of object ids and caches all of their information
* in a single query, cuts down on the connections * in a single query, cuts down on the connections
*/ */
public static function build_cache($ids) { public static function build_cache($ids) {
if (!is_array($ids) OR !count($ids)) { return false; } if (!is_array($ids) OR !count($ids)) { return false; }
$idlist = '(' . implode(',',$ids) . ')'; $idlist = '(' . implode(',',$ids) . ')';
$sql = "SELECT * FROM `tag` WHERE `id` IN $idlist"; $sql = "SELECT * FROM `tag` WHERE `id` IN $idlist";
$db_results = Dba::query($sql); $db_results = Dba::read($sql);
while ($row = Dba::fetch_assoc($db_results)) { while ($row = Dba::fetch_assoc($db_results)) {
parent::add_to_cache('tag',$row['id'],$row); parent::add_to_cache('tag',$row['id'],$row);
@ -102,18 +150,20 @@ class Tag extends database_object {
$type = self::validate_type($type); $type = self::validate_type($type);
$idlist = '(' . implode(',',$ids) . ')'; $idlist = '(' . implode(',',$ids) . ')';
$sql = "SELECT COUNT(`tag_map`.`id`) AS `count`,`tag`.`id`,`tag_map`.`object_id` FROM `tag_map` " . $sql = "SELECT `tag_map`.`tag_id`,`tag_map`.`object_id`,`tag_map`.`user` FROM `tag_map` " .
"INNER JOIN `tag` ON `tag`.`id`=`tag_map`.`tag_id` " . "WHERE `tag_map`.`object_type`='$type' AND `tag_map`.`object_id` IN $idlist ";
"WHERE `tag_map`.`object_type`='$type' AND `tag_map`.`object_id` IN $idlist " .
"GROUP BY `tag_map`.`object_id` ORDER BY `count` DESC";
$db_results = Dba::query($sql); $db_results = Dba::query($sql);
$tags = array();
while ($row = Dba::fetch_assoc($db_results)) { while ($row = Dba::fetch_assoc($db_results)) {
$tags[$row['object_id']][] = $row; $tags[$row['object_id']][$row['tag_id']]['users'][] = $row['user'];
$tags[$row['object_id']][$row['tag_id']]['count']++;
} }
foreach ($tags as $id=>$entry) { // Run through our origional ids as we want to cache NULL results
parent::add_to_cache('tag_map_' . $type,$id,$entry); foreach ($ids as $id) {
parent::add_to_cache('tag_top_' . $type,$id,$tags[$id]);
} }
return true; return true;
@ -121,61 +171,60 @@ class Tag extends database_object {
} // build_map_cache } // build_map_cache
/** /**
* has_object * add
* This checks to see if the current tag element has the specified object * This is a wrapper function, it figures out what we need to add, be it a tag
* of the specified type * and map, or just the mapping
*/ */
public function has_object($object_type,$object_id) { public static function add($type,$id,$value,$user='') {
$object_type = self::validate_type($object_type); // Validate the tag type
$object_id = intval($object_id); if (!self::validate_type($type)) { return false; }
$tag_id = intval($this->id);
$sql = "SELECT * FROM `tag_map` WHERE `object_type`='$object_type' AND `object_id`='$object_id' " .
" AND `tag_id`='$tag_id'";
$db_results = Dba::query($sql);
return Dba::num_rows($db_results); if (!is_numeric($id)) { return false; }
} // has_object $cleaned_value = self::clean_tag($value);
if (!strlen($cleaned_value)) { return false; }
$uid = ($user == '') ? intval($user) : intval($GLOBALS['user']->id);
// Check and see if the tag exists, if not create it, we need the tag id from this
if (!$tag_id = self::tag_exists($cleaned_value)) {
$tag_id = self::add_tag($cleaned_value);
}
if (!$tag_id) {
debug_event('Error','Error unable to create tag value:' . $cleaned_value . ' unknown error','1');
return false;
}
// We've got the tag id, let's see if it's already got a map, if not then create the map and return the value
if (!$map_id = self::tag_map_exists($type,$id,$tag_id,$user)) {
$map_id = self::add_tag_map($type,$id,$tag_id,$user);
}
return $map_id;
} // add
/** /**
* add_tag * add_tag
* This function adds a new tag, for now we're going to limit the tagging a bit * This function adds a new tag, for now we're going to limit the tagging a bit
*/ */
public static function add_tag($type, $id, $tagval,$user='') { public static function add_tag($value) {
if (!self::validate_type($type)) {
return false;
}
if (!is_numeric($id)) {
return false;
}
// Clean it up and make it tagish // Clean it up and make it tagish
$tagval = self::clean_tag($tagval); $value = self::clean_tag($value);
if (!strlen($tagval)) { return false; } if (!strlen($value)) { return false; }
$uid = ($user == '') ? intval($user) : intval($GLOBALS['user']->id); $value = Dba::escape($value);
$tagval = Dba::escape($tagval);
$type = Dba::escape($type);
$id = intval($id);
// Check if tag object exists $sql = "REPLACE INTO `tag` SET `name`='$value'";
$sql = "SELECT `tag`.`id` FROM `tag` WHERE `name`='$tagval'"; $db_results = Dba::write($sql);
$db_results = Dba::query($sql) ; $insert_id = Dba::insert_id();
$row = Dba::fetch_assoc($db_results);
$insert_id = $row['id'];
// If the tag doesn't exist create it. parent::add_to_cache('tag_name',$value,$insert_id);
if (!count($row)) {
$sql = "INSERT INTO `tag` SET `name`='$tagval'";
$db_results = Dba::query($sql) ;
$insert_id = Dba::insert_id();
}
self::add_tag_map($insert_id,$type,$id);
return $insert_id; return $insert_id;
@ -185,98 +234,107 @@ class Tag extends database_object {
* add_tag_map * add_tag_map
* This adds a specific tag to the map for specified object * This adds a specific tag to the map for specified object
*/ */
public static function add_tag_map($tag_id,$object_type,$object_id,$user='') { public static function add_tag_map($type,$object_id,$tag_id,$user='') {
$uid = ($user == '') ? intval($GLOBALS['user']->id) : intval($user); $uid = ($user == '') ? intval($GLOBALS['user']->id) : intval($user);
$tag_id = intval($tag_id); $tag_id = intval($tag_id);
$type = self::validate_type($object_type); if (!self::validate_type($type)) { return false; }
$id = intval($object_id); $id = intval($object_id);
if (!$tag_id || !$id) { return false; }
$sql = "INSERT INTO `tag_map` (`tag_id`,`user`,`object_type`,`object_id`) " .
"VALUES ('$tag_id','$uid','$type','$id')";
$db_results = Dba::write($sql);
$insert_id = Dba::insert_id();
// Now make sure this isn't a duplicate parent::add_to_cache('tag_map_' . $type,$insert_id,array('tag_id'=>$tag_id,'user'=>$uid,'object_type'=>$type,'object_id'=>$id));
$sql = "SELECT * FROM `tag_map " .
"WHERE `tag_id`='$insert_id' AND `user`='$uid' AND `object_type`='$type' AND `object_id`='$id'";
$db_results = Dba::query($sql);
$row = Dba::fetch_assoc($db_results);
// Only insert it if the current tag for this user doesn't exist
if (!count($row)) {
$sql = "INSERT INTO `tag_map` (`tag_id`,`user`,`object_type`,`object_id`) " .
"VALUES ('$tag_id','$uid','$type','$id')";
$db_results = Dba::query($sql);
$insert_id = Dba::insert_id();
}
else {
$insert_id = $row['id'];
}
return $insert_id; return $insert_id;
} // add_tag_map } // add_tag_map
/** /**
* get_many_tags * tag_exists
* This builds a cache of all of the tags contained by the specified object ids * This checks to see if a tag exists, this has nothing to do with objects or maps
* of the specified type
*/ */
public static function get_many_tags($type, $object_ids) { public static function tag_exists($value) {
// If they pass us nothing, they get nothing if (parent::is_cached('tag_name',$value)) {
if (!count($object_ids)) { return array(); } return parent::get_from_cache('tag_name',$value);
if (!self::validate_type($type)) { return array(); }
$lid = '(' . implode(',',$id) . ')';
$orsql = '';
if ($objType == 'artist' || $objType == 'album')
$orsql=" or (tag_map.object_id = song.id AND tag_map.object_type='song' and song.$objType in $lid )";
if ($objType == 'artist')
$orsql .= "or (tag_map.object_id = album.id AND tag_map.object_type='album' and $objType.id in $lid )";
$sql = "SELECT DISTINCT tag.id, tag.name, tag_map.user, $objType.id as oid FROM tag, tag_map, song, artist, album WHERE " .
"tag_map.tag_id = tag.id AND ( (tag_map.object_type='$objType' AND $objType.id in $lid AND tag_map.object_id = $objType.id) $orsql) " .
"AND song.album = album.id AND song.artist = artist.id;";
return array();
$results = array();
$db_results = Dba::query($sql) or die(Dba::error());
while ($r = Dba::fetch_assoc($db_results)) {
$uid = intval($r['oid']);
$results[] = $r;
} }
//return self::filter_with_prefs($results); $value = Dba::escape($value);
return $results; $sql = "SELECT * FROM `tag` WHERE `name`='$value'";
$db_results = Dba::read($sql);
} // get_man_tags $results = Dba::fetch_assoc($db_results);
parent::add_to_cache('tag_name',$results['name'],$results['id']);
return $results['id'];
} // tag_exists
/**
* tag_map_exists
* This looks to see if the current mapping of the current object of the current tag of the current
* user exists, lots of currents... taste good in scones.
*/
public static function tag_map_exists($type,$object_id,$tag_id,$user) {
if (!self::validate_type($type)) { return false; }
if (parent::is_cached('tag_map_' . $type,$object_id)) {
$data = parent::get_from_cache('tag_map_' . $type,$object_id);
return $data['id'];
}
$object_id = Dba::escape($object_id);
$tag_id = Dba::escape($tag_id);
$user = Dba::escape($user);
$type = Dba::escape($type);
$sql = "SELECT * FROM `tag_map` WHERE `tag_id`='$tag_id' AND `user`='$user' AND `object_id`='$object_id' AND `object_type`='$type'";
$db_results = Dba::read($sql);
$results = Dba::fetch_assoc($db_results);
parent::add_to_cache('tag_map_' . $type,$results['id'],$results);
return $results['id'];
} // tag_map_exists
/** /**
* get_top_tags * get_top_tags
* This gets the top tags for the specified object using limit * This gets the top tags for the specified object using limit
*/ */
public static function get_top_tags($type,$object_id,$limit='2') { public static function get_top_tags($type,$object_id,$limit='10') {
$type = self::validate_type($type); if (!self::validate_type($type)) { return false; }
if (parent::is_cached('tag_map_' . $type,$object_id)) { if (parent::is_cached('tag_top_' . $type,$object_id)) {
return parent::get_from_cache('tag_map_' . $type,$object_id); return parent::get_from_cache('tag_top_' . $type,$object_id);
} }
$object_id = intval($object_id); $object_id = intval($object_id);
$limit = intval($limit); $limit = intval($limit);
$sql = "SELECT COUNT(`tag_map`.`id`) AS `count`,`tag`.`id` FROM `tag_map` " . $sql = "SELECT `tag_map`.`tag_id`,`tag_map`.`user` FROM `tag_map` " .
"INNER JOIN `tag` ON `tag`.`id`=`tag_map`.`tag_id` " .
"WHERE `tag_map`.`object_type`='$type' AND `tag_map`.`object_id`='$object_id' " . "WHERE `tag_map`.`object_type`='$type' AND `tag_map`.`object_id`='$object_id' " .
"GROUP BY `tag_map`.`object_id` ORDER BY `count` DESC LIMIT $limit"; "LIMIT $limit";
$db_results = Dba::query($sql); $db_results = Dba::query($sql);
$results = array(); $results = array();
while ($row = Dba::fetch_assoc($db_results)) { while ($row = Dba::fetch_assoc($db_results)) {
$results[] = $row['id']; $results[$row['tag_id']]['users'][] = $row['user'];
$results[$row['tag_id']]['count']++;
} }
parent::add_to_cache('tag_top_' . $type,$object_id,$results);
return $results; return $results;
} // get_top_tags } // get_top_tags
@ -364,6 +422,26 @@ return array();
} // filter_with_prefs } // filter_with_prefs
/**
* remove_map
* This will only remove tag maps for the current user
*/
public function remove_map($type,$object_id) {
if (!self::validate_type($type)) { return false; }
$type = Dba::escape($type);
$tag_id = Dba::escape($this->id);
$object_id = Dba::escape($object_id);
$user_id = Dba::escape($GLOBALS['user']->id);
$sql = "DELETE FROM `tag_map` WHERE `tag_id`='$tag_id' AND `object_type`='$type' AND `object_id`='$object_id' AND `user`='$user_id'";
$db_results = Dba::write($sql);
return true;
} // remove_map
/** /**
* validate_type * validate_type
* This validates the type of the object the user wants to tag, we limit this to types * This validates the type of the object the user wants to tag, we limit this to types

View file

@ -1398,5 +1398,27 @@ class Update {
} // update_350002 } // update_350002
/**
* update_350003
* This update tweakes the tag tables a little bit more, we're going to simplify things for the first little bit and then
* then if it all works out we will worry about making it complex again. One thing at a time people...
*/
public static function update_350003() {
$sql = "ALTER TABLE `tag` DROP `order`";
$db_results = Dba::write($sql);
$sql = "ALTER TABLE `tag` DROP INDEX `order`";
$db_results = Dba::write($sql);
$sql = "ALTER TABLE `tag` ADD UNIQUE ( `name` )";
$db_results = Dba::write($sql);
$sql = "ALTER TABLE `tag` CHANGE `name` `name` VARCHAR( 255 )";
$db_results = Dba::write($sql);
} // update_350003
} // end update class } // end update class
?> ?>

View file

@ -115,7 +115,7 @@ class vainfo {
$this->_getID3->option_tag_lyrics3 = false; $this->_getID3->option_tag_lyrics3 = false;
$this->_getID3->encoding = $this->encoding; $this->_getID3->encoding = $this->encoding;
$this->_getID3->encoding_id3v1 = $this->encoding_id3v1; $this->_getID3->encoding_id3v1 = $this->encoding_id3v1;
$this->_getID3->encoding_id3v2 = $this->encoding_id3v2; // $this->_getID3->encoding_id3v2 = $this->encoding_id3v2;
$this->_getID3->option_tags_process = true; $this->_getID3->option_tags_process = true;
/* Check for ICONV */ /* Check for ICONV */
@ -139,7 +139,7 @@ class vainfo {
$this->_raw = $this->_getID3->analyze($this->filename); $this->_raw = $this->_getID3->analyze($this->filename);
} }
catch (Exception $error) { catch (Exception $error) {
debug_event('getid3',$error->message,'1'); debug_event('getid3',$error->message,'1');
} }
/* Figure out what type of file we are dealing with */ /* Figure out what type of file we are dealing with */

View file

@ -199,12 +199,22 @@ function check_putenv() {
if (!ini_set(memory_limit,$new_limit)) { if (!ini_set(memory_limit,$new_limit)) {
return false; return false;
} }
// Make sure it actually worked
$current = ini_get('memory_limit');
if ($new_limit != $current) {
return false;
}
/* Check if safe mode is on */ /* Check if safe mode is on */
if (ini_get('safe_mode')) { if (ini_get('safe_mode')) {
return false; return false;
} }
// See if we can override the set_time_limit();
return true; return true;
} // check_putenv } // check_putenv

View file

@ -85,7 +85,7 @@ if (!count($results)) {
} }
/** This is the version.... fluf nothing more... **/ /** This is the version.... fluf nothing more... **/
$results['version'] = '3.5-Alpha1 (Build 003)'; $results['version'] = '3.5-Alpha1 (Build 004)';
$results['int_config_version'] = '7'; $results['int_config_version'] = '7';
$results['raw_web_path'] = $results['web_path']; $results['raw_web_path'] = $results['web_path'];

View file

@ -1,7 +1,7 @@
<?php <?php
/* /*
Copyright (c) 2001 - 2006 Ampache.org Copyright (c) Ampache.org
All Rights Reserved All Rights Reserved
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
@ -25,15 +25,16 @@
or to a defined log file based on config options or to a defined log file based on config options
*/ */
function log_event($username='Unknown',$event_name,$event_description,$log_name='ampache') { function log_event($username='Unknown',$event_name,$event_description,$log_name='ampache') {
/* Set it up here to make sure it's _always_ the same */ /* Set it up here to make sure it's _always_ the same */
$log_time = time(); $log_time = time();
/* must have some name */ /* must have some name */
if (!strlen($log_name)) { $log_name = 'ampache'; } if (!strlen($log_name)) { $log_name = 'ampache'; }
$username = $username ? $username : 'ampache';
$log_filename = Config::get('log_path') . "/$log_name." . date("Ymd",$log_time) . ".log"; $log_filename = Config::get('log_path') . "/$log_name." . date("Ymd",$log_time) . ".log";
$log_line = date("Y-m-d H:i:s",$log_time) . " { $username } ( $event_name ) - $event_description \n"; $log_line = date("Y-m-d H:i:s",$log_time) . " [$username] ($event_name) -> $event_description \n";
$log_write = error_log($log_line, 3, $log_filename); $log_write = error_log($log_line, 3, $log_filename);
@ -49,7 +50,7 @@ function log_event($username='Unknown',$event_name,$event_description,$log_name=
as many errors as it can and logs em as many errors as it can and logs em
*/ */
function ampache_error_handler($errno, $errstr, $errfile, $errline) { function ampache_error_handler($errno, $errstr, $errfile, $errline) {
/* Default level of 1 */ /* Default level of 1 */
$level = 1; $level = 1;
@ -79,6 +80,7 @@ function ampache_error_handler($errno, $errstr, $errfile, $errline) {
$level = 2; $level = 2;
break; break;
} // end switch } // end switch
/* Don't log var: Deprecated we know shutup! /* Don't log var: Deprecated we know shutup!
* Yea now getid3() spews errors I love it :( * Yea now getid3() spews errors I love it :(
@ -101,9 +103,13 @@ function ampache_error_handler($errno, $errstr, $errfile, $errline) {
return false; return false;
} }
$log_line = "[$error_name] $errstr on line $errline in $errfile"; $log_line = "[$error_name] $errstr in file $errfile($errline)";
debug_event('PHP Error',$log_line,$level); debug_event('PHP Error',$log_line,$level);
// When a dir is defined lets log it to a logfile
if (Config::get('log_path') != "")
log_event("ampache","PHP Error", $log_line);
} // ampache_error_handler } // ampache_error_handler
/** /**

View file

@ -180,18 +180,34 @@ function search_song($data,$operator,$method,$limit) {
"WHERE `object_type`='song' GROUP BY `object_id`"; "WHERE `object_type`='song' GROUP BY `object_id`";
$db_results = Dba::query($rating_sql); $db_results = Dba::query($rating_sql);
// Fill it with one value to prevent sql error on no results
$where_sql .= " `song`.`id` IN ("; $where_sql .= " `song`.`id` IN (";
$end_rating = '';
$ids = array('0');
while ($row = Dba::fetch_assoc($db_results)) { while ($row = Dba::fetch_assoc($db_results)) {
if ($row['avgrating'] < $value) { continue; } if ($row['avgrating'] < $value) { continue; }
$where_sql .= $row['object_id'] . ','; $ids[] = $row['object_id'];
$end_rating = ") $operator";
} }
$where_sql = rtrim($where_sql,"`song`.`id` IN ("); $where_sql .= implode(',',$ids) . ')';
$where_sql = rtrim($where_sql,",") . $end_rating; break;
case 'tag':
// Fill it with one value to prevent sql error on no results
$ids = array('0');
$tag_sql = "SELECT `object_id` FROM `tag` LEFT JOIN `tag_map` ON `tag`.`id`=`tag_map`.`tag_id` " .
"WHERE `tag_map`.`object_type`='song' AND `tag`.`name` $value_string ";
$db_results = Dba::read($tag_sql);
while ($row = Dba::fetch_assoc($db_results)) {
$ids[] = $row['object_id'];
}
$where_sql = " `song`.`id` IN (" . implode(',',$ids) . ")";
break;
default: default:
// Notzing! // Notzing!
break; break;

View file

@ -156,5 +156,3 @@ if ($auth['success']) {
require Config::get('prefix') . '/templates/show_login_form.inc.php'; require Config::get('prefix') . '/templates/show_login_form.inc.php';
?> ?>
</body>
</html>

View file

@ -1,3 +1,4 @@
<?xml version="1.0"?>
<!-- Copyright (c) 2001 - 2008 Ampache.org <!-- Copyright (c) 2001 - 2008 Ampache.org
All rights reserved. All rights reserved.
@ -14,9 +15,6 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --> Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -->
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy <!DOCTYPE cross-domain-policy
SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy> <cross-domain-policy>

View file

@ -375,7 +375,7 @@ class getid3_write_id3v2 extends getid3_handler_write
// rewrite file - no tag present or new tag longer than old tag // rewrite file - no tag present or new tag longer than old tag
else else
{
if (!$fp_source = @fopen($this->filename, 'rb')) { if (!$fp_source = @fopen($this->filename, 'rb')) {
throw new getid3_exception('Could not open '.$this->filename.' mode "rb"'); throw new getid3_exception('Could not open '.$this->filename.' mode "rb"');
} }

View file

@ -288,7 +288,7 @@ class mp3tunes {
$limit = $limit ? intval($limit) : $this->limit; $limit = $limit ? intval($limit) : $this->limit;
$offset = $offset ? intval($offset) : '0'; $offset = $offset ? intval($offset) : '0';
$xml_doc = self::run_query('general'"/lockerSearch?s=$name&count=$limit&set=$offset&type=album"); $xml_doc = self::run_query('general',"/lockerSearch?s=$name&count=$limit&set=$offset&type=album");
// Set the right parent // Set the right parent
$this->_containerTag = 'albumList'; $this->_containerTag = 'albumList';

View file

@ -282,7 +282,8 @@ if (Config::get('track_user_ip')) {
// If we've got downsample remote enabled // If we've got downsample remote enabled
if (Config::get('downsample_remote')) { if (Config::get('downsample_remote')) {
if (!Access::check_network('network',$_SERVER['REMOTE_ADDR'],$GLOBALS['user']->id,'25')) { if (!Access::check_network('network',$_SERVER['REMOTE_ADDR'],$GLOBALS['user']->id,'0')) {
debug_event('downsample','Network Downsample ' . $_SERVER['REMOTE_ADDR'] . ' is not in Local definition','5');
$not_local = true; $not_local = true;
} }
} // if downsample remote is enabled } // if downsample remote is enabled

View file

@ -65,23 +65,10 @@ switch ($_REQUEST['action']) {
$playlist->remove_songs($_REQUEST['song']); $playlist->remove_songs($_REQUEST['song']);
show_playlist($playlist); show_playlist($playlist);
break; break;
case 'update_playlist':
/* Make sure they've got thems rights */
if (!$playlist->has_access()) {
access_denied();
break;
}
$playlist->update_type($_REQUEST['type']);
$playlist->update_name($_REQUEST['playlist_name']);
$url = conf('web_path') . '/playlist.php?action=show_playlist&amp;playlist_id=' . $playlist->id;
$title = _('Playlist Updated');
$body = "$playlist->name " . _('has been updated and is now') . " $playlist->type";
show_confirmation($title,$body,$url);
break;
case 'show_playlist': case 'show_playlist':
$playlist = new Playlist($_REQUEST['playlist_id']); $playlist = new Playlist($_REQUEST['playlist_id']);
$playlist->format(); $playlist->format();
$object_ids = $playlist->get_items();
require_once Config::get('prefix') . '/templates/show_playlist.inc.php'; require_once Config::get('prefix') . '/templates/show_playlist.inc.php';
break; break;
case 'show_import_playlist': case 'show_import_playlist':

View file

@ -29,7 +29,11 @@ switch ($_REQUEST['action']) {
break; break;
case 'add_tag': case 'add_tag':
Tag::add_tag_map($_REQUEST['type'],$_REQUEST['object_id'],$_REQUEST['tag_id']);
break;
case 'remove_tag':
$tag = new Tag($_REQUEST['tag_id']);
$tag->remove_map($_REQUEST['type'],$_REQUEST['object_id']);
break; break;
default: default:
$results['rfc3514'] = '0x1'; $results['rfc3514'] = '0x1';

View file

@ -49,9 +49,7 @@ switch ($_REQUEST['action']) {
default: default:
// Global stuff first // Global stuff first
$stats = Catalog::get_stats(); $stats = Catalog::get_stats();
require_once Config::get('prefix') . '/templates/show_local_catalog_info.inc.php'; require_once Config::get('prefix') . '/templates/show_stats.inc.php';
require_once Config::get('prefix') . '/templates/show_stats_popular.inc.php';
require_once Config::get('prefix') . '/templates/show_stats_newest.inc.php';
break; break;
} // end switch on action } // end switch on action

46
templates/base.css Normal file
View file

@ -0,0 +1,46 @@
/*
Copyright (c) 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 v2
as published by the Free Software Foundation
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.
*/
/*****************************************************************************/
/* Base Definitions, may be overwridden by themes
/*****************************************************************************/
/*****************
* Tag Definitions
*****************/
.tag_size1 {
font-size:.6em;
}
.tag_size2 {
font-size:.8em;
}
.tag_size3 {
font-size:1em;
}
.tag_size4 {
font-size:1.2em;
}
a.tag_size1, a.tag_size2, a.tag_size3, a.tag_size4 { text-decoration: none; }
.hover-add:hover { font-weight:900; }
.hover-remove:hover { text-decoration:line-through;}

View file

@ -1,106 +0,0 @@
<!--
/*
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 v2
as published by the Free Software Foundation.
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.
*/
-->
/*
#topbar {
display: none;
}
*/
html, address,
blockquote,
body, dd, div,
dl, dt, fieldset, form,
frame, frameset,
h1, h2, h3, h4,
h5, h6, noframes,
ol, p, ul, center,
dir, hr, menu, pre { display: block }
li { display: list-item }
head { display: none }
table { display: block }
tr { display: table-row }
thead { display: table-header-group }
tbody { display: table-row-group }
tfoot { display: table-footer-group }
col { display: table-column }
colgroup { display: table-column-group }
td, th { display: table-cell }
caption { display: table-caption }
th { font-weight: bolder; text-align: center }
caption { text-align: center }
body { margin: 8px }
h1 { font-size: 2em; margin: .67em 0 }
h2 { font-size: 1.5em; margin: .75em 0 }
h3 { font-size: 1.17em; margin: .83em 0 }
h4, p,
blockquote, ul,
fieldset, form,
ol, dl, dir,
menu { margin: 1.12em 0 }
h5 { font-size: .83em; margin: 1.5em 0 }
h6 { font-size: .75em; margin: 1.67em 0 }
h1, h2, h3, h4,
h5, h6, b,
strong { font-weight: bolder }
blockquote { margin-left: 40px; margin-right: 40px }
i, cite, em,
var, address { font-style: italic }
pre, tt, code,
kbd, samp { font-family: monospace }
pre { white-space: pre }
textarea,
input, select { display: block }
big { font-size: 1.17em }
small, sub, sup { font-size: .83em }
sub { vertical-align: sub }
sup { vertical-align: super }
table { border-spacing: 2px; }
thead, tbody,
tfoot { vertical-align: middle }
td, th { vertical-align: inherit }
s, strike, del { text-decoration: line-through }
hr { border: 1px inset }
ol, ul, dir,
menu, dd { margin-left: 40px }
ol { list-style-type: decimal }
ol ul, ul ol,
ul ul, ol ol { margin-top: 0; margin-bottom: 0 }
u, ins { text-decoration: underline }
br:before { content: "\A" }
:before, :after { white-space: pre }
center { text-align: center }
:link, :visited { text-decoration: underline }
:focus { outline: thin dotted invert }
/* Begin bidirectionality settings (do not change) */
BDO[DIR="ltr"] { direction: ltr; unicode-bidi: bidi-override }
BDO[DIR="rtl"] { direction: rtl; unicode-bidi: bidi-override }
*[DIR="ltr"] { direction: ltr; unicode-bidi: embed }
*[DIR="rtl"] { direction: rtl; unicode-bidi: embed }
@media print {
h1 { page-break-before: always }
h1, h2, h3,
h4, h5, h6 { page-break-after: avoid }
ul, ol, dl { page-break-before: avoid }
}

View file

@ -33,23 +33,19 @@ $location = get_location();
<?php <?php
if (Config::get('use_rss')) { ?> if (Config::get('use_rss')) { ?>
<link rel="alternate" type="application/rss+xml" title="<?php echo Config::get('rss_main_title'); ?>" href="<?php echo $web_path; ?>/rss.php" /> <link rel="alternate" type="application/rss+xml" title="<?php echo Config::get('rss_main_title'); ?>" href="<?php echo $web_path; ?>/rss.php" />
<link rel="alternate" type="application/rss+xml" title="<?php echo _('Ampache Latest Artists Additions'); ?>" href="<?php echo $web_path; ?>/rss.php?type=latestartist" />
<link rel="alternate" type="application/rss+xml" title="<?php echo _('Ampache Latest Albums Additions'); ?>" href="<?php echo $web_path; ?>/rss.php?type=latestalbum" />
<link rel="alternate" type="application/rss+xml" title="<?php echo _('Ampache Most Popular Albums'); ?>" href="<?php echo $web_path; ?>/rss.php?type=popularalbum" />
<link rel="alternate" type="application/rss+xml" title="<?php echo _('Ampache Most Popular Artists'); ?>" href="<?php echo $web_path; ?>/rss.php?type=popularalbum" />
<link rel="alternate" type="application/rss+xml" title="<?php echo _('Ampache Most Popular Songs'); ?>" href="<?php echo $web_path; ?>/rss.php?type=popularsong" />
<link rel="alternate" type="application/rss+xml" title="<?php echo _('Ampache Recently Played'); ?>" href="<?php echo $web_path; ?>/rss.php?type=recentlyplayed" /> <link rel="alternate" type="application/rss+xml" title="<?php echo _('Ampache Recently Played'); ?>" href="<?php echo $web_path; ?>/rss.php?type=recentlyplayed" />
<?php } ?> <?php } ?>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=<?php echo Config::get('site_charset'); ?>" /> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=<?php echo Config::get('site_charset'); ?>" />
<title><?php echo scrub_out(Config::get('site_title')); ?> - <?php echo $location['title']; ?></title> <title><?php echo scrub_out(Config::get('site_title')); ?> - <?php echo $location['title']; ?></title>
<link rel="stylesheet" href="<?php echo $web_path; ?>/templates/base.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php echo $web_path; ?><?php echo Config::get('theme_path'); ?>/templates/default.css" type="text/css" media="screen" /> <link rel="stylesheet" href="<?php echo $web_path; ?><?php echo Config::get('theme_path'); ?>/templates/default.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php echo $web_path; ?>/templates/print.css" type="text/css" media="print" /> <link rel="stylesheet" href="<?php echo $web_path; ?>/templates/print.css" type="text/css" media="print" />
<link rel="stylesheet" href="<?php echo $web_path; ?>/templates/handheld.css" type="text/css" media="handheld" />
</head> </head>
<body> <body>
<script src="<?php echo $web_path; ?>/lib/javascript-base.js" language="javascript" type="text/javascript"></script> <script src="<?php echo $web_path; ?>/lib/javascript-base.js" language="javascript" type="text/javascript"></script>
<script src="<?php echo $web_path; ?>/modules/kajax/ajax.js" language="javascript" type="text/javascript"></script> <script src="<?php echo $web_path; ?>/modules/kajax/ajax.js" language="javascript" type="text/javascript"></script>
<script src="<?php echo $web_path; ?>/modules/prototype/prototype.js" language="javascript" type="text/javascript"></script> <script src="<?php echo $web_path; ?>/modules/prototype/prototype.js" language="javascript" type="text/javascript"></script>
<!-- rfc3514 implementation -->
<div id="rfc3514" style="display:none;">0x0</div> <div id="rfc3514" style="display:none;">0x0</div>
<div id="maincontainer" <?php <div id="maincontainer" <?php
if ($GLOBALS['theme']['orientation'] == 'horizontal') { if ($GLOBALS['theme']['orientation'] == 'horizontal') {
@ -78,8 +74,6 @@ if (Config::get('use_rss')) { ?>
<div id="rightbar"><!-- This is the rightbar --> <div id="rightbar"><!-- This is the rightbar -->
<?php require_once Config::get('prefix') . '/templates/rightbar.inc.php'; ?> <?php require_once Config::get('prefix') . '/templates/rightbar.inc.php'; ?>
</div><!-- End rightbar --> </div><!-- End rightbar -->
<!-- I hate IE...
<table class="smeg-ie" width="100%"><tr><td> -->
<!-- Tiny little iframe, used to cheat the system --> <!-- Tiny little iframe, used to cheat the system -->
<div id="ajax-loading">Loading . . .</div> <div id="ajax-loading">Loading . . .</div>
<iframe name="util_iframe" id="util_iframe" style="display:none;" src="<?php echo Config::get('web_path'); ?>/util.php"></iframe> <iframe name="util_iframe" id="util_iframe" style="display:none;" src="<?php echo Config::get('web_path'); ?>/util.php"></iframe>

View file

@ -92,7 +92,7 @@ h3 {
/* Table style */ /* Table style */
td{ td{
padding:5px; padding:5px;
//background-color: #D9E0E8; /*background-color: #D9E0E8;*/
font-size: smaller; font-size: smaller;
} }
@ -120,13 +120,13 @@ textarea:focus{
.ok { .ok {
font-weight:bold; font-weight:bold;
color:#009900; color:#009900;
margin:10px 10 10px 10px; margin:10px 10px 10px 10px;
} }
.notok { .notok {
font-weight:bold; font-weight:bold;
color:#FF3300; color:#FF3300;
margin:10px 10 10px 10px; margin:10px 10px 10px 10px;
} }
/* Bottom */ /* Bottom */

View file

@ -84,7 +84,7 @@ br:before { content: "\A" }
:before, :after { white-space: pre } :before, :after { white-space: pre }
center { text-align: center } center { text-align: center }
:link, :visited { text-decoration: underline } :link, :visited { text-decoration: underline }
:focus { outline: thin dotted invert } /* :focus { outline: thin invert }*/
/* Begin bidirectionality settings (do not change) */ /* Begin bidirectionality settings (do not change) */
BDO[DIR="ltr"] { direction: ltr; unicode-bidi: bidi-override } BDO[DIR="ltr"] { direction: ltr; unicode-bidi: bidi-override }
@ -99,6 +99,7 @@ BDO[DIR="rtl"] { direction: rtl; unicode-bidi: bidi-override }
h1, h2, h3, h1, h2, h3,
h4, h5, h6 { page-break-after: avoid } h4, h5, h6 { page-break-after: avoid }
ul, ol, dl { page-break-before: avoid } ul, ol, dl { page-break-before: avoid }
}
#sidebar { #sidebar {
display: none; display: none;
@ -122,5 +123,4 @@ display: none;
} }
select { select {
display: none; display: none;
} }

View file

@ -32,6 +32,7 @@
</li> </li>
<?php <?php
$playlists = Playlist::get_users($GLOBALS['user']->id); $playlists = Playlist::get_users($GLOBALS['user']->id);
Playlist::build_cache($playlists);
foreach ($playlists as $playlist_id) { foreach ($playlists as $playlist_id) {
$playlist = new Playlist($playlist_id); $playlist = new Playlist($playlist_id);
$playlist->format(); $playlist->format();

View file

@ -44,7 +44,6 @@
<?php echo get_user_icon('comment',_('Post Shout')); ?> <?php echo get_user_icon('comment',_('Post Shout')); ?>
</a> </a>
<?php } ?> <?php } ?>
<?php echo Ajax::button('?page=tag&action=show_add_tag&type=album&id=' . $album->id,'add_tag',_('Add Tag'),'add_album_tag_' . $album->id); ?>
<?php if (Access::check_function('batch_download')) { ?> <?php if (Access::check_function('batch_download')) { ?>
<a href="<?php echo Config::get('web_path'); ?>/batch.php?action=album&amp;id=<?php echo $album->id; ?>"> <a href="<?php echo Config::get('web_path'); ?>/batch.php?action=album&amp;id=<?php echo $album->id; ?>">
<?php echo get_user_icon('batch_download',_('Batch Download')); ?> <?php echo get_user_icon('batch_download',_('Batch Download')); ?>

View file

@ -25,7 +25,7 @@ $title = sprintf(_('Albums by %s'), $artist->full_name);
show_box_top(sprintf(gettext('%s by %s'), ucfirst($object_type) ,$artist->f_name),'info-box'); show_box_top(sprintf(gettext('%s by %s'), ucfirst($object_type) ,$artist->f_name),'info-box');
if (Config::get('ratings')) { if (Config::get('ratings')) {
?> ?>
<div id="rating_"<?php echo intval($artist->id); ?>"_artist" style="display:inline;"> <div id="rating_<?php echo intval($artist->id); ?>_artist" style="display:inline;">
<?php show_rating($artist->id, 'artist'); ?> <?php show_rating($artist->id, 'artist'); ?>
</div> </div>
<?php } ?> <?php } ?>
@ -38,7 +38,7 @@ if (Config::get('ratings')) {
<?php echo Ajax::button('?action=basket&type=artist&id=' . $artist->id,'add',_('Add'),'add_' . $artist->id); ?><?php printf(_('Add All Songs By %s'), $artist->f_name); ?> <?php echo Ajax::button('?action=basket&type=artist&id=' . $artist->id,'add',_('Add'),'add_' . $artist->id); ?><?php printf(_('Add All Songs By %s'), $artist->f_name); ?>
</li> </li>
<li> <li>
<?php echo Ajax::button('?action=basket&type=artist_random&id=' . $artist->id,'random',_('Random'),'random_' . $artist->id); ?><?php printf(_('Add Random Songs By %s'), $artist->f_name); ?>> <?php echo Ajax::button('?action=basket&type=artist_random&id=' . $artist->id,'random',_('Random'),'random_' . $artist->id); ?><?php printf(_('Add Random Songs By %s'), $artist->f_name); ?>
</li> </li>
<?php if (Access::check('interface','50')) { ?> <?php if (Access::check('interface','50')) { ?>
<li> <li>
@ -53,7 +53,7 @@ if (Config::get('ratings')) {
<?php } ?> <?php } ?>
<li> <li>
<input type="checkbox" id="show_artist_artCB" <?php echo $string = Browse::get_filter('show_art') ? 'checked="checked"' : ''; ?>/> <?php echo _('Show Art'); ?> <input type="checkbox" id="show_artist_artCB" <?php echo $string = Browse::get_filter('show_art') ? 'checked="checked"' : ''; ?>/> <?php echo _('Show Art'); ?>
<?php echo Ajax::observe('show_artist_artCB','click',Ajax::action('?page=browse&action=browse&key=show_art&value=1','')); ?> <?php echo Ajax::observe('show_artist_artCB','click',Ajax::action('?page=browse&action=browse&key=show_art&value=1&type=album','')); ?>
</ul> </ul>
</div> </div>
<?php show_box_bottom(); ?> <?php show_box_bottom(); ?>

View file

@ -28,7 +28,7 @@ $htmllang = str_replace("_","-",Config::get('lang'));
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo Config::get('site_charset'); ?>" /> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo Config::get('site_charset'); ?>" />
<title><?php echo Config::get('site_title'); ?> - <?php echo _("Album Art"); ?></title> <title><?php echo Config::get('site_title'); ?> - <?php echo _("Album Art"); ?></title>
</head> </head>
<body onLoad="self.resizeTo(document.images[0].width+30, document.images[0].height+70)"> <body onload="self.resizeTo(document.images[0].width+30, document.images[0].height+70)">
<?php <?php
echo "<a href=\"javascript:window.close()\" title=\"" . _('Click to close window') . "\">"; 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() . "\" border=\"0\" alt=\"\" />"; echo "<img src=\"" . Config::get('web_path') . "/image.php?id=" . scrub_out($_GET['id']) . "&amp;sid=" . session_id() . "\" border=\"0\" alt=\"\" />";

View file

@ -24,7 +24,7 @@ show_box_top(_('Create Democratic Playlist')); ?>
<table class="tabledata" cellspacing="0" cellpadding="0"> <table class="tabledata" cellspacing="0" cellpadding="0">
<tr> <tr>
<td><?php echo _('Name'); ?></td> <td><?php echo _('Name'); ?></td>
<td><input type="textbox" name="name" value="" /></td> <td><input type="text" name="name" value="" /></td>
</tr> </tr>
<tr> <tr>
<td><?php echo _('Base Playlist'); ?></td> <td><?php echo _('Base Playlist'); ?></td>
@ -32,7 +32,7 @@ show_box_top(_('Create Democratic Playlist')); ?>
</tr> </tr>
<tr> <tr>
<td><?php echo _('Cooldown Time'); ?></td> <td><?php echo _('Cooldown Time'); ?></td>
<td><input type="textbox" size="4" maxlength="6" name="cooldown" value="5" /><?php echo _('minutes'); ?></td> <td><input type="text" size="4" maxlength="6" name="cooldown" value="5" /><?php echo _('minutes'); ?></td>
</tr> </tr>
<tr> <tr>
<td><?php echo _('Level'); ?></td> <td><?php echo _('Level'); ?></td>

View file

@ -25,9 +25,9 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ampache -- Debug Page</title> <title>Ampache -- Debug Page</title>
<link rel="stylesheet" href="<?php echo Config::get('web_path'); ?>/templates/install.css" type="text/css" media="screen" />
</head> </head>
<body bgcolor="#f0f0f0"> <body bgcolor="#f0f0f0">
<link rel="stylesheet" href="<?php echo Config::get('web_path'); ?>/templates/install.css" type="text/css" media="screen" />
<div id="header"> <div id="header">
<h1>Ampache :: <?php echo _('Access Denied'); ?></h1> <h1>Ampache :: <?php echo _('Access Denied'); ?></h1>
<p>This Event has been logged</p> <p>This Event has been logged</p>

View file

@ -30,7 +30,7 @@
<col id="col_additiontime" /> <col id="col_additiontime" />
</colgroup> </colgroup>
<tr class="th-top"> <tr class="th-top">
<th class="cel_select"><a href="#" onclick="check_select('song'); return false;"><?php echo _('Select'); ?></a></td> <th class="cel_select"><a href="#" onclick="check_select('song'); return false;"><?php echo _('Select'); ?></a></th>
<th class="cel_song"><?php echo _('Title'); ?></th> <th class="cel_song"><?php echo _('Title'); ?></th>
<th class="cel_album"><?php echo _('Album'); ?></th> <th class="cel_album"><?php echo _('Album'); ?></th>
<th class="cel_artist"><?php echo _('Artist'); ?></th> <th class="cel_artist"><?php echo _('Artist'); ?></th>
@ -53,7 +53,7 @@
</tr> </tr>
<?php } ?> <?php } ?>
<tr class="th-bottom"> <tr class="th-bottom">
<th class="cel_select"><a href="#" onclick="check_select('song'); return false;"><?php echo _('Select'); ?></a></td> <th class="cel_select"><a href="#" onclick="check_select('song'); return false;"><?php echo _('Select'); ?></a></th>
<th class="cel_song"><?php echo _('Title'); ?></th> <th class="cel_song"><?php echo _('Title'); ?></th>
<th class="cel_album"><?php echo _('Album'); ?></th> <th class="cel_album"><?php echo _('Album'); ?></th>
<th class="cel_artist"><?php echo _('Artist'); ?></th> <th class="cel_artist"><?php echo _('Artist'); ?></th>

View file

@ -24,7 +24,7 @@
<table class="table-data"> <table class="table-data">
<tr> <tr>
<td><?php echo _('Name'); ?>: </td> <td><?php echo _('Name'); ?>: </td>
<td><input type="textbox" name="name" value="<?php echo scrub_out($access->name); ?>" /></td> <td><input type="text" name="name" value="<?php echo scrub_out($access->name); ?>" /></td>
</tr> </tr>
<tr> <tr>
<td><?php echo _('ACL Type'); ?>: </td> <td><?php echo _('ACL Type'); ?>: </td>
@ -65,7 +65,6 @@
<input type="text" name="key" value="<?php echo scrub_out($access->key); ?>" size="32" maxlength="32" /> <input type="text" name="key" value="<?php echo scrub_out($access->key); ?>" size="32" maxlength="32" />
</td> </td>
</tr> </tr>
</tr>
<tr> <tr>
<td><?php echo _('Level'); ?>:</td> <td><?php echo _('Level'); ?>:</td>
<td> <td>

View file

@ -26,13 +26,13 @@
<tr class="<?php echo flip_class(); ?>"> <tr class="<?php echo flip_class(); ?>">
<td><?php echo _('Name'); ?></td> <td><?php echo _('Name'); ?></td>
<td> <td>
<input type="textbox" name="name" value="<?php echo scrub_out($album->full_name); ?>"> <input type="text" name="name" value="<?php echo scrub_out($album->full_name); ?>">
</td> </td>
</tr> </tr>
<tr class="<?php echo flip_class(); ?>"> <tr class="<?php echo flip_class(); ?>">
<td><?php echo _('Year'); ?></td> <td><?php echo _('Year'); ?></td>
<td> <td>
<input type="textbox" name="year" value="<?php echo scrub_out($album->year); ?>"> <input type="text" name="year" value="<?php echo scrub_out($album->year); ?>">
</td> </td>
</tr> </tr>
<tr class="<?php echo flip_class(); ?>"> <tr class="<?php echo flip_class(); ?>">

View file

@ -24,7 +24,7 @@
<table class="inline-edit" cellpadding="3" cellspacing="0"> <table class="inline-edit" cellpadding="3" cellspacing="0">
<tr> <tr>
<td> <td>
<input type="textbox" name="name" value="<?php echo scrub_out($album->full_name); ?>" /> <input type="text" name="name" value="<?php echo scrub_out($album->full_name); ?>" />
</td> </td>
<td> <td>
<?php <?php
@ -37,7 +37,7 @@
?> ?>
</td> </td>
<td> <td>
<input type="textbox" name="year" value="<?php echo scrub_out($album->year); ?>" /> <input type="text" name="year" value="<?php echo scrub_out($album->year); ?>" />
</td> </td>
<td> <td>
<input type="hidden" name="id" value="<?php echo $album->id; ?>" /> <input type="hidden" name="id" value="<?php echo $album->id; ?>" />

View file

@ -26,7 +26,7 @@
<tr class="<?php echo flip_class(); ?>"> <tr class="<?php echo flip_class(); ?>">
<td><?php echo _('Name'); ?></td> <td><?php echo _('Name'); ?></td>
<td> <td>
<input type="textbox" name="name" value="<?php echo scrub_out($artist->name); ?>"> <input type="text" name="name" value="<?php echo scrub_out($artist->name); ?>">
</td> </td>
</tr> </tr>
<tr class="<?php echo flip_class(); ?>"> <tr class="<?php echo flip_class(); ?>">

View file

@ -24,7 +24,7 @@
<table class="inline-edit" cellpadding="3" cellspacing="0"> <table class="inline-edit" cellpadding="3" cellspacing="0">
<tr> <tr>
<td> <td>
<input type="textbox" name="name" value="<?php echo scrub_out($artist->f_full_name); ?>" /> <input type="text" name="name" value="<?php echo scrub_out($artist->f_full_name); ?>" />
</td> </td>
<td> <td>
<input type="hidden" name="id" value="<?php echo $artist->id; ?>" /> <input type="hidden" name="id" value="<?php echo $artist->id; ?>" />

View file

@ -32,19 +32,19 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<input type="textbox" name="name" value="<?php echo scrub_out($radio->name); ?>" size="9" /> <input type="text" name="name" value="<?php echo scrub_out($radio->name); ?>" size="9" />
</td> </td>
<td> <td>
<input type="textbox" name="url" value="<?php echo scrub_out($radio->url); ?>" size ="12" /> <input type="text" name="url" value="<?php echo scrub_out($radio->url); ?>" size ="12" />
</td> </td>
<td> <td>
<input type="textbox" name="site_url" value="<?php echo scrub_out($radio->site_url); ?>" size="9" /> <input type="text" name="site_url" value="<?php echo scrub_out($radio->site_url); ?>" size="9" />
</td> </td>
<td> <td>
<input type="textbox" name="call_sign" value="<?php echo scrub_out($radio->call_sign); ?>" size="6" /> <input type="text" name="call_sign" value="<?php echo scrub_out($radio->call_sign); ?>" size="6" />
</td> </td>
<td> <td>
<input type="textbox" name="frequency" value="<?php echo scrub_out($radio->frequency); ?>" size="6" /> <input type="text" name="frequency" value="<?php echo scrub_out($radio->frequency); ?>" size="6" />
</td> </td>
<td> <td>
<input type="hidden" name="id" value="<?php echo $radio->id; ?>" /> <input type="hidden" name="id" value="<?php echo $radio->id; ?>" />

View file

@ -24,7 +24,7 @@
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr> <tr>
<td> <td>
<input type="textbox" name="name" size="9" value="<?php echo scrub_out($playlist->name); ?>" /> <input type="text" name="name" size="9" value="<?php echo scrub_out($playlist->name); ?>" />
</td> </td>
<td> <td>
<?php $name = 'select_' . $playlist->type; ${$name} = ' selected="selected"'; ?> <?php $name = 'select_' . $playlist->type; ${$name} = ' selected="selected"'; ?>

View file

@ -24,7 +24,7 @@
<table class="inline-edit" cellpadding="3" cellspacing="0"> <table class="inline-edit" cellpadding="3" cellspacing="0">
<tr> <tr>
<td> <td>
<input type="textbox" name="track" size="3" maxlength="4" value="<?php echo intval($track['track']); ?>" /> <input type="text" name="track" size="3" maxlength="4" value="<?php echo intval($track['track']); ?>" />
</td> </td>
<td class="cel_song"><?php echo $song->f_link; ?></td> <td class="cel_song"><?php echo $song->f_link; ?></td>
<td class="cel_artist"><?php echo $song->f_artist_link; ?></td> <td class="cel_artist"><?php echo $song->f_artist_link; ?></td>

View file

@ -30,7 +30,7 @@
<tr class="<?php echo flip_class(); ?>"> <tr class="<?php echo flip_class(); ?>">
<td><?php echo _('Title'); ?></td> <td><?php echo _('Title'); ?></td>
<td> <td>
<input type="textbox" name="title" value="<?php echo scrub_out($song->title); ?>" size="45" /> <input type="text" name="title" value="<?php echo scrub_out($song->title); ?>" size="45" />
</td> </td>
</tr> </tr>
<tr class="<?php echo flip_class(); ?>"> <tr class="<?php echo flip_class(); ?>">
@ -38,7 +38,7 @@
<td> <td>
<?php show_album_select('album',$song->album); ?> <?php show_album_select('album',$song->album); ?>
<br /><?php echo _('OR'); ?><br /> <br /><?php echo _('OR'); ?><br />
<input type="textbox" name="album_string" value="<?php echo scrub_out($song->get_album_name()); ?>" /> <input type="text" name="album_string" value="<?php echo scrub_out($song->get_album_name()); ?>" />
</td> </td>
</tr> </tr>
<tr class="<?php echo flip_class(); ?>"> <tr class="<?php echo flip_class(); ?>">
@ -46,7 +46,7 @@
<td> <td>
<?php show_artist_select('artist',$song->artist); ?> <?php show_artist_select('artist',$song->artist); ?>
<br /><?php echo _('OR'); ?><br /> <br /><?php echo _('OR'); ?><br />
<input type="textbox" name="artist_string" value="<?php echo scrub_out($song->get_artist_name()); ?>" /> <input type="text" name="artist_string" value="<?php echo scrub_out($song->get_artist_name()); ?>" />
</td> </td>
</tr> </tr>
<tr class="<?php echo flip_class(); ?>"> <tr class="<?php echo flip_class(); ?>">
@ -54,25 +54,25 @@
<td> <td>
<?php show_genre_select('genre',$song->genre); ?> <?php show_genre_select('genre',$song->genre); ?>
<br /><?php echo _('OR'); ?><br /> <br /><?php echo _('OR'); ?><br />
<input type="textbox" name="genre_string" value="<?php echo scrub_out($song->f_genre); ?>" /> <input type="text" name="genre_string" value="<?php echo scrub_out($song->f_genre); ?>" />
</td> </td>
</tr> </tr>
<tr class="<?php echo flip_class(); ?>"> <tr class="<?php echo flip_class(); ?>">
<td><?php echo _('Track'); ?></td> <td><?php echo _('Track'); ?></td>
<td> <td>
<input type="textbox" name="track" value="<?php echo scrub_out($song->track); ?>" size="3" /> <input type="text" name="track" value="<?php echo scrub_out($song->track); ?>" size="3" />
</td> </td>
</tr> </tr>
<tr class="<?php echo flip_class(); ?>"> <tr class="<?php echo flip_class(); ?>">
<td><?php echo _('Year'); ?></td> <td><?php echo _('Year'); ?></td>
<td> <td>
<input type="textbox" name="year" value="<?php echo scrub_out($song->year); ?>" size="5" /> <input type="text" name="year" value="<?php echo scrub_out($song->year); ?>" size="5" />
</td> </td>
</tr> </tr>
<tr class="<?php echo flip_class(); ?>"> <tr class="<?php echo flip_class(); ?>">
<td><?php echo _('Comment'); ?></td> <td><?php echo _('Comment'); ?></td>
<td> <td>
<input type="textbox" name="comment" value="<?php echo scrub_out($song->comment); ?>" size="45" /> <input type="text" name="comment" value="<?php echo scrub_out($song->comment); ?>" size="45" />
</td> </td>
</tr> </tr>
<tr class="<?php echo flip_class(); ?>"> <tr class="<?php echo flip_class(); ?>">

View file

@ -1,7 +1,7 @@
<?php <?php
/* /*
Copyright (c) 2001 - 2008 Ampache.org Copyright (c) Ampache.org
All rights reserved. All rights reserved.
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
@ -22,8 +22,9 @@
<td colspan="8"> <td colspan="8">
<form method="post" id="edit_song_<?php echo $song->id; ?>"> <form method="post" id="edit_song_<?php echo $song->id; ?>">
<table class="inline-edit" cellpadding="3" cellspacing="0"> <table class="inline-edit" cellpadding="3" cellspacing="0">
<tr>
<td> <td>
<input type="textbox" name="title" value="<?php echo scrub_out($song->title); ?>" /> <input type="text" name="title" value="<?php echo scrub_out($song->title); ?>" />
</td> </td>
<td> <td>
<?php show_artist_select('artist',$song->artist,true,$song->id); ?> <?php show_artist_select('artist',$song->artist,true,$song->id); ?>
@ -36,18 +37,14 @@
<?php echo Ajax::observe('album_select_'.$song->id,'change','check_inline_song_edit("album", '.$song->id.')'); ?> <?php echo Ajax::observe('album_select_'.$song->id,'change','check_inline_song_edit("album", '.$song->id.')'); ?>
</td> </td>
<td> <td>
<?php show_genre_select('genre',$song->genre,'',true,$song->id); ?> <input type="text" name="track" size="3" value="<?php echo scrub_out($song->track); ?>" />
<div id="genre_select_song_<?php echo $song->id ?>"></div>
<?php echo Ajax::observe('genre_select_'.$song->id,'change','check_inline_song_edit("genre", '.$song->id.')'); ?>
</td>
<td>
<input type="textbox" name="track" size="3" value="<?php echo scrub_out($song->track); ?>" />
</td> </td>
<td> <td>
<input type="hidden" name="id" value="<?php echo $song->id; ?>" /> <input type="hidden" name="id" value="<?php echo $song->id; ?>" />
<input type="hidden" name="type" value="song" /> <input type="hidden" name="type" value="song" />
<?php echo Ajax::button('?action=edit_object&id=' . $song->id . '&type=song','download',_('Save Changes'),'save_song_' . $song->id,'edit_song_' . $song->id); ?> <?php echo Ajax::button('?action=edit_object&id=' . $song->id . '&type=song','download',_('Save Changes'),'save_song_' . $song->id,'edit_song_' . $song->id); ?>
</td> </td>
</tr>
</table> </table>
</form> </form>
</td> </td>

View file

@ -26,7 +26,7 @@
*/ */
$web_path = Config::get('web_path'); $web_path = Config::get('web_path');
?> ?>
<?php show_box_top(sprintf(_('Viewing %s Genre') $genre->name)); ?> <?php show_box_top(sprintf(_('Viewing %s Genre'), $genre->name)); ?>
[<?php echo $genre->get_album_count(); ?>] [<?php echo $genre->get_album_count(); ?>]
<a href="<?php echo $web_path; ?>/genre.php?action=show_albums&amp;genre_id=<?php echo $genre->id; ?>"> <a href="<?php echo $web_path; ?>/genre.php?action=show_albums&amp;genre_id=<?php echo $genre->id; ?>">
<?php echo _('Albums'); ?></a><br /> <?php echo _('Albums'); ?></a><br />

View file

@ -25,7 +25,7 @@ if (INSTALL != '1') { exit; }
<head> <head>
<title>Ampache :: For The Love Of Music - Install</title> <title>Ampache :: For The Love Of Music - Install</title>
<link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" /> <link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" />
<meta http-equiv="Content-Type" Content="text/html; Charset=<?php echo $charset; ?>" /> <meta http-equiv="Content-Type" content="text/html; Charset=<?php echo $charset; ?>" />
</head> </head>
<body> <body>
<script src="lib/javascript-base.js" language="javascript" type="text/javascript"></script> <script src="lib/javascript-base.js" language="javascript" type="text/javascript"></script>

View file

@ -26,7 +26,7 @@ if (INSTALL != '1') { exit; }
<head> <head>
<title>Ampache :: For The Love Of Music - Install</title> <title>Ampache :: For The Love Of Music - Install</title>
<link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" /> <link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" />
<meta http-equiv="Content-Type" Content="text/html; Charset=<?php echo $charset; ?>" /> <meta http-equiv="Content-Type" content="text/html; Charset=<?php echo $charset; ?>" />
</head> </head>
<body> <body>
<div id="header"> <div id="header">

View file

@ -26,7 +26,7 @@ if (INSTALL != '1') { exit; }
<head> <head>
<title>Ampache :: For The Love Of Music - Install</title> <title>Ampache :: For The Love Of Music - Install</title>
<link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" /> <link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" />
<meta http-equiv="Content-Type" Content="text/html; Charset=<?php echo $charset; ?>" /> <meta http-equiv="Content-Type" content="text/html; Charset=<?php echo $charset; ?>" />
</head> </head>
<body> <body>
<div id="header"> <div id="header">

View file

@ -26,7 +26,7 @@
<head> <head>
<title>Ampache :: Pour l'Amour de la Musique - Install</title> <title>Ampache :: Pour l'Amour de la Musique - Install</title>
<link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" /> <link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" />
<meta http-equiv="Content-Type" Content="text/html; Charset=<?php echo $charset; ?>" /> <meta http-equiv="Content-Type" content="text/html; Charset=<?php echo $charset; ?>" />
</head> </head>
<body> <body>
<script src="lib/javascript-base.js" language="javascript" type="text/javascript"></script> <script src="lib/javascript-base.js" language="javascript" type="text/javascript"></script>

View file

@ -1,7 +1,7 @@
<?php <?php
/* /*
Copyright (c) 2001 - 2007 Ampache.org Copyright (c) Ampache.org
All Rights Reserved All Rights Reserved
this program is free software; you can redistribute it and/or this program is free software; you can redistribute it and/or
@ -21,7 +21,7 @@
*/ */
?> ?>
<?php show_box_top(_('Catalog Statistics')); ?> <i><?php echo _('Catalog Statistics'); ?></i>
<table class="tabledata" cellpadding="3" cellspacing="1"> <table class="tabledata" cellpadding="3" cellspacing="1">
<tr class="th-top"> <tr class="th-top">
<th><?php echo _('Connected Users'); ?></th> <th><?php echo _('Connected Users'); ?></th>
@ -44,4 +44,3 @@
<td><?php echo $stats['time_text']; ?></td> <td><?php echo $stats['time_text']; ?></td>
</tr> </tr>
</table> </table>
<?php show_box_bottom(); ?>

View file

@ -27,7 +27,7 @@
<?php foreach ($fields as $key=>$field) { ?> <?php foreach ($fields as $key=>$field) { ?>
<tr> <tr>
<td><?php echo $field['description']; ?></td> <td><?php echo $field['description']; ?></td>
<td><input type="textbox" name="<?php echo $key; ?>" /></td> <td><input type="text" name="<?php echo $key; ?>" /></td>
</tr> </tr>
<?php } ?> <?php } ?>
</table> </table>

View file

@ -26,7 +26,7 @@
<?php foreach ($fields as $key=>$field) { ?> <?php foreach ($fields as $key=>$field) { ?>
<tr> <tr>
<td><?php echo $field['description']; ?></td> <td><?php echo $field['description']; ?></td>
<td><input type="textbox" name="<?php echo $key; ?>" value="<?php echo scrub_out($instance[$key]); ?>" /></td> <td><input type="text" name="<?php echo $key; ?>" value="<?php echo scrub_out($instance[$key]); ?>" /></td>
</tr> </tr>
<?php } ?> <?php } ?>
</table> </table>

View file

@ -55,11 +55,11 @@ function focus(){ document.login.username.focus(); }
<form name="login" method="post" enctype="multipart/form-data" action="<?php echo Config::get('web_path'); ?>/login.php"> <form name="login" method="post" enctype="multipart/form-data" action="<?php echo Config::get('web_path'); ?>/login.php">
<div class="loginfield" id="usernamefield"> <div class="loginfield" id="usernamefield">
<label for="username"><?php echo _('Login'); ; ?>:</label> <label for="username"><?php echo _('Username'); ?>:</label>
<input class="text_input" type="text" id="username" name="username" value="<?php echo $_REQUEST['username']; ; ?>" /> <input class="text_input" type="text" id="username" name="username" value="<?php echo $_REQUEST['username']; ; ?>" />
</div> </div>
<div class="loginfield" id="passwordfield"> <div class="loginfield" id="passwordfield">
<label for="password"><?php echo _('Password'); ; ?>:</label> <label for="password"><?php echo _('Password'); ?>:</label>
<input class="text_input" type="password" id="password" name="password" value="" /> <input class="text_input" type="password" id="password" name="password" value="" />
</div> </div>
<div class="loginfield" id="remembermefield"><label for="rememberme"> <div class="loginfield" id="remembermefield"><label for="rememberme">

View file

@ -27,7 +27,7 @@ $web_path = Config::get('web_path');
<col id="col_username" /> <col id="col_username" />
<col id="col_sticky" /> <col id="col_sticky" />
<col id="col_comment" /> <col id="col_comment" />
<col id="col_date /> <col id="col_date" />
<col id="col_action" /> <col id="col_action" />
</colgroup> </colgroup>
<tr class="th-top"> <tr class="th-top">

View file

@ -35,7 +35,7 @@ $base_url = '?action=set_rating&rating_type=' . $rating->type . '&object_id=' .
if ($rating->rating <= 0) { if ($rating->rating <= 0) {
echo _('not rated yet') . "</li>\n"; echo _('not rated yet') . "</li>\n";
} }
else printf(_('%s of 5', $rating->preciserating)); echo "</li>\n"; else printf(_('%s of 5'), $rating->preciserating); echo "</li>\n";
for ($i=1; $i<6; $i++) for ($i=1; $i<6; $i++)
{ {

View file

@ -60,7 +60,7 @@ if (is_object($GLOBALS['playlist'])) { ?>
<option value="artist"><?php echo _('Artist'); ?></option> <option value="artist"><?php echo _('Artist'); ?></option>
<option value="year"><?php echo _('Year'); ?></option> <option value="year"><?php echo _('Year'); ?></option>
</select> </select>
<input type="textbox" name="update_value" /> <input type="text" name="update_value" />
<input class="button" type="button" value="<?php echo _('Update'); ?>" onclick="return SubmitToPage('songs','<?php echo $web_path; ?>/admin/flag.php?action=mass_update');" /> <input class="button" type="button" value="<?php echo _('Update'); ?>" onclick="return SubmitToPage('songs','<?php echo $web_path; ?>/admin/flag.php?action=mass_update');" />
</td> </td>
</tr> </tr>

View file

@ -38,7 +38,6 @@
</div> </div>
<?php show_box_bottom(); ?> <?php show_box_bottom(); ?>
<?php <?php
$object_ids = $playlist->get_items();
Browse::set_type('playlist_song'); Browse::set_type('playlist_song');
Browse::add_supplemental_object('playlist',$playlist->id); Browse::add_supplemental_object('playlist',$playlist->id);
Browse::set_static_content(1); Browse::set_static_content(1);

View file

@ -27,16 +27,14 @@ $web_path = Config::get('web_path');
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo Config::get('site_charset'); ?>" /> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo Config::get('site_charset'); ?>" />
<title><?php echo Config::get('site_title'); ?> - <?php echo _('Registration'); ?></title> <title><?php echo Config::get('site_title'); ?> - <?php echo _('Registration'); ?></title>
</head>
<body bgcolor="#f0f0f0">
<link rel="stylesheet" href="<?php echo Config::get('web_path'); ?>/templates/install.css" type="text/css" media="screen" /> <link rel="stylesheet" href="<?php echo Config::get('web_path'); ?>/templates/install.css" type="text/css" media="screen" />
<link rel="shortcut icon" href="<?php echo Config::get('web_path'); ?>/favicon.ico" /> <link rel="shortcut icon" href="<?php echo Config::get('web_path'); ?>/favicon.ico" />
</head>
<body>
<div id="header"> <div id="header">
<h1><?php echo scrub_out(Config::get('site_title')); ?></h1> <h1><?php echo scrub_out(Config::get('site_title')); ?></h1>
<?php echo _('Registration Complete'); ?>... <?php echo _('Registration Complete'); ?>...
</div> </div>
</head>
<body>
<script src="<?php echo $web_path; ?>/lib/javascript-base.js" language="javascript" type="text/javascript"></script> <script src="<?php echo $web_path; ?>/lib/javascript-base.js" language="javascript" type="text/javascript"></script>
<script src="<?php echo $web_path; ?>/modules/kajax/ajax.js" language="javascript" type="text/javascript"></script> <script src="<?php echo $web_path; ?>/modules/kajax/ajax.js" language="javascript" type="text/javascript"></script>
<script src="<?php echo $web_path; ?>/modules/prototype/prototype.js" language="javascript" type="text/javascript"></script> <script src="<?php echo $web_path; ?>/modules/prototype/prototype.js" language="javascript" type="text/javascript"></script>

View file

@ -19,23 +19,9 @@
*/ */
?> ?>
<div id="recent_added"> <i><?php echo _('Newest Albums'); ?></i>
<?php <?php $object_ids = Stats::get_newest('album'); ?>
$objects = Stats::get_newest('album'); <?php require_once Config::get('prefix') . '/templates/show_albums.inc.php'; ?>
$headers = array('f_link'=>_('Newest Albums')); <?php $object_ids = Stats::get_newest('artist'); ?>
show_box_top('','info-box box_newest_albums'); <i><?php echo _('Newest Artists'); ?></i>
require Config::get('prefix') . '/templates/show_objects.inc.php'; <?php require_once Config::get('prefix') . '/templates/show_artists.inc.php'; ?>
show_box_bottom();
$objects = Stats::get_newest('artist');
$headers = array('f_name_link'=>_('Newest Artists'));
show_box_top('','info-box box_newest_artists');
require Config::get('prefix') . '/templates/show_objects.inc.php';
show_box_bottom();
$objects = Stats::get_newest('genre');
$headers = array('f_link'=>_('Newest Genres'));
show_box_top('','info-box box_newest_genres');
require Config::get('prefix') . '/templates/show_objects.inc.php';
show_box_bottom();
?>
</div>

View file

@ -1,7 +1,7 @@
<?php <?php
/* /*
Copyright (c) 2001 - 2007 Ampache.org Copyright (c) Ampache.org
All rights reserved. All rights reserved.
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
@ -33,10 +33,5 @@
require Config::get('prefix') . '/templates/show_objects.inc.php'; require Config::get('prefix') . '/templates/show_objects.inc.php';
show_box_bottom(); show_box_bottom();
$objects = Stats::get_top('genre');
$headers = array('f_link'=>_('Most Popular Genres'));
show_box_top('','info-box box_popular_genres');
require Config::get('prefix') . '/templates/show_objects.inc.php';
show_box_bottom();
?> ?>
</div> </div>

View file

@ -21,56 +21,3 @@
*/ */
$web_path = Config::get('web_path'); $web_path = Config::get('web_path');
?> ?>
<?php show_box_top('', 'info-box');
/* make a map id->name
$tagbyid = array();
foreach ($tagcloudList as $f)
$tagbyid[$f['id']] = $f;
$ar = $_GET;
unset($ar['tag']);
$base = rebuild_query($ar);
$currentTags = array_fill_keys($_SESSION['browse']['filter']['tag'], '1');
$filter=0;
foreach ($_SESSION['browse']['filter']['tag'] as $t) {
if (!$filter) {
$filter = 1;
echo _('Filters(remove): ');
}
$ctags = $currentTags;
unset($ctags[$t]);
$stags = implode(',', array_keys($ctags));
$col = 'black';
$alt = '';
if (isset($tagbyid[$t]['color'])) {
$col = $tagbyid[$t]['color'];
$alt = ' title="owner: '. $tagbyid[$t]['username'].'" ';
}
echo '<a style="color:'. $col.'"'.$alt .' href="' .$base
. 'tag='.$stags.'">'.$tagbyid[$t]['name'].'</a> ';
}
echo '<br/>';
$filter = 0;
foreach ($tagcloudList as $f) {
$n = $f['name'];
$id = $f['id'];
if (!$currentTags[$id]) {
if (!$filter) {
$filter = 1;
echo _('Matching tags: ');
}
$ctags = $currentTags;
$ctags[$id] = 1;
$stags = implode(',', array_keys($ctags));
$col = 'black';
$alt = '';
if (isset($f['color'])) {
$col = $f['color'];
$alt = ' title="owner: '. $f['username'].'" ';
}
echo '<a style="color:'.$col.'"'.$alt.' href="' .$base
. 'tag='.$stags.'">'.$n.'</a> ';
}
}
*/
?>
<?php show_box_bottom(); ?>

View file

@ -25,13 +25,14 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ampache -- Debug Page</title> <title>Ampache -- Debug Page</title>
<link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" />
</head> </head>
<body bgcolor="#f0f0f0"> <body bgcolor="#f0f0f0">
<link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" />
<div id="header"> <div id="header">
<h1><?php echo _('Ampache Debug'); ?></h1> <h1><?php echo _('Ampache Debug'); ?></h1>
<p><?php echo _('You\'ve reached this page because a configuration error has occured. Debug Information below'); ?></p> <p><?php echo _('You\'ve reached this page because a configuration error has occured. Debug Information below'); ?></p>
</div> </div>
<div>
<table align="center" cellpadding="3" cellspacing="0"> <table align="center" cellpadding="3" cellspacing="0">
<tr> <tr>
<td><font size="+1"><?php echo _('CHECK'); ?></font></td> <td><font size="+1"><?php echo _('CHECK'); ?></font></td>
@ -246,7 +247,7 @@
} }
$results['web_path'] = $http_type . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . Config::get('web_path'); $results['web_path'] = $http_type . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . Config::get('web_path');
if ($status['parse_config']) { if ($status['parse_config']) {
echo "<img src=\"" . $results['web_path'] ."/images/ampache.png\" width=\"80\" height=\"15\"/>"; echo "&nbsp;&nbsp;&nbsp;<img src=\"" . $results['web_path'] ."/images/icon_enable.png\" />&nbsp;&nbsp;&nbsp;";
} }
else { else {
$status['check_webpath'] = false; $status['check_webpath'] = false;
@ -257,15 +258,15 @@
] ]
</td> </td>
<td> <td>
This test makes sure that your web_path variable is set correctly and that we are able to get to the index page. If you do not see the ampache This test makes sure that your web_path variable is set correctly and that we are able to get to the index page. If you do not see a check mark
logo here then your web_path is not set correctly. here then your web_path is not set correctly.
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="bottom"> <div id="bottom">
<p><strong>Ampache Debug.</strong><br /> <p><strong>Ampache Debug.</strong><br />
For the love of Music.</p> Pour l'Amour de la Musique.</p>
</div> </div>
</body> </body>
</html> </html>

View file

@ -25,8 +25,6 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ampache -- Config Debug Page</title> <title>Ampache -- Config Debug Page</title>
</head>
<body bgcolor="#f0f0f0">
<link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" /> <link rel="stylesheet" href="templates/install.css" type="text/css" media="screen" />
<style type="text/css"> <style type="text/css">
body { body {
@ -36,6 +34,8 @@ body {
padding-left: 10px; padding-left: 10px;
} }
</style> </style>
</head>
<body bgcolor="#f0f0f0">
<div id="header"> <div id="header">
<h1><?php echo _('Ampache Debug'); ?></h1> <h1><?php echo _('Ampache Debug'); ?></h1>
<p>Ampache.cfg.php error detected</p> <p>Ampache.cfg.php error detected</p>
@ -47,7 +47,7 @@ If you are upgrading from 3.3.x please see the directions below.</p>
<h3>Migrating from 3.3.x to 3.4.x</h3> <h3>Migrating from 3.3.x to 3.4.x</h3>
<p>Ampache 3.4 uses a different config parser that is over 10x faster then the previous version. Unfortunately the new parser is <p>Ampache 3.4 uses a different config parser that is over 10x faster then the previous version. Unfortunately the new parser is
unable to read the old config files. You must run <strong>php /bin/migrate_config.inc</strong> from the command line to create your unable to read the old config files. From inside the Ampache root directory you must run <strong>php bin/migrate_config.inc</strong> from the command line to create your
new config file.</p> new config file.</p>
<p>The following settings will not be migrated by the <strong>migrate_config.inc</strong> script due to major changes between versions. The default <p>The following settings will not be migrated by the <strong>migrate_config.inc</strong> script due to major changes between versions. The default
@ -75,7 +75,7 @@ This variable no longer exists, all downsampling/transcoding is handled by the t
</div> </div>
<div id="bottom"> <div id="bottom">
<p><strong>Ampache Debug.</strong><br /> <p><strong>Ampache Debug.</strong><br />
For the love of Music.</p> Pour l'Amour de la Musique.</p>
</div> </div>
</body> </body>
</html> </html>

View file

@ -27,16 +27,15 @@ $web_path = Config::get('web_path');
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo Config::get('site_charset'); ?>" /> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo Config::get('site_charset'); ?>" />
<title><?php echo Config::get('site_title'); ?> - <?php echo _('Registration'); ?></title> <title><?php echo Config::get('site_title'); ?> - <?php echo _('Registration'); ?></title>
</head>
<body bgcolor="#f0f0f0">
<link rel="stylesheet" href="<?php echo Config::get('web_path'); ?>/templates/install.css" type="text/css" media="screen" /> <link rel="stylesheet" href="<?php echo Config::get('web_path'); ?>/templates/install.css" type="text/css" media="screen" />
<link rel="shortcut icon" href="<?php echo Config::get('web_path'); ?>/favicon.ico" /> <link rel="shortcut icon" href="<?php echo Config::get('web_path'); ?>/favicon.ico" />
</head>
<body>
<div id="header"> <div id="header">
<h1><?php echo Config::get('site_title'); ?></h1> <h1><?php echo Config::get('site_title'); ?></h1>
<?php echo _('Registration'); ?>... <?php echo _('Registration'); ?>...
</div> </div>
</head>
<body>
<script src="<?php echo $web_path; ?>/lib/javascript-base.js" language="javascript" type="text/javascript"></script> <script src="<?php echo $web_path; ?>/lib/javascript-base.js" language="javascript" type="text/javascript"></script>
<script src="<?php echo $web_path; ?>/modules/kajax/ajax.js" language="javascript" type="text/javascript"></script> <script src="<?php echo $web_path; ?>/modules/kajax/ajax.js" language="javascript" type="text/javascript"></script>
<script src="<?php echo $web_path; ?>/modules/prototype/prototype.js" language="javascript" type="text/javascript"></script> <script src="<?php echo $web_path; ?>/modules/prototype/prototype.js" language="javascript" type="text/javascript"></script>
@ -48,7 +47,8 @@ $web_path = Config::get('web_path');
?> ?>
<h3><?php echo _('User Activated'); ?></h3> <h3><?php echo _('User Activated'); ?></h3>
<p> <p>
<?php printf(_('This User ID is activated and can be used %sLogin%s'), '<a href="' . Config::get('web_path'). '/login.php">', '</a>'); ?></a> <?php
printf(_('This User ID is activated and can be used %sLogin%s'), '<a href="' . Config::get('web_path'). '/login.php">', '</a>'); ?>
</p> </p>
<?php } else { ?> <?php } else { ?>
<h3><?php echo _('Validation Failed'); ?></h3> <h3><?php echo _('Validation Failed'); ?></h3>

View file

@ -27,16 +27,14 @@ $web_path = Config::get('web_path');
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo Config::get('site_charset'); ?>" /> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo Config::get('site_charset'); ?>" />
<title><?php echo Config::get('site_title'); ?> - <?php echo _('Registration'); ?></title> <title><?php echo Config::get('site_title'); ?> - <?php echo _('Registration'); ?></title>
</head>
<body bgcolor="#f0f0f0">
<link rel="stylesheet" href="<?php echo Config::get('web_path'); ?>/templates/install.css" type="text/css" media="screen" /> <link rel="stylesheet" href="<?php echo Config::get('web_path'); ?>/templates/install.css" type="text/css" media="screen" />
<link rel="shortcut icon" href="<?php echo Config::get('web_path'); ?>/favicon.ico" /> <link rel="shortcut icon" href="<?php echo Config::get('web_path'); ?>/favicon.ico" />
</head>
<body>
<div id="header"> <div id="header">
<h1><?php echo scrub_out(Config::get('site_title')); ?></h1> <h1><?php echo scrub_out(Config::get('site_title')); ?></h1>
<?php echo _('Registration'); ?>... <?php echo _('Registration'); ?>...
</div> </div>
</head>
<body>
<script src="<?php echo $web_path; ?>/lib/javascript-base.js" language="javascript" type="text/javascript"></script> <script src="<?php echo $web_path; ?>/lib/javascript-base.js" language="javascript" type="text/javascript"></script>
<script src="<?php echo $web_path; ?>/modules/kajax/ajax.js" language="javascript" type="text/javascript"></script> <script src="<?php echo $web_path; ?>/modules/kajax/ajax.js" language="javascript" type="text/javascript"></script>
<script src="<?php echo $web_path; ?>/modules/prototype/prototype.js" language="javascript" type="text/javascript"></script> <script src="<?php echo $web_path; ?>/modules/prototype/prototype.js" language="javascript" type="text/javascript"></script>
@ -62,7 +60,7 @@ if (Config::get('user_agreement')) { ?>
</tr> </tr>
<tr> <tr>
<td> <td>
<input type='checkbox' name='accept_agreement'> <?php echo _('I Accept'); ?> <input type='checkbox' name='accept_agreement' /> <?php echo _('I Accept'); ?>
<?php Error::display('user_agreement'); ?> <?php Error::display('user_agreement'); ?>
</td> </td>
</tr> </tr>

View file

@ -20,7 +20,7 @@
*/ */
show_box_top(); show_box_top();
printf(_('Updating the %s catalog', "<strong>[ $catalog->name ]</strong>")); printf(_('Updating the %s catalog'), "<strong>[ $catalog->name ]</strong>");
echo "<br />\n" . $number . " " . _('songs found checking tag information.') . "<br />\n\n"; echo "<br />\n" . $number . " " . _('songs found checking tag information.') . "<br />\n\n";
echo _('Verifed') . ":<span id=\"verify_count_$catalog_id\">$catalog_verify_found</span><br />"; echo _('Verifed') . ":<span id=\"verify_count_$catalog_id\">$catalog_verify_found</span><br />";
echo _('Reading') . ":<span id=\"verify_dir_$catalog_id\">$catalog_verify_directory</span><br />"; echo _('Reading') . ":<span id=\"verify_dir_$catalog_id\">$catalog_verify_directory</span><br />";

View file

@ -43,7 +43,7 @@ $ajax_info = Config::get('ajax_url'); $web_path = Config::get('web_path');
<?php if (in_array('starts_with',$allowed_filters)) { ?> <?php if (in_array('starts_with',$allowed_filters)) { ?>
<form id="multi_alpha_filter_form" method="post" action="javascript:void(0);"> <form id="multi_alpha_filter_form" method="post" action="javascript:void(0);">
<label id="multi_alpha_filterLabel" for="multi_alpha_filter"><?php echo _('Starts With'); ?></label> <label id="multi_alpha_filterLabel" for="multi_alpha_filter"><?php echo _('Starts With'); ?></label>
<input type="textbox" id="multi_alpha_filter" name="multi_alpha_filter" value="<?php echo scrub_out(Browse::get_filter('starts_with')); ?>" onKeyUp="DelayRun(this,'400','ajaxState','<?php echo Config::get('ajax_url'); ?>?page=browse&action=browse&type=<?php echo Browse::get_type(); ?>&key=starts_with','multi_alpha_filter');"> <input type="text" id="multi_alpha_filter" name="multi_alpha_filter" value="<?php echo scrub_out(Browse::get_filter('starts_with')); ?>" onKeyUp="DelayRun(this,'400','ajaxState','<?php echo Config::get('ajax_url'); ?>?page=browse&action=browse&type=<?php echo Browse::get_type(); ?>&key=starts_with','multi_alpha_filter');">
</form> </form>
<?php } // end if alpha_match ?> <?php } // end if alpha_match ?>
<?php if (in_array('minimum_count',$allowed_filters)) { ?> <?php if (in_array('minimum_count',$allowed_filters)) { ?>

View file

@ -1,6 +1,6 @@
/* /*
Copyright (c) 2001 - 2007 Ampache.org Copyright (c) Ampache.org
All rights reserved. All rights reserved.
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or

View file

@ -1,6 +1,6 @@
/* /*
Copyright (c) 2001 - 2006 Ampache.org Copyright (c) Ampache.org
All rights reserved. All rights reserved.
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or

View file

@ -49,11 +49,11 @@ $htmllang = str_replace("_","-",Config::get('lang'));
<body> <body>
<div id="header"> <div id="header">
<h1><?php echo _('Ampache Update'); ?></h1> <h1><?php echo _('Ampache Update'); ?></h1>
<p>For the love of Music</p> <p>Pour l'Amour de la Musique.</p>
</div> </div>
<div id="text-box"> <div id="text-box">
<div class="notify"> <div class="notify">
This page handles all database updates to Ampache starting with 3.3.3.5. According to your database your current version is: <?php echo Update::format_version($version); ; ?>. This page handles all database updates to Ampache starting with <strong>3.3.3.5</strong>. According to your database your current version is: <strong><?php echo Update::format_version($version); ; ?></strong>.
the following updates need to be performed<br /><br /> the following updates need to be performed<br /><br />
<div style="font-size:1.2em;font-weight:bold;text-align:center;"><?php Error::display('general'); ?></div> <div style="font-size:1.2em;font-weight:bold;text-align:center;"><?php Error::display('general'); ?></div>
</div> </div>
@ -61,7 +61,7 @@ the following updates need to be performed<br /><br />
<?php Update::display_update(); ?> <?php Update::display_update(); ?>
<form method="post" enctype="multipart/form-data" action="<?php echo Config::get('web_path'); ?>/update.php?action=update"> <form method="post" enctype="multipart/form-data" action="<?php echo Config::get('web_path'); ?>/update.php?action=update">
<?php if (Update::need_update()) { ?><input type="submit" value="Update Now!" /> <?php } ?> <?php if (Update::need_update()) { ?><input type="submit" value="<?php echo _('Update Now!'); ?>" /> <?php } ?>
</form> </form>
</div> </div>
<div id="bottom"> <div id="bottom">