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

shop block

Try to find the location of the button when you make a post and put this script after action button.
PHP:
$getName = $player->getName();
$getVoc = $SQL->query('SELECT `vocation` FROM `players` WHERE `name` = '.$getName .';');
if($getVoc == 0){
    echo $getName . ' is player rooker!';
    return true;
}
 
Try to find the location of the button when you make a post and put this script after action button.
PHP:
$getName = $player->getName();
$getVoc = $SQL->query('SELECT `vocation` FROM `players` WHERE `name` = '.$getName .';');
if($getVoc == 0){
    echo $getName . ' is player rooker!';
    return true;
}
no have "$getName = $player->getName();" in script
 
No need to perform additional separate queries, we could use "secure" PDO for that.
Noob solution would be to modify filter criteria in getPlayersList.

PHP:
$filter = new OTS_SQLFilter();
$filter->compareField('account_id', $account_logged->getId());
$filter->compareField('vocation', 0, OTS_SQLFilter::OPERATOR_GREATER);
$players_from_logged_acc->setFilter($filter);
$players_from_logged_acc->orderBy('name');

Or even better to provide some param to getPlayersList like includeNonVocation or vocationList which to exclude so you'd have SSOT instead.
*I'm not a PHP guy, thus there's probably hundreds of better ways to tackle that problem
 
Back
Top