Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*includes*/
- include("config.php");
- include("database.class.php");
- include("user.class.php");
- /*vars*/
- $allowed = array("png", "ico", "jpeg", "jfif", "exif", "tiff", "raw", "png", "gif", "bmp", "ppm", "pgm", "pbm", "pnm", "webp", "tag", "ilmb", "pcx", "ecw", "img", "sid", "cd5", "fits", "pgf", "xcf", "psd", "psp", "cmg", "svg", "ai", "xgl", "iges", "vrml", "step", "dwf", "xaml", "x3d", "xvrml", "jt", "3dxml", "ipa", "prc", "3d", "3df", "hsf", "xvl", "stl", "u3d", "imml", "skp", "cdr", "eps", "hvif", "hpgl", "myv", "odg", "pict", "pdf", "pgf", "regis", "swf", "vml", "wmf", "xaml", "xar", "xps", "jpg");
- $db = new database($config['host'], $config['user'], $config['pass'], $config['db']);
- /*function*/
- function bb2html($text) {
- $bbcode = array("<", ">", "[list]", "[*]", "[/list]", "[img]", "[/img]", "[b]", "[/b]", "[u]", "[/u]", "[i]", "[/i]", "[color=\"", "[/color]", "[size=\"", "[/size]", "[url=\"", "[/url]", "[mail=\"", "[/mail]", "[code]", "[/code]", "[quote]", "[/quote]", "\"]");
- $htmlcode = array("<", ">", "<ul>", "<li>", "</ul>", "<img src=\"", "\">", "<b>", "</b>", "<u>", "</u>", "<i>", "</i>", "<span style=\"color", "</span>", "<span style=\"font-size:", "</span>", "<a href=\"", "</a>", "<a href=\"mailto:", "</a>", "<code>", "</code>", "<table width=100% bgcolor=lightgray><tr><td bgcolor=white>", "</td></tr></table>", "\">");
- $newtext = str_replace($bbcode, $htmlcode, $text);
- $newtext = nl2br($newtext);
- return $newtext;
- }
- function random($length){
- $newcode = "";
- $x = "";
- while($x < $length){
- $part = rand(1, 3);
- $a = ($part == 1) ? 48 : ($part == 2) ? 65 : 097;
- $b = ($part == 1) ? 57 : ($part == 2) ? 90 : 122;
- $code_part = chr(rand($a, $b));
- $x = $x + 1;
- $newcode = $newcode.$code_part;
- }
- return $newcode;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement