issue65, fixed incorrect array_rand handling
authorAndreas Unterkircher <unki@netshadow.at>
Sun, 22 Jul 2007 16:58:59 +0000 (16:58 +0000)
committerAndreas Unterkircher <unki@netshadow.at>
Sun, 22 Jul 2007 16:58:59 +0000 (16:58 +0000)
git-svn-id: file:///var/lib/svn/phpfspot/trunk@246 fa6a889d-dae6-447d-9e79-4ba9a3039384

phpfspot.class.php
themes/default/templates/welcome.tpl

index d2bb8954e62599e1adc31be16a1ab11c92ba1276..a7290b6e833af99c023f07ff16980db8fb5c00e4 100644 (file)
@@ -1743,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()
 
index 9845755ee7ff080ccd54ecc83b4747ec9802ea8c..529cbb67c20b02399e3565389af3e0b00c905fec 100644 (file)
@@ -8,6 +8,10 @@
  <tr>
   <td>
    <div id='single'>
+    <div style="float: left">
+     <img src="phpfspot_img.php?idx=rand&width=150&1" />
+     <img src="phpfspot_img.php?idx=rand&width=150&2" />
+    </div>
    <table>
     <tr>
      <td>