if ($it1 != IMAGETYPE_GIF && $it1 != IMAGETYPE_JPEG && $it1 != IMAGETYPE_PNG) {
    $HTMLOUT .= "<h1>{$lang['bitbucket_upfail']}<br />{$lang['bitbucket_sorry']}";
    exit;
}
$file = strtolower($file);
$path = $bucketdir . $USERSALT . '_' . $file;
$pathlink = $bucketlink . $USERSALT . '_' . $file;
$loop = 0;
while (true) {
    if ($loop > 10) {
        stderr($lang['bitbucket_error'], $lang['bitbucket_upfail']);
    }
    if (!file_exists($path)) {
        break;
    }
    $randb = bucketrand();
    $path = $bucketdir . $USERSALT . '_' . $randb . $file;
    $pathlink = $bucketlink . $USERSALT . '_' . $randb . $file;
    $loop++;
}
if (!move_uploaded_file($_FILES['file']['tmp_name'], $path)) {
    stderr($lang['bitbucket_error'], $lang['bitbucket_upfail']);
}
if (isset($_POST["from"]) && $_POST["from"] == "upload") {
    echo "<p><b><font color='red'>{$lang['bitbucket_success']}</b></p>\n<p><b><strong>" . $address . "img.php/" . $pathlink . "</strong></font></b></p>";
    exit;
}
$HTMLOUT .= "<table width=\"300\" align=\"center\">\n<tr class=\"clear\">\n<td align=\"center\"><p><a href=\"" . $_SERVER['PHP_SELF'] . "\"><strong>{$lang['bitbucket_up_another']}</strong></a></p>\n<p>{$lang['bitbucket_thefile']}</p>\n<p><img src=\"" . $address . "img.php/" . $pathlink . "\" border=\"0\" alt=\"\"/></p>";
$HTMLOUT .= "<script type=\"text/javascript\">\n/*<![CDATA[*/\nfunction SelectAll(id)\n{\ndocument.getElementById(id).focus();\ndocument.getElementById(id).select();\n}\n/*]]>*/\n</script>";
$HTMLOUT .= "<p>{$lang['bitbucket_directlink']}<br />\n<input style=\"font-size: 9pt;text-align: center;\" id=\"direct\" onclick=\"SelectAll('direct');\" type=\"text\" size=\"70\" value=\"" . $address . "img.php/" . $pathlink . "\" readonly=\"readonly\" /></p>\n<p align=\"center\">{$lang['bitbucket_tags']}\n<input style=\"font-size: 9pt;text-align: center;\" id=\"tag\" onclick=\"SelectAll('tag');\" type=\"text\" size=\"70\" value=\"[img]" . $address . "img.php/" . $pathlink . "[/img]\" readonly=\"readonly\" /></p>\n<p align=\"center\"><a href=\"{$INSTALLER09['baseurl']}/bitbucket.php?images=1\">{$lang['bitbucket_viewmyi']}</a></p>\n<p align=\"center\"><a href=\"{$INSTALLER09['baseurl']}/bitbucket.php?images=2\">{$lang['bitbucket_viewmya']}</a></p>\n</td>\n</tr>\n</table>";
echo stdhead($lang['bitbucket_bitbucket']) . $HTMLOUT . stdfoot();
Example #2
0
}
$it1 = exif_imagetype($_FILES['file']['tmp_name']);
if ($it1 != IMAGETYPE_GIF && $it1 != IMAGETYPE_JPEG && $it1 != IMAGETYPE_PNG) {
    $HTMLOUT .= "<h1>{$lang['bitbucket_upfail']}<br />{$lang['bitbucket_sorry']}";
    exit;
}
$path = $bucketdir . $CURUSER['username'] . '_' . $file;
$loop = 0;
while (true) {
    if ($loop > 10) {
        stderr($lang['bitbucket_error'], $lang['bitbucket_upfail']);
    }
    if (!file_exists($path)) {
        break;
    }
    $path = $bucketdir . $CURUSER['username'] . '_' . bucketrand() . $file;
    $loop++;
}
if (!move_uploaded_file($_FILES['file']['tmp_name'], $path)) {
    stderr($lang['bitbucket_error'], $lang['bitbucket_upfail']);
}
if (isset($_POST["from"]) && $_POST["from"] == "upload") {
    $HTMLOUT .= "<p><b><font color='red'>{$lang['bitbucket_success']}</b></p>\r\n<p><b><strong>{$address}/{$path}</strong></font></b></p>";
    exit;
}
$HTMLOUT .= "<table width=\"300\" align=\"center\">\r\n<tr class=\"clear\">\r\n<td align=\"center\"><p><a href=\"" . $_SERVER['PHP_SELF'] . "\"><strong>{$lang['bitbucket_up_another']}</strong></a></p>\r\n<p>{$lang['bitbucket_thefile']}</p>\r\n<p><img src=\"" . $address . $path . "\" border=\"0\" alt=\"\"/></p>";
$HTMLOUT .= "<script type=\"text/javascript\">\r\n/*<![CDATA[*/\r\nfunction SelectAll(id)\r\n{\r\ndocument.getElementById(id).focus();\r\ndocument.getElementById(id).select();\r\n}\r\n/*]]>*/\r\n</script>";
$HTMLOUT .= "<p>{$lang['bitbucket_directlink']}<br />\r\n<input style=\"font-size: 9pt;text-align: center;\" id=\"direct\" onclick=\"SelectAll('direct');\" type=\"text\" size=\"70\" value=\"" . $address . $path . "\" readonly=\"readonly\" /></p>\r\n<p align=\"center\">{$lang['bitbucket_tags']}\r\n<input style=\"font-size: 9pt;text-align: center;\" id=\"tag\" onclick=\"SelectAll('tag');\" type=\"text\" size=\"70\" value=\"[img]" . $address . $path . "[/img]\" readonly=\"readonly\" /></p>\r\n<p align=\"center\"><a href=\"{$TBDEV['baseurl']}/bitbucket.php?type=2&amp;avatar=" . $address . $path . "\">{$lang['bitbucket_maketma']}</a></p>\r\n<p align=\"center\"><a href=\"{$TBDEV['baseurl']}/bitbucket.php?images=1\">{$lang['bitbucket_viewmyi']}</a></p>\r\n<p align=\"center\"><a href=\"{$TBDEV['baseurl']}/bitbucket.php?images=2\">{$lang['bitbucket_viewmya']}</a></p>\r\n</td>\r\n</tr>\r\n</table>";
print stdhead($lang['bitbucket_bitbucket']) . $HTMLOUT . stdfoot();
function bucketrand()
{