Changeset 27442
- Timestamp:
- Feb 20, 2014, 11:28:01 PM (10 years ago)
- Location:
- extensions/see_photos_by_user
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/see_photos_by_user/main.inc.php
r27429 r27442 47 47 function section_init_SPBA() 48 48 { 49 global $tokens ;49 global $tokens, $conf; 50 50 $testa = explode('user-', $_SERVER['REQUEST_URI']); 51 51 if (!empty ($testa[1])) 52 52 { 53 53 $testd= explode('/', $testa[1]); 54 $query = ' 55 SELECT UT.id, UT.username, COUNT(DISTINCT(IT.id)) AS PBU, IT.id 56 FROM ' . USERS_TABLE . ' as UT 57 INNER JOIN '.IMAGES_TABLE.' AS IT ON IT.added_by = UT.id 58 INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON IT.id = ic.image_id 59 '.get_sql_condition_FandF 60 ( 61 array 62 ( 63 'forbidden_categories' => 'category_id', 64 'visible_categories' => 'category_id', 65 'visible_images' => 'id' 66 ), 67 'WHERE' 68 ).' 69 GROUP BY IT.added_by 70 HAVING PBU >'.$conf['see_photos_by_user_nbphotos'].' 71 ORDER BY '.$conf['see_photos_by_user_order'].' 72 LIMIT '.$conf['see_photos_by_user_limit'].';'; 73 74 $result = pwg_query($query); 75 $userok = array(); 76 while ($row = pwg_db_fetch_assoc($result)) 77 { 78 $userok[] = $row['username']; 79 } 80 81 if (in_array($testd[0], $userok)) 82 { 54 83 $me = 'user-'.$testd[0]; 84 } 85 else 86 { 87 $redirect_url = get_root_url().'index.php?/categories'; 88 redirect($redirect_url); 89 } 55 90 } 56 91 else -
extensions/see_photos_by_user/maintain.inc.php
r27438 r27442 5 5 function plugin_activate() 6 6 { 7 8 global $conf; 9 7 10 if (!isset($conf['see_photos_by_user_nbphotos'])) 8 11 {
Note: See TracChangeset
for help on using the changeset viewer.