Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > Template Shares > Mods & Themes
Reply
  #1  
Old 11th November 2010, 18:04
lafouine022's Avatar
lafouine022 lafouine022 is offline
Support FR
 
Join Date: Feb 2010
P2P
Posts: 120
Smile 10%
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 / $downloaded, 3);
  $newratio = number_format($newuploaded / $downloaded, 3);
  $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("<br><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:
Attached Thumbnails
10 pour.png  
Reply With Quote
The Following 5 Users Say Thank You to lafouine022 For This Useful Post:
FENIX (27th January 2013), Fynnon (12th November 2010), ghostrider2k (12th November 2010), Tingull (28th December 2010), Tory (12th November 2010)
  #2  
Old 12th November 2010, 01:04
ghostrider2k's Avatar
ghostrider2k ghostrider2k is offline
Member
 
Join Date: Nov 2010
Canada
Posts: 3
Default
Thanks looks good :)
Reply With Quote
  #3  
Old 12th November 2010, 13:29
Gouald's Avatar
Gouald Gouald is offline
Member
 
Join Date: Sep 2010
P2P
Posts: 7
Default 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.
Reply With Quote
The Following User Says Thank You to Gouald For This Useful Post:
Subzero (18th March 2011)
  #4  
Old 12th November 2010, 14:24
lafouine022's Avatar
lafouine022 lafouine022 is offline
Support FR
 
Join Date: Feb 2010
P2P
Posts: 120
Talking
yes this mod in scar from tbdev

I Whenever the adapter is for TS

just for the fun :)
Reply With Quote
  #5  
Old 12th November 2010, 16:11
mistermister's Avatar
mistermister mistermister is offline
Senior Member
 
Join Date: Feb 2009
P2P
Posts: 20
Thumbs up
Quote:
Originally Posted by lafouine022 View Post
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

Click the image to open in full size.
Reply With Quote
  #6  
Old 13th November 2010, 01:04
lafouine022's Avatar
lafouine022 lafouine022 is offline
Support FR
 
Join Date: Feb 2010
P2P
Posts: 120
Default
lol nice
Reply With Quote
  #7  
Old 13th November 2010, 13:53
lateam's Avatar
lateam lateam is offline
Senior Member
 
Join Date: Apr 2009
France
Posts: 40
Angry LOL
mistermister Click the image to open in full size.
Senior MemberLOL
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
Reply With Quote
  #8  
Old 13th November 2010, 23:29
mistermister's Avatar
mistermister mistermister is offline
Senior Member
 
Join Date: Feb 2009
P2P
Posts: 20
Red face
Quote:
Originally Posted by lateam View Post
mistermister Click the image to open in full size.
Senior MemberLOL
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.
Reply With Quote
  #9  
Old 18th December 2011, 17:35
eckeO5's Avatar
eckeO5 eckeO5 is offline
Senior Member
 
Join Date: Jan 2011
P2P
Posts: 117
Thumbs down
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!

Last edited by eckeO5; 19th December 2011 at 02:57.
Reply With Quote
  #10  
Old 18th December 2011, 18:31
DAKz's Avatar
DAKz DAKz is offline
Black Cobra Hosting
 
Join Date: Jul 2009
P2P
Posts: 380
Question 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.
Reply With Quote
Reply

Tags
10%

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 01:32. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2021, vBulletin Solutions Inc.