From 6902c0af352cb7f262d77c728e489876b21d2933 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 26 Mar 2011 15:08:27 -0400 Subject: [PATCH] Add group posts to createsim.php --- scripts/createsim.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/createsim.php b/scripts/createsim.php index e1c4b1124e..6615e903f7 100644 --- a/scripts/createsim.php +++ b/scripts/createsim.php @@ -103,6 +103,21 @@ function newNotice($i, $tagmax) } } + $in_group = rand(0, 5); + + if ($in_group == 0) { + $groups = $user->getGroups(); + if ($groups->N > 0) { + $gval = rand(0, $group->N); + $groups->fetch(); // go to 0th + for ($i = 0; $i < $gval; $i++) { + $groups->fetch(); + } + $options['groups'] = array($groups->id); + $content = "!".$groups->nickname." ".$content; + } + } + $notice = Notice::saveNew($user->id, $content, 'system', $options); } -- 2.39.5