• 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!

Show Vip Status, kekox System

Acordion

Member
Joined
Mar 26, 2010
Messages
150
Reaction score
6
Location
Mèxico
Show the vip status, based in the Vip System Of Kekox.

OutCome:

Account
10001159.gif


Character

71534233.gif


Firt add in your htdocs/pot/OTS_ACCOUNT.php
Next to

PHP:
'lastday' => 0,

Add this

PHP:
'vipdays' => 0,

Next to

PHP:
' . $this->db->fieldName('rlname') . ',

Add this

PHP:
'. $this->db->fieldName('vipdays') . ',

Next to

PHP:
' . $this->db->fieldName('rlname') . ' = ' . $this->db->quote($this->data['rlname']) . '

Add this

PHP:
' . $this->db->fieldName('vipdays') . ' = ' . $this->db->quote($this->data['vipdays']) . ',

After to

PHP:
	public function getRLName()
    {
        if( !isset($this->data['rlname']) )
        {
            throw new E_OTS_NotLoaded();
        }

        return $this->data['rlname'];
    }

Add this

PHP:
public function getPlayerVipDays()
    {
        if( !isset($this->data['vipdays']) )
        {
            throw new E_OTS_NotLoaded();
        }

        return $this->data['vipdays'];
    }

Now, in htdocs/pot/OTS_PLAYER.php
After to

PHP:
   public function getPremiumEnd()
    {
        if( !isset($this->data['id']) )
        {
            throw new E_OTS_NotLoaded();
        }

        return $this->getAccount()->getPremiumEnd();
    }

Add this

PHP:
	    public function getPlayerVipDays()
    {
        if( !isset($this->data['id']) )
        {
            throw new E_OTS_NotLoaded();
        }

        return $this->getAccount()->getPlayerVipDays();
    }

Htdocs/Accountmanagement,php
Add after to

PHP:
                $account_email = $account_logged->getEMail();

Add this

PHP:
								$account_vip = $account_logged->getPlayerVipDays() ? '<b><font color="green"> Vip Account, '.$account_logged->getPlayerVipDays().' Days left </font></b>' : '<b><font color="red">Not Vip Account</font></b>';

Next to

PHP:
" ><td class="LabelV" >Account Status:</td><td>'.$account_status.'</td></tr><tr style="background-color:'.$config['site']['darkborder'].';

Add this

PHP:
" ><td class="LabelV" >Vip Status:</td><td>'.$account_vip.'</td></tr><tr style="background-color:'.$config['site']['darkborder'].';

Htdocs/Characters.PHP
After to

PHP:
$main_content .= ($account->isPremium()) ? '<b><font color="green">Premium Account</font></b>' : '<b><font color="red">Free Account</font></b>';

Add this

PHP:
          if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
                                $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Vip*Status:</TD><TD>';
                                $main_content .= ($account->getPlayerVipDays()) ? '<b><font color="green">Vip Account</font></b>' : '<b><font color="red">Not Vip Account</font></b>';

You end ._.
Don't forget to Rep :)
 
Well, it's always good to extend the core, anyway this does not use any additional query because it is loaded in the same query as other data. Anyway good work :)
 
Doesn't works:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'vipdays' in 'field list'' in C:\xampp\htdocs\pot\OTS_Account.php:228 Stack trace: #0 C:\xampp\htdocs\pot\OTS_Account.php(228): PDO->query('SELECT `id`, `n...') #1 C:\xampp\htdocs\pot\OTS_Player.php(320): OTS_Account->load('3098144') #2 C:\xampp\htdocs\characters.php(12): OTS_Player->getAccount() #3 C:\xampp\htdocs\index.php(99): include('C:\xampp\htdocs...') #4 {main} thrown in C:\xampp\htdocs\pot\OTS_Account.php on line 228

:S
 
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'vipdays' in 'field list'' in C:\xampp\htdocs\pot\OTS_Account.php:228 Stack trace: #0 C:\xampp\htdocs\pot\OTS_Account.php(228): PDO->query('SELECT `id`, `n...') #1 C:\xampp\htdocs\index.php(25): OTS_Account->load('128784') #2 {main} thrown in C:\xampp\htdocs\pot\OTS_Account.php on line 228
HELP ME PLEASE! ;( my fail
 
Back
Top