librefm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Librefm-commits] [1276] Remove '?>' from config.php; make Free_Scrobble


From: Toby Inkster
Subject: [Librefm-commits] [1276] Remove '?>' from config.php; make Free_Scrobbles verses Scrobbles configurable.
Date: Thu, 07 May 2009 13:02:32 +0000

Revision: 1276
          http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1276
Author:   tobyink
Date:     2009-05-07 13:02:32 +0000 (Thu, 07 May 2009)
Log Message:
-----------
Remove '?>' from config.php; make Free_Scrobbles verses Scrobbles configurable.

Modified Paths:
--------------
    trunk/gnukebox/install.php
    trunk/nixtape/artist.php
    trunk/nixtape/data/Group.php
    trunk/nixtape/data/TagCloud.php
    trunk/nixtape/edit_group.php
    trunk/nixtape/explore.php
    trunk/nixtape/group.php
    trunk/nixtape/index.php
    trunk/nixtape/install.php
    trunk/nixtape/listen.php
    trunk/nixtape/track.php
    trunk/nixtape/user-edit.php
    trunk/nixtape/user-groups.php
    trunk/nixtape/user-journal.php
    trunk/nixtape/user-profile.php
    trunk/nixtape/user-recent-tracks.php
    trunk/nixtape/user-stats.php

Property Changed:
----------------
    trunk/gnukebox/
    trunk/nixtape/
    trunk/nixtape/themes/librefm/templates_c/


Property changes on: trunk/gnukebox
___________________________________________________________________
Added: svn:ignore
   + config.php


Modified: trunk/gnukebox/install.php
===================================================================
--- trunk/gnukebox/install.php  2009-05-07 12:25:34 UTC (rev 1275)
+++ trunk/gnukebox/install.php  2009-05-07 13:02:32 UTC (rev 1276)
@@ -315,7 +315,7 @@
        $install_path = dirname(__FILE__) . "/";
 
        //Write out the configuration
-       $config = "<?php\n \$config_version = " . $version .";\n 
\$connect_string = '" . $connect_string . "';\n \$submissions_server = '" . 
$submissions_server . "';\n\$install_path = '" . $install_path . "'; ?>";
+       $config = "<?php\n \$config_version = " . $version .";\n 
\$connect_string = '" . $connect_string . "';\n \$submissions_server = '" . 
$submissions_server . "';\n\ $install_path = '" . $install_path . "'; ";
 
        $conf_file = fopen("config.php", "w");
        $result = fwrite($conf_file, $config);


Property changes on: trunk/nixtape
___________________________________________________________________
Modified: svn:ignore
   - config.php

   + config.php
smarty
adodb


Modified: trunk/nixtape/artist.php
===================================================================
--- trunk/nixtape/artist.php    2009-05-07 12:25:34 UTC (rev 1275)
+++ trunk/nixtape/artist.php    2009-05-07 13:02:32 UTC (rev 1276)
@@ -32,7 +32,7 @@
 $smarty->assign("id", $artist->id);
 $smarty->assign("bio_summary", $artist->bio_summary);
 
-$aTagCloud = TagCloud::GenerateTagCloud('Free_Scrobbles', 'artist');
+$aTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable(), 'artist');
 if (!PEAR::isError ($aTagCloud)) {
         $smarty->assign('tagcloud', $aTagCloud);
 }

Modified: trunk/nixtape/data/Group.php
===================================================================
--- trunk/nixtape/data/Group.php        2009-05-07 12:25:34 UTC (rev 1275)
+++ trunk/nixtape/data/Group.php        2009-05-07 13:02:32 UTC (rev 1276)
@@ -318,7 +318,7 @@
 
        function tagCloudData () {
                return TagCloud::generateTagCloud(
-                       'Scrobbles INNER JOIN Group_Members ON 
Scrobbles.username=Group_Members.member',
+                       TagCloud::scrobblesTable('group').' s INNER JOIN 
Group_Members gm ON s.username=gm.member',
                        'artist',
                        40,
                        $this->name,

Modified: trunk/nixtape/data/TagCloud.php
===================================================================
--- trunk/nixtape/data/TagCloud.php     2009-05-07 12:25:34 UTC (rev 1275)
+++ trunk/nixtape/data/TagCloud.php     2009-05-07 13:02:32 UTC (rev 1276)
@@ -20,6 +20,7 @@
 
 require_once($install_path . '/database2.php');
 require_once($install_path . '/data/Server.php');
+require_once($install_path . '/config.php'); // Should already be required 
though.
 
 class TagCloud {
    /*
@@ -51,7 +52,7 @@
        $adodb->SetFetchMode(ADODB_FETCH_ASSOC);
         $res = $adodb->CacheGetAll(7200,$query);
         if (!$res) {
-            echo("ERROR");
+            echo("ERROR $query");
         } else {
             foreach($res as $count => &$i) {
                 $i['size'] = $sizes[(int) ($count/(count($res)/7))];
@@ -63,5 +64,30 @@
             return $res;
         }
     }
+    
+       /**
+        * Returns the preferred table to generate scrobble data from.
+        *
+        * @param string $area The are where we're displaying scrobble data; 
one of 'main', 'user', 'group'. Optional: defaults to 'main'.
+        * @return string Usually 'Scrobbles' or 'Free_Scrobbles'.
+        * @author tobyink
+        */
+       static function scrobblesTable ($area = 'main')
+       {
+               // This array can be set up in config.php
+               global  $scrobblecloud_table;
+               
+               if (!empty($scrobblecloud_table[$area]))
+               {
+                       return $scrobblecloud_table[$area];
+               }
+               
+               if ($area == 'main')
+               {
+                       return 'Free_Scrobbles';
+               }
+               
+               return 'Scrobbles';
+       }
 }
 ?>

Modified: trunk/nixtape/edit_group.php
===================================================================
--- trunk/nixtape/edit_group.php        2009-05-07 12:25:34 UTC (rev 1275)
+++ trunk/nixtape/edit_group.php        2009-05-07 13:02:32 UTC (rev 1276)
@@ -55,7 +55,7 @@
        else
        {
                $smarty->assign('newform', true);
-               $aTagCloud = TagCloud::GenerateTagCloud('Free_Scrobbles', 
'artist');
+               $aTagCloud = 
TagCloud::GenerateTagCloud(TagCloud::scrobblesTable(), 'artist');
                if (!PEAR::isError ($aTagCloud))
                {
                        $smarty->assign('tagcloud', $aTagCloud);
@@ -143,7 +143,7 @@
        # And display the page.
        $smarty->assign('errors', $errors);
        $smarty->assign('newform', false);
-       $aTagCloud = TagCloud::GenerateTagCloud('Free_Scrobbles', 'artist');
+       $aUserTagCloud = $group->tagCloudData();
        if (!PEAR::isError ($aTagCloud))
        {
                $smarty->assign('tagcloud', $aTagCloud);

Modified: trunk/nixtape/explore.php
===================================================================
--- trunk/nixtape/explore.php   2009-05-07 12:25:34 UTC (rev 1275)
+++ trunk/nixtape/explore.php   2009-05-07 13:02:32 UTC (rev 1276)
@@ -27,7 +27,7 @@
 require_once('data/TagCloud.php');
 
 // This should be contextual based on the mode= parameter?
-$aTagCloud = TagCloud::GenerateTagCloud('Free_Scrobbles', 'artist');
+$aTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable(), 'artist');
 if (!PEAR::isError ($aTagCloud)) {
         $smarty->assign('tagcloud', $aTagCloud);
 }

Modified: trunk/nixtape/group.php
===================================================================
--- trunk/nixtape/group.php     2009-05-07 12:25:34 UTC (rev 1275)
+++ trunk/nixtape/group.php     2009-05-07 13:02:32 UTC (rev 1276)
@@ -36,7 +36,7 @@
                                'href' => 
$base_url.'/rdf.php?fmt=xml&page='.htmlentities($_SERVER['REQUEST_URI'])
                                )
                ));
-       $aTagCloud = TagCloud::GenerateTagCloud('Free_Scrobbles', 'artist');
+       $aTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable(), 
'artist');
        if (!PEAR::isError ($aTagCloud))
        {
                $smarty->assign('tagcloud', $aTagCloud);

Modified: trunk/nixtape/index.php
===================================================================
--- trunk/nixtape/index.php     2009-05-07 12:25:34 UTC (rev 1275)
+++ trunk/nixtape/index.php     2009-05-07 13:02:32 UTC (rev 1276)
@@ -25,7 +25,7 @@
 require_once('data/Server.php');
 require_once('data/TagCloud.php');
 
-$aTagCloud = TagCloud::GenerateTagCloud('Free_Scrobbles', 'artist');
+$aTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable(), 'artist');
 if (!PEAR::isError ($aTagCloud)) {
        $smarty->assign('tagcloud', $aTagCloud);
 }

Modified: trunk/nixtape/install.php
===================================================================
--- trunk/nixtape/install.php   2009-05-07 12:25:34 UTC (rev 1275)
+++ trunk/nixtape/install.php   2009-05-07 13:02:32 UTC (rev 1276)
@@ -52,7 +52,7 @@
        $submissions_server = $_POST['submissions_server'];
 
        //Write out the configuration
-       $config = "<?php\n \$config_version = " . $version .";\n 
\$connect_string = '" . $connect_string . "';\n \$default_theme = '" . 
$default_theme . "';\n \$base_url = '" . $base_url . "';\n \$submissions_server 
= '" . $submissions_server . "';\n \$install_path = '" . $install_path . "'; 
?>";
+       $config = "<?php\n \$config_version = " . $version .";\n 
\$connect_string = '" . $connect_string . "';\n \$default_theme = '" . 
$default_theme . "';\n \$base_url = '" . $base_url . "';\n \$submissions_server 
= '" . $submissions_server . "';\n \$install_path = '" . $install_path . "'; ";
 
        $conf_file = fopen("config.php", "w");
        $result = fwrite($conf_file, $config);

Modified: trunk/nixtape/listen.php
===================================================================
--- trunk/nixtape/listen.php    2009-05-07 12:25:34 UTC (rev 1275)
+++ trunk/nixtape/listen.php    2009-05-07 13:02:32 UTC (rev 1276)
@@ -23,7 +23,7 @@
 require_once('templating.php');
 require_once('data/TagCloud.php');
 
-$aTagCloud = TagCloud::GenerateTagCloud('Scrobbles', 'artist');
+$aTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable(), 'artist');
 if (!PEAR::isError ($aTagCloud)) {
         $smarty->assign('tagcloud', $aTagCloud);
 }


Property changes on: trunk/nixtape/themes/librefm/templates_c
___________________________________________________________________
Added: svn:ignore
   + *


Modified: trunk/nixtape/track.php
===================================================================
--- trunk/nixtape/track.php     2009-05-07 12:25:34 UTC (rev 1275)
+++ trunk/nixtape/track.php     2009-05-07 13:02:32 UTC (rev 1276)
@@ -33,7 +33,7 @@
 $smarty->assign("artisturl", Server::getArtistURL($track->artist_name));
 
 // no idea how this would be track-relevant
-$aTagCloud = TagCloud::GenerateTagCloud('Free_Scrobbles', 'artist');
+$aTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable(), 'artist');
 if (!PEAR::isError ($aTagCloud)) {
         $smarty->assign('tagcloud', $aTagCloud);
 }

Modified: trunk/nixtape/user-edit.php
===================================================================
--- trunk/nixtape/user-edit.php 2009-05-07 12:25:34 UTC (rev 1275)
+++ trunk/nixtape/user-edit.php 2009-05-07 13:02:32 UTC (rev 1276)
@@ -170,7 +170,7 @@
        }
 
        # And display the page.
-       $aTagCloud = TagCloud::GenerateTagCloud('Free_Scrobbles', 'artist');
+       $aTagCloud = 
TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40, 
$this_user->name);
        if (!PEAR::isError ($aTagCloud))
        {
                $smarty->assign('tagcloud', $aTagCloud);

Modified: trunk/nixtape/user-groups.php
===================================================================
--- trunk/nixtape/user-groups.php       2009-05-07 12:25:34 UTC (rev 1275)
+++ trunk/nixtape/user-groups.php       2009-05-07 13:02:32 UTC (rev 1276)
@@ -39,7 +39,7 @@
 if(isset($user->name)) {
 
        $smarty->assign('geo', Server::getLocationDetails($user->location_uri));
-       $aUserTagCloud =  TagCloud::GenerateTagCloud('Scrobbles', 'artist', 40, 
$user->name);
+       $aUserTagCloud =  
TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40, 
$user->name);
        if (!PEAR::isError ($aUserTagCloud)) {
                $smarty->assign('user_tagcloud',$aUserTagCloud);
        }

Modified: trunk/nixtape/user-journal.php
===================================================================
--- trunk/nixtape/user-journal.php      2009-05-07 12:25:34 UTC (rev 1275)
+++ trunk/nixtape/user-journal.php      2009-05-07 13:02:32 UTC (rev 1276)
@@ -66,7 +66,7 @@
        }
 }
 
-$aUserTagCloud =  TagCloud::GenerateTagCloud('Scrobbles', 'artist', 40, 
$user->name);
+$aUserTagCloud =  TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 
'artist', 40, $user->name);
 if (!PEAR::isError ($aUserTagCloud)) {
        $smarty->assign('user_tagcloud',$aUserTagCloud);
 }

Modified: trunk/nixtape/user-profile.php
===================================================================
--- trunk/nixtape/user-profile.php      2009-05-07 12:25:34 UTC (rev 1275)
+++ trunk/nixtape/user-profile.php      2009-05-07 13:02:32 UTC (rev 1276)
@@ -45,7 +45,7 @@
        if (!PEAR::isError ($aUserNowPlaying)) {
                $smarty->assign('nowplaying', $aUserNowPlaying);
        }
-       $aUserTagCloud =  TagCloud::GenerateTagCloud('Scrobbles', 'artist', 40, 
$user->name);
+       $aUserTagCloud =  
TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40, 
$user->name);
        if (!PEAR::isError ($aUserTagCloud)) {
                $smarty->assign('user_tagcloud',$aUserTagCloud);
        }

Modified: trunk/nixtape/user-recent-tracks.php
===================================================================
--- trunk/nixtape/user-recent-tracks.php        2009-05-07 12:25:34 UTC (rev 
1275)
+++ trunk/nixtape/user-recent-tracks.php        2009-05-07 13:02:32 UTC (rev 
1276)
@@ -46,7 +46,7 @@
        if (!PEAR::isError ($aUserScrobbles)) {
                $smarty->assign('scrobbles', $aUserScrobbles);
        }
-       $aUserTagCloud =  TagCloud::GenerateTagCloud('Scrobbles', 'artist', 40, 
$user->name);
+       $aUserTagCloud =  
TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40, 
$user->name);
        if (!PEAR::isError ($aUserTagCloud)) {
                $smarty->assign('user_tagcloud',$aUserTagCloud);
        }

Modified: trunk/nixtape/user-stats.php
===================================================================
--- trunk/nixtape/user-stats.php        2009-05-07 12:25:34 UTC (rev 1275)
+++ trunk/nixtape/user-stats.php        2009-05-07 13:02:32 UTC (rev 1276)
@@ -36,7 +36,7 @@
 
 if(isset($user->name)) {
 
-#      $aUserTagCloud =  TagCloud::GenerateTagCloud('Scrobbles', 'artist', 40, 
$user->name);
+#      $aUserTagCloud =  
TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40, 
$user->name);
 #      if (!PEAR::isError ($aUserTagCloud)) {
 #              $smarty->assign('user_tagcloud',$aUserTagCloud);
 #      }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]