Forums / National / Russian / Тех. поддержка / переезд с PHP 5.4  на PHP 8.1 и Cotonti 0.9.21

Kabak
#45945 2023-02-24 15:16

Заменил - заработало

 

SQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
defined('COT_CODE') or die('Wrong URL');
 
require_once cot_langfile('toplastseen', 'plug');
require_once cot_incfile('toplastseen', 'plug');
 
    $date = cot::$sys['now'];  //  ЗАМЕНИЛ - заработало
 
$sql = $db->query("SELECT * FROM $db_users WHERE user_lastlog >= $date ORDER BY user_lastlog DESC LIMIT {$cfg['users']['maxusersperpage']}");
     
//  $temp1 = new XTemplate(cot_tplfile('toplastseen', 'plug'));
     
    $count = 0;
    while ( ($row = $sql->fetch()) != 0 ){
 
    $count++;
     
    $t->assign(array(
        'UMP_ROW_ODDEVEN' => cot_build_oddeven($count),
        'UMP_ROW_NUM' => $count,
        'UMP_ROW' => $row,
    ));   
         
    $t->assign(array(
     'UMP_ROW_USERNAME' => $row['user_name'],
     'UMP_ROW_LASTLOGIN' => cot_date('datetime_medium',$row['user_lastlog']),
     'UMP_ROW_LASTLOGIN_STAMP' => $row['user_lastlog'],
     'UMP_ROW_TIMEAGO' => cot_build_timegap($row['user_lastlog']),      
      ));      
    $t->parse('MAIN.UMP_ROW');
    }
 
$t->parse('ALTERNATIVE');