Ignore:
Timestamp:
Feb 23, 2011, 11:45:29 PM (13 years ago)
Author:
tiico
Message:

Complete v2.0.0 :

  • Add information on admin page
  • Change blockmenu to show Contests without groups or for Guests.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/ConcoursPhoto/include/Concours.class.php

    r8965 r9364  
    933933
    934934
    935    
    936935                if (($page['section']) == 'categories' AND !empty($page['category']))
    937936                {
     
    10041003                                if (isset($_POST['concours_submit']))
    10051004                                {
     1005               
     1006//                    array_push($page['infos'] , l10n('concours_vote_saved'));
     1007                   
    10061008                                        $user_note = "";
    10071009                if ($this->debug)                       echo "SUBMIT";
     
    17841786        }
    17851787
    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
    17901789        public function blockmanager_apply( $menu_ref_arr )
    17911790        {
     
    17991798                if ( ($block = $menu->get_block( 'CONCOURS_menu' ) ) != null )
    18001799                {
    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
    18111801                  $menu_list=array();
    18121802
     
    18241814
    18251815                        // 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'
    18271817                        .' FROM ' .CONCOURS_RESULT_TABLE
    18281818                        .' INNER JOIN '.CONCOURS_TABLE. ' AS CONC ON CONC.id = id_concours'
    1829                         .' ORDER BY date DESC'
     1819                        .' ORDER BY id DESC'
    18301820                        .';';
    18311821                       
     
    18391829                                        break;
    18401830                                       
    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']))
    18421838                                {
    18431839                                        $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)
    18451848                                        {
    1846                                                 continue;
    1847                                         }
    18481849                                        $nb_concours ++;
    18491850                                        array_push($menu_list,
     
    18511852                                                'nfo' => "",
    18521853                                                'text' => $row['name'],
    1853         //                                      'link' => CONCOURS_PATH.'publish.php?id='.$row['id_concours'],
    18541854                                                'link' => './index.php?/concours/'.$row['id_concours'],
    18551855                                                'edit' => (is_admin()? PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . CONCOURS_DIR . '%2Fadmin%2Fadd_concours.php&concours=' . $row['id_concours'].'&action=modify':"")
     
    18621862                  {
    18631863
    1864                           $block->set_title("Concours Photo");
     1864                          $block->set_title(l10n('concoursphoto'));
    18651865                          $block->template = CONCOURS_ROOT.'/template/concours_menu.tpl';
    18661866                          $block->data = $menu_list;
Note: See TracChangeset for help on using the changeset viewer.