2 include_once("class/database-connection.php");
3 include_once("../class/database-connection.php");
4 include_once("class/twitter-connection.php");
5 include_once("../class/twitter-connection.php");
8 public static $die_state = array();
9 public static $comment_error = false;
11 function __construct(){}
13 public static function buildAudioGimick($song = 0){
14 $track_list = scandir (__DIR__
. "/../audio", FilesystemIterator
::SKIP_DOTS
);
16 $track_list = array_slice($track_list, 4);//remove non-audio and dots
17 $track = 'audio/' . $track_list[$song];
20 <audio id="blaring-music" controls autoplay preload="none" class="top-widget">
21 <source src="' . $track . '" type="audio/mpeg">
22 Your browser does not support the audio tag.
25 var audio = document.getElementById("blaring-music");
30 $post_properties = parse_ini_file("settings/postproperties.ini");
33 $id = "kind-of-a-huge-deal-komrad";
35 <style>#kind-of-a-huge-deal-komrad{
40 position:absolute;}</style>
43 echo '<h1 id="' . $id . '">ХОРОШО <br/>POSTER NUMBER: ' . $post_properties["TotalPosts"] .'<br/>
48 <style>#a-huge-deal-komrad{
56 $id = "a-huge-deal-komrad";
57 echo '<h1 id="' . $id . '">ХОРОШО<br/> POSTER NUMBER: ' . $post_properties["TotalPosts"] .'<br/><br/>HIBIKI LIVED, SO WILL YOU!</h1>';
60 $id = "fucking-huge-deal-komrad";
62 <style>#fucking-huge-deal-komrad{
70 echo '<h1 id="' . $id . '">CONGRAGULATIONS KOMRAD NUMBER:' . $post_properties["TotalPosts"] .' <br/> KOMRAD.
71 YOU MADE A VERY GREAT POST ON THIS VERY GOOD SITE UNFORTUNATLY WE HAVE NO FOOD TO GIVE SINCE WE KILLED ALL THE UKRAINIAN FARMERS.
72 MANY THANKS AND HAVE A NICE DAY SORRY FOR THE EAR RAPE!!!!!!!!!!!!!</h1>';
78 $added_properties = "color:rgb($r,g,$b)";
79 $id = "its-a-deal-komrad";
80 echo "<style>#its-a-deal-komrad{
87 echo "<h1 id='$id' style='color:rgb($r,g,$b)'>ХОРОШО<br/> POSTER NUMBER:". $post_properties["TotalPosts"] . " </h1>";
92 //https://html.com/tags/blink/
93 var blink_speed = 700; var t = setInterval(function () { var ele = document.getElementById("'. $id .'"); ele.style.visibility = (ele.style.visibility == "hidden" ? "" : "hidden"); }, blink_speed);
99 public static function buildNavBar(){
100 echo' <nav class="navbar navbar-expand-sm bg-secondary">
101 <ul class="navbar-nav">
102 <li class="nav-item">
103 <a class="nav-link text-success" href="/">Home</a>
105 <li class="nav-item">
106 <a class="nav-link text-success" href="/view-queue">To Be Posted</a>
108 <li class="nav-item">
109 <a class="nav-link text-success" href="https://twitter.com/Qazoku">@Qazoku</a>
116 public static function buildQueueForm(){
119 echo'<div class="card w-75 mx-5 my-0">
120 <div class="card-header">
121 <button class="btn btn-link" data-toggle="collapse" data-target="#comment-fields" aria-expanded="true" aria-controls="comment-fields">Comment</button>
123 <div id="comment-fields" class="collapse px-5 pt-2 pb-5">
124 <form action="add-to-queue.php" enctype="multipart/form-data" method="POST" target="_self" id="submit-form">
126 <textarea id="Comment" name="comment" rows="10" cols="60" placeholder = "Comment Text Here"></textarea>
127 <p id="CharacterCount" class="lead"></p>
129 <input name="MAX_FILE_SIZE" type="hidden" value="5242880" />
130 <div class="dropdown">
131 <button class="btn dropdown-toggle" type="button" id="file-container" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Add Image</button>
132 <div class="dropdown-menu pt-3" aria-labelledby="file-container">
133 <input name="file1" type="file" id="f1" class="dropdown-item form-control-file"/>
134 <input name="file2" type="file" id="f2" class="dropdown-item form-control-file"/>
135 <input name="file3" type="file" id="f3" class="dropdown-item form-control-file"/>
136 <input name="file4" type="file" id="f4" class="dropdown-item form-control-file"/>
140 <div id="errorMsg" class="alert alert-warning" role="alert">Input a comment and/or file</div>
141 <input id="submit-button" class="btn btn-secondary form-control" type="submit" disabled="1"/></form>
147 public static function buildPassForm(){
148 echo"<form action='' method='POST'>
149 <input name='name'><br/>
150 <input name='pass' type='password'><br/>
151 <input type='submit' id='authorization-input' value='Authorize'><br/>
152 <label>Stay Logged In: <input type='checkbox' name='persistent-login'></label><br/></form>";
157 public static function retrieveTwitterTimeline($connection_tw, $connection_db){
158 $timeline_tweets = $connection_tw->retrieveTimeline();
159 StandardFunctions
::recursiveEchoJson($combined_database_arr,0);
161 echo sizeof($timeline_tweets) . "<pre>";
162 if(sizeof($timeline_tweets) != 0){
163 $connection_db->addTimelineTweetsToDatabase($timeline_tweets);
169 public static function checkSubmissionValid($tweet_comment="", $file_string="",$database_con){
171 BoardFunctions
::$comment_error = 0;
172 $tweet_comment = trim($tweet_comment);
173 $banned = $database_con->getPostDetails("Banned", "IPAddress", $_SERVER['HTTP_X_REAL_IP'])[0]["BanComment"];
174 $banned = str_replace(" ", "_", $banned);
176 BoardFunctions
::$comment_error = "-5 $banned";
178 else if(mb_strlen($tweet_comment) > $COMMENT_MAX){
179 BoardFunctions
::$comment_error = "-3 Comment-too-long";
181 else if(mb_strlen($tweet_comment) == 0){
182 BoardFunctions
::$comment_error = "-4 No Comment";
184 else if(preg_match("/VERIFY: /", $tweet_comment) == 0){
185 $filters = JSON_Decode(file_get_contents("settings/verify-levels.json"), true);
186 if($filters["Image-Block"] == 1 && !($file_string == "" ||
$file_string == NULL))
187 BoardFunctions
::$comment_error = "-2 Images_disabled";
188 else if($filters["URL-Block"] == 1 && (preg_match("/http/", $tweet_comment) == 1 ||
preg_match("/\.com/", $tweet_comment) == 1))
189 BoardFunctions
::$comment_error = "-2 URLs_disabled";
190 else if($filters["At-Block"] == 1 && preg_match("/@/", $tweet_comment) == 1)
191 BoardFunctions
::$comment_error = "-2 @_links_disabled";
192 else if($filters["Filter-Text-Active"] == 1){
193 foreach($filters["Filter-Text"] as $filter){
194 if(preg_match("/$filter/", $tweet_comment) == 1) {
195 BoardFunctions
::$comment_error = "-2 Remove_$filter";
200 return $tweet_comment;
203 public static function uploadAndVerify($files){
208 for($file = 0; $file < 4; $file++
){
210 if($files[$file] == "") {
211 //echo "file " . (string)$file .", Empty<br/>";
212 BoardFunctions
::$die_state[$file] = 5;
216 $file_components = explode("=", ($files[$file]));
217 $file_name = urldecode($file_components[0]);
218 $file_data = $file_components[1];
219 $upload_location = "images/" . $file_name;
222 if(file_exists($upload_location)) {
223 //echo "file " . (string)$file .", Duplicate ($upload_location)<br/>";
224 BoardFunctions
::$die_state[$file] = 6;
228 $dir_file = fopen($upload_location, "w");
229 fwrite($dir_file, base64_decode($file_data));
231 $file_size = filesize ($upload_location);//https://softwareengineering.stackexchange.com/questions/288670/know-file-size-with-a-base64-string
233 //over filesize check
234 if($file_size >= $FILE_MAX){
235 //echo "file" . (string)$file ." Over filesize limit-Server $file_size<br/>";
236 BoardFunctions
::$die_state[$file] = 1;
237 unlink($upload_location);
242 $file_string .= rawurlencode($upload_location);
246 $file_string .= "," . rawurlencode($upload_location);
249 BoardFunctions
::$die_state[$file] = 0;
254 public static function displayTabularDatabase($table_name, $ordering_param, $display_images = false){
255 echo "<br/>Displaying All entries(lower number means posted sooner): <br/>";
256 $statement = $this->connection
->prepare("Select * from $table_name ORDER BY :param DESC;");
257 $statement->bindParam(":param", $ordering_param);
258 $statement->execute();
259 $result_arr = $statement->fetchAll();
260 if(sizeof($result_arr) !== 0){
261 foreach($result_arr[0] as $key=>$head){
262 if(is_numeric ($key)) unset($result_arr[0][$key]);
265 echo "<table border='1' class='table table-striped'><tr> <thead class='table-dark'><tr>";
266 foreach($result_arr[0] as $key=>$head_item)
267 echo "<th>$key</th>";
268 echo "</thead></tr><tbody>";
270 for($row = sizeof($result_arr) - 1; $row >= 0 ; $row--){
272 $tupple = $result_arr[$row];
274 foreach($tupple as $key=>$col){
275 if(is_numeric ($key)) unset($result_arr[0][$key]);
277 if($column == 2 && $display_images){
278 $img_arr = explode(",", $col);
279 foreach($img_arr as $img){
280 $img = urldecode($img);
281 $img_ext = pathinfo($img, PATHINFO_EXTENSION
);
282 if(strcmp($img_ext, "png") == 0 ||
strcmp($img_ext, "jpg") == 0||
strcmp($img_ext, "gif") == 0)
283 echo "<td>" . $this->createImageNode($img) . "</td>";
285 echo "<td>" . $this->createVideoNode($img) . "</td>";
290 if($key == "PostNo") echo "<td>$col - $row</td>";
291 else echo "<td>$col</td>";
298 echo "</tbody></table><hr/>";
300 else echo '<table border="1"><hr/><th>No Entries</th><tr></table>';
304 public static function displayTabularJoin($table_name, $join_with, $ordering_param, $skip_col, $display_images = false, $database_con, $ordering = "ASC"){
305 echo "<h3>Displaying All Combined Entries(lower number means posted sooner): </h3>";
306 $result_arr = $database_con->getAllSubmissionDetails($table_name, $join_with, $ordering_param,$ordering);
308 if(sizeof($result_arr) !== 0){
309 foreach($result_arr[0] as $key=>$head){
310 if(is_numeric ($key)) unset($result_arr[0][$key]);
313 echo "<table border='1' class='table table-striped'><tr> <thead class='table-dark'>";
314 foreach($result_arr[0] as $key=>$head_item){
315 if($column++
== $skip_col) continue;
316 echo "<th>$key</th>";
318 echo "</tr> </thead><tbody>";
322 for($row = sizeof($result_arr) - 1; $row >= 0 ; $row--){
324 $tupple = $result_arr[$row];
326 foreach($tupple as $key=>$col){
328 if(is_numeric ($key)) {
329 unset($result_arr[0][$key]);
332 else if($column == $skip_col){
338 if($key=="Unverified"){
340 if($col == "1") echo "Withheld"; //is unverified
341 else if ($col == "-1") echo "Banned"; //banned
342 else if($col == "187") echo "Duplicate"; //is not unverified
343 else if($col == "170") echo "No Contents"; //is not unverified
344 else if($col == "0") echo "Verified"; //is not unverified
348 else if($key == "PostNo") echo "$col - $row";
349 else if($key == "ImageURL" && $display_images){
350 $img_arr = explode(",", $col);
351 foreach($img_arr as $img){
352 $img = urldecode($img);
353 $img_ext = pathinfo($img, PATHINFO_EXTENSION
);
354 if(strcmp($img_ext, "png") == 0 ||
strcmp($img_ext, "jpg") == 0||
strcmp($img_ext, "gif") == 0)
355 echo BoardFunctions
::createImageNode($img);
356 else if(strcmp($img_ext, "mp4") == 0)
357 echo BoardFunctions
::createVideoNode($img);
367 echo "</tbody></table><hr/>";
369 else echo '<table border="1"><hr/><th>No Entries</th><tr></table>';
373 public static function displayVerificationForm($display_images = false, $database_con, $ordering = "DESC"){
374 echo "<h3>Displaying All Data(lower number means posted sooner): </h3>";
375 $result_arr = $database_con->getVerificationDetails($ordering);
376 if(sizeof($result_arr) !== 0){
377 echo "<form method='POST' action='proccess-mod.php'><table border='1' class='table table-striped'><thead class='table-dark'><tr>";
378 echo "<th>Item Selected</th>";
379 foreach($result_arr[0] as $key=>$head_item){
380 if(!is_numeric ($key)) echo "<th>$key</th>";
382 echo "</thead></tr></tbody>";
383 for($row = 0; $row <= sizeof($result_arr) - 1 ; $row++
){
384 if($result_arr[$row][0] != null){
385 $result_arr[$row]["PostID"] = $result_arr[$row][0];
387 if($result_arr[$row][6] != null){
388 $result_arr[$row]["IPAddress"] = $result_arr[$row][6];
391 echo "<td><input type='checkbox' name='chk". $result_arr[$row]["PostID"] ."' /></td>";
393 $tupple = $result_arr[$row];
395 foreach($tupple as $key=>$col){
397 if(is_numeric ($key)) {
398 unset($result_arr[0][$key]);
403 if($key=="Unverified"){
405 if($col == "1") echo "Withheld"; //is unverified
406 else if($col == "187") echo "Duplicate"; //is not unverified
407 else if($col == "170") echo "No Contents"; //is not unverified
408 else if($col == "0") echo "Verified"; //is not unverified
409 else if($result_arr[$row]["RepliesTo"] == "") echo "Posted";
410 else if($result_arr[$row]["RepliesTo"] != "") echo "Replied";
412 if ($col == "") $col = "-";
414 if($col == "1" ||
$col == "0") echo ": <input placeholder='$col' name='unv". $result_arr[$row]["PostID"] ."' class=''/>";
416 else if($key == "PostID") echo ($row+
1) . " - $col";
417 else if($key == "ImageURL" && $display_images){
418 $img_arr = explode(",", $col);
419 if($img_arr[0] == "") echo "<strong>None</strong>";
420 foreach($img_arr as $img){
421 $img = urldecode($img);
422 $img_ext = pathinfo($img, PATHINFO_EXTENSION
);
423 if(strcmp($img_ext, "png") == 0 ||
strcmp($img_ext, "jpg") == 0||
strcmp($img_ext, "gif") == 0)
424 echo BoardFunctions
::createImageNode($img);
425 else if(strcmp($img_ext, "mp4") == 0)
426 echo BoardFunctions
::createVideoNode($img);
431 else if($key == "BanComment"){
432 if( $result_arr[$row]["IPAddress"] != "")
433 echo "<textarea name='ban" . $result_arr[$row]["PostID"] . "' class=''>$col</textarea> ";
436 else if($key == "IPAddress"){
437 if($col != "") echo "<input hidden name='ipd" . $result_arr[$row]["PostID"]. "' value='$col' />$col";
440 else if($key == "RepliesTo" && $col == "") echo "-";
441 else if($key == "BanComment" && $col == "") echo "-";
448 echo "</table><br/>";
449 echo "<input type='submit' value='Delete Entries' name='delete-button'>";
450 echo "<input type='submit' value='Toggle IP Ban' name='ban-button'>";
451 echo "<input type='submit' value='Set Unverifed' name='verify-button'>";
452 echo "<input type='submit' value='Send Entries' name='send-button'>";
455 echo "<h2>Verification Blocks</h2>";
456 echo "<form method='POST' action='proccess-mod.php'>";
457 //read from text file settings and place into inputs
458 $settings_file = JSON_Decode(file_get_contents($database_con->path_prefix
. "settings/verify-levels.json"), true);
459 if($settings_file["Image-Block"] == 0){
460 echo "<label><input type='checkbox' name='blockimg'>Block Images</label><br/>";
463 echo "<label><input type='checkbox' name='blockimg' checked>Block Images</label><br/>";
465 if($settings_file["URL-Block"] == 0){
466 echo "<label><input type='checkbox' name='blockurl'>Block URLS</label><br/>";
469 echo "<label><input type='checkbox' name='blockurl' checked>Block URLS</label><br/>";
471 if($settings_file["At-Block"] == 0){
472 echo "<label><input type='checkbox' name='blockat'>Block @ Links</label><br/>";
475 echo "<label><input type='checkbox' name='blockat' checked>Block @ Links</label><br/>";
477 if($settings_file["Filter-Text-Active"] == 0){
478 echo "<label><input type='checkbox' name='blocktext' id='blocktext'>Block Filtered Text</label><br/>";
479 if(sizeof($settings_file["Filter-Text"]) == 0){
480 echo "<span style='display:none' class='filters'>Item 1: <input type='text' name='filter1' '>
481 <a style='text-decoration:none' id='plus' class='fa fa-plus-circle' href='javascript:void(0)'></a ></span><br/>";
484 echo "<span style='display:none;margin:10px;' class='filters'>";
485 foreach($settings_file["Filter-Text"] as $index=>$filter){
486 $filter_number = $index +
1;
487 echo "Item $filter_number: <input type='text' name='filter$filter_number' value='$filter'>";
489 echo "<a style='text-decoration:none' id='plus' class='fa fa-plus-circle' href='javascript:void(0)'></a >";
497 echo "<label><input type='checkbox' name='blocktext' id='blocktext' checked>Block Filtered Text</label><br/>";
498 echo "<span style='display:block;margin:10px;' class='filters'>";
499 foreach($settings_file["Filter-Text"] as $index=>$filter){
500 $filter_number = $index +
1;
501 echo "Item $filter_number: <input type='text' name='filter$filter_number' value='$filter'>";
503 echo "<a style='text-decoration:none' id='plus' class='fa fa-plus-circle' href='javascript:void(0)'></a >";
509 //script to handel new filters
512 var blocktext_node=document.getElementById('blocktext');
513 blocktext_node.addEventListener('click', function(){
514 var filters = document.getElementsByClassName('filters');
515 if(blocktext_node.checked == false){
516 var len = filters.length;
517 console.log(filters);
518 for(var filter = 0; filter < len ; filter++){
519 filters[filter].style.display = 'none';
523 var len = filters.length;
524 console.log(filters);
525 for(var filter = 0; filter < len ; filter++){
526 filters[filter].style.display = 'block';
530 var plus = document.getElementById('plus');
531 plus.addEventListener('click',function(){
532 var filters = document.getElementsByClassName('filters');
533 var new_span = document.createElement('SPAN');
534 new_span.innerHTML='Item ' + (filters[filters.length-1].getElementsByTagName('INPUT').length + 1) + ': <input type=\'text\' name=\'filter' + (filters[filters.length-1].getElementsByTagName('INPUT').length + 1) + '\'></span><br/>';
535 filters[filters.length-1].appendChild(new_span);
539 echo "<br/><input type='submit' value='Set Verification Levels' name='levels-button'>";
542 else echo '</tbody><table border="1"><hr/><th>No Entries</th><tr></table>';
546 public static function logIntoAuthorizedSpace($post_fields, $client_ip, &$session_fields, $database_con){
547 if($post_fields["logout"] !== null){
548 $database_con->updatePost("Authorized", "LoggedInIP", $client_ip,
549 array("LoggedInIP" => null));
550 $session_fields["mod"] = "Good Samaritan";
557 $persistent_lookup = $database_con->getPostDetails("Authorized",
558 "LoggedInIP", $client_ip);
559 if(sizeof($persistent_lookup) > 0 ){
560 $session_fields["mod"] = "pervert";
561 header("Location: ");
564 $user_lookup = $database_con->getPostDetails("Authorized", "ModName", $post_fields["name"]);
565 if(sizeof($user_lookup) == 0) $name_false = true;
567 $password_hashed = hash("SHA512", $post_fields["pass"]);
568 if(strcasecmp($password_hashed, $user_lookup[0]["ModSha512"]) == 0){
569 if($post_fields["persistent-login"])
570 $database_con->updatePost("Authorized", "ModName", $post_fields["name"],
571 array("LoggedInIP" => $client_ip));
573 $database_con->updatePost("Authorized", "ModName", $post_fields["name"],
574 array("LoggedInIP" => null));
576 $session_fields["mod"] = "pervert";
577 header("Location: ");
579 else $pass_fail = true;
586 public static function createMediaNodeFromRaw($img_path_unprocessed){
587 $img_arr = explode(",", $img_path_unprocessed);
588 foreach($img_arr as $img){
589 $img = urldecode($img);
590 $img_ext = pathinfo($img, PATHINFO_EXTENSION
);
591 if(strcmp($img_ext, "png") == 0 ||
strcmp($img_ext, "jpg") == 0||
strcmp($img_ext, "gif") == 0)
592 echo "<td>" . BoardFunctions
::createImageNode($img) . "</td>";
594 echo "<td>" . BoardFunctions
::createVideoNode($img) . "</td>";
599 public static function createImageNode($img_path){
600 //return "<img src='$img_path' width='50%'/>";
601 return "<a href='$img_path'><img src='$img_path' class='img-fluid' style=''/></a>";
603 public static function createVideoNode($vid_path){
604 //return "<video src='$vid_path' autoplay='true' loop='true' width='50%'/>"
605 return "<a href='$vid_path'><video src='$vid_path' autoplay='true' loop='true' class='img-fluid' /></a>";
607 public static function buildAllThreads($build_type, $display_type, $database_con){
608 $threads = $database_con->getThreads();
612 if($build_type == "native"){
613 if($display_type == "list"){
614 foreach($threads as $thread){
615 $post_id = $thread[0];
616 echo "<div class='container px-0 my-4 border' PostNo='" . $post_id ."'>";
618 echo "<div class='border p-2 bg-light'>
621 <span>PostNo: " . $post_id ."</span>
625 <a href='/?thread=" . $post_id . "' class='px-4 py-0'>
630 <a href='https://twitter.com/Qazoku/status/". $post_id ."'>
639 <div class='row px-1 py-0'>
640 <div class='col-8 p-4'><blockquote>" . $thread["PostText"] ."</blockquote></div>
641 <div class='col-4'>";
642 if($thread["ImageURL"] !== null)
643 BoardFunctions
::createMediaNodeFromRaw($thread["ImageURL"]);
648 //if($thread_counter % $row_size == $row_size - 1) echo "</ul>";
652 foreach($threads as $thread){
653 $post_id = $thread[0];
654 echo "<div class='d-flex flex-wrap border w-25 m-4' PostNo='" . $post_id ."'>";
656 echo "<div class='border px-0 py-2 col-12 bg-light' style='height:5rem'>
659 <div class='col-1'></div>
660 <span class='col-10'>PostNo: " . $post_id ."</span>
662 <div class='col-1'></div>
665 <div class='col-1'></div>
667 <a href='/?thread=" . $post_id . "' class='px-4 py-0'>
671 <div class='col-1'></div>
673 <a href='https://twitter.com/Qazoku/status/". $post_id ."'>
682 <div class='px-1 py-0'>
683 <div class='row p-4'><blockquote>" . $thread["PostText"] ."</blockquote></div>
684 <div class='row col-12' style=''>";
685 if($thread["ImageURL"] !== null)
686 BoardFunctions
::createMediaNodeFromRaw($thread["ImageURL"]);
691 //if($thread_counter % $row_size == $row_size - 1) echo "</ul>";
698 require_once("class/twitter-connection.php");
700 $twitter_connection = new TwitterConnection();
702 if($display_type == "list"){
703 foreach($threads as $thread){
704 $post_id = $thread[0];
706 //if($thread_counter % $row_size == 0) echo"<ul class='row-container" . $list_add ."'>";
707 echo "<div class='container w-50 border p-0 m-4' PostNo='" . $post_id ."'>";
709 echo "<div class='border m-0 bg-light'>
712 <span>PostNo: " . $post_id ."</span>
716 <a href='/?thread=" . $post_id . "' class='px-4 py-0'>
721 <a href='https://twitter.com/Qazoku/status/". $post_id ."'>
729 echo "<div class='row'>
730 <div class='col-1'></div>
731 <div class='col-10 px-0 py-0'>";
732 echo $twitter_connection->getEmbededTweet($post_id)["html"];
734 <div class='col-1'></div>
738 //if($thread_counter % $row_size == $row_size - 1) echo "</ul>";
742 foreach($threads as $thread){
743 $post_id = $thread[0];
744 echo "<div class='d-flex flex-wrap border m-4' style='width:550px' PostNo='" . $post_id ."'>";
746 echo "<div class='border px-0 py-2 col-12 bg-light' style='height:5rem'>
749 <div class='col-1'></div>
750 <span class='col-10'>PostNo: " . $post_id ."</span>
752 <div class='col-1'></div>
755 <div class='col-1'></div>
757 <a href='/?thread=" . $post_id . "' class='px-4 py-0'>
761 <div class='col-1'></div>
763 <a href='https://twitter.com/Qazoku/status/". $post_id ."'>
772 <div class='px-1 py-0'>
774 <div class=''>" . $twitter_connection->getEmbededTweet($post_id)["html"] ."
778 //if($thread_counter % $row_size == $row_size - 1) echo "</ul>";
784 public static function buildThread($build_type, $display_type, $thread_id, $database_con){
786 $replies = $database_con->getReplies($thread_id);
787 //var_dump ($replies);
791 if($build_type == "native"){
792 foreach($replies as $reply){
793 $post_id = $reply[0];
794 echo "<div class='container px-0 my-4 border' PostNo='" . $post_id ."'>";
796 echo "<div class='border p-2 bg-light'>
799 <span>PostNo: " . $post_id ."</span>
803 <a href='/?thread=" . $post_id . "' class='px-4 py-0'>
808 <a href='https://twitter.com/Qazoku/status/". $post_id ."'>
817 <div class='row px-1 py-0'>
818 <div class='col-8 p-4'><blockquote>" . $reply["PostText"] ."</blockquote></div>
819 <div class='col-4'>";
820 if($reply["ImageURL"] !== null)
821 BoardFunctions
::createMediaNodeFromRaw($reply["ImageURL"]);
831 require_once("class/twitter-connection.php");
834 $twitter_connection = new TwitterConnection($connection->path_prefix
);
836 foreach($replies as $reply){
837 $post_id = $reply[0];
839 //if($thread_counter % $row_size == 0) echo"<ul class='row-container" . $list_add ."'>";
840 echo "<div class='container w-50 border p-0 m-4' PostNo='" . $post_id ."'>";
842 echo "<div class='border m-0 bg-light'>
845 <span>PostNo: " . $post_id ."</span>
849 <a href='/?thread=" . $post_id . "' class='px-4 py-0'>
854 <a href='https://twitter.com/Qazoku/status/". $post_id ."'>
862 echo "<div class='row'>
863 <div class='col-1'></div>
864 <div class='col-10 px-0 py-0'>";
865 echo $twitter_connection->getEmbededTweet($post_id)["html"];
867 <div class='col-1'></div>
871 //if($thread_counter % $row_size == $row_size - 1) echo "</ul>";
877 public static function uploadMedia($filename,$url){
878 echo("<br/>" . $filename . " " . $url . "<br/>");
879 $file_binary = file_get_contents($url);
880 fopen($filename, "w");
881 file_put_contents($filename, $file_binary);