]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add group posts to createsim.php
authorEvan Prodromou <evan@status.net>
Sat, 26 Mar 2011 19:08:27 +0000 (15:08 -0400)
committerEvan Prodromou <evan@status.net>
Sat, 26 Mar 2011 19:08:27 +0000 (15:08 -0400)
scripts/createsim.php

index e1c4b1124e245428d7b2a8361a217bcd0a32397c..6615e903f7fd0887bd254098f5de27f3d65c859e 100644 (file)
@@ -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);
 }