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

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

MyAAC

Well-Known Member
Joined
May 4, 2017
Messages
98
Solutions
8
Reaction score
66
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

  • powerful-guilds.zip
    2.3 KB · Views: 957 · VirusTotal
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
 
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 :)
 
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
 
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
 */
 
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.
 
I installes here in new ubuntu 18 and nothing happens, do you know how to see errors or what happened? Thanks
 
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:
Here's version 2.0 of the plugin, with fixed the bug above.

Full changelog:
Code:
* moved html code to Twig
* set sql_mode to fix some errors on newer/older (not sure) MySQL Versions
* add this CHANGELOG and LICENSE
* add make-plugin.sh

i get this for tfs 0.4 what is this column?
View attachment 46209

Download this.
 

Attachments

  • myaac-powerful-guilds.zip
    15.5 KB · Views: 97 · VirusTotal
Does it work with TFS 1.3?
I know it says TFS 0.3, 0.4 and 1.0 in the title, but doesn't hurt to ask right.
 
PHP:
[Wed Jul 29 18:22:16.975272 2020] [:error] [pid 23916] [client 168.195.229.220:35746] PHP Fatal error:  Uncaught Error: Class 'ZipArchive' not found in /var/www/html/system/libs/plugins.php:79\nStack trace:\n#0 /var/www/html/system/pages/admin/plugins.php(67): Plugins::install('/var/www/html/p...')\n#1 /var/www/html/admin/index.php(52): include('/var/www/html/s...')\n#2 {main}\n  thrown in /var/www/html/system/libs/plugins.php on line 79, referer: http://sv2.dboackerzin.com/admin/?p=plugins
 
PHP:
[Wed Jul 29 18:22:16.975272 2020] [:error] [pid 23916] [client 168.195.229.220:35746] PHP Fatal error:  Uncaught Error: Class 'ZipArchive' not found in /var/www/html/system/libs/plugins.php:79\nStack trace:\n#0 /var/www/html/system/pages/admin/plugins.php(67): Plugins::install('/var/www/html/p...')\n#1 /var/www/html/admin/index.php(52): include('/var/www/html/s...')\n#2 {main}\n  thrown in /var/www/html/system/libs/plugins.php on line 79, referer: http://sv2.dboackerzin.com/admin/?p=plugins


You need to install php zip extension.

In console:
Code:
apt-get install php-zip
 
Hello I use OTHire and have below issue, can fix it ? Thanks in advance

Lua:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'k.unjustified' in 'where clause'


Backtrace:

#0 C:\xampp\htdocs\system\libs\pot\OTS_Base_DB.php(85): PDO->query('SELECT `g`.`id`...')
#1 C:\xampp\htdocs\plugins\powerful-guilds\powerful-guilds.php(37): OTS_Base_DB->query('SELECT `g`.`id`...')
#2 C:\xampp\htdocs\plugins\powerful-guilds\powerful-guilds.php(72): mostPowerfulGuildsDatabase()
#3 C:\xampp\htdocs\plugins\powerful-guilds\powerful-guilds.php(88): mostPowerfulGuildsList()
#4 C:\xampp\htdocs\system\hooks.php(71): require('C:\\xampp\\htdocs...')
#5 C:\xampp\htdocs\system\hooks.php(99): Hook->execute(Array)
#6 C:\xampp\htdocs\index.php(339): Hooks->trigger(2)
#7 {main}

1611364598589.png
 
Hello I use OTHire and have below issue, can fix it ? Thanks in advance

Lua:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'k.unjustified' in 'where clause'


Backtrace:

#0 C:\xampp\htdocs\system\libs\pot\OTS_Base_DB.php(85): PDO->query('SELECT `g`.`id`...')
#1 C:\xampp\htdocs\plugins\powerful-guilds\powerful-guilds.php(37): OTS_Base_DB->query('SELECT `g`.`id`...')
#2 C:\xampp\htdocs\plugins\powerful-guilds\powerful-guilds.php(72): mostPowerfulGuildsDatabase()
#3 C:\xampp\htdocs\plugins\powerful-guilds\powerful-guilds.php(88): mostPowerfulGuildsList()
#4 C:\xampp\htdocs\system\hooks.php(71): require('C:\\xampp\\htdocs...')
#5 C:\xampp\htdocs\system\hooks.php(99): Hook->execute(Array)
#6 C:\xampp\htdocs\index.php(339): Hooks->trigger(2)
#7 {main}

View attachment 54056
Anyone ?
 
Back
Top