Ignore:
Timestamp:
Oct 21, 2009, 6:38:46 PM (11 years ago)
Author:
flop25
Message:

block successfully implemented : admin page remaining

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/adult_content/class.inc.php

    r4078 r4080  
    7676  function set_block_on_index ()
    7777  {
    78         global $page, $template;
     78        $this->loading_lang();
     79        global $page, $template, $user, $conf;
    7980
    8081        if (isset($page['section']) and $page['section'] == 'categories')
     82
    8183        {
     84                ////////////lié à quoi/////     
     85         $query = '
     86SELECT id FROM '.GROUPS_TABLE.'
     87  WHERE name IN (\'+18\')
     88;';
     89     $data_18 = mysql_fetch_array(pwg_query($query));
     90         $query = '
     91SELECT id FROM '.GROUPS_TABLE.'
     92  WHERE name IN (\'16-17\')
     93;';
     94     $data_16 = mysql_fetch_array(pwg_query($query));
     95         $query = '
     96SELECT id FROM '.GROUPS_TABLE.'
     97  WHERE name IN (\'nothing\')
     98;';
     99     $data_no = mysql_fetch_array(pwg_query($query));
     100         $n_query = '
     101SELECT COUNT(*) AS result FROM '.USER_GROUP_TABLE.'
     102  WHERE group_id IN (\''.$data_18['id'].'\',\''.$data_16['id'].'\',\''.$data_no['id'].'\') AND user_id IN (\''.$user['id'].'\')
     103;';
     104      $data_user = mysql_fetch_array(pwg_query($n_query));
     105          $is_grouped = $data_user['result'];   
     106         
     107          if ( $is_grouped == 0 and $user['username'] !== '16' and $user['username'] !== '18')
     108          {
    82109                $template->set_filename('ac_block', realpath($this->get_template('block.tpl') ) );
    83110                $begin = 'PLUGIN_INDEX_CONTENT_BEFORE';
    84111                $end = 'PLUGIN_INDEX_CONTENT_AFTER';
    85112                $template->concat($begin,       $template->parse('ac_block', true));
     113          }
    86114        }
    87115  }
Note: See TracChangeset for help on using the changeset viewer.