diff options
Diffstat (limited to 'core/controllers/welcome.php')
-rw-r--r-- | core/controllers/welcome.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php index b5215a02..9363a276 100644 --- a/core/controllers/welcome.php +++ b/core/controllers/welcome.php @@ -199,6 +199,8 @@ class Welcome_Controller extends Template_Controller { $parents = ORM::factory("item")->where("type", "album")->find_all()->as_array(); $owner_id = user::active()->id; + $test_images = glob(APPPATH . "tests/images/*.[Jj][Pp][Gg]"); + for ($i = 0; $i < $count; $i++) { set_time_limit(30); @@ -213,8 +215,9 @@ class Welcome_Controller extends Template_Controller { ->set_thumbnail(DOCROOT . "core/tests/test.jpg", 200, 150) ->save(); } else { - photo::create($parent->id, DOCROOT . "themes/default/images/thumbnail.jpg", - "thumbnail.jpg", "rnd_" . rand(), "sample thumbnail", $owner_id); + $photo_index = rand(0, count($test_images) - 1); + photo::create($parent->id, $test_images[$photo_index], basename($test_images[$photo_index]), + "rnd_" . rand(), "sample thumbnail", $owner_id); } } url::redirect("welcome"); |