Jump to content
Дизайн и модификация IPS Community IPBSkinsBETA
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
TemKa_SD

Правильно ли сделан код?

Recommended Posts

Ваша функция должна возвращать true или false и нужно использовать return

Share this post


Link to post
Share on other sites

Спасибо, добавил return true; и заработало. Я вам сильное надоел?

Edited by TemKa_SD

Share this post


Link to post
Share on other sites

Хотя нет, что-то не то.

 

Шаблон еще поправил, правильно?

 

  {{if \IPS\Settings::i()->pvpgn_enabled AND $accountPvPGN == true }}

 

	public function accountPvPGN()
{
	$db = \IPS\sharedstats\DB::get();
	$db::i('stats')->select('COUNT(*)', 'stats_forum_connections', [['member_id=?', \IPS\Member::loggedIn()->member_id], ['server=?', 'Server.WC3.Games']])->first() != 0;
	return true;
}

 

Блин, тоже не работает.

Edited by TemKa_SD

Share this post


Link to post
Share on other sites
    public function accountPvPGN()
   {
       $db = \IPS\sharedstats\DB::get();
       return ($db::i('stats')->select('COUNT(*)', 'stats_forum_connections', [['member_id=?', \IPS\Member::loggedIn()->member_id], ['server=?', 'Server.WC3.Games']])->first() == 0);
   }

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...