class sets fine.. if your class is above well 2 stock then well of-course it will not demote you to vip LOL
Quote:Dear testie :wave: Thanks for your support to ! Your donation helps us in the costs of running the site! As a donor, you are given some bonus gigs 100.00 GB added to your uploaded amount, the status of VIP, and the warm fuzzy feeling you get inside for helping to support this site that we all know and love :smile: so, thanks again, and enjoy!cheers, Staff
Downloaded: 859.52 MB
Uploaded: 107.40 GB
Class: VIP
anyway this works fine on my sites for setting donations that dont auto credit for what ever stupid reason like not changing donated email address, $DONATEMAIL dont match you real sites donated address..............
in account-details.php
find
if($CURUSER["delete_users"] == "yes"){
print("<hr><center><form method=post action=admin-modtasks.php>n");
print("<input type=hidden name='action' value='deleteaccount'>n");
add before
if ($CURUSER["class"] == "7") {
begin_frame("VIP Donation Fix");
print("<form method=post action=admin-modtasks.php>n");
print("<input type=hidden name='action' value='donater_fix'>n");
print("<input type=hidden name='userid' value='$id'>n");
echo "<br /><br /><center><table border=0>";
echo "<tr><td align=right class=table_col1><b>" . T_("REASON") . ":</b> </td><td align=left class=table_col1><textarea cols=40 rows=5 name=reason></textarea></td></tr>";
echo "<tr><td align=right class=table_col1><b>Transaction ID (req):</b> </td><td align=left class=table_col1><input type=text size=30 name=txn_id></td></tr>";
echo "<tr><td align=right class=table_col1><b>Money (req):</b> </td><td align=left class=table_col1><input type=text size=10 name=money></td></tr>";
echo "<tr><td colspan=2 align=center class=table_col1><input type=submit class=btn_big value='Add Donation'></td></tr></table></center></form>";
end_frame();
} //$CURUSER["class"] == "7"
then in admin-modtasks
add before
if ($action == "deleteaccount"){
add
if ($action == 'donater_fix') {
if ($CURUSER["class"] <= "6") //only allow admins to delete users
show_error_msg(T_("ERROR"), "Only Owners can do this", 1);
$clid = (int) $_POST["userid"];
$payment_amount = mysql_real_escape_string($_POST["money"]);
$txn_id = mysql_real_escape_string($_POST["txn_id"]);
$reason = mysql_real_escape_string($_POST["reason"]);
if (!is_valid_id($clid))
show_error_msg(T_("EDITING_FAILED"), T_("INVALID_USER_ID"), 1);
if (!$txn_id || !$payment_amount) {
show_error_msg(T_("ERROR"), T_("MISSING_FORM_DATA") . ".", 1);
} //!$txn_id || $payment_amount
$donated_time = get_date_time();
///Sort Upload and Donor time amounts
if ($payment_amount == 5) {
$days = 1 * 4;
} //$payment_amount == 5
elseif ($payment_amount == 10) {
$days = 1 * 8;
} //$payment_amount == 10
elseif ($payment_amount == 20) {
$days = 1 * 16;
} //$payment_amount == 20
elseif ($payment_amount == 30) {
$days = 1 * 24;
} //$payment_amount == 30
else {
$days = 1 * 1;
}
//set donor upload upgrade
if ($payment_amount == 5) {
$donb = 107374182400;
} //$payment_amount == 5
//{$donb = 5368709120; }
elseif ($payment_amount == 10) {
$donb = 214748364800;
} //$payment_amount == 10
//{$donb = 10737418240; }
elseif ($payment_amount == 20) {
$donb = 429496729600;
} //$payment_amount == 20
//{$donb = 21474836480; }
elseif ($payment_amount == 30) {
$donb = 644245094400;
} //$payment_amount == 30
else {
$donb = 1073741824 * $payment_amount;
}
//Set User Invites
if ($payment_amount == 5) {
$invites = 2;
} //$payment_amount == 5
elseif ($payment_amount == 10) {
$invites = 4;
} //$payment_amount == 10
elseif ($payment_amount == 20) {
$invites = 8;
} //$payment_amount == 20
elseif ($payment_amount == 30) {
$invites = 12;
} //$payment_amount == 30
else {
$invites = 0;
}
//get user information from DB
if ($clid > 0) {
$query = "SELECT * FROM users WHERE id='" . $clid . "'";
$result = SQL_Query_exec($query);
$row = mysql_fetch_array($result);
$username = $row['username'];
$old = date($row['donoruntil']);
$class = $row['class'];
$dona = $row['uploaded'];
$modcomment = $row['modcomment'];
} //$clid > 0
else {
$username = 'Guest' . rand(1000, 9999);
$class = 1;
}
//Set class to VIP if lower then VIP
if ($clid > 0) {
if ($class <= 3) {
$class = 3;
} //$class <= 3
$r = @SQL_Query_exec("SELECT * FROM users WHERE id=$clid");
$user = mysql_fetch_array($r) or show_error_msg(T_("ERROR"), "No user with ID.", 1);
//Reset download upload post and reset to zero H&R's
$query = "UPDATE users SET donor='yes', class=$class, warned ='no', invites=$invites WHERE id='" . $clid . "'";
$result = SQL_Query_exec("$query");
//Get Donor time if already some left from before
If ($old <> "0000-00-00 00:00:00") {
$old1 = strtotime($old) - gmtime();
$donateuntil = get_date_time((gmtime() + $days * 604800) + $old1);
} //$old <> "0000-00-00 00:00:00"
else {
$donateuntil = get_date_time(gmtime() + $days * 604800);
}
//add Upload bonus for amount given at 1Gb per ?1
$bonus = $donb + $dona;
$donordif = strtotime($donateuntil) - gmtime();
$don_bonus = mksize($donb);
//add to mod comment for staff to check if payment made via here
$modcomment3 = gmdate("Y-m-d") . " Donor Status Given. ($don_bonus) Bonus Granted. Reason: $reason. ($donordif) Donator Time Added. n";
$modcomment = $modcomment3 . "n" . $modcomment;
$modcom = sqlesc($modcomment);
//update users total and bonus totals
$query = "UPDATE users SET uploaded='" . $bonus . "', modcomment = CONCAT($modcom,modcomment), donoruntil='$donateuntil', donated=$payment_amount, total_donated=total_donated+$payment_amount WHERE id='" . $clid . "'";
$result = SQL_Query_exec($query);
$newclass_name = get_user_class_name('3');
//Send Message to User That Donated
$msg = sqlesc("Dear $username :wave: Thanks for your support to $SITENAME! Your donation helps us in the costs of running the site! As a donor, you are given some bonus gigs $don_bonus added to your uploaded amount, the status of " . $newclass_name . ", and the warm fuzzy feeling you get inside for helping to support this site that we all know and love :smile: so, thanks again, and enjoy!cheers, $SITENAME Staffn");
$subject = sqlesc("Thank You for Your Donation!");
$added = sqlesc(get_date_time());
if ($clid > 0)
SQL_Query_exec("INSERT INTO messages (sender, subject, receiver, msg, added) VALUES (0, $subject, $clid, $msg, $added)");
} //$clid > 0
//Send Message to Site Owners
$sysop = SQL_Query_exec("SELECT id FROM users WHERE class=7");
while ($sysopid = mysql_fetch_assoc($sysop)) {
$subject = "New Donation Manually Credited";
$sysopmsg = $subject." | User: $username | Amount : $payment_amount | txn_id: $txn_id | New Class: $newclass_name";
$sysopmsg .= "nNew Modcomment: ".$modcomment3;
SQL_Query_exec("INSERT INTO messages (poster, sender, receiver, added, subject, msg) VALUES(0, 0, " . $sysopid['id'] . ", '" . get_date_time() . "', " . sqlesc($subject) . ", " . sqlesc($sysopmsg) . ")");
} //$sysopid = mysql_fetch_assoc($sysop)
//update donation totals for counter
$added = sqlesc(get_date_time());
$month1 = sqlesc(gmdate("m"));
$year1 = sqlesc(gmdate("Y"));
$query = "INSERT INTO funds (cash,user,added,month,year) VALUES ($payment_amount, $clid, $added,$month1,$year1)";
$result = SQL_Query_exec($query);
write_log($CURUSER['username']." has manual donation for user: <a href='account-details.php?id=$clid'>$clid</a> $modcomment3");
autolink("account-details.php?id=$clid","Donation Added For $username Class: $newclass_name");
die;
} //$action == 'donater_fix'
Then well edit the user that donated.. but again if I have to tell you this well should not be running an site EVIL GRIN
you should have the transaction # in the email you got about the donation.. in theory you could put anything in the space.