Changeset 2119
- Timestamp:
- Oct 4, 2007, 1:36:21 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/permalinks.php
r1975 r2119 31 31 { 32 32 global $template; 33 33 34 34 $url_components = parse_url( $_SERVER['REQUEST_URI'] ); 35 35 36 36 $base_url = $url_components['path']; 37 37 38 38 parse_str($url_components['query'], $vars); 39 39 $is_first = true; … … 52 52 { 53 53 $url = $base_url; 54 $disp = '⇓'; // TODO: an small image is better 55 54 56 if ( $field !== @$_GET[$get_param] ) 55 57 { … … 58 60 $url = add_url_params($url, array($get_param=>$field) ); 59 61 } 60 $disp = '⇓'; // TODO: an small image is better 62 elseif (isset($default_field) and !isset($_GET[$get_param]) ) 63 { 64 array_push($ret, $field); 65 $disp = '<em>'.$disp.'</em>'; 66 } 61 67 } 62 68 else 63 69 { 64 70 array_push($ret, $field); 65 $disp = '<em> ⇓</em>'; // TODO: an small image is better71 $disp = '<em>'.$disp.'</em>'; 66 72 } 67 73 if ( isset($template_var) ) … … 104 110 105 111 $query = ' 106 SELECT 107 id, 112 SELECT 113 id, 108 114 CONCAT(id, " - ", name, IF(permalink IS NULL, "", " √") ) AS name, 109 uppercats, global_rank 115 uppercats, global_rank 110 116 FROM '.CATEGORIES_TABLE; 111 117 … … 125 131 WHERE permalink IS NOT NULL 126 132 '; 127 if ( count($sort_by) and 128 ($sort_by[0]=='id' or $sort_by[0]=='permalink') 129 ) 133 if ( $sort_by[0]=='id' or $sort_by[0]=='permalink' ) 130 134 { 131 135 $query .= ' ORDER BY '.$sort_by[0]; … … 139 143 } 140 144 141 if ( !count($sort_by) or$sort_by[0]=='name')145 if ( $sort_by[0]=='name') 142 146 { 143 147 usort($categories, 'global_rank_compare'); -
trunk/include/ws_functions.inc.php
r2029 r2119 33 33 { 34 34 global $conf, $calling_partner_id; 35 35 36 36 if ( strpos($methodName,'reflection.')===0 ) 37 37 { // OK for reflection 38 38 return $res; 39 39 } 40 40 41 41 if ( !is_autorize_status(ACCESS_GUEST) and 42 42 strpos($methodName,'pwg.session.')!==0 ) … … 44 44 return new PwgError(401, 'Access denied'); 45 45 } 46 46 47 47 if ( !$conf['ws_access_control'] ) 48 48 { … … 317 317 ); 318 318 } 319 $where_clauses[] = 'id NOT IN ('.$user['forbidden_categories'].')'; 319 $where_clauses[] = get_sql_condition_FandF( 320 array('forbidden_categories' => 'id'), 321 NULL, true 322 ); 320 323 321 324 $query = ' … … 461 464 else 462 465 { 463 $where[] = 'id NOT IN ('.$user['forbidden_categories'].')';464 466 $where[]= 'user_id='.$user['id']; 465 467 } … … 473 475 WHERE '. implode(' 474 476 AND ', $where); 475 $query .= '476 ORDER BY global_rank';477 477 478 478 $result = pwg_query($query); … … 513 513 $params['image_id'] = (int)$params['image_id']; 514 514 $query = ' 515 SELECT DISTINCT image_id 515 SELECT DISTINCT image_id 516 516 FROM '.IMAGE_CATEGORY_TABLE.' INNER JOIN '.CATEGORIES_TABLE.' ON category_id=id 517 WHERE commentable="true" 517 WHERE commentable="true" 518 518 AND image_id='.$params['image_id']. 519 519 get_sql_condition_FandF( … … 529 529 return new PwgError(WS_ERR_INVALID_PARAM, "Invalid image_id"); 530 530 } 531 531 532 532 include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php'); 533 533 534 534 $comm = array( 535 535 'author' => trim( stripslashes($params['author']) ), … … 539 539 540 540 include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php'); 541 542 $comment_action = insert_user_comment( 541 542 $comment_action = insert_user_comment( 543 543 $comm, $params['key'], $infos 544 544 ); … … 551 551 case 'validate': 552 552 case 'moderate': 553 $ret = array( 553 $ret = array( 554 554 'id' => $comm['id'], 555 555 'validation' => $comment_action=='validate', … … 557 557 return new PwgNamedStruct( 558 558 'comment', 559 $ret, 560 null, array() 559 $ret, 560 null, array() 561 561 ); 562 562 default: … … 600 600 FROM '.IMAGE_CATEGORY_TABLE.' 601 601 INNER JOIN '.CATEGORIES_TABLE.' ON category_id = id 602 WHERE image_id = '.$image_row['id'].' 603 AND category_id NOT IN ('.$user['forbidden_categories'].') 602 WHERE image_id = '.$image_row['id']. 603 get_sql_condition_FandF( 604 array( 'forbidden_categories' => 'category_id' ), 605 ' AND' 606 ).' 604 607 ;'; 605 608 $result = pwg_query($query); … … 668 671 //---------------------------------------------------------- related comments 669 672 $related_comments = array(); 670 673 671 674 $where_comments = 'image_id = '.$image_row['id']; 672 675 if ( !is_admin() ) … … 700 703 } 701 704 } 702 705 703 706 $comment_post_data = null; 704 if ($is_commentable and 707 if ($is_commentable and 705 708 (!is_a_guest() 706 709 or (is_a_guest() and $conf['comments_forall'] ) … … 709 712 { 710 713 include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php'); 711 $comment_post_data['author'] = $user['username']; 714 $comment_post_data['author'] = $user['username']; 712 715 $comment_post_data['key'] = get_comment_post_key($params['image_id']); 713 716 } … … 734 737 } 735 738 $ret['comments'] = array( 736 WS_XML_ATTRIBUTES => 739 WS_XML_ATTRIBUTES => 737 740 array( 738 741 'page' => $params['comments_page'], … … 806 809 $image_ids = $search_result['items']; 807 810 } 808 811 809 812 $image_ids = array_slice($image_ids, 810 813 $params['page']*$params['per_page'], … … 952 955 @include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php'); 953 956 global $conf; 954 957 955 958 // first build all the tag_ids we are interested in 956 959 $params['tag_id'] = array_map( 'intval',$params['tag_id'] ); … … 1029 1032 while ($row = mysql_fetch_assoc($result)) 1030 1033 { 1034 $image = array(); 1031 1035 foreach ( array('id', 'width', 'height', 'hit') as $k ) 1032 1036 {
Note: See TracChangeset
for help on using the changeset viewer.