• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Linux [Modern AAC] Homepay buypoints error

Shikate

Pixel Artist since 2011
Joined
Mar 30, 2011
Messages
404
Reaction score
838
Location
Poland
Hi
This is my script:
Code:
<?PHP
### CREDITS ###
/* 
    homepay-buypoints fixed on ModernAAC
    by SunShine/SunnShine
    edited by Homepay.pl
    feel free to donate -> [email protected]
    respect the credits and my work, please
*/
###############

### NIE RUSZAC! ###
require("config.php"); 
$ots = POT::getInstance(); 
$ots->connect(POT::DB_MYSQL, connection()); 
$SQL = $ots->getDBHandle(); 
$config['homepay'] = array();
#################

### KONFIGURACJA ###

## sms ##

# smsy aktywne? true/false
$config['homepay_active_sms'] = true; 

# przykladowy konfig dla SMS
$config['homepay'][2]['acc_id']=671;
$config['homepay'][2]['addpoints']=10;
$config['homepay'][2]['sms_number']="79550";
$config['homepay'][2]['type']="sms";
$config['homepay'][2]['sms_text']="HPAY.NASZAUSLUGA";
$config['homepay'][2]['sms_cost']="10.98 zl brutto";

## przelewy ##

# przelewy aktywne? true/false
$config['homepay_active_transfer'] = false; 



####NIE RUSZAC NIZEJ JESLI NIE WIESZ CO ROBISZ

##funkcje
function save_trans($file, $acc, $code)
{
    $hak = fopen($file, "a");
    fwrite($hak, $code.'='.$acc.'');
    fclose($hak);
}

function save_nick($file, $acc)
{
    $hak = fopen($file, "a");
    if(fwrite($hak, $acc)==FALSE)
        $errors[] = 'Cos zjebales xD';
    fclose($hak);
}

function check_code_homepay($code,$usluga)
{
global $config;

$code=urlencode($code);
$handle=fopen("http://homepay.pl/sms/check_code.php?acc_id=".(int)($config['homepay'][$usluga]['acc_id'])."&code=".$code,'r');

$status=fgets($handle,8);
fclose($handle);
return $status;
}

function check_tcode_homepay($code,$usluga)
{
global $config;
$code=urlencode($code);
$handle=fopen("http://homepay.pl/API/check_tcode.php?acc_id=".$acc_id."&code=".$code,'r');

$status=fgets($handle,8);
fclose($handle);
return $status;
}

function add_points(OTS_Account $account, $number_of_points)
{
    if($account->isLoaded())
    {
        $account->setCustomField('premium_points', ($account->getCustomField('premium_points')+$number_of_points));
        return true;
    }
    else
        return false;
}

    if(isset($_POST['submit'])){ 
##reszta
$sms_type = (int) $_POST['sms_type'];
$posted_code = trim($_POST['code']);
$to_user = trim($_POST['to_user']);
$verify_code = trim(isset($_POST['verify_code']));

if(!empty($to_user))
{
    if(is_numeric($to_user))
    {
        $account = new OTS_Account();
        $account->find($to_user);
    }
    else
    {
        $player = new OTS_Player();
        $player->find($to_user);
        if($player->isLoaded())
            $account = $player->getAccount();
        else
            $account = new OTS_Account();
    }
    $errors = array();
    if(empty($posted_code))
        $errors[] = 'Prosze wpisac kod z SMSa/przelewu.';
        
    if(!$account->isLoaded())
        $errors[] = 'Konto/konto postaci o podanym nicku nie istnieje.';
        
    if(count($errors) == 0 || !isset($errors))
    {
        if(count($errors) == 0)
          {
          if($config['homepay'][$sms_type]['type']=="sms")
               $code_info = check_code_homepay($posted_code,$sms_type);
               else
               $code_info = check_tcode_homepay($posted_code,$sms_type);
               
               
               if($code_info != "1")
                    $errors[] = 'Podany kod z SMSa/przelewu jest niepoprawny lub wybrano zla opcje SMSa/przelewu.';
               else
               {
                    if(add_points($account, $config['homepay'][$sms_type]['addpoints']))
                {
                    save_trans('config/homepay.log', $account->getId(), $posted_code);    
                    echo '<h1><font color="red">Dodano '.$config['homepay'][$sms_type]['addpoints'].' punktow premium do konta: '.$to_user.' !</font></h1>';
                }
                else
                    $errors[] = 'Wystapil blad podczas dodawania punktow do konta, sproboj ponownie.';
                }
            }
        }
		if($errors)
{
    echo 'Wystapily bledy:';
    foreach($errors as $error)
    echo '<br />* '.$error;
    echo '<hr /><hr />';
}
    }
	
}

if($config['homepay_active_sms']) 
{ 
echo '<h2>SMS</h2>Kup punkty premium, mozesz je wymienic w sklepie OTSa na PACC/przedmioty w grze, aby zakupic punkty premium wyslij SMSa:'; 
foreach($config['homepay'] as $sms) 
if($sms['type'] == 'sms') 
echo '<br /><b>* Na numer <font color="red">'.$sms['sms_number'].'</font> o tresci <font color="red"><b>'.$sms['sms_text'].'</b></font> za <font color="red"><b>'.$sms['sms_cost'].'</b></font>, a za kod dostaniesz <font color="red"><b>'.$sms['addpoints'].'</b></font> punktow premium.</b>'; 
echo '<br />W SMSie zwrotnym otrzymasz specjalny kod. Wpisz ten kod w formularzu wraz z nickiem postaci lub numerem konta osoby ktora ma otrzymac punkty.<br /> 
Serwis SMS obslugiwany przez <a href="http://www.dotpay.pl" target="_blank">Dotpay.pl</a><br /> 
Regulamin: <a href="http://www.dotpay.pl/regulaminsms" target="_blank">http://www.dotpay.pl/regulaminsms</a><br /> 
Usluga dostepna w sieciach: Orange, Plus GSM, Era.<br /> 
<b>'.$config['server_name'].'</b> nie odpowieda za zle wpisane tresci SMS.<hr />'; 
} 
if($config['homepay_active_transfer']) 
{ 
echo '<h2>Przelew/karta kredytowa</h2>Kup punkty premium, mozesz je wymienic w sklepie OTSa na PACC/przedmioty w grze, aby zakupic punkty premium wejdz na jeden z adresow i wypelnij formularz:'; 
foreach($config['homepay'] as $przelew) 
if($przelew['type'] == 'C1') 
echo '<br /><b>* Adres - <a href="https://ssl.allpay.pl/?id='.$przelew['id'].'&code='.$przelew['code'].'"><font color="red">https://ssl.allpay.pl/?id='.$przelew['id'].'&code;='.$przelew['code'].'</font></a> - koszt <font color="red"><b>'.$przelew['sms_cost'].'</b></font>, a za kod dostaniesz <font color="red"><b>'.$przelew['addpoints'].'</b></font> punktow premium.</b>'; 
echo 'Kiedy Twoj przelew dojdzie (z kart kredytowych i bankow internetowych z listy jest to kwestia paru sekund) na e-mail ktory podales w formularzu otrzymasz kod. Kod ten mozesz wymienic na tej stronie na punkty premium w formularzu ponizej.<hr />'; 
} ?> 
<form method="post" action="homepay" id="enter_code"><table> 
<tr><td><b>Nick postaci lub numer konta: </b></td><td><input type="text" size="20" value="<?php $to_user?>" name="to_user" /></td></tr> 
<tr><td><b>Kod z SMSa: </b></td><td><input type="text" id="code" size="20" value="<?php $posted_code?>" name="code" /></td></tr> 
<tr><td><b>Typ wyslanego SMSa: </b></td><td><select name="sms_type"> 
<?php 
foreach($config['homepay'] as $id => $sms) 
if($sms['type'] == 'sms') 
echo '<option value="'.$id.'">numer '.$sms['sms_number'].' - kod '.$sms['sms_text'].' - SMS za '.$sms['sms_cost'].'</option>'; 
elseif($przelew['type'] == 'C1') 
echo '<option value="'.$id.'">przelew - kod '.$sms['sms_text'].' - za '.$sms['sms_cost'].'</option>'; 
echo '</select></td></tr>'; 
?> 
<tr><td></td><td><input type="submit" name='submit' value="Sprawdz" /></td></tr></table></form></br></br>
When i use this script i got this message:

Code:
Severity: Notice
Message: Undefined index: homepay
Filename: pages/homepay.php
Line Number: 65
Line 65:

$handle=fopen("http://homepay.pl/sms/check_code.php?acc_id=".(int)($config['homepay'][$usluga]['acc_id'])."&code=".$code,'r');

Same error here, if somebody already solved this, please post fix here. Rep +
 
Last edited:
Back
Top