[MyAAC][Plugin] Most powerful guilds (TFS 0.3/4 and 1.0)

MyAAC

Member
Joined
May 4, 2017
Messages
96
Reaction score
42
This is most powerful guilds plugin for MyAAC. It displays guilds that have most unjustified kills.

Requirements: Any version of MyAAC.

Installation:

Go to Admin Panel, select 'Plugins', and then select powerful-guilds.zip and click upload. That's all!

In config.local.php, optionally add:
Code:
$config['powerful_guilds'] = array(
   'refresh_interval' => 10 * 60, // cache query for 10 minutes (in seconds)
   'amount' => 5, // how many powerful guilds to show
   'page' => 'news' // on what pages most powerful guilds box should appear, for example 'news', or 'guilds' (blank makes it visible on every page)
);
Screenshot:
Bildschirmfoto 2017-10-11 um 16.10.51.png
 

Attachments

cs007

Member
Joined
Dec 2, 2010
Messages
56
Reaction score
1
Hey man, you can help me?
PHP:
Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'database_ot.g.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by in /var/www/html/system/libs/pot/OTS_Base_DB.php:101 Stack trace: #0 /var/www/html/system/libs/pot/OTS_Base_DB.php(101): PDO->query('SELECT `g`.`id`...') #1 /var/www/html/plugins/powerful-guilds/powerful-guilds.php(35): OTS_Base_DB->query('SELECT `g`.`id`...') #2 /var/www/html/plugins/powerful-guilds/powerful-guilds.php(70): mostPowerfulGuildsDatabase() #3 /var/www/html/plugins/powerful-guilds/powerful-guilds.php(96): mostPowerfulGuildsList() #4 /var/www/html/system/hooks.php(47): require('/var/www/html/p...') #5 /var/www/html/system/hooks.php(74): Hook->execute(Array) #6 /var/www/html/index.php(384): Hooks->trigger(2) #7 {main} thrown in /var/www/html/system/libs/pot/OTS_Base_DB.php on line 101
 
OP
M

MyAAC

Member
Joined
May 4, 2017
Messages
96
Reaction score
42
Hey man, you can help me?
PHP:
Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'database_ot.g.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by in /var/www/html/system/libs/pot/OTS_Base_DB.php:101 Stack trace: #0 /var/www/html/system/libs/pot/OTS_Base_DB.php(101): PDO->query('SELECT `g`.`id`...') #1 /var/www/html/plugins/powerful-guilds/powerful-guilds.php(35): OTS_Base_DB->query('SELECT `g`.`id`...') #2 /var/www/html/plugins/powerful-guilds/powerful-guilds.php(70): mostPowerfulGuildsDatabase() #3 /var/www/html/plugins/powerful-guilds/powerful-guilds.php(96): mostPowerfulGuildsList() #4 /var/www/html/system/hooks.php(47): require('/var/www/html/p...') #5 /var/www/html/system/hooks.php(74): Hook->execute(Array) #6 /var/www/html/index.php(384): Hooks->trigger(2) #7 {main} thrown in /var/www/html/system/libs/pot/OTS_Base_DB.php on line 101
This seems to be a new behavior introduced in MySQL version 5.7, as stated here: MySQL :: MySQL 5.7 Reference Manual :: 5.1.10 Server SQL Modes

To get around this error, we can change sql_mode to behave like in older MySQL versions. The real solution would be to rewrite the query, but for that I don't have time now.

So, just edit your plugins/powerful-guilds/powerful-guilds.php and replace first line:
PHP:
<?php
with:
PHP:
<?php
$query = $db->query('SELECT @@sql_mode as `mode`')->fetch();
$mode = str_replace('ONLY_FULL_GROUP_BY', '', $query['mode']);

$db->query('set session sql_mode = ' . $db->quote($mode));
And it should work :)
 

cs007

Member
Joined
Dec 2, 2010
Messages
56
Reaction score
1
This seems to be a new behavior introduced in MySQL version 5.7, as stated here: MySQL :: MySQL 5.7 Reference Manual :: 5.1.10 Server SQL Modes

To get around this error, we can change sql_mode to behave like in older MySQL versions. The real solution would be to rewrite the query, but for that I don't have time now.

So, just edit your plugins/powerful-guilds/powerful-guilds.php and replace first line:
PHP:
<?php
with:
PHP:
<?php
$query = $db->query('SELECT @@sql_mode as `mode`')->fetch();
$mode = str_replace('ONLY_FULL_GROUP_BY', '', $query['mode']);

$db->query('set session sql_mode = ' . $db->quote($mode));
And it should work :)
Mine was already this way.
3xzwq - Ghostbin
 
OP
M

MyAAC

Member
Joined
May 4, 2017
Messages
96
Reaction score
42
Mine was already this way.
3xzwq - Ghostbin
Which part of my post didn't you understand?

Replace the first line, so it looks like this:
PHP:
<?php
$query = $db->query('SELECT @@sql_mode as `mode`')->fetch();
$mode = str_replace('ONLY_FULL_GROUP_BY', '', $query['mode']);

$db->query('set session sql_mode = ' . $db->quote($mode));

/**
 * Powerful guilds for MyAAC
 *
 * @name      powerful-guilds
 * @author    Slawkens <[email protected]>
 * @version   1.1
 */
 

cs007

Member
Joined
Dec 2, 2010
Messages
56
Reaction score
1
Which part of my post didn't you understand?

Replace the first line, so it looks like this:
PHP:
<?php
$query = $db->query('SELECT @@sql_mode as `mode`')->fetch();
$mode = str_replace('ONLY_FULL_GROUP_BY', '', $query['mode']);

$db->query('set session sql_mode = ' . $db->quote($mode));

/**
 * Powerful guilds for MyAAC
 *
 * @name      powerful-guilds
 * @author    Slawkens <[email protected]>
 * @version   1.1
 */
Thank you very much, my friend.
 

dervin13

Excellent OT User
Joined
Apr 26, 2008
Messages
432
Reaction score
15
I installes here in new ubuntu 18 and nothing happens, do you know how to see errors or what happened? Thanks
 

dervin13

Excellent OT User
Joined
Apr 26, 2008
Messages
432
Reaction score
15
I think its some problem with compatibility but I have no idea of what it is, because I was using it without any problems in ubunth 14. I updated my ubuntu to 18 including php to 7 and after that the plugin disapprared

solved just downgraded the hooks in past system
 
Last edited:
Top