using array_slice correctly now :P
authorToby Elliott <telliott@mozilla.com>
Thu, 09 Jul 2009 10:26:39 -0700
changeset 1072 7ced99157240f1a6f0440925a000bd01a14e9fbe
parent 1071 a711bf967a09d34bbeb55bd28716b874f0107584
child 1073 eb0cdda69eabb7b5dee35ec4af54ad04282110b1
push id689
push usertelliott@mozilla.com
push dateThu, 09 Jul 2009 17:27:45 +0000
using array_slice correctly now :P
compile.php
--- a/compile.php
+++ b/compile.php
@@ -42,43 +42,43 @@
 	require_once 'server/lib/storage.php';
 
 	
 	$db = new PersonaStorage();
 	$categories = $db->get_categories();
 	$page_size = 501;
 	
 	#Top level popular page
-	$popular_list = array_slice($db->get_popular_personas(null), 21);
+	$popular_list = array_slice($db->get_popular_personas(null), 0, 21);
 	foreach ($popular_list as $item)
 	{
 		$data = extract_record_data($item);
 		$data['recent'] = (time() - strtotime($item['approve']) < 604800) ? true : false;
 		$popular_json[] = $data;
 	}
 	$master['popular'] = $popular_json;
 
 	#Top level recent page
-	$recent_list = array_slice($db->get_recent_personas(null), 21);
+	$recent_list = array_slice($db->get_recent_personas(null), 0, 21);
 	foreach ($recent_list as $item)
 	{
 		$data = extract_record_data($item);
 		$data['recent'] = (time() - strtotime($item['approve']) < 604800) ? true : false;
 		$recent_json[] = $data;
 	}
 	$master['recent'] = $recent_json;
 
 
 	foreach ($categories as $category)
 	{
 		#get category counts for pagination
 		$category_total = $db->get_active_persona_count($category);
 		$pages = floor($category_total/$page_size) + 1;
 		
-		$popular_list = array_slice($db->get_popular_personas($category), 10);
+		$popular_list = array_slice($db->get_popular_personas($category), 0, 10);
 	
 		$short_cat_list = array();
 		foreach ($popular_list as $item)
 		{
 			$data = extract_record_data($item);
 			$data['recent'] = (time() - strtotime($item['approve']) < 604800) ? true : false;
 			$short_cat_list[] = $data;
 		}