assign( 'gestionB', array( 'USERUSBU' => $testd[0], )); $query = ' SELECT DISTINCT(id) FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id '.get_sql_condition_FandF ( array ( 'forbidden_categories' => 'category_id', 'visible_categories' => 'category_id', 'visible_images' => 'id' ), 'WHERE' ).' AND added_by = \''.$row['id'].'\' '.$conf['order_by'].' ;'; $page = array_merge ( $page, array ( 'title' => ''.$me.'', 'items' => array_from_query($query, 'id'), ) ); } else { $me = 'user-'; $page['section'] = $me; } $showSPBU = $conf['see_photos_by_user_show']; if (in_array($showSPBU, array(1,2,3))) { //read auteur list $groups = array(); $query = ' SELECT UT.id, UT.username, COUNT(DISTINCT(IT.id)) AS PBU, IT.id FROM ' . USERS_TABLE . ' as UT INNER JOIN '.IMAGES_TABLE.' AS IT ON IT.added_by = UT.id INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON IT.id = ic.image_id '.get_sql_condition_FandF ( array ( 'forbidden_categories' => 'category_id', 'visible_categories' => 'category_id', 'visible_images' => 'id' ), 'WHERE' ).' GROUP BY IT.added_by HAVING PBU >'.$conf['see_photos_by_user_nbphotos'].' ORDER BY '.$conf['see_photos_by_user_order'].' LIMIT '.$conf['see_photos_by_user_limit'].';'; $result = pwg_query($query); while ($row = pwg_db_fetch_assoc($result)) { $groups[$row['username']] = $row['username'].' ('.$row['PBU'].')'; } $selected = 0; if (empty ($testd[1])) {$options[] = l10n('select user');} else {$options[] = l10n('select other user');} $options['a'] = '----------------------'; foreach ($groups as $metalist => $metalist2) { $options[$metalist] = $metalist2; } $template->assign( 'gestionA', array( 'OPTIONS' => $options, 'SELECTED' => $selected )); if (isset($_POST['submitchoixauteur'])) { $redirect_url = get_root_url().'index.php?/user-'.($_POST['metalist']); redirect($redirect_url); } $template->assign('SPBA2', 'toto'); $template->set_filename('SPBA', realpath(SPBA_PATH.'pagespba.tpl')); $template->assign_var_from_handle('CONTENT', 'SPBA');} ?>