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

Joined
May 4, 2017
Messages
96
Best answers
8
Likes
41
#1
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

Joined
Dec 2, 2010
Messages
56
Best answers
0
Likes
1
#2
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
 
Joined
May 4, 2017
Messages
96
Best answers
8
Likes
41
#3
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 :)
 
Joined
Dec 2, 2010
Messages
56
Best answers
0
Likes
1
#4
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
 
Joined
May 4, 2017
Messages
96
Best answers
8
Likes
41
#5
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
 */
 
Joined
Dec 2, 2010
Messages
56
Best answers
0
Likes
1
#6
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.
 
Top