summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2007-07-22 16:58:59 +0000
committerAndreas Unterkircher <unki@netshadow.at>2007-07-22 16:58:59 +0000
commit223a626abc5757fbce0b6ce4e0a4a4a1cf4980e4 (patch)
treea4d8aa6be6a02fe34a0bef92290af6dadf2f595e
parentfd68fbf3364faf0ef72b4a717e891743c17e9f27 (diff)
issue65, fixed incorrect array_rand handling
git-svn-id: file:///var/lib/svn/phpfspot/trunk@246 fa6a889d-dae6-447d-9e79-4ba9a3039384
-rw-r--r--phpfspot.class.php4
-rw-r--r--themes/default/templates/welcome.tpl4
2 files changed, 6 insertions, 2 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php
index d2bb895..a7290b6 100644
--- a/phpfspot.class.php
+++ b/phpfspot.class.php
@@ -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()
diff --git a/themes/default/templates/welcome.tpl b/themes/default/templates/welcome.tpl
index 9845755..529cbb6 100644
--- a/themes/default/templates/welcome.tpl
+++ b/themes/default/templates/welcome.tpl
@@ -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>