Changeset 774
- Timestamp:
- Apr 26, 2005, 4:24:08 PM (20 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/language/en_UK.iso-8859-1/common.lang.php
r759 r774 60 60 $lang['powered_by'] = 'Powered by'; 61 61 $lang['all_categories'] = 'all categories'; 62 $lang['unavailable'] = 'N/A'; 62 63 63 64 //Properties -
trunk/language/fr_FR.iso-8859-1/common.lang.php
r748 r774 60 60 $lang['powered_by'] = 'Propulsé par'; 61 61 $lang['all_categories'] = 'toutes catégories'; 62 $lang['unavailable'] = 'N/A'; 62 63 63 64 // Properties -
trunk/picture.php
r745 r774 460 460 $url_metadata.= '&show_metadata=1'; 461 461 } 462 462 463 // author 464 $author = $creation_date = $size = $filesize = $lang['unavailable']; 465 if ( !empty($picture['current']['author']) ) 466 { 467 $search_url = PHPWG_ROOT_PATH.'category.php?cat=search'; 468 $search_url.= '&search=author:'.$picture['current']['author']; 469 470 $author = '<a href="'; 471 $author .= add_session_id($search_url); 472 $author .= '">'.$picture['current']['author'].'</a>'; 473 } 474 475 // creation date 476 if ( !empty($picture['current']['date_creation']) ) 477 { 478 $creation_date = format_date($picture['current']['date_creation']); 479 } 480 481 // date of availability 482 $availability_date = format_date($picture['current']['date_available']); 483 484 // size in pixels 485 if ($picture['current']['is_picture']) 486 { 487 if ($original_width != $picture_size[0] 488 or $original_height != $picture_size[1]) 489 { 490 $size = '[ <a href="'.$picture['current']['src'].'" '; 491 $size .= ' title="'.$lang['true_size'].'">'; 492 $size .= $original_width.'*'.$original_height.'</a> ]'; 493 } 494 else 495 { 496 $size = $original_width.'*'.$original_height; 497 } 498 } 499 500 // filesize 501 if (empty($picture['current']['filesize'])) 502 { 503 if (!$picture['current']['is_picture']) 504 { 505 $filesize = floor(filesize($picture['current']['download'])/1024); 506 } 507 else 508 { 509 $filesize = floor(filesize($picture['current']['src'])/1024); 510 } 511 } 512 else 513 { 514 $filesize = $picture['current']['filesize']; 515 } 516 517 // number of visits 518 $template->assign_block_vars( 519 'info_line', 520 array( 521 'INFO'=>$lang['visited'], 522 'VALUE'=>$picture['current']['hit'].' '.$lang['times'] 523 )); 524 463 525 include(PHPWG_ROOT_PATH.'include/page_header.php'); 464 526 $template->set_filenames(array('picture'=>'picture.tpl')); … … 472 534 'WIDTH_IMG' => $picture_size[0], 473 535 'HEIGHT_IMG' => $picture_size[1], 536 'AUTHOR' => $author, 537 'CREATION_DATE' => $creation_date, 538 'AVAILABILITY_DATE' => $availability_date, 539 'SIZE' => $size, 540 'FILE_SIZE' => $filesize, 474 541 475 542 'LEVEL_SEPARATOR' => $conf['level_separator'], … … 494 561 'L_UP_HINT' => $lang['home_hint'], 495 562 'L_UP_ALT' => $lang['home'], 563 'L_CREATION_DATE' => $lang['creation_date'], 564 'L_AVAILABILITY_DATE' => $lang['registration_date'], 565 'L_SIZE' => $lang['size'], 566 'L_FILE' => $lang['file'], 567 'L_FILE_SIZE' => $lang['size'], 496 568 497 569 'U_HOME' => add_session_id(PHPWG_ROOT_PATH.'category.php'), … … 612 684 } 613 685 614 // author615 if ( !empty($picture['current']['author']) )616 {617 $search_url = PHPWG_ROOT_PATH.'category.php?cat=search';618 $search_url.= '&search=author:'.$picture['current']['author'];619 620 $value = '<a href="';621 $value.= add_session_id($search_url);622 $value.= '">'.$picture['current']['author'].'</a>';623 624 $template->assign_block_vars(625 'info_line',626 array(627 'INFO'=>$lang['author'],628 'VALUE'=>$value629 ));630 }631 // creation date632 if ( !empty($picture['current']['date_creation']) )633 {634 $search_url = PHPWG_ROOT_PATH.'category.php?cat=search';635 $search_url.= '&search=';636 $search_url.= 'date_creation:'.$picture['current']['date_creation'];637 638 $value = '<a href="';639 $value.= add_session_id($search_url);640 $value.= '">'.format_date($picture['current']['date_creation']).'</a>';641 642 $template->assign_block_vars(643 'info_line',644 array(645 'INFO'=>$lang['creation_date'],646 'VALUE'=>$value647 ));648 }649 // date of availability650 $search_url = PHPWG_ROOT_PATH.'category.php?cat=search';651 $search_url.= '&search=';652 $search_url.= 'date_available:'.$picture['current']['date_available'];653 654 $value = '<a href="';655 $value.= add_session_id($search_url);656 $value.= '">'.format_date($picture['current']['date_available']).'</a>';657 658 $template->assign_block_vars(659 'info_line',660 array(661 'INFO'=>$lang['registration_date'],662 'VALUE'=>$value663 ));664 // size in pixels665 if ($picture['current']['is_picture'])666 {667 if ($original_width != $picture_size[0]668 or $original_height != $picture_size[1])669 {670 $content = '[ <a href="'.$picture['current']['src'].'" ';671 $content.= ' title="'.$lang['true_size'].'">';672 $content.= $original_width.'*'.$original_height.'</a> ]';673 }674 else675 {676 $content = $original_width.'*'.$original_height;677 }678 $template->assign_block_vars(679 'info_line',680 array(681 'INFO'=>$lang['size'],682 'VALUE'=>$content683 ));684 }685 // file686 $template->assign_block_vars('info_line', array(687 'INFO'=>$lang['file'],688 'VALUE'=>$picture['current']['file']689 ));690 // filesize691 if (empty($picture['current']['filesize']))692 {693 if (!$picture['current']['is_picture'])694 {695 $filesize = floor(filesize($picture['current']['download'])/1024);696 }697 else698 {699 $filesize = floor(filesize($picture['current']['src'])/1024);700 }701 }702 else703 {704 $filesize = $picture['current']['filesize'];705 }706 707 $template->assign_block_vars('info_line', array(708 'INFO'=>$lang['filesize'],709 'VALUE'=>$filesize.' KB'710 ));711 686 // keywords 712 687 if (!empty($picture['current']['keywords'])) … … 725 700 } 726 701 $template->assign_block_vars( 727 ' info_line',702 'keywords', 728 703 array( 729 704 'INFO'=>$lang['keywords'], … … 731 706 )); 732 707 } 733 // number of visits 734 $template->assign_block_vars( 735 'info_line', 736 array( 737 'INFO'=>$lang['visited'], 738 'VALUE'=>$picture['current']['hit'].' '.$lang['times'] 739 )); 740 // rate results 741 if ($conf['rate']) 742 { 743 $query = ' 744 SELECT COUNT(rate) AS count 745 , ROUND(AVG(rate),2) AS average 746 , ROUND(STD(rate),2) AS STD 747 FROM '.RATE_TABLE.' 748 WHERE element_id = '.$picture['current']['id'].' 749 ;'; 750 $row = mysql_fetch_array(pwg_query($query)); 751 if ($row['count'] == 0) 752 { 753 $value = $lang['no_rate']; 754 } 755 else 756 { 757 $value = $row['average']; 758 $value.= ' ('; 759 $value.= $row['count'].' '.$lang['rates']; 760 $value.= ', '.$lang['standard_deviation'].' : '.$row['STD']; 761 $value.= ')'; 762 } 763 764 $template->assign_block_vars( 765 'info_line', 766 array( 767 'INFO' => $lang['element_rate'], 768 'VALUE' => $value 769 )); 770 } 708 771 709 // related categories 772 710 $cat_output = ''; … … 796 734 } 797 735 $template->assign_block_vars( 798 ' info_line',736 'associated', 799 737 array( 800 738 'INFO' => $lang['categories'], 801 739 'VALUE' => $cat_output 802 740 )); 803 // metadata 741 742 //------------------------------------------------------------------- metadata 804 743 if ($metadata_showable and isset($_GET['show_metadata'])) 805 744 { … … 905 844 } 906 845 907 //------------------------------------------------------------------- rate form 908 if ($conf['rate'] and !$user['is_the_guest']) 909 { 910 $query = ' 911 SELECT rate 846 //------------------------------------------------------------------- rating 847 if ($conf['rate']) 848 { 849 $query = 'SELECT COUNT(rate) AS count 850 , ROUND(AVG(rate),2) AS average 851 , ROUND(STD(rate),2) AS STD 912 852 FROM '.RATE_TABLE.' 913 WHERE user_id = '.$user['id'].' 914 AND element_id = '.$_GET['image_id'].' 853 WHERE element_id = '.$picture['current']['id'].' 915 854 ;'; 855 $row = mysql_fetch_array(pwg_query($query)); 856 if ($row['count'] == 0) 857 { 858 $value = $lang['no_rate']; 859 } 860 else 861 { 862 $value = $row['average']; 863 $value.= ' ('; 864 $value.= $row['count'].' '.$lang['rates']; 865 $value.= ', '.$lang['standard_deviation'].' : '.$row['STD']; 866 $value.= ')'; 867 } 868 869 if (!$user['is_the_guest']) 870 { 871 $query = 'SELECT rate 872 FROM '.RATE_TABLE.' 873 WHERE user_id = '.$user['id'].' 874 AND element_id = '.$_GET['image_id'].';'; 916 875 $result = pwg_query($query); 917 876 if (mysql_num_rows($result) > 0) … … 925 884 { 926 885 $sentence = $lang['never_rated'].'. '.$lang['to_rate']; 927 } 886 } 928 887 $template->assign_block_vars( 929 888 'rate', 930 array('SENTENCE' => $sentence) 931 ); 932 889 array( 890 'INFO' => $lang['element_rate'], 891 'VALUE' => $value, 892 'SENTENCE' => $sentence 893 )); 933 894 934 895 foreach ($rate_items as $num => $mark) … … 954 915 'SEPARATOR' => $separator 955 916 )); 956 } 957 } 917 } 918 } 919 } 920 958 921 //---------------------------------------------------- users's comments display 959 922 if ($page['show_comments']) -
trunk/template/default/picture.tpl
r712 r774 76 76 <div id="centre"> 77 77 <table style="margin:auto;margin-top:5px;margin-bottom:5px;"> 78 <!-- BEGIN info_line --> 79 <tr> 80 <td class="menu" style="font-weight:bold;">{info_line.INFO} : </td> 81 <td class="menu" style="text-align:right;">{info_line.VALUE}</td> 82 </tr> 83 <!-- END info_line --> 78 <tr> 79 <td class="menu" style="font-weight:bold;">{L_AUTHOR} : </td> 80 <td class="menu" style="text-align:right;">{AUTHOR}</td> 81 </tr> 82 <tr> 83 <td class="menu" style="font-weight:bold;">{L_CREATION_DATE} : </td> 84 <td class="menu" style="text-align:right;">{CREATION_DATE}</td> 85 </tr> 86 <tr> 87 <td class="menu" style="font-weight:bold;">{L_AVAILABILITY_DATE} : </td> 88 <td class="menu" style="text-align:right;">{AVAILABILITY_DATE}</td> 89 </tr> 90 <tr> 91 <td class="menu" style="font-weight:bold;">{L_SIZE} : </td> 92 <td class="menu" style="text-align:right;">{SIZE}</td> 93 </tr> 94 <tr> 95 <td class="menu" style="font-weight:bold;">{L_FILE} : </td> 96 <td class="menu" style="text-align:right;">{ALT_IMG}</td> 97 </tr> 98 <tr> 99 <td class="menu" style="font-weight:bold;">{L_FILE_SIZE} : </td> 100 <td class="menu" style="text-align:right;">{FILE_SIZE} Ko</td> 101 </tr> 102 <!-- BEGIN keywords --> 103 <tr> 104 <td class="menu" style="font-weight:bold;">{keywords.INFO} : </td> 105 <td class="menu" style="text-align:right;">{keywords.VALUE}</td> 106 </tr> 107 <!-- END keywords --> 108 <!-- BEGIN associated --> 109 <tr> 110 <td class="menu" style="font-weight:bold;">{associated.INFO} : </td> 111 <td class="menu" style="text-align:right;">{associated.VALUE}</td> 112 </tr> 113 <!-- END associated --> 114 <!-- BEGIN rate --> 115 <tr> 116 <td class="menu" style="font-weight:bold;">{rate.INFO} : </td> 117 <td class="menu" style="text-align:right;">{rate.VALUE}</td> 118 </tr> 119 <!-- END rate --> 84 120 </table> 85 121 </div> … … 95 131 </div> 96 132 <div style="clear:both;"></div> 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 133 <!-- BEGIN metadata --> 134 <table class="tablecompact"> 135 <!-- BEGIN headline --> 136 <tr> 137 <th colspan="2">{metadata.headline.TITLE}</th> 138 </tr> 139 <!-- END headline --> 140 <!-- BEGIN line --> 141 <tr> 142 <td>{metadata.line.KEY}</td> 143 <td>{metadata.line.VALUE}</td> 144 </tr> 145 <!-- END line --> 146 </table> 147 <!-- END metadata --> 112 148 113 <!-- BEGIN rate --> 114 <div> 115 {rate.SENTENCE} : 116 <!-- BEGIN rate_option --> 117 {rate.rate_option.SEPARATOR} <a href="{rate.rate_option.URL}">{rate.rate_option.OPTION}</a> 118 <!-- END rate_option --> 119 </div> 120 <!-- END rate --> 149 <!-- BEGIN rate --> 150 <div>{rate.SENTENCE} : 151 <!-- BEGIN rate_option --> 152 {rate.rate_option.SEPARATOR} <a href="{rate.rate_option.URL}">{rate.rate_option.OPTION}</a> 153 <!-- END rate_option --> 154 </div> 155 <!-- END rate --> 121 156 122 157 <table class="tablecompact"> 123 124 125 126 158 <!-- BEGIN comments --> 159 <tr align="center" valign="middle"> 160 <td colspan="3" class="table2"> 161 <div class="commentTitle"> 127 162 [{comments.NB_COMMENT}] {L_COMMENT_TITLE} 128 163 </div>
Note: See TracChangeset
for help on using the changeset viewer.