diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-01-27 19:16:01 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-01-27 19:16:01 +0000 |
commit | 21871e8d17385885961c9b0319757f259bdb6f74 (patch) | |
tree | d526236b4ff7b97bc78d666281537bf8b8b337f1 | |
parent | f9831bdcd090dbf67ab7262f1e0fcef58ec1e880 (diff) | |
download | ampache-21871e8d17385885961c9b0319757f259bdb6f74.tar.gz ampache-21871e8d17385885961c9b0319757f259bdb6f74.tar.bz2 ampache-21871e8d17385885961c9b0319757f259bdb6f74.zip |
added in the rating images from greengeek, removed some useless functions, tweaked working on update to correctly reflect limitations
-rwxr-xr-x | docs/CHANGELOG | 1 | ||||
-rw-r--r-- | images/ratings/x.gif | bin | 873 -> 866 bytes | |||
-rw-r--r-- | images/ratings/x_off.gif | bin | 873 -> 866 bytes | |||
-rw-r--r-- | lib/class/rating.class.php | 2 | ||||
-rw-r--r-- | lib/general.lib.php | 20 | ||||
-rw-r--r-- | lib/ui.lib.php | 147 | ||||
-rw-r--r-- | templates/show_object_rating.inc.php | 2 | ||||
-rw-r--r-- | update.php | 4 |
8 files changed, 5 insertions, 171 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 962a5b76..abe0eabc 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,7 @@ -------------------------------------------------------------------------- v.3.4-Beta2 + - Added new rating images (Thx greengeek) - Added check for old database versions, prevent upgrade if too old - Fixed issue with user creation (Thx yoog) - Fixed Now Playing refresh diff --git a/images/ratings/x.gif b/images/ratings/x.gif Binary files differindex de7140ff..1b46f290 100644 --- a/images/ratings/x.gif +++ b/images/ratings/x.gif diff --git a/images/ratings/x_off.gif b/images/ratings/x_off.gif Binary files differindex f815d7e8..4edbf8c1 100644 --- a/images/ratings/x_off.gif +++ b/images/ratings/x_off.gif diff --git a/lib/class/rating.class.php b/lib/class/rating.class.php index f981fc4e..14c13753 100644 --- a/lib/class/rating.class.php +++ b/lib/class/rating.class.php @@ -1,7 +1,7 @@ <?php /* - Copyright (c) 2001 - 2007 Ampache.org + Copyright (c) 2001 - 2008 Ampache.org All rights reserved. This program is free software; you can redistribute it and/or diff --git a/lib/general.lib.php b/lib/general.lib.php index f79153b7..e43736e5 100644 --- a/lib/general.lib.php +++ b/lib/general.lib.php @@ -231,26 +231,6 @@ function set_memory_limit($new_limit) { } // set_memory_limit -/** - * cleanup_and_exit - * used specificly for the play/index.php file - * this functions nukes now playing and then exits - * @package Streaming - * @catagory Clean - */ -function cleanup_and_exit($playing_id) { - - /* Clear now playing */ - // 900 = 15 min - $expire = time() - 900; - $sql = "DELETE FROM now_playing WHERE now_playing.id='$lastid' OR now_playing.start_time < $expire"; - - $db_results = @mysql_query($sql, dbh()); - - exit(); - -} // cleanup_and_exit - /** * get_global_popular * this function gets the current globally popular items diff --git a/lib/ui.lib.php b/lib/ui.lib.php index ed208f34..68092b71 100644 --- a/lib/ui.lib.php +++ b/lib/ui.lib.php @@ -201,143 +201,6 @@ function show_footer() { } // show_footer /** - * show_play_selected - * this shows the playselected/add to playlist - * box, which includes a little javascript - */ -function show_play_selected() { - - require (conf('prefix') . "/templates/show_play_selected.inc.php"); - -} // show_play_selected - -/* - * Artist Ratings - Implemented by SoundOfEmotion - * - * set_artist_rating() - * - * check to see if the ratings exist - * if they do: update them - * if they don't: insert them - * - */ -function set_artist_rating ($artist_id, $rate_user, $rating) { - $artist_id = sql_escape($artist_id); - - $sql = "SELECT * FROM ratings WHERE user='$rate_user' AND object_type='artist' AND object_id='$artist_id'"; - $db_result = mysql_query( $sql, dbh() ); - $r = mysql_fetch_row( $db_result ); - - if($r[0]) { - $sql2 = "UPDATE ratings SET user_rating='$rating' WHERE object_id='$artist_id' AND user='$rate_user' AND object_type='artist'"; - $db_result2 = mysql_query( $sql2, dbh() ); - $r = mysql_fetch_row( $db_result2 ); - return mysql_insert_id( dbh() ); - } - else if(!$r[0]) { - $sql2 = "INSERT INTO ratings (id,user,object_type,object_id,user_rating) ". - "VALUES ('','$rate_user','artist','$artist_id','$rating')"; - $db_result2 = mysql_query( $sql2, dbh() ); - return mysql_insert_id(dbh() ); - } - else{ - return "NA"; - } -} // set_artist_rating() - -/* - * Album Ratings - Implemented by SoundOfEmotion - * - * set_album_rating() - * - * check to see if the ratings exist - * if they do: update them - * if they don't: insert them - * - */ - -function set_album_rating($album_id, $rate_user, $rating) { - $album_id = sql_escape($album_id); - - $sql = "SELECT * FROM ratings WHERE user='$rate_user' AND object_type='album' AND object_id='$album_id'"; - $db_result = mysql_query( $sql, dbh() ); - $r = mysql_fetch_row( $db_result ); - - if($r[0]) { - $sql2 = "UPDATE ratings SET user_rating='$rating' WHERE object_id='$album_id' AND user='$rate_user' AND object_type='album'"; - $db_result2 = mysql_query( $sql2, dbh() ); - return mysql_insert_id( dbh() ); - } - else if(!$r[0]) { - $sql2 = "INSERT INTO ratings (id,user,object_type,object_id,user_rating) ". - "VALUES ('','$rate_user','album','$album_id','$rating')"; - $db_result2 = mysql_query( $sql2, dbh() ); - return mysql_insert_id( dbh() ); - } - else{ - return "NA"; - } -} // set_album_rating() - -/* - * Song Ratings - Implemented by SoundOfEmotion - * - * set_song_rating() - * - * check to see if the ratings exist - * if they do: update them - * if they don't: insert them - * - */ - -function set_song_rating($song_id, $rate_user, $rating) { - $song_id = sql_escape($song_id); - - $sql = "SELECT * FROM ratings WHERE user='$rate_user' AND object_type='song' AND object_id='$song_id'"; - $db_result = mysql_query( $sql, dbh() ); - $r = mysql_fetch_row( $db_result ); - - if($r[0]){ - $sql2 = "UPDATE ratings SET user_rating='$rating' WHERE object_id='$song_id' AND user='$rate_user' AND object_type='song'"; - $db_result2 = mysql_query( $sql2, dbh() ); - return mysql_insert_id( dbh() ); - } - else if(!$r[0]){ - $sql2 = "INSERT INTO ratings (id,user,object_type,object_id,user_rating) ". - "VALUES ('','$rate_user','song','$song_id','$rating')"; - $db_result2 = mysql_query( $sql2, dbh() ); - return mysql_insert_id( dbh() ); - } - else{ - return "NA"; - } -} // set_song_rating() - -/** - * show_page_footer - * adds page footer including html and body end tags - * @param $menu menu item to highlight - * @param $admin_menu admin menu item to highlight - * @param $display_menu display menu or not (1 on 0 off) - * @package Web Interface - * @catagory Display - */ -function show_page_footer($menu="Home", $admin_menu='', $display_menu=0) { - - if ($display_menu){ - if($menu == 'Admin'){ - show_admin_menu($admin_menu); - } // end if admin - - show_menu_items($menu); - - } // end if - - show_template('footer'); - -} // show_page_footer - -/** * img_resize * this automaticly resizes the image for thumbnail viewing * only works on gif/jpg/png this function also checks to make @@ -599,16 +462,6 @@ function good_email($email) { } //good_email /** - * show_playlist_import - * This shows the playlist import templates - */ -function show_playlist_import() { - - require (conf('prefix') . '/templates/show_import_playlist.inc.php'); - -} // show_playlist_import - -/** * show_album_select * This displays a select of every album that we've got in Ampache, (it can be hella long) it's used * by the Edit page, it takes a $name and a $album_id diff --git a/templates/show_object_rating.inc.php b/templates/show_object_rating.inc.php index ea3a22ba..e028b89f 100644 --- a/templates/show_object_rating.inc.php +++ b/templates/show_object_rating.inc.php @@ -1,6 +1,6 @@ <?php /* - Copyright 2001 - 2007 Ampache.org + Copyright 2001 - 2008 Ampache.org All Rights Reserved This program is free software; you can redistribute it and/or @@ -44,7 +44,7 @@ $htmllang = str_replace("_","-",Config::get('lang')); <link rel="shortcut icon" href="<?php echo Config::get('web_path'); ?>/favicon.ico" /> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo Config::get('site_charset'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo Config::get('web_path') . '/templates/install.css'; ?>" /> -<title>Ampache - Update</title> +<title><?php echo _('Ampache Update'); ?></title> </head> <body> <div id="header"> @@ -53,7 +53,7 @@ $htmllang = str_replace("_","-",Config::get('lang')); </div> <div id="text-box"> <div class="notify"> -This page handles all database updates to Ampache starting with 3.2. According to your database your current version is: <?php echo Update::format_version($version); ; ?>. +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); ; ?>. 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> |