alter upload/download credit

Started by rickandmary, July 22, 2012, 01:13:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rickandmary

This allows you to alter someone amount uploaded/downloaded.

add to userdetails.php

?>
<script type="text/javascript">

function togglepic(bu, picid, formid)
{
    var pic = document.getElementById(picid);
    var form = document.getElementById(formid);
   
    if(pic.src == bu + "/plus.gif")
    {
        pic.src = bu + "/minus.gif";
        form.value = "minus";
    }else{
        pic.src = bu + "/plus.gif";
        form.value = "plus";
    }
}

</script>
<?
  // start upload download boxes //
 
  print("<tr><td class=rowhead>Change Upload</td><td align=center><img src='/plus.gif' id=uppic onClick=togglepic('$BASEURL','uppic','upchange')> <input type=text name=amountup size=10><td><select name=formatup>\n<option value=mb>MB</option>\n<option value=gb>GB</option></select>\n</td></tr>");
  print("<tr><td class=rowhead>Change Download</td><td align=center><img src='/minus.gif' id=downpic onClick=togglepic('$BASEURL','downpic','downchange')> <input type=text name=amountdown size=10><td><select name=formatdown>\n<option value=mb>MB</option>\n<option value=gb>GB</option></select>\n</td></tr>"); 
 
  //Finish adding selections //


and

print("<input type=hidden id=upchange name=upchange value=plus><input type=hidden id=downchange name=downchange value=plus>");

and to file modtask.php add

  $formatup = $_POST["formatup"];
  $formatdown = $_POST["formatdown"];


still modtask.php add

if($uploadtoadd > 0)
    {
        if($mpup == "plus")
            $newupload = $arr["uploaded"] + ($formatup == mb ? ($uploadtoadd * 1048576) : ($uploadtoadd * 1073741824));
        else
            $newupload = $arr["uploaded"] - ($formatup == mb ? ($uploadtoadd * 1048576) : ($uploadtoadd * 1073741824));
        $updateset[] =  "uploaded = $newupload";

    }
   
    if($downloadtoadd > 0)
    {
        if($mpdown == "plus")
            $newdownload = $arr["downloaded"] + ($formatdown == mb ? ($downloadtoadd * 1048576) : ($downloadtoadd * 1073741824));
        else
            $newdownload = $arr["downloaded"] - ($formatdown == mb ? ($downloadtoadd * 1048576) : ($downloadtoadd * 1073741824));
        $updateset[] = "downloaded = $newdownload";
    }


credits to author