From 059e0d95d0c28bc5060e87e146eaf7411f51bf90 Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Thu, 27 Apr 2023 03:47:30 +0300 Subject: skeleton commit; based on an anom project --- public/app/views/simple/lorem-posts.php | 93 +++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 public/app/views/simple/lorem-posts.php (limited to 'public/app/views/simple/lorem-posts.php') diff --git a/public/app/views/simple/lorem-posts.php b/public/app/views/simple/lorem-posts.php new file mode 100644 index 0000000..5f7fccb --- /dev/null +++ b/public/app/views/simple/lorem-posts.php @@ -0,0 +1,93 @@ +". $lorem[$i] ."

"; + } + + return $html; +} + +function some_lorem_title() { + // make an array of + $lorem = explode(".", // sentences only + str_replace(". ", ".", + implode(" ", LOREM) // made from all Lorem-ipsums + ) + ); + shuffle($lorem); + return $lorem[0]; +} + + +include 'pythia.php'; + + +$categories = $wiki->get_categories(); + +$non_root = []; +foreach($categories as $node) { + if (intval($node['parent_id']) > 0) { $non_root[] = $node['id']; } + // if (intval($node['parent_id']) > 5) { $non_root[] = $node['id']; } +} +// print_r($non_root); die(); + +echo "
";
+for( $i = 0 ; $i < 250 ; $i++ ) {
+
+    $temp = $non_root;
+    shuffle($temp);
+
+    $post = [
+        'title' => some_lorem_title(),
+        'category' => intval($temp[0]),
+        'body' => some_lorem_html()
+    ];
+    print_r($post);
+
+    $wiki->add_post($post);
+}
+echo "
"; \ No newline at end of file -- cgit v1.2.3