Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=109)
-   -   Transfer bonus points [jQuery] (http://www.bvlist.com/showthread.php?t=10706)

Chez 29th January 2016 10:13

Transfer bonus points [jQuery]
 
4 Attachment(s)
A simple mod that allows you to send bonus points to a user with just one click.

http://s29.postimg.org/cx8slyrmf/screenshot_22.png

So to use this mode, you must have registered library jQuery.

Open userdetails.php and add this code in any place you want to show:

PHP Code:

?>
<script language="javascript" type="text/javascript">
function present(from, to, amount) {
    jQuery.post("present.php",{"from":from,"to":to,"amount":amount},function (response) {
       alert(response);
    });
};
</script>
<tr><td class="rowhead">Give Bonuses</td><td align="left">
<img src="pic/10.png" alt="10" title="Send 10 bonus points" onclick="javascript:present('<?=$CURUSER["id"];?>', '<?=$user["id"];?>', '10');" />
<img src="pic/25.png" alt="25" title="Send 25 bonus points" onclick="javascript:present('<?=$CURUSER["id"];?>', '<?=$user["id"];?>', '25');" />
<img src="pic/50.png" alt="50" title="Send 50 bonus points" onclick="javascript:present('<?=$CURUSER["id"];?>', '<?=$user["id"];?>', '50');" />
<img src="pic/100.png" alt="100" title="Send 100 bonus points" onclick="javascript:present('<?=$CURUSER["id"];?>', '<?=$user["id"];?>', '100');" />
</td>
</tr>

<?

Create a file called present.php and add this code then put it in your root:

PHP Code:

<?
require_once("include/bittorrent.php");
dbconn();
loggedinorreturn(); 

$from = (int) $_POST["from"];
$to = (int) $_POST["to"];
$amount = (int) $_POST["amount"];

if (empty(
$from)) {
    
stdmsg("Error, If you are not a hacker - try again.");


sql_query("UPDATE users SET seedbonus = seedbonus + '$amount' WHERE id = '$to' LIMIT 1");
sql_query("UPDATE users SET seedbonus = seedbonus - '$amount' WHERE id = '$from' LIMIT 1"); 

if(
$CURUSER["id"] == $to) {
print(
"You can not pass bonuses themselves.");
} elseif(
$CURUSER["seedbonus"] <= $amount) {
print(
"You do not have enough bonuses");
} else {
print(
"You have successfully sent $amount bonus points.");
}
?>

Download attached icons and put them in your pic folder.

Enjoy!

UFFENO1 29th January 2016 11:55

Thank you very much for the mod, but i missing the icons.

Chez 29th January 2016 12:06

Quote:

Originally Posted by UFFENO1 (Post 48319)
Thank you very much for the mod, but i missing the icons.

sorry for that ... i forgot the icons. post updated

Str1k3r 10th March 2016 10:37

2 Attachment(s)
Here for all.

regards Str1k3r

elvira 12th March 2016 14:31

PHP Code:

So to use this modeyou must have registered library jQuery


Where is the jQuery.js

Chez 12th March 2016 19:47

It says clearly ... YOU MUST HAVE (this means that you should already have that jquery.js)

elvira 12th March 2016 20:16

Quote:

Originally Posted by Chez (Post 48567)
It says clearly ... YOU MUST HAVE (this means that you should already have that jquery.js)

I have but not work can you post yours

fireknight 13th March 2016 00:38

1 Attachment(s)
This is the jQuery.js I have.
Might work for you.
Would not accept it as a js file, so had to rar it.

Chez 13th March 2016 10:50

1 Attachment(s)
Download the attached archive and also try to insert this code in your stdhead.php file between your tags.

PHP Code:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> 


elvira 13th March 2016 12:29

Quote:

Originally Posted by Chez (Post 48570)
Download the attached archive and also try to insert this code in your stdhead.php file between your tags.

PHP Code:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> 


Ok Thanks, works


All times are GMT +2. The time now is 16:06.

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