- Timestamp:
- Feb 1, 2006, 3:46:26 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/remote_site.php
r1004 r1020 410 410 'name', 411 411 'comment', 412 'has_high', 412 413 'path'); 413 414 foreach ($optional_atts as $att) … … 426 427 $dbfields = array('file','storage_category_id','date_available','tn_ext', 427 428 'filesize','width','height','date_creation','author', 428 'keywords','name','comment',' path');429 'keywords','name','comment','has_high','path'); 429 430 mass_inserts(IMAGES_TABLE, $dbfields, $inserts); 430 431 $counts{'new_elements'}+= count($inserts); -
trunk/category.php
r1015 r1020 407 407 ); 408 408 } 409 if ($page['cat_nb_images']>0 and 410 $page['cat'] != 'most_visited' and $page['cat'] != 'best_rated') 411 { 412 // image order 413 $template->assign_block_vars( 'preferred_image_order', array() ); 414 415 if ( isset($_GET['image_order']) ) 416 { 417 $order_idx = $_GET['image_order']; 418 } 419 else 420 { 421 $order_idx = isset($_COOKIE['pwg_image_order']) ? 422 $_COOKIE['pwg_image_order'] : 0; 423 } 424 425 $orders = get_category_preferred_image_orders(); 426 for ( $i = 0; $i < count($orders); $i++) 427 { 428 if ($orders[$i][2]) 429 { 430 $url = PHPWG_ROOT_PATH.'category.php' 431 .get_query_string_diff(array('image_order')); 432 $url .= '&image_order='.$i; 433 $template->assign_block_vars( 'preferred_image_order.order', array( 434 'DISPLAY' => $orders[$i][0], 435 'URL' => $url, 436 'SELECTED_OPTION' => ($order_idx==$i ? 'SELECTED' : '' ), 437 ) ); 438 } 439 } 440 } 409 441 } 410 442 //------------------------------------------------------------ log informations -
trunk/include/functions.inc.php
r1015 r1020 534 534 } 535 535 536 function url_is_remote($url) 537 { 538 if (preg_match('/^https?:\/\/[~\/\.\w-]+$/', $url)) 539 { 540 return true; 541 } 542 return false; 543 } 544 536 545 /** 537 546 * returns available templates/themes -
trunk/include/functions_category.inc.php
r1008 r1020 319 319 } 320 320 321 // returns an array of image orders available for users/visitors 322 function get_category_preferred_image_orders() 323 { 324 global $lang, $conf; 325 return array( 326 array('Default', '', true), 327 array($lang['best_rated_cat'], 'average_rate DESC', $conf['rate']), 328 array($lang['most_visited_cat'], 'hit DESC', true), 329 array($lang['Creation date'], 'date_creation DESC', true), 330 array($lang['Availability date'], 'date_available DESC', true) 331 ); 332 } 333 334 321 335 // initialize_category initializes ;-) the variables in relation 322 336 // with category : … … 604 618 $user['nb_image_page'], 'back' ); 605 619 } 620 621 if ($page['cat'] != 'most_visited' and $page['cat'] != 'best_rated') 622 { 623 $available_image_orders = get_category_preferred_image_orders(); 624 625 $order_idx=0; 626 if ( isset($_GET['image_order']) ) 627 { 628 $order_idx = $_GET['image_order']; 629 setcookie( 'pwg_image_order', $order_idx, 0 ); 630 } 631 else if ( isset($_COOKIE['pwg_image_order']) ) 632 { 633 $order_idx = $_COOKIE['pwg_image_order']; 634 } 635 636 if ( $order_idx > 0 ) 637 { 638 $order = $available_image_orders[$order_idx][1]; 639 $conf['order_by'] = str_replace('ORDER BY ', 'ORDER BY '.$order.',', 640 $conf['order_by'] ); 641 } 642 } 606 643 } 607 644 else -
trunk/install/phpwebgallery_structure.sql
r1008 r1020 1 -- MySQL dump 9.112 -- 3 -- Host: localhost Database: pwg -bsf1 -- MySQL dump 10.9 2 -- 3 -- Host: localhost Database: pwg_dev_bsf 4 4 -- ------------------------------------------------------ 5 -- Server version 4. 0.24_Debian-10-log5 -- Server version 4.1.15-nt 6 6 7 7 -- … … 156 156 `date_metadata_update` date default NULL, 157 157 `average_rate` float(5,2) unsigned default NULL, 158 `has_high` enum('true') default NULL, 158 159 `path` varchar(255) NOT NULL default '', 159 160 PRIMARY KEY (`id`), -
trunk/language/en_UK.iso-8859-1/common.lang.php
r1015 r1020 44 44 $lang['At least one listed rule must be satisfied.'] = 'At least one listed rule must be satisfied.'; 45 45 $lang['Author'] = 'Author'; 46 $lang['Availability date'] = 'Availability date'; 46 47 $lang['Average rate'] = 'Average rate'; 47 48 $lang['Categories'] = 'Categories'; … … 54 55 $lang['Create a new account'] = 'Create a new account'; 55 56 $lang['Created on'] = 'Created on'; 57 $lang['Creation date'] = 'Creation date'; 56 58 $lang['Current password is wrong'] = 'Current password is wrong'; 57 59 $lang['Dimensions'] = 'Dimensions'; … … 122 124 $lang['became available between %s (%s) and %s (%s)'] = 'became available between %s (%s) and %s (%s)'; 123 125 $lang['became available on %s'] = 'became available on %s'; 124 $lang['best_rated_cat'] = ' best rated';126 $lang['best_rated_cat'] = 'Best rated'; 125 127 $lang['best_rated_cat_hint'] = 'displays best rated items'; 126 128 $lang['caddie'] = 'caddie'; -
trunk/language/fr_FR.iso-8859-1/common.lang.php
r1015 r1020 43 43 $lang['At least one listed rule must be satisfied.'] = 'Au moins un des critères doit être satisfait.'; 44 44 $lang['Author'] = 'Auteur'; 45 $lang['Availability date'] = 'Date de disponibilité'; 45 46 $lang['Average rate'] = 'Note moyenne'; 46 47 $lang['Categories'] = 'Catégories'; … … 53 54 $lang['Create a new account'] = 'Créer un nouveau compte'; 54 55 $lang['Created on'] = 'Créée le'; 56 $lang['Creation date'] = 'Date de création'; 55 57 $lang['Current password is wrong'] = 'Erreur sur le mot de passe actuel'; 56 58 $lang['Dimensions'] = 'Dimensions'; -
trunk/picture.php
r1014 r1020 248 248 // if we are working on the "current" element, we search if there is a 249 249 // high quality picture 250 // FIXME : with remote pictures, this "remote fopen" takes long...251 250 if ($i == 'current') 252 251 { 253 if (@fopen($cat_directory.'/pwg_high/'.$row['file'], 'r')) 252 $url_high=$cat_directory.'/pwg_high/'.$row['file']; 253 if (url_is_remote($cat_directory)) 254 254 { 255 $picture[$i]['high'] = $cat_directory.'/pwg_high/'.$row['file']; 255 if ($row['has_high']) 256 { 257 $picture[$i]['high'] = $url_high; 258 } 259 } 260 else 261 { 262 if (@fopen($url_high, 'r')) 263 { 264 $picture[$i]['high'] = $url_high; 265 } 256 266 } 257 267 } … … 527 537 528 538 $page['body_id'] = 'thePicturePage'; 539 //-------------------------------------------------------- navigation management 540 if ($has_prev) 541 { 542 $template->assign_block_vars( 543 'previous', 544 array( 545 'TITLE_IMG' => $picture['prev']['name'], 546 'IMG' => $picture['prev']['thumbnail'], 547 'U_IMG' => $picture['prev']['url'], 548 'U_IMG_SRC' => $picture['prev']['src'] 549 )); 550 } 551 552 if ($has_next) 553 { 554 $template->assign_block_vars( 555 'next', 556 array( 557 'TITLE_IMG' => $picture['next']['name'], 558 'IMG' => $picture['next']['thumbnail'], 559 'U_IMG' => $picture['next']['url'], 560 'U_IMG_SRC' => $picture['next']['src'] // allow navigator to preload 561 )); 562 } 563 529 564 include(PHPWG_ROOT_PATH.'include/page_header.php'); 530 565 $template->set_filenames(array('picture'=>'picture.tpl')); … … 586 621 if (isset($picture['current']['high'])) 587 622 { 588 $full_size = @getimagesize($picture['current']['high']);589 $full_width = $full_size[0];590 $full_height = $full_size[1];591 623 $uuid = uniqid(rand()); 592 624 $template->assign_block_vars('high', array( 593 625 'U_HIGH' => $picture['current']['high'], 594 'UUID'=>$uuid, 595 'WIDTH_IMG'=>($full_width + 40), 596 'HEIGHT_IMG'=>($full_height + 40) 626 'UUID'=>$uuid 597 627 )); 598 628 $template->assign_block_vars( … … 672 702 { 673 703 $template->assign_block_vars('admin', array()); 674 }675 676 //-------------------------------------------------------- navigation management677 if ($has_prev)678 {679 $template->assign_block_vars(680 'previous',681 array(682 'TITLE_IMG' => $picture['prev']['name'],683 'IMG' => $picture['prev']['thumbnail'],684 'U_IMG' => $picture['prev']['url'],685 'U_IMG_SRC' => $picture['prev']['src']686 ));687 }688 689 if ($has_next)690 {691 $template->assign_block_vars(692 'next',693 array(694 'TITLE_IMG' => $picture['next']['name'],695 'IMG' => $picture['next']['thumbnail'],696 'U_IMG' => $picture['next']['url'],697 'U_IMG_SRC' => $picture['next']['src'] // allow navigator to preload698 ));699 704 } 700 705 -
trunk/profile.php
r1004 r1020 212 212 $selected = $_POST['template']==$pwg_template ? 'selected="selected"' : ''; 213 213 } 214 else if ($userdata['template'] == $pwg_template)214 else if ($userdata['template'].'/'.$userdata['theme'] == $pwg_template) 215 215 { 216 216 $selected = 'selected="selected"'; -
trunk/template/yoga/category.tpl
r1015 r1020 121 121 <!-- END search_rules --> 122 122 123 <!-- BEGIN preferred_image_order --> 124 <li> 125 {lang:Sort order}: 126 <select onchange="document.location = this.options[this.selectedIndex].value;"> 127 <!-- BEGIN order --> 128 <option value="{preferred_image_order.order.URL}" {preferred_image_order.order.SELECTED_OPTION}>{preferred_image_order.order.DISPLAY}</option> 129 <!-- END order --> 130 </select> 131 </li> 132 <!-- END preferred_image_order --> 123 133 </ul> 124 134 -
trunk/template/yoga/content.css
r981 r1020 120 120 #content UL.categoryActions LI { 121 121 display: inline; 122 122 123 } 123 124 124 125 #content UL.categoryActions A IMG, UL.categoryActions A { 125 126 border: none; 127 margin-bottom: -5px; 126 128 } 127 129 -
trunk/template/yoga/header.tpl
r983 r1020 12 12 <link rel="stylesheet" type="text/css" href="template/{themeconf:template}/default-colors.css"> 13 13 <link rel="stylesheet" type="text/css" href="template/{themeconf:template}/theme/{themeconf:theme}/theme.css"> 14 <!-- BEGIN next --> 15 <link rel="prefetch" href="{next.U_IMG_SRC}"> 16 <!-- END next --> 14 17 <!-- BEGIN refresh --> 15 18 <meta http-equiv="refresh" content="{REFRESH_TIME};url={U_REFRESH}"> -
trunk/template/yoga/picture.tpl
r1014 r1020 40 40 <!-- BEGIN next --> 41 41 <a class="navButton next" href="{next.U_IMG}" title="{L_NEXT_IMG}{next.TITLE_IMG}" rel="next"><img src="{themeconf:icon_dir}/right.png" class="button" alt="next"></a> 42 <link rel="prefetch" href="{next.U_IMG_SRC}"><link rel="prefetch" href="{next.U_IMG}">43 42 <!-- END next --> 44 43 <a class="navButton up" href="{U_UP}" title="{L_UP_HINT}"><img src="{themeconf:icon_dir}/up.png" class="button" alt="{L_UP_ALT}"></a> … … 55 54 <div id="theImage"> 56 55 <!-- BEGIN high --> 57 <a href="javascript:phpWGOpenWindow('{high.U_HIGH}','{high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes ,width={high.WIDTH_IMG},height={high.HEIGHT_IMG}')">56 <a href="javascript:phpWGOpenWindow('{high.U_HIGH}','{high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')"> 58 57 <!-- END high --> 59 58 <img src="{SRC_IMG}" style="width:{WIDTH_IMG}px;height:{HEIGHT_IMG}px;" alt="{ALT_IMG}"> -
trunk/tools/create_listing_file.php
r954 r1020 281 281 282 282 /** 283 * returns an array with high quality/resolution picture files of a directory 284 * according to $conf['picture_ext'] 285 * 286 * @param string $dir 287 * @return array 288 */ 289 function get_high_files($dir) 290 { 291 global $conf; 292 293 $pictures = array(); 294 if ($opendir = @opendir($dir.'/pwg_high')) 295 { 296 while ($file = readdir($opendir)) 297 { 298 if (in_array(get_extension($file), $conf['picture_ext'])) 299 { 300 array_push($pictures, $file); 301 } 302 } 303 } 304 return $pictures; 305 } 306 307 /** 283 308 * search in $basedir the sub-directories and calls get_pictures 284 309 * … … 348 373 $fs_thumbnails = get_thumb_files($dir); 349 374 $fs_representatives = get_representative_files($dir); 375 $fs_highs = get_high_files($dir); 350 376 351 377 $elements = array(); … … 378 404 379 405 // 2 cases : the element is a picture or not. Indeed, for a picture 380 // thumbnail is mandatory and for non picture element, thumbnail and381 // representative is optionnal406 // thumbnail is mandatory, high is optional and for non picture element, 407 // thumbnail and representative is optionnal 382 408 if (in_array(get_extension($fs_file), $conf['picture_ext'])) 383 409 { … … 389 415 $element['width'] = $image_size[0]; 390 416 $element['height'] = $image_size[1]; 417 } 418 419 if ( in_array($fs_file, $fs_highs) ) 420 { 421 $element['has_high'] = 'true'; 391 422 } 392 423 … … 453 484 $attributes = array('file','tn_ext','representative_ext','filesize', 454 485 'width','height','date_creation','author','keywords', 455 'name','comment',' path');486 'name','comment','has_high', 'path'); 456 487 foreach ($elements as $element) 457 488 {
Note: See TracChangeset
for help on using the changeset viewer.