Changeset 26643
- Timestamp:
- Jan 12, 2014, 12:55:14 AM (11 years ago)
- 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 3 3 $lang['select user'] = 'select user'; 4 4 $lang['sumit']= 'sumit'; 5 6 5 ?> -
extensions/see_photos_by_user/main.inc.php
r26636 r26643 11 11 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 12 12 13 14 13 define('SPBA_DIR' , basename(dirname(__FILE__))); 15 14 define('SPBA_PATH' , PHPWG_PLUGINS_PATH . SPBA_DIR . '/'); 16 15 17 18 16 function add_link_SPBA($menu_ref_arr) 19 {17 { 20 18 global $conf, $user; 21 22 19 $menu = & $menu_ref_arr[0]; 23 24 20 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 } 40 37 41 38 function section_init_SPBA() … … 43 40 global $tokens; 44 41 if (in_array('See_photos_by_user', $tokens)) 45 42 include(SPBA_PATH . 'pagespba.php'); 46 43 } 47 44 -
extensions/see_photos_by_user/pagespba.php
r26635 r26643 5 5 global $page, $conf, $user, $template; 6 6 $page['section'] = 'See_photos_by_author'; 7 8 7 9 8 //read auteur list … … 17 16 18 17 while ($row = pwg_db_fetch_assoc($result)) 19 18 { 20 19 $groups[$row['id']] = $row['username']; 21 } 22 23 $selected = 0; 20 } 21 $selected = 0; 24 22 $options[] = l10n('select user'); 25 23 $options['a'] = '----------------------'; … … 27 25 foreach ($groups as $metalist => $metalist2) 28 26 { 29 27 $options[$metalist] = $metalist2; 30 28 } 31 29 $template->assign( … … 37 35 38 36 if (isset($_POST['submitchoixauteur'])) 39 40 41 42 37 { 38 $forbidden = get_sql_condition_FandF( 39 array( 'visible_images' => 'id' ), 40 'AND' 43 41 ); 44 42 45 $page['section'] = 'See_photos_by_author';43 $page['section'] = 'See_photos_by_author'; 46 44 47 45 $query = ' 48 SELECT DISTINCT(id)46 SELECT DISTINCT(id) 49 47 FROM '.IMAGES_TABLE.' 50 48 INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id … … 52 50 '.$forbidden.' 53 51 '.$conf['order_by'].' 54 ;';52 ;'; 55 53 56 57 58 59 60 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 ); 63 61 64 62 //read auteur list 65 63 $groups = array(); 66 64 $query = ' 67 select id,username65 select id,username 68 66 FROM ' . USERS_TABLE . ' 69 67 WHERE id<>2 … … 75 73 $groups[$row['id']] = $row['username']; 76 74 } 77 78 $selected = $_POST['metalist']; 75 $selected = $_POST['metalist']; 79 76 80 77 foreach ($groups as $metalist => $metalist2) … … 85 82 'gestionA', 86 83 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'); 98 89 $template->set_filename('SPBA', realpath(SPBA_PATH.'pagespba.tpl')); 99 90 $template->assign_var_from_handle('CONTENT', 'SPBA'); 100 91 101 102 103 92 ?> -
extensions/see_photos_by_user/pagespba.tpl
r26635 r26643 1 1 {if isset ($gestionA)} 2 3 4 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> 5 5 {/if}
Note: See TracChangeset
for help on using the changeset viewer.