How to donate restart?
The month started and donations not resumed, it was the same amount donated in the previous month.
I want to know how do I go back to zero donations and donations to redial the current month.
Sorry for the bad English.
Quote:
Originally Posted by wdq
in root folder you have bitbucket-upload.php open it and the first lines will tell you that is accepting gif pictures you just need to upload them in a specific size
PHP Code:
$maxfilesize = 256 * 1024; $imgtypes = array (null,'gif','jpg','png'); $scaleh = 150; // set our height size desired $scalew = 150; // set our width size desired
how you can see the height of the picture needs to be 150px
and the width is set the same the max file size is 256px x 1024px
modify those lines to fit your needs or just upload a picture that is 150 x 150 .
hope thius helps.
|
Ok I'm a noob, but I found a way to make the script work, it seems the imagecreatefromgif () does not give much right with the imagecreatetruecolor () and imagecopyresized ().
I made a change in the part of "$ orig = ($ it =" replace the code for a part of tbsource.
I made several tests and it worked well.
Just got the new bitbucket:
PHP Code:
<?php
require "include/bittorrent.php";
dbconn();
loggedinorreturn();
parked();
$maxfilesize = 256 * 1024;
$imgtypes = array (null,'gif','jpg','png');
$scaleh = 150; // set our height size desired
$scalew = 150; // set our width size desired
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$file = $_FILES["file"];
if (!isset($file) || $file["size"] < 1)
stderr("Upload failed", "Nothing received!");
if ($file["size"] > $maxfilesize)
stderr("Upload failed", "Sorry, that file is too large for the bit-bucket.");
$pp=pathinfo($filename = $file["name"]);
if($pp['basename'] != $filename)
stderr("Upload failed", "Bad file name.");
$tgtfile = "$bitbucket/$filename";
if (file_exists($tgtfile))
stderr("Upload failed", "Sorry, a file with the name <b>" . htmlspecialchars($filename) . "</b> already exists in the bit-bucket.",false);
$size = getimagesize($file["tmp_name"]);
$height = $size[1];
$width = $size[0];
$it = $size[2];
if($imgtypes[$it] == null || $imgtypes[$it] != $pp['extension'])
stderr("Error", "Invalid extension: <b>GIF, JPG or PNG only!</b>",false);
// Scale image to appropriate avatar dimensions
$hscale=$height/$scaleh;
$wscale=$width/$scalew;
$scale=($hscale < 1 && $wscale < 1) ? 1 : ( $hscale > $wscale) ? $hscale : $wscale;
$newwidth=floor($width/$scale);
$newheight=floor($height/$scale);
$it = @exif_imagetype($file["tmp_name"]);
if ($it != IMAGETYPE_GIF && $it != IMAGETYPE_JPEG && $it != IMAGETYPE_PNG)
stderr("Image not recognized");
$i = strrpos($filename, ".");
if ($i !== false)
{
$ext = strtolower(substr($filename, $i));
if (($it == IMAGETYPE_GIF && $ext != ".gif") || ($it == IMAGETYPE_JPEG && $ext != ".jpg") || ($it == IMAGETYPE_PNG && $ext != ".png"))
stderr("invalid extension");
}
else
stderr("Image processing failed","Sorry, the uploaded $imgtypes[$it] failed processing. Try resaving the image in a graphic editor. Thanx");
move_uploaded_file($file["tmp_name"], $tgtfile) or stderr("Image processing failed","Sorry, the uploaded $imgtypes[$it] failed processing. Try resaving the image in a graphic editor. Thanx");
$url = str_replace(" ", "%20", htmlspecialchars("$BASEURL/bitbucket/$filename"));
$name = sqlesc($filename);
$added = sqlesc(get_date_time());
if ($_POST['public'] != 'yes' )
$public='"0"';
else
$public='"1"';
sql_query("INSERT INTO bitbucket (owner, name, added, public) VALUES ($CURUSER[id], $name, $added, $public)") or sqlerr(__FILE__, __LINE__);
sql_query("UPDATE users SET avatar = ".sqlesc($url)." WHERE id = $CURUSER[id]") or sqlerr(__FILE__, __LINE__);
stderr("Success", "Use the following URL to access the file: <br><b><a href=\"$url\">$url</a></b><p><a href=bitbucket-upload.php>Upload another file</a>.<br><br><img src=\"$url\" border=0><br><br>Image ". ($width=$newwidth && $height==$newheight ? "doesn't require rescaling":"Image rescaled from $height x $width to $newheight x $newwidth") .'.<br>Note: Your profile has been updated!',false);
}
stdhead("AVATAR Upload");
?>
<h1>AVATAR Upload</h1>
<form method="post" action="<?=$_SERVER[SCRIPT_NAME];?>" enctype="multipart/form-data">
<table border=1 cellspacing=0 cellpadding=5>
<?
$disclaimer = "
<tr><td colspan=2 align=center><div class=alert align=justify>Disclaimer:
Do not upload unauthorized or illegal pictures. Uploaded pictures should be considered \"public domain\"; do not upload pictures you wouldn't want a stranger to have access to. Uploaded images will be scaled to $scaleh x $scalew
<br><br>Maximum file size: ".number_format($maxfilesize)." bytes.</div>
";
if(!is_writable("$bitbucket"))
print("<tr><td class=rowhead colspan=2><div class=alert>ATTENTION: Upload directory isn't writable. Please contact the administrator about this problem!</div></tr></td>");
print("$disclaimer");
?>
<tr><td class=rowhead>File</td><td><input type="file" name="file" size="60"></td></tr>
<tr><td colspan=2 align=center><input type=checkbox name=public value=yes>Other users can use my avatar (It's choosable in the profile). <input type="submit" value="Upload"></td></tr>
</table>
</form>
<?
stdfoot();
?>
Bump: This missing part of the function code from here ...
The missing part that checks if the user is the same owner of the site, or sysop...
in include/functions.php after "include($rootpath . 'include/globalfunctions.php');"
added:
PHP Code:
//---------------------------------
//---- Max. Sysops v0.2 by xam
//---------------------------------
function maxsysop () {
global $CURUSER;
// Check Staff Names
$lmaxclass = 7;
$lsysopnames = array("Beto", "Beto|lol"); // Case sensitive. Change this (YOUR SYSOP-ADMIN NAMES GOES HERE) (example: array("adminname1","adminname2","adminname3","adminname4","so far")
if ($CURUSER["class"] >= $lmaxclass)
if (!in_array($CURUSER["username"], $lsysopnames, true)) { // true for strict comparison
$msg = "Fake Account Detected: Username: ".$CURUSER["username"]." - UserID: ".$CURUSER["id"]." - UserIP : ".getip();
write_log($msg);
stderr("Access Denied!","We come to believe you are using a fake account, therefore we've logged this action!");
}
// Check Staff IDS
define ('UC_STAFF', 7); // Minumum Staff Level (4= UC_MODERATOR)
if ($CURUSER['class'] >= UC_STAFF) {
$allowed_ID = array(1,6); // Change this (YOUR SYSOP-ADMIN IDS GOES HERE) (example: array(1,2,3,4,5))
if (!in_array((int)$CURUSER['id'], $allowed_ID, true)) { // true for strict comparison
$msg = "Fake Account Detected: Username: ".$CURUSER["username"]." - UserID: ".$CURUSER["id"]." - UserIP : ".getip();
write_log($msg);
stderr("Access Denied!","We come to believe you are using a fake account, therefore we've logged this action!");
}
}
}