Changeset 1059 for trunk/picture.php
- Timestamp:
- Feb 28, 2006, 5:28:06 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/picture.php
r1057 r1059 174 174 array_push( $already_there, $row['element_id'] ); 175 175 } 176 176 177 177 if ( count($already_there)>0 ) 178 178 { … … 184 184 pwg_query($query); 185 185 } 186 186 187 187 $query = ' 188 188 UPDATE '. RATE_TABLE . ' … … 192 192 pwg_query($query); 193 193 194 setcookie('pwg_anonymous_rater', $anonymous_id, 194 setcookie('pwg_anonymous_rater', $anonymous_id, 195 195 strtotime('+10 years'), cookie_path() ); 196 196 } … … 198 198 else 199 199 { 200 setcookie('pwg_anonymous_rater', $anonymous_id, 200 setcookie('pwg_anonymous_rater', $anonymous_id, 201 201 strtotime('+10 years'), cookie_path() ); 202 202 } … … 293 293 $i = 'current'; 294 294 } 295 295 296 296 foreach (array_keys($row) as $key) 297 297 { … … 307 307 $picture[$i]['is_picture'] = true; 308 308 } 309 309 310 310 $cat_directory = dirname($row['path']); 311 311 $file_wo_ext = get_filename_wo_extension($row['file']); … … 347 347 348 348 $picture[$i]['thumbnail'] = get_thumbnail_src($row['path'], @$row['tn_ext']); 349 349 350 350 if ( !empty( $row['name'] ) ) 351 351 { … … 377 377 if ($url_up_start>0) 378 378 { 379 $url_up .= '&start='.$url_up_start; 379 $url_up .= '&start='.$url_up_start; 380 380 } 381 381 … … 408 408 $query.= ';'; 409 409 $result = pwg_query( $query ); 410 410 411 411 if ( $_GET['add_fav'] == 1 ) 412 412 { … … 461 461 } 462 462 } 463 463 464 464 if ( $register_comment ) 465 465 { … … 480 480 $data{'image_id'} = $_GET['image_id']; 481 481 $data{'content'} = htmlspecialchars( $_POST['content'], ENT_QUOTES); 482 482 483 483 if (!$conf['comments_validation'] or $user['status'] == 'admin') 484 484 { … … 490 490 $data{'validated'} = 'false'; 491 491 } 492 492 493 493 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 494 494 $fields = array('author', 'date', 'image_id', 'content', 'validated', 495 495 'validation_date'); 496 496 mass_inserts(COMMENTS_TABLE, $fields, array($data)); 497 497 498 498 // information message 499 499 $message = $lang['comment_added']; 500 500 501 501 if (!$conf['comments_validation'] or $user['status'] == 'admin') 502 502 503 503 if ( $conf['comments_validation'] and $user['status'] != 'admin' ) 504 504 { … … 541 541 542 542 $title_img = $picture['current']['name']; 543 if ( isset( $page['cat'] ) ) 544 { 545 if (is_numeric( $page['cat'] )) 543 if ( isset( $page['cat'] ) ) 544 { 545 if (is_numeric( $page['cat'] )) 546 546 { 547 547 $title_img = replace_space(get_cat_display_name($page['cat_name'])); … … 648 648 'L_UP_HINT' => $lang['home_hint'], 649 649 'L_UP_ALT' => $lang['home'], 650 650 651 651 'U_HOME' => (PHPWG_ROOT_PATH.'category.php'), 652 652 'U_UP' => $url_up, … … 687 687 } 688 688 // button to set the current picture as representative 689 if ('admin' == $user['status'] and 689 if ('admin' == $user['status'] and 690 690 isset($page['cat']) and is_numeric($page['cat'])) 691 691 { … … 741 741 $url.= get_query_string_diff(array('add_fav')); 742 742 $url.= '&add_fav=0'; 743 743 744 744 $template->assign_block_vars( 745 745 'favorite', … … 805 805 // date of availability 806 806 $val = format_date($picture['current']['date_available'], 'mysql_datetime'); 807 $infos['INFO_ AVAILABILITY_DATE'] = '<a href="'.807 $infos['INFO_POSTED_DATE'] = '<a href="'. 808 808 PHPWG_ROOT_PATH.'category.php?calendar=posted-c-'. 809 809 substr($picture['current']['date_available'],0,10).'">'.$val.'</a>'; … … 894 894 die('Exif extension not available, admin should disable exif display'); 895 895 } 896 896 897 897 if ($exif = @read_exif_data($picture['current']['src'])) 898 898 { … … 913 913 $key = $lang['exif_field_'.$field]; 914 914 } 915 915 916 916 $template->assign_block_vars( 917 917 'metadata.line', … … 933 933 $key = $lang['exif_field_'.$tokens[1]]; 934 934 } 935 935 936 936 $template->assign_block_vars( 937 937 'metadata.line', … … 958 958 ); 959 959 } 960 960 961 961 foreach ($iptc as $field => $value) 962 962 { … … 966 966 $key = $lang[$field]; 967 967 } 968 968 969 969 $template->assign_block_vars( 970 970 'metadata.line', … … 981 981 { 982 982 if ( !is_numeric( $_GET['slideshow'] ) ) $_GET['slideshow'] = $conf['slideshow_period']; 983 983 984 984 $template->assign_block_vars('stop_slideshow', array( 985 985 'U_SLIDESHOW'=>$picture['current']['url'] … … 1020 1020 WHERE element_id = '.$_GET['image_id'] . ' 1021 1021 AND user_id = '.$user['id'] ; 1022 1022 1023 1023 if ($user['is_the_guest']) 1024 1024 { … … 1031 1031 $query .= ' AND anonymous_id = \''.$anonymous_id . '\''; 1032 1032 } 1033 1033 1034 1034 $result = pwg_query($query); 1035 1035 if (mysql_num_rows($result) > 0) … … 1045 1045 } 1046 1046 } 1047 else 1047 else 1048 1048 { 1049 1049 $sentence = $lang['never_rated'].'. '.$lang['Rate']; … … 1111 1111 $query.= ';'; 1112 1112 $row = mysql_fetch_array( pwg_query( $query ) ); 1113 1113 1114 1114 // navigation bar creation 1115 1115 $url = PHPWG_ROOT_PATH.'picture.php'; … … 1162 1162 } 1163 1163 } 1164 1164 1165 1165 if (!$user['is_the_guest'] 1166 1166 or ($user['is_the_guest'] and $conf['comments_forall']))
Note: See TracChangeset
for help on using the changeset viewer.