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

AAC PHP 7.2 Cannot use $this as parameter

beliar34

Member
Joined
Feb 28, 2012
Messages
307
Solutions
7
Reaction score
11
Code:
function getOrder($arr, $order, $this) {
    // Function by Colandus!
    $type = 'asc';
    if($orderBy = $arr[$this])
        if(isset($_GET[$order])) {
            $v = explode('_', strrev($_GET[$order]), 2);
            if(strrev($v[1]) == $this)
                $type = (strrev($v[0]) == 'asc' ? 'desc' : 'asc');
        }

    return $this . '_' . $type;
}

Fatal error: Cannot use $this as parameter in /var/www/config-and-functions.php on line 498

Anyone ? :)
 
after changing $this to $string
Code:
Notice: Undefined index: sqliteDatabase in /var/www/config-and-functions.php on line 30 Notice: Undefined index: encryptionType in /var/www/config-and-functions.php on line 32 Notice: Undefined index: encryptionType in /var/www/config-and-functions.php on line 34 Warning: parse_ini_file(layouts/dirt/layout_config.ini): failed to open stream: No such file or directory in /var/www/config-and-functions.php on line 75 Warning: Invalid argument supplied for foreach() in /var/www/config-and-functions.php on line 76 Warning: fopen(config/serverstatus): failed to open stream: Permission denied in /var/www/config-and-functions.php on line 452 Notice: Undefined variable: file_data in /var/www/config-and-functions.php on line 455 Warning: rewind() expects parameter 1 to be resource, boolean given in /var/www/config-and-functions.php on line 458 Warning: fwrite() expects parameter 1 to be resource, boolean given in /var/www/config-and-functions.php on line 459 Warning: fclose() expects parameter 1 to be resource, boolean given in /var/www/config-and-functions.php on line 460 Warning: fopen(usercounter.dat): failed to open stream: Permission denied in /var/www/config-and-functions.php on line 468 Warning: fgets() expects parameter 1 to be resource, boolean given in /var/www/config-and-functions.php on line 469 Warning: rewind() expects parameter 1 to be resource, boolean given in /var/www/config-and-functions.php on line 471 Warning: fputs() expects parameter 1 to be resource, boolean given in /var/www/config-and-functions.php on line 472 Warning: fclose() expects parameter 1 to be resource, boolean given in /var/www/config-and-functions.php on line 473 Notice: Undefined index: action in /var/www/index.php on line 16 Notice: Undefined index: account_login in /var/www/index.php on line 40 Notice: Undefined index: password_login in /var/www/index.php on line 41 Notice: Undefined index: vdarkborder in /var/www/latestnews.php on line 32 Notice: Undefined index: vdarkborder in /var/www/latestnews.php on line 35 Notice: Undefined index: darkborder in /var/www/latestnews.php on line 36 Notice: Undefined index: lightborder in /var/www/latestnews.php on line 39 Notice: Undefined index: darkborder in /var/www/latestnews.php on line 42 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 'ots.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/latestnews.php:70 Stack trace: #0 /var/www/latestnews.php(70): PDO->query('SELECT `g`.`id`...') #1 /var/www/index.php(70): include('/var/www/latest...') #2 {main} thrown in /var/www/latestnews.php on line 70


@Update

After change layout

Code:
Notice: Undefined index: sqliteDatabase in /var/www/config-and-functions.php on line 30 Notice: Undefined index: encryptionType in /var/www/config-and-functions.php on line 32 Notice: Undefined index: encryptionType in /var/www/config-and-functions.php on line 34 Warning: fopen(config/serverstatus): failed to open stream: Permission denied in /var/www/config-and-functions.php on line 452 Notice: Undefined variable: file_data in /var/www/config-and-functions.php on line 455 Warning: rewind() expects parameter 1 to be resource, boolean given in /var/www/config-and-functions.php on line 458 Warning: fwrite() expects parameter 1 to be resource, boolean given in /var/www/config-and-functions.php on line 459 Warning: fclose() expects parameter 1 to be resource, boolean given in /var/www/config-and-functions.php on line 460 Warning: fopen(usercounter.dat): failed to open stream: Permission denied in /var/www/config-and-functions.php on line 468 Warning: fgets() expects parameter 1 to be resource, boolean given in /var/www/config-and-functions.php on line 469 Warning: rewind() expects parameter 1 to be resource, boolean given in /var/www/config-and-functions.php on line 471 Warning: fputs() expects parameter 1 to be resource, boolean given in /var/www/config-and-functions.php on line 472 Warning: fclose() expects parameter 1 to be resource, boolean given in /var/www/config-and-functions.php on line 473 Notice: Undefined index: action in /var/www/index.php on line 16 Notice: Undefined index: account_login in /var/www/index.php on line 40 Notice: Undefined index: password_login in /var/www/index.php on line 41 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 'ots.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/latestnews.php:70 Stack trace: #0 /var/www/latestnews.php(70): PDO->query('SELECT `g`.`id`...') #1 /var/www/index.php(70): include('/var/www/latest...') #2 {main} thrown in /var/www/latestnews.php on line 70



@Update



Code:
Notice: Undefined index: sqliteDatabase in /var/www/config-and-functions.php on line 30 Notice: Undefined variable: file_data in /var/www/config-and-functions.php on line 455 Notice: Undefined index: action in /var/www/index.php on line 17 Notice: Undefined index: account_login in /var/www/index.php on line 41 Notice: Undefined index: password_login in /var/www/index.php on line 42 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 'ots1.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/latestnews.php:71 Stack trace: #0 /var/www/latestnews.php(71): PDO->query('SELECT `g`.`id`...') #1 /var/www/index.php(71): include('/var/www/latest...') #2 {main} thrown in /var/www/latestnews.php on line 71


After few changes

  • Database server
    • Server: Localhost via UNIX socket
    • Server type: MySQL
    • Server connection: SSL is not being used
    • Server version: 5.7.24-0ubuntu0.18.04.1 - (Ubuntu)
    • Protocol version: 10
    • User: myusernamerestricted@localhost
    • Server charset: UTF-8 Unicode (utf8)
    Web server
    • Apache
    • Database client version: libmysql - mysqlnd 5.0.12-dev - 20150407 -
    • PHP extension: mysqli curl mbstring
    • PHP version: 7.2.10-0ubuntu0.18.04.1
    phpMyAdmin
    • Version information: 4.8.3 (up to date)



@Update




Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'topic_ot' in 'field list' in /var/www/latestnews.php:109 Stack trace: #0 /var/www/latestnews.php(109): PDO->query('SELECT image_id...') #1 /var/www/index.php(77): include('/var/www/latest...') #2 {main} thrown in /var/www/latestnews.php on line 109

line 109 :

$news_DB = $SQL->query('SELECT image_id, date, author, '.$newsLanguageSystem.' FROM z_news_big WHERE hide_news != 1 ORDER BY date DESC LIMIT '.$config['site']['news_big_limit'].';');


When delete whole line site works fine but i need this function ! any idea why this happen?


@Update

Thread can be closed i fixed everyting



fix :

Code:
    $news_DB = $SQL->query('SELECT * FROM '.$SQL->tableName('z_news_big').' WHERE hide_news != 1 ORDER BY date DESC LIMIT '.$config['site']['news_big_limit'].';');
 
Last edited:
This is the errors you have with software that hasn't been updated since 6 YEARS!

But, well, I think I can _still_ help you.

But I advice against using this software for your Open Tibia Server, in 2018.

Oh well, I see you updated your thread and managed to fix everything. Nice then! But think about next ones that will have the same problems with outdated software.

I highly advice against using outdated software that has no support at all!
 
This is the errors you have with software that hasn't been updated since 6 YEARS!

But, well, I think I can _still_ help you.

But I advice against using this software for your Open Tibia Server, in 2018.

Oh well, I see you updated your thread and managed to fix everything. Nice then! But think about next ones that will have the same problems with outdated software.

I highly advice against using outdated software that has no support at all!

Yep i moved to newest gesior, i don't want to do this because i got a lot of custom scripts for my anime ot that would need rewrite when move to newest gesior, atleast i get rid of these errors :)
 
Back
Top