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() { $types_allowed = array(); if (TINYIB_PIC) { array_push($types_allowed, "GIF", "JPG", "PNG"); } if (TINYIB_SWF) { array_push($types_allowed, "SWF"); } if (TINYIB_WEBM) { array_push($types_allowed, "WebM"); } $i = 0; $types_count = count($types_allowed); $types_formatted = ""; foreach ($types_allowed as $type) { if (++$i >= $types_count - 1) { $types_formatted .= $type . ($i == $types_count - 1 && $types_count > 1 ? " and " : ""); } else { $types_formatted .= $type . ", "; } } if ($types_formatted != "") { return "Supported file type" . ($types_count != 1 ? "s are " : " is ") . $types_formatted . "."; } return $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 (!isset($post["omitted"])) { $post["omitted"] = 0; } $embed = ''; if ($post["file_hex"] == "YouTube" || $post["file_hex"] == "Vimeo" || $post["file_hex"] == "SoundCloud") { $embed = str_replace("'", "\'", $post['file']); } if ($post["parent"] != TINYIB_NEWTHREAD) { $return .= << ¨ EOF; } elseif ($embed != "") { $return .= <<Embed: ${post["file_original"]}–(${post["file_hex"]})
${post[ EOF; } elseif ($post["file"] != "") { $return .= <<File: ${post["file"]}–(${post["file_size_formatted"]}, ${post["image_width"]}x${post["image_height"]}, ${post["file_original"]})
${post[ EOF; } $return .= <<