summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/controllers/welcome.php11
-rw-r--r--core/helpers/module.php4
2 files changed, 10 insertions, 5 deletions
diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php
index ac0925b9..019bb609 100644
--- a/core/controllers/welcome.php
+++ b/core/controllers/welcome.php
@@ -293,6 +293,7 @@ class Welcome_Controller extends Template_Controller {
function add_comments($count) {
srand(time());
$photos = ORM::factory("item")->where("type", "photo")->find_all()->as_array();
+ $users = ORM::factory("user")->find_all()->as_array();
if (empty($photos)) {
url::redirect("welcome");
@@ -303,10 +304,12 @@ class Welcome_Controller extends Template_Controller {
}
for ($i = 0; $i < $count; $i++) {
$photo = $photos[array_rand($photos)];
- comment::create(
- ucfirst($this->random_phrase(rand(1, 3))),
- "johndoe@example.com",
- $this->random_phrase(rand(8, 500)), $photo->id);
+ $author = $users[array_rand($users)];
+ $guest_name = ucfirst($this->random_phrase(rand(1, 3)));
+ $guest_email = sprintf("%s@%s.com", $this->random_phrase(1), $this->random_phrase(1));
+ $guest_url = sprintf("http://www.%s.com", $this->random_phrase(1));
+ comment::create($photo, $author, $this->random_phrase(rand(8, 500)),
+ $guest_name, $guest_email, $guest_url);
}
url::redirect("welcome");
diff --git a/core/helpers/module.php b/core/helpers/module.php
index 0c800786..9574c9c5 100644
--- a/core/helpers/module.php
+++ b/core/helpers/module.php
@@ -63,10 +63,12 @@ class module_Core {
$module = ORM::factory("module")->where("name", $module_name)->find();
if ($module->loaded) {
$db = Database::instance();
- $db->query("DELETE FROM `vars` WHERE `module_name` = '{$module->name}';");
$db->query("DELETE FROM `graphics_rules` WHERE module_name = '{$module->name}';");
$module->delete();
+ // We could delete the module vars here too, but it's nice to leave them around in case the
+ // module gets reinstalled.
+
Kohana::log("debug", "$module_name: module deleted");
}
}