Pages, Articles & News
Tools & Plugins
Example / Placeholder Title


Description as an example placeholder. Sample text content for further customization of the "Index36" template.

You are free to edit and customize the template however you like. If you don’t have time or enough knowledge — you can always order template adaptation by contacting me via GitHub or private messages on the digital goods marketplace.

2025-12-20 06:05

Warning: Undefined variable $touser_ids in search.php on line 666

 

Строка

'PLUGIN_SEARCH_USER' => UsersHelper::getInstance()->usersSelect('rs[setuser][]', $touser_ids, [], true),

$touser_ids лежит внутри массива, но перед этим нигде не инициализирована.

нужно либо перед 

$t->assign([

выполнить инициализацию 

    // Users LIST
    $authorUsers = [];
    $touser_ids = [];

 

ЛИБО

Вынеси эти две строки выше, перед if (!empty($sq)) {:

примерно 240 строка
 
// Users LIST           //стало
$authorUsers = [];      //стало
$touser_ids = [];       //стало
if (!empty($sq)) {
   $words = explode(' ', preg_replace("'\s+'", " ", $sq));
   $sqlsearch = '%' . implode('%', $words) . '%';
   if (mb_strlen($sq) < Cot::$cfg['plugin']['search']['minsigns']) {
       cot_error(Cot::$L['plu_querytooshort'] . Cot::$R['code_error_separator'], '');
   }
   if (count($words) > Cot::$cfg['plugin']['search']['maxwords']) {
       cot_error(
           Cot::$L['plu_toomanywords'] . ' ' . Cot::$cfg['plugin']['search']['maxwords']
           . Cot::$R['code_error_separator']
       );
   }
   // Users LIST
   //$authorUsers = [];               //  было
   //$touser_ids = [];                //  было
   if (!empty($rs['setuser'])) {
       $authorUsers = UsersRepository::getInstance()->getByIds($rs['setuser']);
       $totalusers = count($authorUsers);
       if ($totalusers == 0) {
           cot_error(Cot::$L['plu_usernotexist'] . Cot::$R['code_error_separator'], 'rs[setuser][]');
       }
       foreach ($authorUsers as $user) {
           $touser_ids[] = $user['user_id'];
       }
       $touser = ($totalusers > 0 && !cot_error_found()) ? 'IN (' . implode(',', $touser_ids) . ')' : '';
   }
 
 
Account