Changeset 27428


Ignore:
Timestamp:
02/19/14 23:32:26 (5 years ago)
Author:
ddtddt
Message:

[extensions] - see_photos_by_user - new function menu / show

Location:
extensions/see_photos_by_user
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • extensions/see_photos_by_user/admin.php

    r27422 r27428  
    1818        'SPBU2' => $conf['see_photos_by_user_limit'], 
    1919        'SPBU3' => $conf['see_photos_by_user_order'], 
     20        'SPBU4' => $conf['see_photos_by_user_show'], 
    2021    ) 
    2122  ); 
     
    3738$template->assign('spbu', $SPBU3); 
    3839$template->assign('spbuT', $SPBU3T);  
    39   
     40 
     41$SPBU3T2 = array( 
     42    l10n('link Specials menu')." - ".l10n('select users box'), 
     43    l10n('bloc menu users')." - ".l10n('select users box'), 
     44    l10n('link Specials menu')." - ".l10n('select users box')." - ".l10n('bloc menu users'), 
     45        l10n('bloc menu users'), 
     46  ); 
     47   
     48$SPBU32 = array( 
     49    '1', 
     50    '2', 
     51    '3', 
     52        '4', 
     53  ); 
     54 
     55$template->assign('spbu2', $SPBU32); 
     56$template->assign('spbuT2', $SPBU3T2);  
    4057 
    4158if (isset($_POST['submitspbu'])) 
     
    5067{array_push( $page['errors'], l10n('Minimal number photos for show users is incorrect !'));} 
    5168conf_update_param('see_photos_by_user_order', $_POST['insspbu3']); 
     69conf_update_param('see_photos_by_user_show', $_POST['insspbu4']); 
    5270 
    5371if (!$page['errors']) 
     
    5977          'SPBU2' => stripslashes($_POST['insspbu2']), 
    6078          'SPBU3' => stripslashes($_POST['insspbu3']), 
     79          'SPBU4' => stripslashes($_POST['insspbu4']), 
    6180      ) 
    6281    ); 
  • extensions/see_photos_by_user/admin.tpl

    r27391 r27428  
    1313 </p> 
    1414 <p> 
    15   <strong>{'users order'|@translate}</strong>  
     15  <strong>{'Users order'|@translate}</strong>  
    1616  {html_options name="insspbu3" values=$spbu output=$spbuT selected="{$SPBU3}"} 
    1717 </p> 
    18  
     18 <p> 
     19  <strong>{'Show'|@translate}</strong>  
     20  {html_options name="insspbu4" values=$spbu2 output=$spbuT2 selected="{$SPBU4}"} 
     21 </p> 
    1922  <p> 
    2023    <input class="submit" type="submit" name="submitspbu" value="{'Submit'|@translate}"> 
  • extensions/see_photos_by_user/language/da_DK/plugin.lang.php

    r27426 r27428  
    3333$lang['users by reverse alphabetical order'] = 'brugere i omvendt alfabetisk rækkefølge'; 
    3434$lang['users in alphabetical order'] = 'brugere i alfabetisk rækkefølge'; 
    35 $lang['users order'] = 'brugerrækkefølge'; 
     35$lang['Users order'] = 'brugerrækkefølge'; 
    3636?> 
  • extensions/see_photos_by_user/language/de_DE/plugin.lang.php

    r27427 r27428  
    3131$lang['users by reverse alphabetical order'] = 'Benutzer in umgekehrter alphabetischer Anordnung'; 
    3232$lang['users in alphabetical order'] = 'Benutzer in alphabetischer Anordnung'; 
    33 $lang['users order'] = 'Benutzer Anordnung'; 
     33$lang['Users order'] = 'Benutzer Anordnung'; 
    3434?> 
  • extensions/see_photos_by_user/language/en_UK/plugin.lang.php

    r27422 r27428  
    1010$lang['Minimal number photos for show users'] = 'Minimal number photos for show users'; 
    1111$lang['Maximal number users'] = 'Maximal number users'; 
    12 $lang['users order'] = 'users order'; 
     12$lang['Users order'] = 'users order'; 
    1313$lang['Maximal number users is incorrect !'] = 'Maximal number users is incorrect !'; 
    1414$lang['Minimal number photos for show users is incorrect !'] = 'Minimal number photos for show users is incorrect !'; 
    15  
     15$lang['link Specials menu'] = 'link Specials menu'; 
     16$lang['select users box'] = 'select users box'; 
     17$lang['bloc menu users'] = 'bloc menu users'; 
     18$lang['Show'] = 'Show'; 
    1619?> 
  • extensions/see_photos_by_user/language/fr_FR/plugin.lang.php

    r27422 r27428  
    1010$lang['Minimal number photos for show users'] = 'Nombre minimal de photos pour montrer les utilisateurs'; 
    1111$lang['Maximal number users'] = 'nombre maximal d\'utilisateurs'; 
    12 $lang['users order'] = 'ordre des utilisateurs'; 
     12$lang['Users order'] = 'Ordre des utilisateurs'; 
    1313$lang['Maximal number users is incorrect !'] = 'Le nombre minimal de photos pour montrer les utilisateurs est incorrect !'; 
    1414$lang['Minimal number photos for show users is incorrect !'] = 'Le nombre maximal d\'utilisateurs est incorrect !'; 
     15$lang['link Specials menu'] = 'le liens dans le menu Spéciales'; 
     16$lang['select users box'] = 'la boite de sélection d\'utilisateurs'; 
     17$lang['bloc menu users'] = 'le bloc menu utilisateurs'; 
     18$lang['Show'] = 'Montrer'; 
    1519?> 
  • extensions/see_photos_by_user/language/it_IT/plugin.lang.php

    r27425 r27428  
    2323$lang['users by reverse alphabetical order'] = 'utenti per ordine alfabetico inverso'; 
    2424$lang['users in alphabetical order'] = 'utenti in ordine alfabetico'; 
    25 $lang['users order'] = 'ordine utenti'; 
     25$lang['Users order'] = 'ordine utenti'; 
    2626$lang['select user'] = 'seleziona utente'; 
    2727$lang['submit'] = 'invia'; 
  • extensions/see_photos_by_user/main.inc.php

    r27392 r27428  
    1515load_language('plugin.lang', SPBA_PATH); 
    1616 
     17global $conf; 
     18$showSPBU = $conf['see_photos_by_user_show']; 
     19 
     20if ($showSPBU == 1 OR $showSPBU == 3) 
     21{ 
    1722add_event_handler('blockmanager_apply' , 'add_link_SPBA'); 
     23} 
    1824function add_link_SPBA($menu_ref_arr) 
    1925 { 
     
    5662 
    5763 
     64 
     65if ($showSPBU == 2 OR $showSPBU == 3 OR $showSPBU == 4) 
     66{ 
     67add_event_handler('blockmanager_register_blocks', 'register_users_menubar_blocks'); 
     68add_event_handler('blockmanager_apply', 'users_apply'); 
     69} 
     70function register_users_menubar_blocks( $menu_ref_arr ) 
     71{ 
     72  $menu = & $menu_ref_arr[0]; 
     73  if ($menu->get_id() != 'menubar') 
     74    return; 
     75  $menu->register_block( new RegisteredBlock( 'mbUsers','Users',('See photos by user'))); 
     76} 
     77 
     78function users_apply($menu_ref_arr) 
     79{ 
     80global $template, $conf, $user; 
     81$menu = & $menu_ref_arr[0]; 
     82load_language('plugin.lang', SPBA_PATH); 
     83load_language('lang', PHPWG_ROOT_PATH.'local/', array('no_fallback'=>true, 'local'=>true)); 
     84 
     85$userslistemenu1 = pwg_query(' 
     86SELECT UT.id, UT.username, COUNT(DISTINCT(IT.id)) AS PBU, IT.id 
     87 FROM ' . USERS_TABLE . ' as UT 
     88 INNER JOIN '.IMAGES_TABLE.' AS IT ON IT.added_by = UT.id 
     89 INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON IT.id = ic.image_id 
     90  '.get_sql_condition_FandF 
     91  ( 
     92    array 
     93      ( 
     94        'forbidden_categories' => 'category_id', 
     95        'visible_categories' => 'category_id', 
     96        'visible_images' => 'id' 
     97      ), 
     98    'WHERE' 
     99  ).' 
     100 GROUP BY IT.added_by 
     101 HAVING PBU >'.$conf['see_photos_by_user_nbphotos'].' 
     102 ORDER BY '.$conf['see_photos_by_user_order'].' 
     103 LIMIT '.$conf['see_photos_by_user_limit'].';'); 
     104 
     105if (pwg_db_num_rows($userslistemenu1)) {         
     106 while ($userslistemenu = pwg_db_fetch_assoc($userslistemenu1)) 
     107        { 
     108    $items = array( 
     109      'USERSSPBYL' => $userslistemenu['username'], 
     110          'USERSSPBYLC' => $userslistemenu['PBU'], 
     111                ); 
     112                 
     113        $template->append('userslistemenu1', $items); 
     114        } 
     115} 
     116$linkusersliste = get_root_url().'index.php?/user-'; 
     117$template->assign('USERSSPBY', $linkusersliste); 
     118    
     119 if (($block = $menu->get_block( 'mbUsers' )) != null) { 
     120 $template->set_template_dir(SPBA_PATH); 
     121 $block->template = 'menubar_users.tpl';} 
     122} 
     123 
    58124add_event_handler('get_admin_plugin_menu_links', 'SPBA_admin_menu'); 
    59125function SPBA_admin_menu($menu) 
  • extensions/see_photos_by_user/maintain.inc.php

    r27391 r27428  
    55function plugin_activate() 
    66{ 
    7  if (!isset($conf['see_photos_by_user_nbphotos'])) 
     7if (!isset($conf['see_photos_by_user_nbphotos'])) 
    88 { 
    99 conf_update_param('see_photos_by_user_nbphotos', '0'); 
    1010 } 
    11   if (!isset($conf['see_photos_by_user_limit'])) 
     11if (!isset($conf['see_photos_by_user_limit'])) 
    1212 { 
    1313 conf_update_param('see_photos_by_user_limit', '1000'); 
    1414 } 
    15    if (!isset($conf['see_photos_by_user_order'])) 
     15if (!isset($conf['see_photos_by_user_order'])) 
    1616 { 
    1717 conf_update_param('see_photos_by_user_order', 'username ASC'); 
     18 } 
     19if (!isset($conf['see_photos_by_user_order'])) 
     20 { 
     21 conf_update_param('see_photos_by_user_show', '1'); 
    1822 } 
    1923} 
  • extensions/see_photos_by_user/pagespba.php

    r27396 r27428  
    5757$page['section'] = $me; 
    5858} 
     59$showSPBU = $conf['see_photos_by_user_show']; 
     60 
     61if ($showSPBU == 1 OR $showSPBU == 2 OR $showSPBU == 3) 
     62{ 
    5963//read auteur list 
    6064$groups = array(); 
     
    112116$template->assign('SPBA2', 'toto'); 
    113117$template->set_filename('SPBA', realpath(SPBA_PATH.'pagespba.tpl')); 
    114 $template->assign_var_from_handle('CONTENT', 'SPBA'); 
     118$template->assign_var_from_handle('CONTENT', 'SPBA');} 
    115119?> 
Note: See TracChangeset for help on using the changeset viewer.