[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Librefm-commits] [1464] Fix more inconsistent indentation
From: |
Michael Sheldon |
Subject: |
[Librefm-commits] [1464] Fix more inconsistent indentation |
Date: |
Sun, 10 May 2009 13:21:19 +0000 |
Revision: 1464
http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1464
Author: elleo
Date: 2009-05-10 13:21:11 +0000 (Sun, 10 May 2009)
Log Message:
-----------
Fix more inconsistent indentation
Modified Paths:
--------------
trunk/nixtape/data/TagCloud.php
Modified: trunk/nixtape/data/TagCloud.php
===================================================================
--- trunk/nixtape/data/TagCloud.php 2009-05-10 13:14:19 UTC (rev 1463)
+++ trunk/nixtape/data/TagCloud.php 2009-05-10 13:21:11 UTC (rev 1464)
@@ -23,47 +23,48 @@
require_once($install_path . '/config.php'); // Should already be required
though.
class TagCloud {
- /*
- * returns an array counting appareances of a given field and his
corresponding font-size.
- * @param string $table table name to be queried
- * @param string $field field name to count
- * @param integer $limit limit of the query
- * @param string $constraint username or artistname depending on field
- * inaccurate @param integer $sizes quantity of possible sizes
- * inaccurate @param float $max_font_size maximum font size (px, em, %, etc)
- * @return array tagcloud
- */
- static function generateTagCloud($table, $field, $limit = 40, $constraint
= null, $constrained_field = false) {
- global $adodb;
- if (!is_string($field)) return false;
- if (!is_string($table)) return false;
- if (!is_integer($limit)) return false;
- $sizes = array('xx-large', 'x-large', 'large', 'medium', 'small',
'x-small', 'xx-small');
- $query = "SELECT $field, count(*) AS count FROM $table";
- $query .= (!is_null($constraint)) ? ' WHERE ' : null;
- if ($constrained_field) {
- $query .= (!is_null($constraint)) ? " $constrained_field = " .
$adodb->qstr($constraint) : null;
- } elseif ($field == "track") {
- $query .= (!is_null($constraint)) ? ' artist = ' .
$adodb->qstr($constraint) : null;
- } else {
- $query .= (!is_null($constraint)) ? ' username = ' .
$adodb->qstr($constraint) : null;
- }
- $query .= " GROUP BY $field ORDER BY count DESC LIMIT $limit";
- $adodb->SetFetchMode(ADODB_FETCH_ASSOC);
- $res = $adodb->CacheGetAll(7200,$query);
- if (!$res) {
- echo("ERROR $query");
- } else {
- foreach($res as $count => &$i) {
- $i['size'] = $sizes[(int) ($count/(count($res)/7))];
- }
- foreach($res as &$i){
- $i['pageurl'] = Server::getArtistURL($i['artist']);
- }
- sort($res);
- return $res;
- }
- }
+
+ /*
+ * returns an array counting appareances of a given field and his
corresponding font-size.
+ * @param string $table table name to be queried
+ * @param string $field field name to count
+ * @param integer $limit limit of the query
+ * @param string $constraint username or artistname depending on field
+ * inaccurate @param integer $sizes quantity of possible sizes
+ * inaccurate @param float $max_font_size maximum font size (px, em, %,
etc)
+ * @return array tagcloud
+ */
+ static function generateTagCloud($table, $field, $limit = 40,
$constraint = null, $constrained_field = false) {
+ global $adodb;
+ if (!is_string($field)) return false;
+ if (!is_string($table)) return false;
+ if (!is_integer($limit)) return false;
+ $sizes = array('xx-large', 'x-large', 'large', 'medium',
'small', 'x-small', 'xx-small');
+ $query = "SELECT $field, count(*) AS count FROM $table";
+ $query .= (!is_null($constraint)) ? ' WHERE ' : null;
+ if ($constrained_field) {
+ $query .= (!is_null($constraint)) ? "
$constrained_field = " . $adodb->qstr($constraint) : null;
+ } elseif ($field == "track") {
+ $query .= (!is_null($constraint)) ? ' artist = ' .
$adodb->qstr($constraint) : null;
+ } else {
+ $query .= (!is_null($constraint)) ? ' username = ' .
$adodb->qstr($constraint) : null;
+ }
+ $query .= " GROUP BY $field ORDER BY count DESC LIMIT $limit";
+ $adodb->SetFetchMode(ADODB_FETCH_ASSOC);
+ $res = $adodb->CacheGetAll(7200,$query);
+ if (!$res) {
+ echo("ERROR $query");
+ } else {
+ foreach($res as $count => &$i) {
+ $i['size'] = $sizes[(int)
($count/(count($res)/7))];
+ }
+ foreach($res as &$i){
+ $i['pageurl'] =
Server::getArtistURL($i['artist']);
+ }
+ sort($res);
+ return $res;
+ }
+ }
/**
* Returns the preferred table to generate scrobble data from.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Librefm-commits] [1464] Fix more inconsistent indentation,
Michael Sheldon <=