issue65, fixed incorrect array_rand handling
[phpfspot.git] / phpfspot.class.php
index 2a2813545045235f2503eeeb7455efe4a14bdf91..a7290b6e833af99c023f07ff16980db8fb5c00e4 100644 (file)
@@ -1551,8 +1551,13 @@ class PHPFSPOT {
                break;
                
             case 'MoinMoin':
-               // [%pictureurl% %thumbnailurl%]
-               print htmlspecialchars(" * [".$orig_url." ".$thumb_url."&fake=1.jpg]") ."<br />\n";
+               // "[%pictureurl% %thumbnailurl%]"
+               print htmlspecialchars("[".$orig_url." ".$thumb_url."&fake=1.jpg]") ."<br />\n";
+               break;
+
+            case 'MoinMoinList':
+               // " * [%pictureurl% %thumbnailurl%]"
+               print "&nbsp;" . htmlspecialchars("* [".$orig_url." ".$thumb_url."&fake=1.jpg]") ."<br />\n";
                break;
          }
 
@@ -1738,10 +1743,10 @@ class PHPFSPOT {
       ");
       
       while($row = $this->db->db_fetch_object($result)) {
-         array_push($all, $row[0]);
+         array_push($all, $row['id']);
       }
 
-      return array_rand($all);
+      return $all[array_rand($all)];
 
    } // get_random_photo()