Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=117)
-   -   10% (http://www.bvlist.com/showthread.php?t=5637)

lafouine022 11th November 2010 18:04

10%
 
1 Attachment(s)
This allows users to add 10% of their current upload amount to their upload amount once, at any time they chose.

SQL:
PHP Code:

ALTER TABLE `usersADD `tenpercentENUM('yes','no'NOT NULL default 'no'

and tenpercent.php:

PHP Code:

<?
include_once("global.php");
dbconn();
loggedinorreturn();

$uploaded $CURUSER["uploaded"];
$downloaded $CURUSER["downloaded"];
$newuploaded = ($uploaded 1.1);

if (
$downloaded 0) {
  
$ratio number_format($uploaded $downloaded3);
  
$newratio number_format($newuploaded $downloaded3);
  
$ratiochange number_format(($newuploaded $downloaded) - ($uploaded $downloaded), 3);
} elseif (
$uploaded 0)
  
$ratio $newratio $ratiochange "Inf.";
else
  
$ratio $newratio $ratiochange "---";

if (
$_SERVER["REQUEST_METHOD"] == "POST") {

  if (
$CURUSER["tenpercent"] == "yes")
    
stderr("Used""It appears that you have already used your 10% addition.");

  
$sure $_POST["sure"];

  if (!
$sure)
    
stderr("Are you sure?""It appears that you are not yet sure whether you want to add 10% to your upload or not. Once you are sure you can <a href=tenpercent.php>return</a> to the 10% page.");

  
$time date("F j Y");
  
$subject "10% Addition";
  
$msg "Today, $time, you have increased your total upload amount by 10% from [b]".mksize($uploaded)."[/b] to [b]".mksize($newuploaded)."[/b], which brings your ratio to [b]".$newratio."[/b].";

  
$res mysql_query("UPDATE users SET uploaded = uploaded * 1.1, tenpercent = 'yes' WHERE id = $CURUSER[id]") or sqlerr(__FILE____LINE__);
  
$res1 mysql_query("INSERT INTO messages (sender, poster, receiver, subject, msg, added) VALUES (0, 0, $CURUSER[id], ".sqlesc($subject).", ".sqlesc($msg).", '".get_date_time()."')") or sqlerr(__FILE____LINE__);

  if (!
$res)
    
stderr("Error""It appears that something went wrong while trying to add 10% to your upload amount.");
  else
    
stderr("10% Added""Your total upload amount has been increased by 10% from <b>".mksize($uploaded)."</b> to <b>".mksize($newuploaded)."</b>, which brings your ratio to <b>$newratio</b>.");
}

?>
<style type=text/css>
  td.normal {
    background: #990000;
  }

  td.normalrowhead {
    font-weight: bold;
    text-align: right;
    background: #990000;
  }
</style>
<?

if ($CURUSER["tenpercent"] == "no") {
  
?>
  <script language=javascript>
  function enablesubmit() {
    document.tenpercent.submit.disabled = document.tenpercent.submit.checked;
  }
  function disablesubmit() {
    document.tenpercent.submit.disabled = !document.tenpercent.submit.checked;
  }
  </script>
  <?
}

stdhead("10%");
begin_table (true);
if (
$CURUSER["tenpercent"] == "yes")
  print(
"<h2>It appears that you have already used your 10% addition</h2>\n");
 
print(
"<div align=center><table border=6 width=100% cellspacing=0 cellpadding=5><tr><td class=thead align=center><font size=2>10%</font>
 </td></tr></div><td class=subheader align=left>
 
 <font size=2><b>add 10%</b></font></td></table>"
);
 
 
print (
'<table cellpadding="1" cellspacing="0" width="100%" align="center" >
    
    <tr>
        <td rowspan="'
.$rowspan.'" align="center" valign="top" width="100%">');

print(
"<p><table width=750 border=0 cellspacing=0 cellpadding=5><tr><td\n");
print(
"<table width=100% border=0 cellspacing=0 cellpadding=10><tr><td style='padding-bottom: 0px'>\n");
print(
"<p><b>How it works:</b></p>");
print(
"<p class=sub>From this page you can <b>add 10%</b> of your current upload amount to your upload amount bringing it it to <b>110%</b> of its current amount. More details about how this would work out for you can be found in the tables below.</p>");
print(
"<p><b>However, there are some things you should know first:</b></p>");
print(
"<li>This can only be done <b>once</b>, so chose your moment wisely.");
print(
"<li>The staff will <b>not</b> reset your 10% addition for any reason.");
print(
"</td></tr></table>\n");
print(
"</td></tr></table></p>\n");
print(
"<p><table width=650 class=main align=center border=0 cellspacing=0 cellpadding=5>\n");
print(
"<tr><td class=normalrowhead>Current&nbsp;upload&nbsp;amount:</td><td class=normal>".str_replace(" ""&nbsp;"mksize($uploaded))."</td><td class=embedded width=5%></td><td class=normalrowhead>Increase:</td><td class=normal>".str_replace(" ""&nbsp;"mksize($newuploaded $uploaded))."</td><td class=embedded width=5%></td><td class=normalrowhead>New&nbsp;upload&nbsp;amount:</td><td class=normal>".str_replace(" ""&nbsp;"mksize($newuploaded))."</td></tr>\n");
print(
"<tr><td class=normalrowhead>Current&nbsp;download&nbsp;amount:</td><td class=normal>".str_replace(" ""&nbsp;"mksize($downloaded))."</td><td class=embedded width=5%></td><td class=normalrowhead>Increase:</td><td class=normal>".str_replace(" ""&nbsp;"mksize(0))."</td><td class=embedded width=5%></td><td class=normalrowhead>New&nbsp;download&nbsp;amount:</td><td class=normal>".str_replace(" ""&nbsp;"mksize($downloaded))."</td></tr>\n");
print(
"<tr><td class=normalrowhead>Current&nbsp;ratio:</td><td class=normal>$ratio</td><td class=embedded width=5%></td><td class=normalrowhead>Increase:</td><td class=normal>$ratiochange</td><td class=embedded width=5%></td><td class=normalrowhead>New&nbsp;ratio:</td><td class=normal>$newratio</td></tr>\n");
print(
"</table></p>\n");
print(
"<p><table align=center border=0 cellspacing=0 cellpadding=5><form name=tenpercent method=post action=tenpercent.php>\n");
print(
"<tr><td align=center><b>Yes please </b><input type=checkbox name=sure value=yes onclick='if (this.checked) enablesubmit(); else disablesubmit();'></td></tr>\n");
print(
"<tr><td align=center><input type=submit name=submit value='Add 10%' class=btn disabled></td></tr>\n");
print(
"</form></table></p></td></tr></table>\n");
end_table ();
stdfoot ();
?>

Enjoy! :bubble:

ghostrider2k 12th November 2010 01:04

Thanks looks good :)

Gouald 12th November 2010 13:29

Pfft
 
How about actually crediting the real author and place you stole the code from - Scars @ Tbdev but looks like your posting this claiming its your own when its simply not - Lamer.

lafouine022 12th November 2010 14:24

yes this mod in scar from tbdev

I Whenever the adapter is for TS

just for the fun :)

mistermister 12th November 2010 16:11

Quote:

Originally Posted by lafouine022 (Post 25596)
yes this mod in scar from tbdev

I Whenever the adapter is for TS

just for the fun :)

Here it is designed different for v7.1
credit goes to original creator

I do not take credit or accept the creation of this mod.
I am only showing a different design layout

http://img577.imageshack.us/img577/7...tenpercent.jpg

lafouine022 13th November 2010 01:04

lol nice

lateam 13th November 2010 13:53

LOL
 
mistermister http://bvlist.com/images/styles/vers...er_offline.gif
Senior Member:lol:LOL
FOR TS 5.6

WE HAVE THE MEANS ADAPTING TO THE 5.6 and THAT MADE YOU CRITICIZE OTHERS TO SHARE!
IT'S LIKE THE THEMES FOR TS 7.0 and 7.1.
JE ME THE SUITABLE FOR 5.6!
AND YOU?
YOU IDIOT!
PUT YOUR CODE that one laughed

mistermister 13th November 2010 23:29

Quote:

Originally Posted by lateam (Post 25627)
mistermister http://bvlist.com/images/styles/vers...er_offline.gif
Senior Member:lol:LOL
FOR TS 5.6

WE HAVE THE MEANS ADAPTING TO THE 5.6 and THAT MADE YOU CRITICIZE OTHERS TO SHARE!
IT'S LIKE THE THEMES FOR TS 7.0 and 7.1.
JE ME THE SUITABLE FOR 5.6!
AND YOU?
YOU IDIOT!
PUT YOUR CODE that one laughed

boy how quick you are to critize someone, for one, i did not say this was my code, i just showed another way of doing it for the original way was sloppy in design, your type is the reason i do not share anything because you are the first to tell people how stupid and ignorant they are but in the end, you make yourself look stupid as hell.

eckeO5 18th December 2011 17:35

my opinion. Why is this discussion about where the code originates.
lafouine022 has not / never said that it was HIS code.

he ported this just for fun, nice idea i mean.

thus the first place.
does not criticize someone who already brought many great ideas.
a forum used to bring together ideas and mutual exchange.
I think.

ok but just my opinion.
must lead to such a disputable here?

i feel like i am in kindergarten!

DAKz 18th December 2011 18:31

WTF
 
Thought that was pretty much what this forum was about? Taking existing code and modifying it to other uses?

Don't knock someone for that, and especially with tbdev code since it is a dead project anyhow. And the in house fighting they do is the reason why its dead. And we don't need that here at all. To the guys that adapt code and mods and themes cheers, to the people that want to knock others for it, simple enough, come up with something original and hang it up here. I have seen very few times that someone has taken credit for someone else's work here. Its all about sharing, isn't that what they whole p2p thing is supposed to be? For so many to come here and share what they have makes us all better, and stronger.


All times are GMT +2. The time now is 00:35.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.