avatar_8BitCore

Credits Transfer [for mmw]~~

Автор 8BitCore, 2010 Июнь 23, 15:49

« назад - далее »

0 Пользователи и 1 гость просматривают эту тему.

8BitCore

Перевод кредитов с ацц на ацц
## здесь был скриншот ##

Файлы и краткое описание по установке:
https://depositfiles.com/files/yy1pj7qhh

Спойлер
I. In "modules/char/wh.php"
1.   after

<?if($acc_online_check=="0"){

insert line2

if(isset($_POST["cred"])){require("includes/cred_transfer.php");option::cred_transfer($login,$_POST["to_acc_cred"],$_POST["cred"]); echo $rowbr;}


2.   after

<form name='send_money' method='post' action=''>
<table class='sort-table' align='center' border='0' cellpadding='0' cellspacing='0' width='300'>
<tr>
<td><?echo mmw_lang_zen_from;?></td>
<td><select name='from_wh'><?echo $select_form;?></select></td>
</tr>
<tr>
<td><?echo mmw_lang_zen_to;?></td>
<td><select name='to_wh'><?echo $select_form;?></select></td>
</tr>
<tr>
<td>Zen</td>
<td><input name='zen' type='text' value='0' maxlength='10' size='14'> <input name='submit' type='submit' value='<?echo mmw_lang_send;?>'></td>
</tr>
</table>
</form>

insert

<?echo $rowbr,$rowbr;
$acc_credits_dbo = mssql_query("SELECT credits FROM dbo.MEMB_CREDITS WHERE memb___id = '$login'");
$acc_credits = mssql_fetch_row($acc_credits_dbo);?>

<table class='sort-table' align='center' border='0' cellpadding='0' cellspacing='0' width='300'>
<thead><tr>
<td align='center'><?echo "AccCredits - $acc_credits[0]";?></td>
</thead></tr>
</table>

<table class='sort-table' align='center' border='0' cellpadding='0' cellspacing='0' width='300'>
<form name='send_cred' method='post' action=''>
<tr>
<td><?echo mmw_lang_zen_from;?></td>
<td><?echo $login;?></td>
</tr>
<tr>
<td><?echo mmw_lang_zen_to;?></td>
<td><input name='to_acc_cred' type='text' maxlength='10' size='14'></td>
</tr>
<tr>
<td>AccCredits</td>
<td><input name='cred' type='text' value='0' maxlength='5' size='14'> <input name='submit' type='submit' value='<?echo mmw_lang_send;?>'></td>
</tr>
</form>
</table>



II.cred_transfer.php insert into "includes" path

III.insert into "lang/english.php"

//Transfer Credits
define('mmw_lang_cred_login',"Please Login First!");
define('mmw_lang_cred_acc_false',"Such Account Not Exist!");
define('mmw_lang_cred_must_be_number',"Credits Must Be Number!");
define('mmw_lang_cred_yourself',"You Cant Send Credits To Yourself!");
define('mmw_lang_cred_positive',"Credits Must Be Positive Number!");
define('mmw_lang_cred_not_enough',"Not Enough Credits!");
define('mmw_lang_cred_success',"Credits Transfered Success To");
[свернуть]

Кредиты: 8BitCore, Vaflan

DobrjaG

Сделайте чтоб был какой то процент за передачу!

Sil3nT

Да,было бы не плохо ,Автору спасибо

men17

бесполезная вещ)если есть система голосований за кредиты

8BitCore

Цитата: men17 от 2010 Сен. 13, 19:45  бесполезная вещ)если есть система голосований за кредиты
бесполезный твой пост.

Для того чтоб брало комиссию за перевод:
I. Добавить в config.php
$transfer_percent = 10; // 1-100%
II. Заменить в cred_transfer.php
$from_cred_set = $acc_credits_from[1]-$cred;
$to_cred_set = $acc_credits_to[1]+$cred;
на
$transfer_payment = $cred*$transfer_percent/100;
$from_cred_set = $acc_credits_from[1]-$cred;
$to_cred_set = $acc_credits_to[1]+$cred-$transfer_payment;

DJGRAD

Битая сылка поменяйте  

8BitCore

cred_transfer.php
[size=1]<?
class option{

function cred_transfer($from,$to,$cred)
{
require("config.php");
require("includes/validate.class.php");
$login = clean_var(stripslashes($_SESSION['user']));
$from = stripslashes($from);
$to = stripslashes($to);
$cred = stripslashes($cred);

$acc_credits_from_dbo = mssql_query("SELECT memb___id,credits FROM MEMB_CREDITS WHERE memb___id = '$from'");
$acc_credits_from = mssql_fetch_row($acc_credits_from_dbo);

$acc_credits_to_dbo = mssql_query("SELECT memb___id,credits FROM MEMB_CREDITS WHERE memb___id = '$to'");
$acc_credits_to = mssql_fetch_row($acc_credits_to_dbo);

$from_login_check_dbo = mssql_query("SELECT memb___id FROM MEMB_INFO WHERE memb___id = '$from'");
$from_login_check = mssql_num_rows($from_login_check_dbo);

$to_login_check_dbo = mssql_query("SELECT memb___id FROM MEMB_INFO WHERE memb___id = '$to'");
$to_login_check = mssql_num_rows($to_login_check_dbo);

if(!isset($login)) {$error=1; echo $die_start . mmw_lang_cred_login . $die_end;}
elseif(!isset($from) || !isset($to) || !isset($cred)){$error=1; echo $die_start . mmw_lang_left_blank . $die_end;}
elseif($from_login_check < 1 || $to_login_check < 1){$error=1; echo $die_start . mmw_lang_cred_acc_false . $die_end;}
elseif(!preg_match("/^d*$/", $cred)){$error=1; echo $die_start . mmw_lang_cred_must_be_number . $die_end;}
elseif($from == $to){$error=1; echo $die_start . mmw_lang_cred_yourself . $die_end;}
elseif($cred < 0){$error=1; echo $die_start . mmw_lang_cred_positive . $die_end;}
elseif($acc_credits_from < $cred){$error=1; echo $die_start . mmw_lang_cred_not_enough . $die_end;}
elseif($login != $from){$error=1; echo $die_start . "*censored* hacker! Your account will be blocked permamently soon!" . $die_end;}

if($error!=1){
$from_cred_set = $acc_credits_from[1]-$cred;
$to_cred_set = $acc_credits_to[1]+$cred;
mssql_query("UPDATE MEMB_CREDITS SET credits = $from_cred_set WHERE memb___id = '$from'");
mssql_query("UPDATE MEMB_CREDITS SET credits = $to_cred_set WHERE memb___id = '$to'");
echo $okey_start,$cred.' '. mmw_lang_cred_success .' '.$to,$okey_end;
writelog("cred_transfer","Acc <font color=red>$login</font> Has Been Transfer from: acc <u>$from</u>|to: acc <u>$to</u>|how many: <b>$cred</b>");
}
}

}
?>[/size]