diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-11-07 10:46:06 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-11-07 10:46:06 +0000 |
commit | dc90ad97396c258f3a5fe9b0c126af33f88a7b4a (patch) | |
tree | a6a1f3b3f611b323bbd1e16b10406e752c7f4121 | |
parent | 30c4433b4406d61466aa347038e4e28ab52ceeb6 (diff) |
Change add() to add photos:albums at a ratio of 10:1
-rw-r--r-- | core/controllers/welcome.php | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php index 791ee192..8bf5138a 100644 --- a/core/controllers/welcome.php +++ b/core/controllers/welcome.php @@ -93,27 +93,20 @@ class Welcome_Controller extends Template_Controller { $parents = ORM::factory("item")->where("type", "album")->find_all()->as_array(); for ($i = 0; $i < $count; $i++) { $parent = $parents[array_rand($parents)]; - switch(rand(0, 1)) { - case 0: + if (!rand(0, 10)) { $parents[] = album::create($parent->id, "rnd_" . rand(), "Rnd $i", "rnd $i") ->set_thumbnail(DOCROOT . "core/tests/test.jpg", 200, 150) ->save(); - break; - - case 1: + } else { photo::create($parent->id, DOCROOT . "themes/default/images/thumbnail.jpg", "thumbnail.jpg", "rnd_" . rand(), "sample thumbnail"); - break; } - print "$i "; if (!($i % 100)) { set_time_limit(30); } } - print "<br/>"; - print html::anchor("welcome", "return"); - $this->auto_render = false; + url::redirect("welcome"); } public function profiler() { |