summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpb1dft <pb1dft@ampache>2007-02-26 19:26:35 +0000
committerpb1dft <pb1dft@ampache>2007-02-26 19:26:35 +0000
commite32e9e320e89865a90343609479050499c00c922 (patch)
tree0de13c3fbb91eb78db3cd1c7cf0bc546f343c9f4
parent1681e9eef3af7099c50e33e5e632ca9b047d0d84 (diff)
downloadampache-e32e9e320e89865a90343609479050499c00c922.tar.gz
ampache-e32e9e320e89865a90343609479050499c00c922.tar.bz2
ampache-e32e9e320e89865a90343609479050499c00c922.zip
Base plugin files/changes for Rio Player
-rw-r--r--lib/preferences.php2
-rw-r--r--modules/plugins/RioPlayer.plugin.php87
2 files changed, 89 insertions, 0 deletions
diff --git a/lib/preferences.php b/lib/preferences.php
index 62781048..ffaad2b1 100644
--- a/lib/preferences.php
+++ b/lib/preferences.php
@@ -251,6 +251,8 @@ function create_preference_input($name,$value) {
case 'allow_localplay_playback':
case 'demo_mode':
case 'condPL':
+ case 'rio_track_stats':
+ case 'rio_global_stats':
case 'direct_link':
if ($value == '1') { $is_true = "selected=\"selected\""; }
else { $is_false = "selected=\"selected\""; }
diff --git a/modules/plugins/RioPlayer.plugin.php b/modules/plugins/RioPlayer.plugin.php
new file mode 100644
index 00000000..f6dae7c3
--- /dev/null
+++ b/modules/plugins/RioPlayer.plugin.php
@@ -0,0 +1,87 @@
+<?php
+/*
+
+ Copyright (c) 2001 - 2006 Ampache.org
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License 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.
+
+*/
+
+class AmpacheRioPlayer {
+
+ var $name ='Rio Player';
+ var $description ='Sets up ampache so a Rio Player can access it';
+ var $url ='';
+ var $version ='000001';
+ var $min_ampache ='333001';
+ var $max_ampache ='333005';
+
+ /**
+ * Constructor
+ * This function does nothing...
+ */
+ function PluginRioPlayer() {
+
+ return true;
+
+ } // PluginLastfm
+
+ /**
+ * install
+ * This is a required plugin function it inserts the required preferences
+ * into Ampache
+ */
+ function install() {
+
+ /* We need to insert the new preferences */
+
+ $sql = "INSERT INTO preferences (`name`,`value`,`description`,`level`,`type`,`catagory`) " .
+ "VALUES ('rio_querylimit','3000','Rio Player Query Limit','100','integer','system')";
+ $db_results = mysql_query($sql,dbh());
+
+ $sql = "INSERT INTO preferences (`name`,`value`,`description`,`level`,`type`,`catagory`) " .
+ "VALUES ('rio_track_stats','0','Rio Player Track Stats','100','boolean','system')";
+ $db_results = mysql_query($sql,dbh());
+
+ $sql = "INSERT INTO preferences (`name`,`value`,`description`,`level`,`type`,`catagory`) " .
+ "VALUES ('rio_user','','Rio Player Global User','100','string','system')";
+ $db_results = mysql_query($sql,dbh());
+
+ $sql = "INSERT INTO preferences (`name`,`value`,`description`,`level`,`type`,`catagory`) " .
+ "VALUES ('rio_global_stats','0','Rio Player Group Stats','100','boolean','system')";
+ $db_results = mysql_query($sql,dbh());
+
+ fix_all_users_prefs();
+
+ } // install
+
+ /**
+ * uninstall
+ * This is a required plugin function it removes the required preferences from
+ * the database returning it to its origional form
+ */
+ function uninstall() {
+
+ /* We need to remove the preivously added preferences */
+
+ $sql = "DELETE FROM preferences WHERE name='rio_querylimit' OR name='rio_track_stats' OR name='rio_user' OR name='rio_global_stats'";
+ $db_results = mysql_query($sql,dbh());
+
+ fix_all_users_prefs();
+
+ } // uninstall
+
+} // end AmpacheRioPlayer
+?>