' : ''; $return = << EOF; $return .= TINYIB_BOARDDESC . <<<EOF $js_captcha EOF; return $return; } function pageFooter() { // If the footer link is removed from the page, please link to TinyIB somewhere on the site. // This is all I ask in return for the free software you are using. return << - futaba + futallaby + tinyib - EOF; } function supportedFileTypes() { global $tinyib_uploads; if (empty($tinyib_uploads)) { return ""; } $types_allowed = array_map('strtoupper', array_unique(array_column($tinyib_uploads, 0))); $types_last = array_pop($types_allowed); $types_formatted = $types_allowed ? implode(', ', $types_allowed) . ' and ' . $types_last : $types_last; return "Supported file type" . (count($tinyib_uploads) != 1 ? "s are " : " is ") . $types_formatted . "."; } function makeLinksClickable($text) { $text = preg_replace('!(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%\!_+.,~#?&;//=]+)!i', '$1', $text); $text = preg_replace('/\(\(.*)\)\<\/a>/i', '($2)', $text); $text = preg_replace('/\(.*)\.\<\/a>/i', '$2.', $text); $text = preg_replace('/\(.*)\,\<\/a>/i', '$2,', $text); return $text; } function buildPost($post, $res) { $return = ""; $threadid = ($post['parent'] == TINYIB_NEWTHREAD) ? $post['id'] : $post['parent']; if ($res == TINYIB_RESPAGE) { $reflink = "No.{$post['id']}"; } else { $reflink = "No.{$post['id']}"; } if ($post["stickied"] == 1) { $reflink .= ' Stickied'; } if (!isset($post["omitted"])) { $post["omitted"] = 0; } $filehtml = ''; $filesize = ''; $expandhtml = ''; $direct_link = isEmbed($post["file_hex"]) ? "#" : (($res == TINYIB_RESPAGE ? "../" : "") . "src/" . $post["file"]); if ($post['parent'] == TINYIB_NEWTHREAD && $post["file"] != '') { $filesize .= isEmbed($post['file_hex']) ? 'Embed: ' : 'File: '; } if (isEmbed($post["file_hex"])) { $expandhtml = $post['file']; } else if (substr($post['file'], -5) == '.webm') { $dimensions = 'width="500" height="50"'; if ($post['image_width'] > 0 && $post['image_height'] > 0) { $dimensions = 'width="' . $post['image_width'] . '" height="' . $post['image_height'] . '"'; } $expandhtml = << EOF; } else if (in_array(substr($post['file'], -4), array('.jpg', '.png', '.gif'))) { $expandhtml = ""; } $thumblink = ""; $expandhtml = rawurlencode($expandhtml); if (isEmbed($post["file_hex"])) { $filesize .= "${post['file_original']}–(${post['file_hex']})"; } else if ($post["file"] != '') { $filesize .= $thumblink . "${post["file"]}–(${post["file_size_formatted"]}"; if ($post["image_width"] > 0 && $post["image_height"] > 0) { $filesize .= ", " . $post["image_width"] . "x" . $post["image_height"]; } if ($post["file_original"] != "") { $filesize .= ", " . $post["file_original"]; } $filesize .= ")"; } if ($filesize != '') { $filesize = '' . $filesize . ''; } if ($filesize != '') { if ($post['parent'] != TINYIB_NEWTHREAD) { $filehtml .= '
'; } $filehtml .= $filesize . '
'; if ($post["thumb_width"] > 0 && $post["thumb_height"] > 0) { $filehtml .= << EOF; } $filehtml .= '
'; if ($expandhtml != '') { $filehtml .= <<