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(){
117 echo'<div class="card w-75 mx-5 my-0">
118 <div class="card-header">
119 <button class="btn btn-link" data-toggle="collapse" data-target="#comment-fields" aria-expanded="true" aria-controls="comment-fields">Comment</button>
121 <div id="comment-fields" class="collapse px-5 pt-2 pb-5">
122 <form action="add-to-queue.php" enctype="multipart/form-data" method="POST" target="_self" id="submit-form">
124 <textarea id="Comment" name="comment" rows="10" class="form-control" placeholder = "Comment Text Here"></textarea>
125 <p id="CharacterCount" class="lead"></p>
127 <input name="MAX_FILE_SIZE" type="hidden" value="5242880" />
128 <div class="dropdown">
129 <button class="btn dropdown-toggle" type="button" id="file-container" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Add Image</button>
130 <div class="dropdown-menu pt-3" aria-labelledby="file-container">
131 <input name="file1" type="file" id="f1" class="dropdown-item form-control-file"/>
132 <input name="file2" type="file" id="f2" class="dropdown-item form-control-file"/>
133 <input name="file3" type="file" id="f3" class="dropdown-item form-control-file"/>
134 <input name="file4" type="file" id="f4" class="dropdown-item form-control-file"/>
138 <div id="errorMsg" class="alert alert-warning" role="alert">Input a comment and/or file</div>
139 <input id="submit-button" class="btn btn-secondary form-control" type="submit" disabled="1"/></form>
145 public static function buildPassForm(){
146 echo"<form action='' method='POST'>
147 <input name='name'><br/>
148 <input name='pass' type='password'><br/>
149 <input type='submit' id='authorization-input' value='Authorize'><br/>
150 <label>Stay Logged In: <input type='checkbox' name='persistent-login'></label><br/></form>";
155 public static function retrieveTwitterTimeline($connection_tw, $connection_db){
156 $timeline_tweets = $connection_tw->retrieveTimeline();
157 StandardFunctions
::recursiveEchoJson($combined_database_arr,0);
159 echo sizeof($timeline_tweets) . "<pre>";
160 if(sizeof($timeline_tweets) != 0){
161 $connection_db->addTimelineTweetsToDatabase($timeline_tweets);
167 public static function checkSubmissionValid($tweet_comment="", $file_string="",$database_con){
169 BoardFunctions
::$comment_error = 0;
170 $tweet_comment = trim($tweet_comment);
171 $banned = $database_con->getPostDetails("Banned", "IPAddress", $_SERVER['HTTP_X_REAL_IP'])[0]["BanComment"];
172 $banned = str_replace(" ", "_", $banned);
174 BoardFunctions
::$comment_error = "-5 $banned";
176 else if(mb_strlen($tweet_comment) > $COMMENT_MAX){
177 BoardFunctions
::$comment_error = "-3 Comment-too-long";
179 else if(mb_strlen($tweet_comment) == 0){
180 BoardFunctions
::$comment_error = "-4 No Comment";
182 else if(preg_match("/VERIFY: /", $tweet_comment) == 0){
183 $filters = JSON_Decode(file_get_contents("settings/verify-levels.json"), true);
184 if($filters["Image-Block"] == 1 && !($file_string == "" ||
$file_string == NULL))
185 BoardFunctions
::$comment_error = "-2 Images_disabled";
186 else if($filters["URL-Block"] == 1 && (preg_match("/http/", $tweet_comment) == 1 ||
preg_match("/\.com/", $tweet_comment) == 1))
187 BoardFunctions
::$comment_error = "-2 URLs_disabled";
188 else if($filters["At-Block"] == 1 && preg_match("/@/", $tweet_comment) == 1)
189 BoardFunctions
::$comment_error = "-2 @_links_disabled";
190 else if($filters["Filter-Text-Active"] == 1){
191 foreach($filters["Filter-Text"] as $filter){
192 if(preg_match("/$filter/", $tweet_comment) == 1) {
193 BoardFunctions
::$comment_error = "-2 Remove_$filter";
198 return $tweet_comment;
201 public static function uploadAndVerify($files){
206 for($file = 0; $file < 4; $file++
){
208 if($files[$file] == "") {
209 //echo "file " . (string)$file .", Empty<br/>";
210 BoardFunctions
::$die_state[$file] = 5;
214 $file_components = explode("=", ($files[$file]));
215 $file_name = urldecode($file_components[0]);
216 $file_data = $file_components[1];
217 $upload_location = "images/" . $file_name;
220 if(file_exists($upload_location)) {
221 //echo "file " . (string)$file .", Duplicate ($upload_location)<br/>";
222 BoardFunctions
::$die_state[$file] = 6;
226 $dir_file = fopen($upload_location, "w");
227 fwrite($dir_file, base64_decode($file_data));
229 $file_size = filesize ($upload_location);//https://softwareengineering.stackexchange.com/questions/288670/know-file-size-with-a-base64-string
231 //over filesize check
232 if($file_size >= $FILE_MAX){
233 //echo "file" . (string)$file ." Over filesize limit-Server $file_size<br/>";
234 BoardFunctions
::$die_state[$file] = 1;
235 unlink($upload_location);
240 $file_string .= rawurlencode($upload_location);
244 $file_string .= "," . rawurlencode($upload_location);
247 BoardFunctions
::$die_state[$file] = 0;
252 public static function displayTabularDatabase($table_name, $ordering_param, $display_images = false){
253 echo "<br/>Displaying All entries(lower number means posted sooner): <br/>";
254 $statement = $this->connection
->prepare("Select * from $table_name ORDER BY :param DESC;");
255 $statement->bindParam(":param", $ordering_param);
256 $statement->execute();
257 $result_arr = $statement->fetchAll();
258 if(sizeof($result_arr) !== 0){
259 foreach($result_arr[0] as $key=>$head){
260 if(is_numeric ($key)) unset($result_arr[0][$key]);
263 echo "<table border='1' class='table table-striped'><tr> <thead class='table-dark'><tr>";
264 foreach($result_arr[0] as $key=>$head_item)
265 echo "<th>$key</th>";
266 echo "</thead></tr><tbody>";
268 for($row = sizeof($result_arr) - 1; $row >= 0 ; $row--){
270 $tupple = $result_arr[$row];
272 foreach($tupple as $key=>$col){
273 if(is_numeric ($key)) unset($result_arr[0][$key]);
275 if($column == 2 && $display_images){
276 $img_arr = explode(",", $col);
277 foreach($img_arr as $img){
278 $img = urldecode($img);
279 $img_ext = pathinfo($img, PATHINFO_EXTENSION
);
280 if(strcmp($img_ext, "png") == 0 ||
strcmp($img_ext, "jpg") == 0||
strcmp($img_ext, "gif") == 0)
281 echo "<td>" . $this->createImageNode($img) . "</td>";
283 echo "<td>" . $this->createVideoNode($img) . "</td>";
288 if($key == "PostNo") echo "<td>$col - $row</td>";
289 else echo "<td>$col</td>";
296 echo "</tbody></table><hr/>";
298 else echo '<table border="1"><hr/><th>No Entries</th><tr></table>';
302 public static function displayTabularJoin($table_name, $join_with, $ordering_param, $skip_col, $display_images = false, $database_con, $ordering = "ASC"){
303 echo "<h3>Displaying All Combined Entries(lower number means posted sooner): </h3>";
304 $result_arr = $database_con->getAllSubmissionDetails($table_name, $join_with, $ordering_param,$ordering);
306 if(sizeof($result_arr) !== 0){
307 foreach($result_arr[0] as $key=>$head){
308 if(is_numeric ($key)) unset($result_arr[0][$key]);
311 echo "<table border='1' class='table table-striped'><tr> <thead class='table-dark'>";
312 foreach($result_arr[0] as $key=>$head_item){
313 if($column++
== $skip_col) continue;
314 echo "<th>$key</th>";
316 echo "</tr> </thead><tbody>";
320 for($row = sizeof($result_arr) - 1; $row >= 0 ; $row--){
322 $tupple = $result_arr[$row];
324 foreach($tupple as $key=>$col){
326 if(is_numeric ($key)) {
327 unset($result_arr[0][$key]);
330 else if($column == $skip_col){
336 if($key=="Unverified"){
338 if($col == "1") echo "Withheld"; //is unverified
339 else if ($col == "-1") echo "Banned"; //banned
340 else if($col == "187") echo "Duplicate"; //is not unverified
341 else if($col == "170") echo "No Contents"; //is not unverified
342 else if($col == "0") echo "Verified"; //is not unverified
346 else if($key == "PostNo") echo "$col - $row";
347 else if($key == "ImageURL" && $display_images){
348 $img_arr = explode(",", $col);
349 foreach($img_arr as $img){
350 $img = urldecode($img);
351 $img_ext = pathinfo($img, PATHINFO_EXTENSION
);
352 if(strcmp($img_ext, "png") == 0 ||
strcmp($img_ext, "jpg") == 0||
strcmp($img_ext, "gif") == 0)
353 echo BoardFunctions
::createImageNode($img);
354 else if(strcmp($img_ext, "mp4") == 0)
355 echo BoardFunctions
::createVideoNode($img);
365 echo "</tbody></table><hr/>";
367 else echo '<table border="1"><hr/><th>No Entries</th><tr></table>';
371 public static function displayVerificationForm($display_images = false, $database_con, $ordering = "DESC"){
372 echo "<h3>Displaying All Data(lower number means posted sooner): </h3>";
373 $result_arr = $database_con->getVerificationDetails($ordering);
374 if(sizeof($result_arr) !== 0){
375 echo "<form method='POST' action='proccess-mod.php'><table border='1' class='table table-striped'><thead class='table-dark'><tr>";
376 echo "<th>Item Selected</th>";
377 foreach($result_arr[0] as $key=>$head_item){
378 if(!is_numeric ($key)) echo "<th>$key</th>";
380 echo "</thead></tr></tbody>";
381 for($row = 0; $row <= sizeof($result_arr) - 1 ; $row++
){
382 if($result_arr[$row][0] != null){
383 $result_arr[$row]["PostID"] = $result_arr[$row][0];
385 if($result_arr[$row][6] != null){
386 $result_arr[$row]["IPAddress"] = $result_arr[$row][6];
389 echo "<td><input type='checkbox' name='chk". $result_arr[$row]["PostID"] ."' /></td>";
391 $tupple = $result_arr[$row];
393 foreach($tupple as $key=>$col){
395 if(is_numeric ($key)) {
396 unset($result_arr[0][$key]);
401 if($key=="Unverified"){
403 if($col == "1") echo "Withheld"; //is unverified
404 else if($col == "187") echo "Duplicate"; //is not unverified
405 else if($col == "170") echo "No Contents"; //is not unverified
406 else if($col == "0") echo "Verified"; //is not unverified
407 else if($result_arr[$row]["RepliesTo"] == "") echo "Posted";
408 else if($result_arr[$row]["RepliesTo"] != "") echo "Replied";
410 if ($col == "") $col = "-";
412 if($col == "1" ||
$col == "0") echo ": <input placeholder='$col' name='unv". $result_arr[$row]["PostID"] ."' class=''/>";
414 else if($key == "PostID") echo ($row+
1) . " - $col";
415 else if($key == "ImageURL" && $display_images){
416 $img_arr = explode(",", $col);
417 if($img_arr[0] == "") echo "<strong>None</strong>";
418 foreach($img_arr as $img){
419 $img = urldecode($img);
420 $img_ext = pathinfo($img, PATHINFO_EXTENSION
);
421 if(strcmp($img_ext, "png") == 0 ||
strcmp($img_ext, "jpg") == 0||
strcmp($img_ext, "gif") == 0)
422 echo BoardFunctions
::createImageNode($img);
423 else if(strcmp($img_ext, "mp4") == 0)
424 echo BoardFunctions
::createVideoNode($img);
429 else if($key == "BanComment"){
430 if( $result_arr[$row]["IPAddress"] != "")
431 echo "<textarea name='ban" . $result_arr[$row]["PostID"] . "' class=''>$col</textarea> ";
434 else if($key == "IPAddress"){
435 if($col != "") echo "<input hidden name='ipd" . $result_arr[$row]["PostID"]. "' value='$col' />$col";
438 else if($key == "RepliesTo" && $col == "") echo "-";
439 else if($key == "BanComment" && $col == "") echo "-";
446 echo "</table><br/>";
447 echo "<input type='submit' value='Delete Entries' name='delete-button'>";
448 echo "<input type='submit' value='Toggle IP Ban' name='ban-button'>";
449 echo "<input type='submit' value='Set Unverifed' name='verify-button'>";
450 echo "<input type='submit' value='Send Entries' name='send-button'>";
453 echo "<h2>Verification Blocks</h2>";
454 echo "<form method='POST' action='proccess-mod.php'>";
455 //read from text file settings and place into inputs
456 $settings_file = JSON_Decode(file_get_contents($database_con->path_prefix
. "settings/verify-levels.json"), true);
457 if($settings_file["Image-Block"] == 0){
458 echo "<label><input type='checkbox' name='blockimg'>Block Images</label><br/>";
461 echo "<label><input type='checkbox' name='blockimg' checked>Block Images</label><br/>";
463 if($settings_file["URL-Block"] == 0){
464 echo "<label><input type='checkbox' name='blockurl'>Block URLS</label><br/>";
467 echo "<label><input type='checkbox' name='blockurl' checked>Block URLS</label><br/>";
469 if($settings_file["At-Block"] == 0){
470 echo "<label><input type='checkbox' name='blockat'>Block @ Links</label><br/>";
473 echo "<label><input type='checkbox' name='blockat' checked>Block @ Links</label><br/>";
475 if($settings_file["Filter-Text-Active"] == 0){
476 echo "<label><input type='checkbox' name='blocktext' id='blocktext'>Block Filtered Text</label><br/>";
477 if(sizeof($settings_file["Filter-Text"]) == 0){
478 echo "<span style='display:none' class='filters'>Item 1: <input type='text' name='filter1' '>
479 <a style='text-decoration:none' id='plus' class='fa fa-plus-circle' href='javascript:void(0)'></a ></span><br/>";
482 echo "<span style='display:none;margin:10px;' class='filters'>";
483 foreach($settings_file["Filter-Text"] as $index=>$filter){
484 $filter_number = $index +
1;
485 echo "Item $filter_number: <input type='text' name='filter$filter_number' value='$filter'>";
487 echo "<a style='text-decoration:none' id='plus' class='fa fa-plus-circle' href='javascript:void(0)'></a >";
495 echo "<label><input type='checkbox' name='blocktext' id='blocktext' checked>Block Filtered Text</label><br/>";
496 echo "<span style='display:block;margin:10px;' class='filters'>";
497 foreach($settings_file["Filter-Text"] as $index=>$filter){
498 $filter_number = $index +
1;
499 echo "Item $filter_number: <input type='text' name='filter$filter_number' value='$filter'>";
501 echo "<a style='text-decoration:none' id='plus' class='fa fa-plus-circle' href='javascript:void(0)'></a >";
507 //script to handel new filters
510 var blocktext_node=document.getElementById('blocktext');
511 blocktext_node.addEventListener('click', function(){
512 var filters = document.getElementsByClassName('filters');
513 if(blocktext_node.checked == false){
514 var len = filters.length;
515 console.log(filters);
516 for(var filter = 0; filter < len ; filter++){
517 filters[filter].style.display = 'none';
521 var len = filters.length;
522 console.log(filters);
523 for(var filter = 0; filter < len ; filter++){
524 filters[filter].style.display = 'block';
528 var plus = document.getElementById('plus');
529 plus.addEventListener('click',function(){
530 var filters = document.getElementsByClassName('filters');
531 var new_span = document.createElement('SPAN');
532 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/>';
533 filters[filters.length-1].appendChild(new_span);
537 echo "<br/><input type='submit' value='Set Verification Levels' name='levels-button'>";
540 else echo '</tbody><table border="1"><hr/><th>No Entries</th><tr></table>';
544 public static function logIntoAuthorizedSpace($post_fields, $client_ip, &$session_fields, $database_con){
545 if($post_fields["logout"] !== null){
546 $database_con->updatePost("Authorized", "LoggedInIP", $client_ip,
547 array("LoggedInIP" => null));
548 $session_fields["mod"] = "Good Samaritan";
555 $persistent_lookup = $database_con->getPostDetails("Authorized",
556 "LoggedInIP", $client_ip);
557 if(sizeof($persistent_lookup) > 0 ){
558 $session_fields["mod"] = "pervert";
559 header("Location: ");
562 $user_lookup = $database_con->getPostDetails("Authorized", "ModName", $post_fields["name"]);
563 if(sizeof($user_lookup) == 0) $name_false = true;
565 $password_hashed = hash("SHA512", $post_fields["pass"]);
566 if(strcasecmp($password_hashed, $user_lookup[0]["ModSha512"]) == 0){
567 if($post_fields["persistent-login"])
568 $database_con->updatePost("Authorized", "ModName", $post_fields["name"],
569 array("LoggedInIP" => $client_ip));
571 $database_con->updatePost("Authorized", "ModName", $post_fields["name"],
572 array("LoggedInIP" => null));
574 $session_fields["mod"] = "pervert";
575 header("Location: ");
577 else $pass_fail = true;
584 public static function createMediaNodeFromRaw($img_path_unprocessed){
585 $img_arr = explode(",", $img_path_unprocessed);
586 foreach($img_arr as $img){
587 $img = urldecode($img);
588 $img_ext = pathinfo($img, PATHINFO_EXTENSION
);
589 if(strcmp($img_ext, "png") == 0 ||
strcmp($img_ext, "jpg") == 0||
strcmp($img_ext, "gif") == 0)
590 echo "<td>" . BoardFunctions
::createImageNode($img) . "</td>";
592 echo "<td>" . BoardFunctions
::createVideoNode($img) . "</td>";
597 public static function createImageNode($img_path){
598 //return "<img src='$img_path' width='50%'/>";
599 return "<a href='$img_path'><img src='$img_path' class='img-fluid' style=''/></a>";
601 public static function createVideoNode($vid_path){
602 //return "<video src='$vid_path' autoplay='true' loop='true' width='50%'/>"
603 return "<a href='$vid_path'><video src='$vid_path' autoplay='true' loop='true' class='img-fluid' /></a>";
605 public static function buildAllThreads($build_type, $display_type, $database_con){
606 $threads = $database_con->getThreads();
610 if($build_type == "native"){
611 if($display_type == "list"){
612 foreach($threads as $thread){
613 $post_id = $thread[0];
614 echo "<div class='container px-0 my-4 border' PostNo='" . $post_id ."'>";
616 echo "<div class='border p-2 bg-light'>
619 <span>PostNo: " . $post_id ."</span>
623 <a href='/?thread=" . $post_id . "' class='px-4 py-0'>
628 <a href='https://twitter.com/Qazoku/status/". $post_id ."'>
637 <div class='row px-1 py-0'>
638 <div class='col-8 p-4'><blockquote>" . $thread["PostText"] ."</blockquote></div>
639 <div class='col-4'>";
640 if($thread["ImageURL"] !== null)
641 BoardFunctions
::createMediaNodeFromRaw($thread["ImageURL"]);
646 //if($thread_counter % $row_size == $row_size - 1) echo "</ul>";
650 foreach($threads as $thread){
651 $post_id = $thread[0];
652 echo "<div class='d-flex flex-wrap border w-25 m-4' PostNo='" . $post_id ."'>";
654 echo "<div class='border px-0 py-2 col-12 bg-light' style='height:5rem'>
657 <div class='col-1'></div>
658 <span class='col-10'>PostNo: " . $post_id ."</span>
660 <div class='col-1'></div>
663 <div class='col-1'></div>
665 <a href='/?thread=" . $post_id . "' class='px-4 py-0'>
669 <div class='col-1'></div>
671 <a href='https://twitter.com/Qazoku/status/". $post_id ."'>
680 <div class='px-1 py-0'>
681 <div class='row p-4'><blockquote>" . $thread["PostText"] ."</blockquote></div>
682 <div class='row col-12' style=''>";
683 if($thread["ImageURL"] !== null)
684 BoardFunctions
::createMediaNodeFromRaw($thread["ImageURL"]);
689 //if($thread_counter % $row_size == $row_size - 1) echo "</ul>";
696 require_once("class/twitter-connection.php");
698 $twitter_connection = new TwitterConnection();
700 if($display_type == "list"){
701 foreach($threads as $thread){
702 $post_id = $thread[0];
704 //if($thread_counter % $row_size == 0) echo"<ul class='row-container" . $list_add ."'>";
705 echo "<div class='container w-50 border p-0 m-4' PostNo='" . $post_id ."'>";
707 echo "<div class='border m-0 bg-light'>
710 <span>PostNo: " . $post_id ."</span>
714 <a href='/?thread=" . $post_id . "' class='px-4 py-0'>
719 <a href='https://twitter.com/Qazoku/status/". $post_id ."'>
727 echo "<div class='row'>
728 <div class='col-1'></div>
729 <div class='col-10 px-0 py-0'>";
730 echo $twitter_connection->getEmbededTweet($post_id)["html"];
732 <div class='col-1'></div>
736 //if($thread_counter % $row_size == $row_size - 1) echo "</ul>";
740 foreach($threads as $thread){
741 $post_id = $thread[0];
742 echo "<div class='d-flex flex-wrap border m-4' style='width:550px' PostNo='" . $post_id ."'>";
744 echo "<div class='border px-0 py-2 col-12 bg-light' style='height:5rem'>
747 <div class='col-1'></div>
748 <span class='col-10'>PostNo: " . $post_id ."</span>
750 <div class='col-1'></div>
753 <div class='col-1'></div>
755 <a href='/?thread=" . $post_id . "' class='px-4 py-0'>
759 <div class='col-1'></div>
761 <a href='https://twitter.com/Qazoku/status/". $post_id ."'>
770 <div class='px-1 py-0'>
772 <div class=''>" . $twitter_connection->getEmbededTweet($post_id)["html"] ."
776 //if($thread_counter % $row_size == $row_size - 1) echo "</ul>";
782 public static function buildThread($build_type, $display_type, $thread_id, $database_con){
784 $replies = $database_con->getReplies($thread_id);
785 //var_dump ($replies);
789 if($build_type == "native"){
790 foreach($replies as $reply){
791 $post_id = $reply[0];
792 echo "<div class='container px-0 my-4 border' PostNo='" . $post_id ."'>";
794 echo "<div class='border p-2 bg-light'>
797 <span>PostNo: " . $post_id ."</span>
801 <a href='/?thread=" . $post_id . "' class='px-4 py-0'>
806 <a href='https://twitter.com/Qazoku/status/". $post_id ."'>
815 <div class='row px-1 py-0'>
816 <div class='col-8 p-4'><blockquote>" . $reply["PostText"] ."</blockquote></div>
817 <div class='col-4'>";
818 if($reply["ImageURL"] !== null)
819 BoardFunctions
::createMediaNodeFromRaw($reply["ImageURL"]);
829 require_once("class/twitter-connection.php");
832 $twitter_connection = new TwitterConnection($connection->path_prefix
);
834 foreach($replies as $reply){
835 $post_id = $reply[0];
837 //if($thread_counter % $row_size == 0) echo"<ul class='row-container" . $list_add ."'>";
838 echo "<div class='container w-50 border p-0 m-4' PostNo='" . $post_id ."'>";
840 echo "<div class='border m-0 bg-light'>
843 <span>PostNo: " . $post_id ."</span>
847 <a href='/?thread=" . $post_id . "' class='px-4 py-0'>
852 <a href='https://twitter.com/Qazoku/status/". $post_id ."'>
860 echo "<div class='row'>
861 <div class='col-1'></div>
862 <div class='col-10 px-0 py-0'>";
863 echo $twitter_connection->getEmbededTweet($post_id)["html"];
865 <div class='col-1'></div>
869 //if($thread_counter % $row_size == $row_size - 1) echo "</ul>";
875 public static function uploadMedia($filename,$url){
876 echo("<br/>" . $filename . " " . $url . "<br/>");
877 $file_binary = file_get_contents($url);
878 fopen($filename, "w");
879 file_put_contents($filename, $file_binary);