Changeset 9364 for extensions/ConcoursPhoto/include
- Timestamp:
- Feb 23, 2011, 11:45:29 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ConcoursPhoto/include/Concours.class.php
r8965 r9364 933 933 934 934 935 936 935 if (($page['section']) == 'categories' AND !empty($page['category'])) 937 936 { … … 1004 1003 if (isset($_POST['concours_submit'])) 1005 1004 { 1005 1006 // array_push($page['infos'] , l10n('concours_vote_saved')); 1007 1006 1008 $user_note = ""; 1007 1009 if ($this->debug) echo "SUBMIT"; … … 1784 1786 } 1785 1787 1786 /* 1787 initialise menubar's menu 1788 called by menubar object when making menu 1789 */ 1788 // initialise menubar's menu. called by menubar object when making menu 1790 1789 public function blockmanager_apply( $menu_ref_arr ) 1791 1790 { … … 1799 1798 if ( ($block = $menu->get_block( 'CONCOURS_menu' ) ) != null ) 1800 1799 { 1801 if($user['id']==2) 1802 { 1803 $vote_id = $_SERVER['REMOTE_ADDR']; 1804 } 1805 else 1806 { 1807 $vote_id = $user['id']; 1808 } 1809 1810 // $polls_list=$this->get_polls_list($vote_id, is_admin(), $user['language']); 1800 1811 1801 $menu_list=array(); 1812 1802 … … 1824 1814 1825 1815 // recover all img_id from the category 1826 $query = 'SELECT distinct(id_concours), groups, CONC.name'1816 $query = 'SELECT distinct(id_concours), groups, guest, CONC.name' 1827 1817 .' FROM ' .CONCOURS_RESULT_TABLE 1828 1818 .' INNER JOIN '.CONCOURS_TABLE. ' AS CONC ON CONC.id = id_concours' 1829 .' ORDER BY dateDESC'1819 .' ORDER BY id DESC' 1830 1820 .';'; 1831 1821 … … 1839 1829 break; 1840 1830 1841 if (!empty($row['groups'])) 1831 $conc_to_show = false; // Default ==> dont show 1832 1833 // Guest 1834 if (is_a_guest() AND $row['guest']) 1835 $conc_to_show = true; 1836 // Group present 1837 elseif (!empty($row['groups'])) 1842 1838 { 1843 1839 $authorized_groups = explode(',', $row['groups']); 1844 if (array_intersect($this->user_groups, $authorized_groups) == array()) 1840 if (array_intersect($this->user_groups, $authorized_groups) != array()) 1841 $conc_to_show = true; 1842 } 1843 // Allowed for any user (logged) 1844 elseif (empty($row['groups'])) 1845 $conc_to_show = true; 1846 1847 if ($conc_to_show) 1845 1848 { 1846 continue;1847 }1848 1849 $nb_concours ++; 1849 1850 array_push($menu_list, … … 1851 1852 'nfo' => "", 1852 1853 'text' => $row['name'], 1853 // 'link' => CONCOURS_PATH.'publish.php?id='.$row['id_concours'],1854 1854 'link' => './index.php?/concours/'.$row['id_concours'], 1855 1855 'edit' => (is_admin()? PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . CONCOURS_DIR . '%2Fadmin%2Fadd_concours.php&concours=' . $row['id_concours'].'&action=modify':"") … … 1862 1862 { 1863 1863 1864 $block->set_title( "Concours Photo");1864 $block->set_title(l10n('concoursphoto')); 1865 1865 $block->template = CONCOURS_ROOT.'/template/concours_menu.tpl'; 1866 1866 $block->data = $menu_list;
Note: See TracChangeset
for help on using the changeset viewer.