Changeset 7541


Ignore:
Timestamp:
Nov 1, 2010, 3:30:48 PM (10 years ago)
Author:
patdenice
Message:

Correction of last commit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/PWG_Stuffs/include/class.inc.php

    r7540 r7541  
    3636
    3737    $query = '
    38 SELECT id, name, type, datas, groups, show_title, id_line, width
     38SELECT id, name, type, datas, users, groups, show_title, id_line, width
    3939FROM ' . STUFFS_TABLE . '
    40 WHERE users LIKE "%' . $user['status'] . '%"
     40WHERE id = 0 OR (
     41  users LIKE "%' . $user['status'] . '%"
    4142';
    4243
     
    5455    else return;
    5556
    56     if (!$page['is_homepage'])
    57     {
    58       $query .= ' OR id = 0';
    59     }
    60 
    61     $query .= '
     57    $query .= ')
    6258ORDER BY pos ASC;';
    6359
     
    7571    foreach ($this->modules as $module)
    7672    {
    77       if ($module['type'] == 'MainBlock')
    78       {
    79                 $this->pos = 'end';
    80                 continue;
    81         }
    8273        if (!empty($module['groups']))
    8374      {
     
    8677        }
    8778
     79      if ($module['type'] == 'MainBlock')
     80      {
     81        global $user;
     82        if (strpos($module['users'], $user['status']) === false)
     83        {
     84          add_event_handler('loc_end_index', 'hide_main_block');
     85        }
     86        $this->pos = 'end';
     87                continue;
     88        }
     89
    8890        $datas = (!empty($module['datas']) ? unserialize($module['datas']) : false);
    8991      $block = array();
     
    102104      $block['TEMPLATE'] = 'stuffs_'.strtolower($module['type']).'.tpl';
    103105        $this->set_tpl_block($block, $module);
    104     }
    105     if ($this->pos == 'begin')
    106     {
    107       add_event_handler('loc_end_index', 'hide_main_block');
    108106    }
    109107  }
Note: See TracChangeset for help on using the changeset viewer.