diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-02-21 01:59:11 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-02-21 01:59:11 +0000 |
commit | c59dd7d4b347f1044dcff7aaeeac0fd2bd110aae (patch) | |
tree | 280648d913540da0a1c818c10028ecc259421e1a /lib/class/democratic.class.php | |
parent | 917c8198ae353ab6fd2b5d981c310e0e3974ab90 (diff) | |
download | ampache-c59dd7d4b347f1044dcff7aaeeac0fd2bd110aae.tar.gz ampache-c59dd7d4b347f1044dcff7aaeeac0fd2bd110aae.tar.bz2 ampache-c59dd7d4b347f1044dcff7aaeeac0fd2bd110aae.zip |
corrected display on cleared democratic playlist, and added some basic caching, vote amount needs to be cached
Diffstat (limited to 'lib/class/democratic.class.php')
-rw-r--r-- | lib/class/democratic.class.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/class/democratic.class.php b/lib/class/democratic.class.php index df34ec5f..a8bd7456 100644 --- a/lib/class/democratic.class.php +++ b/lib/class/democratic.class.php @@ -35,6 +35,7 @@ class Democratic extends tmpPlaylist { // Build local, buy local public $tmp_playlist; + public $object_ids = array(); /** * constructor @@ -194,9 +195,14 @@ class Democratic extends tmpPlaylist { /* Define the array */ $items = array(); $votes = array(); + $object_ids = array(); + // Itterate and build the sortable array while ($results = Dba::fetch_assoc($db_results)) { + // Extra set of data for caching! + $this->object_ids[] = $results['object_id']; + // First build a variable that holds the number of votes for an object $name = 'vc_' . $results['object_id']; @@ -216,6 +222,8 @@ class Democratic extends tmpPlaylist { // Sort highest voted stuff to the top krsort($items); + $sorted_items = array(); + // re-collapse the array foreach ($items as $vote_count=>$date_array) { ksort($date_array); |