Changeset 9383 for extensions/PWG_Stuffs/include/class.inc.php
- Timestamp:
- Feb 26, 2011, 4:28:24 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PWG_Stuffs/include/class.inc.php
r9369 r9383 9 9 var $blocks = array(); 10 10 var $pos = 'begin'; 11 var $template_var = array(); 11 12 12 13 function stuffs() 13 14 { 15 global $page, $template; 16 17 if ($page['stuffs_section'] == 'on_picture') 18 { 19 $this->template_var['begin'] = 'PLUGIN_PICTURE_BEFORE'; 20 $this->template_var['end'] = 'PLUGIN_PICTURE_AFTER'; 21 $template->set_prefilter('header', array('stuffs', 'prefilter_picture_css')); 22 pwgs_picture_special_sections(); 23 } 24 else 25 { 26 $this->template_var['begin'] = 'PLUGIN_INDEX_CONTENT_BEFORE'; 27 $this->template_var['end'] = 'PLUGIN_INDEX_CONTENT_AFTER'; 28 $template->set_prefilter( 'header', array('stuffs', 'prefilter_index_css') ); 29 } 30 14 31 $this->get_user_groups(); 15 32 $this->get_modules(); … … 35 52 global $page, $user; 36 53 54 if (!isset($page['stuffs_section'])) return; 55 37 56 $query = ' 38 SELECT id, name, path, parent, datas, groups, show_title, id_line, width57 SELECT DISTINCT id, name, path, parent, datas, groups, show_title, id_line, width 39 58 FROM ' . STUFFS_TABLE . ' 40 WHERE users LIKE "%' . $user['status'] . '%" 41 '; 42 43 $script = script_basename(); 44 if ($script == 'index') 45 { 46 $query .= !$page['is_homepage'] ? 47 'AND on_cats = "true"' : 48 'AND on_home = "true"' ; 49 } 50 elseif ($script == 'picture') 51 { 52 $query .= 'AND on_picture = "true"'; 53 } 54 else return; 55 56 $query .= ' 57 ORDER BY pos ASC;'; 59 LEFT JOIN ' . USER_GROUP_TABLE . ' 60 ON user_id = '.$user['id'].' 61 WHERE (users IS NULL OR users LIKE "%' . $user['status'] . '%") 62 AND (groups IS NULL OR groups REGEXP CONCAT("(^|,)",group_id,"(,|$)")) 63 AND level <= '.$user['level'].' 64 AND '.$page['stuffs_section'].' = "true" 65 ORDER BY pos ASC 66 ;'; 58 67 59 68 $result = pwg_query($query); … … 86 95 { 87 96 continue; 88 }89 if (!empty($module['groups']))90 {91 $authorized_groups = explode(',', $module['groups']);92 if (array_intersect($this->user_groups, $authorized_groups) == array()) continue;93 97 } 94 98
Note: See TracChangeset
for help on using the changeset viewer.