Changeset 26643


Ignore:
Timestamp:
Jan 12, 2014, 12:55:14 AM (10 years ago)
Author:
ddtddt
Message:

[extensions] - see_photos_by_user

Location:
extensions/see_photos_by_user
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/see_photos_by_user/language/en_UK/plugin.lang.php

    r26635 r26643  
    33$lang['select user'] = 'select user';
    44$lang['sumit']= 'sumit';
    5 
    65?>
  • extensions/see_photos_by_user/main.inc.php

    r26636 r26643  
    1111if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    1212
    13 
    1413define('SPBA_DIR' , basename(dirname(__FILE__)));
    1514define('SPBA_PATH' , PHPWG_PLUGINS_PATH . SPBA_DIR . '/');
    1615
    17 
    1816function add_link_SPBA($menu_ref_arr)
    19 {
     17 {
    2018  global $conf, $user;
    21 
    2219  $menu = & $menu_ref_arr[0];
    23  
    2420  if (($block = $menu->get_block('mbSpecials')) != null)
    25   {
    26     load_language('plugin.lang', SPBA_PATH);
    27 
    28     $position = (isset($conf['SPBA_position']) and is_numeric($conf['SPBA_position'])) ? $conf['SPBA_position'] : count($block->data)+1;
    29 
    30     array_splice($block->data, $position-1, 0, array('See_photos_by_user' =>
    31       array(
    32         'URL' => make_index_url(array('section' => 'See_photos_by_user')),
    33         'TITLE' => l10n('See photos by user'),
    34         'NAME' => l10n('See photos by user')
    35         )
    36       )
    37     );
    38   }
    39 }
     21   {
     22   load_language('plugin.lang', SPBA_PATH);
     23   $position = (isset($conf['SPBA_position']) and is_numeric($conf['SPBA_position'])) ? $conf['SPBA_position'] : count($block->data)+1;
     24   array_splice
     25         ($block->data, $position-1, 0, array
     26          ('See_photos_by_user' =>
     27      array
     28                         (
     29                         'URL' => make_index_url(array('section' => 'See_photos_by_user')),
     30                         'TITLE' => l10n('See photos by user'),
     31                         'NAME' => l10n('See photos by user')
     32       )
     33    )
     34   );
     35   }
     36 }
    4037
    4138function section_init_SPBA()
     
    4340  global $tokens;
    4441  if (in_array('See_photos_by_user', $tokens))
    45     include(SPBA_PATH . 'pagespba.php');
     42  include(SPBA_PATH . 'pagespba.php');
    4643}
    4744
  • extensions/see_photos_by_user/pagespba.php

    r26635 r26643  
    55global $page, $conf, $user, $template;
    66$page['section'] = 'See_photos_by_author';
    7 
    87 
    98//read auteur list
     
    1716
    1817while ($row = pwg_db_fetch_assoc($result))
    19         {
     18 {
    2019  $groups[$row['id']] = $row['username'];
    21         }
    22 
    23     $selected = 0;
     20}
     21  $selected = 0;
    2422        $options[] = l10n('select user');
    2523        $options['a'] = '----------------------';
     
    2725  foreach ($groups as $metalist => $metalist2)
    2826        {
    29     $options[$metalist] = $metalist2;
     27   $options[$metalist] = $metalist2;
    3028        }
    3129  $template->assign(
     
    3735       
    3836if (isset($_POST['submitchoixauteur']))
    39         {
    40                 $forbidden = get_sql_condition_FandF(
    41               array( 'visible_images' => 'id' ),
    42               'AND'
     37 {
     38     $forbidden = get_sql_condition_FandF(
     39     array( 'visible_images' => 'id' ),
     40    'AND'
    4341          );
    4442         
    45 $page['section'] = 'See_photos_by_author';
     43  $page['section'] = 'See_photos_by_author';
    4644
    4745    $query = '
    48 SELECT DISTINCT(id)
     46  SELECT DISTINCT(id)
    4947  FROM '.IMAGES_TABLE.'
    5048  INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id
     
    5250    '.$forbidden.'
    5351    '.$conf['order_by'].'
    54 ;';
     52  ;';
    5553
    56     $page = array_merge(
    57       $page,
    58       array(
    59         'title' => '<a href="'.duplicate_index_url(array('start'=>0)).'">'.l10n('See photos by author').'</a>',
    60         'items' => array_from_query($query, 'id'),
    61         )
    62       );
     54   $page = array_merge(
     55  $page,
     56  array(
     57    'title' => '<a href="'.duplicate_index_url(array('start'=>0)).'">'.l10n('See photos by author').'</a>',
     58    'items' => array_from_query($query, 'id'),
     59      )
     60     );
    6361         
    6462//read auteur list
    6563$groups = array();
    6664$query = '
    67 select id,username
     65 select id,username
    6866  FROM ' . USERS_TABLE . '
    6967  WHERE id<>2
     
    7573  $groups[$row['id']] = $row['username'];
    7674        }
    77 
    78     $selected = $_POST['metalist'];
     75  $selected = $_POST['metalist'];
    7976
    8077  foreach ($groups as $metalist => $metalist2)
     
    8582    'gestionA',
    8683    array(
    87       'OPTIONS' => $options,
    88       'SELECTED' => $selected
    89       ));
    90          
    91          
    92         }
    93          
    94          
    95          
    96          
    97           $template->assign('SPBA2', 'toto');
     84     'OPTIONS' => $options,
     85     'SELECTED' => $selected
     86     ));
     87 }
     88$template->assign('SPBA2', 'toto');
    9889$template->set_filename('SPBA', realpath(SPBA_PATH.'pagespba.tpl'));
    9990$template->assign_var_from_handle('CONTENT', 'SPBA');
    10091
    101 
    102 
    10392?>
  • extensions/see_photos_by_user/pagespba.tpl

    r26635 r26643  
    11{if isset ($gestionA)}
    2         <form method="post" >
    3                 {html_options name="metalist" options=$gestionA.OPTIONS selected=$gestionA.SELECTED}<input class="submit" name="submitchoixauteur" type="submit" value="{'sumit'|@translate}"/>
    4         </form>
     2 <form method="post" >
     3  {html_options name="metalist" options=$gestionA.OPTIONS selected=$gestionA.SELECTED}<input class="submit" name="submitchoixauteur" type="submit" value="{'sumit'|@translate}"/>
     4 </form>
    55{/if}
Note: See TracChangeset for help on using the changeset viewer.