[pLog-svn] r4023 - plugins/branches/lifetype-1.1/galleryimages

oscar at devel.lifetype.net oscar at devel.lifetype.net
Fri Sep 22 22:20:54 GMT 2006


Author: oscar
Date: 2006-09-22 22:20:53 +0000 (Fri, 22 Sep 2006)
New Revision: 4023

Modified:
   plugins/branches/lifetype-1.1/galleryimages/plugingalleryimages.class.php
Log:
fixed the randomImage() function


Modified: plugins/branches/lifetype-1.1/galleryimages/plugingalleryimages.class.php
===================================================================
--- plugins/branches/lifetype-1.1/galleryimages/plugingalleryimages.class.php	2006-09-22 21:54:49 UTC (rev 4022)
+++ plugins/branches/lifetype-1.1/galleryimages/plugingalleryimages.class.php	2006-09-22 22:20:53 UTC (rev 4023)
@@ -85,10 +85,10 @@
          */
         function randomImage( $album_id = 0 )
         {
-            $randomImages = $this->randomImages( $album_id );
+            $randomImages = $this->randomImages( 1, $album_id );
             
             if( $randomImages )
-                return( array_pop( $randomImage ));
+                return( array_pop( $randomImages ));
             else
                 return( false );
         }
@@ -117,8 +117,8 @@
             }
                       
             $query .=" ORDER BY RAND() LIMIT 0, {$maxImages}";
-            
-            // just to make things easier, we'll cheat a little here...            
+
+            // just to make things easier, we'll cheat a little here...
 			include_once( PLOG_CLASS_PATH."class/database/db.class.php" );
 			$db =& Db::getDb();
             $result = $db->Execute( $query );
@@ -128,8 +128,8 @@
                 
             $randomimages = Array();
             while( $row = $result->FetchRow()) { 
-               array_push( $randomimages, $resources->mapRow( $row )); 
-            } 
+               $randomimages[] = $resources->mapRow( $row );
+            }
             
             return $randomimages;
         }



More information about the pLog-svn mailing list