Changeset 847
- Timestamp:
- Aug 21, 2005, 1:32:12 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/picture.php
r811 r847 96 96 FROM '.IMAGE_CATEGORY_TABLE.' 97 97 INNER JOIN '.CATEGORIES_TABLE.' ON category_id = id 98 WHERE image_id = '.$_GET['image_id']; 99 if ($user['forbidden_categories'] != '') 100 { 101 $query.= ' 102 AND category_id NOT IN ('.$user['forbidden_categories'].')'; 103 } 104 $query.= ' 98 WHERE image_id = '.$_GET['image_id'].' 99 AND category_id NOT IN ('.$user['forbidden_categories'].') 105 100 ;'; 106 101 $result = pwg_query($query); … … 488 483 } 489 484 490 // author491 $author = $creation_date = $size = $filesize = $lang['unavailable'];492 if ( !empty($picture['current']['author']) )493 {494 $search_url = PHPWG_ROOT_PATH.'category.php?cat=search';495 $search_url.= '&search=author:'.$picture['current']['author'];496 497 $author = '<a href="';498 $author .= add_session_id($search_url);499 $author .= '">'.$picture['current']['author'].'</a>';500 }501 502 // creation date503 if ( !empty($picture['current']['date_creation']) )504 {505 $creation_date = format_date($picture['current']['date_creation']);506 }507 508 // date of availability509 $availability_date = format_date($picture['current']['date_available'],510 'mysql_datetime');511 512 // size in pixels513 if ($picture['current']['is_picture'])514 {515 if ($original_width != $picture_size[0]516 or $original_height != $picture_size[1])517 {518 $size = '[ <a href="'.$picture['current']['src'].'" ';519 $size .= ' title="'.$lang['true_size'].'">';520 $size .= $original_width.'*'.$original_height.'</a> ]';521 }522 else523 {524 $size = $original_width.'*'.$original_height;525 }526 }527 528 // filesize529 if (empty($picture['current']['filesize']))530 {531 if (!$picture['current']['is_picture'])532 {533 $filesize = floor(filesize($picture['current']['download'])/1024);534 }535 else536 {537 $filesize = floor(filesize($picture['current']['src'])/1024);538 }539 }540 else541 {542 $filesize = $picture['current']['filesize'];543 }544 545 // number of visits546 $template->assign_block_vars(547 'info_line',548 array(549 'INFO'=>$lang['visited'],550 'VALUE'=>$picture['current']['hit'].' '.$lang['times']551 ));552 553 485 include(PHPWG_ROOT_PATH.'include/page_header.php'); 554 486 $template->set_filenames(array('picture'=>'picture.tpl')); … … 562 494 'WIDTH_IMG' => $picture_size[0], 563 495 'HEIGHT_IMG' => $picture_size[1], 564 'AUTHOR' => $author,565 'CREATION_DATE' => $creation_date,566 'AVAILABILITY_DATE' => $availability_date,567 'SIZE' => $size,568 'FILE_SIZE' => $filesize,569 496 570 497 'LEVEL_SEPARATOR' => $conf['level_separator'], … … 581 508 'L_DELETE' =>$lang['delete'], 582 509 'L_SUBMIT' =>$lang['submit'], 583 'L_AUTHOR' =>$lang['author'],584 510 'L_COMMENT' =>$lang['comment'], 585 511 'L_DOWNLOAD' => $lang['download'], … … 589 515 'L_UP_HINT' => $lang['home_hint'], 590 516 'L_UP_ALT' => $lang['home'], 591 'L_CREATION_DATE' => $lang['creation_date'],592 'L_AVAILABILITY_DATE' => $lang['registration_date'],593 'L_SIZE' => $lang['size'],594 'L_FILE' => $lang['file'],595 'L_FILE_SIZE' => $lang['size'],596 517 597 518 'U_HOME' => add_session_id(PHPWG_ROOT_PATH.'category.php'), … … 731 652 } 732 653 654 $infos = array(); 655 656 // author 657 if (!empty($picture['current']['author'])) 658 { 659 $infos['INFO_AUTHOR'] = 660 '<a href="'. 661 add_session_id( 662 PHPWG_ROOT_PATH.'category.php?cat=search'. 663 '&search=author:'.$picture['current']['author'] 664 ). 665 '">'.$picture['current']['author'].'</a>'; 666 } 667 else 668 { 669 $infos['INFO_AUTHOR'] = l10n('N/A'); 670 } 671 672 // creation date 673 if (!empty($picture['current']['date_creation'])) 674 { 675 $infos['INFO_CREATION_DATE'] = 676 '<a href="'. 677 add_session_id( 678 PHPWG_ROOT_PATH.'category.php?cat=search'. 679 '&search=date_creation:'.$picture['current']['date_creation'] 680 ). 681 '">'.format_date($picture['current']['date_creation']).'</a>'; 682 } 683 else 684 { 685 $infos['INFO_CREATION_DATE'] = l10n('N/A'); 686 } 687 688 // date of availability 689 $infos['INFO_AVAILABILITY_DATE'] = 690 '<a href="'. 691 add_session_id( 692 PHPWG_ROOT_PATH.'category.php?cat=search'. 693 '&search=date_available:'. 694 substr($picture['current']['date_available'], 0, 10) 695 ). 696 '">'. 697 format_date($picture['current']['date_available'], 'mysql_datetime'). 698 '</a>'; 699 700 // size in pixels 701 if ($picture['current']['is_picture']) 702 { 703 if ($original_width != $picture_size[0] 704 or $original_height != $picture_size[1]) 705 { 706 $infos['INFO_DIMENSIONS'] = 707 '<a href="'.$picture['current']['src'].'" title="'. 708 l10n('Original dimensions').'">'. 709 $original_width.'*'.$original_height.'</a>'; 710 } 711 else 712 { 713 $infos['INFO_DIMENSIONS'] = $original_width.'*'.$original_height; 714 } 715 } 716 else 717 { 718 $infos['INFO_DIMENSIONS'] = l10n('N/A'); 719 } 720 721 // filesize 722 if (!empty($picture['current']['filesize'])) 723 { 724 $infos['INFO_FILESIZE'] = 725 sprintf(l10n('%d Kb'), $picture['current']['filesize']); 726 } 727 else 728 { 729 $infos['INFO_FILESIZE'] = l10n('N/A'); 730 } 731 732 // number of visits 733 $infos['INFO_VISITS'] = $picture['current']['hit']; 734 735 // file 736 $infos['INFO_FILE'] = $picture['current']['file']; 737 733 738 // keywords 734 739 if (!empty($picture['current']['keywords'])) 735 740 { 736 $keywords = explode(',', $picture['current']['keywords']); 737 $content = ''; 738 $url = PHPWG_ROOT_PATH.'category.php?cat=search&search=keywords:'; 739 foreach ($keywords as $i => $keyword) 740 { 741 $local_url = add_session_id($url.$keyword); 742 if ($i > 0) 743 { 744 $content.= ','; 745 } 746 $content.= '<a href="'.$local_url.'">'.$keyword.'</a>'; 747 } 741 $infos['INFO_KEYWORDS'] = 742 preg_replace( 743 '/([^,]+)/', 744 '<a href="'. 745 add_session_id( 746 PHPWG_ROOT_PATH.'category.php?cat=search&search=keywords:$1' 747 ). 748 '">$1</a>', 749 $picture['current']['keywords'] 750 ); 751 } 752 else 753 { 754 $infos['INFO_KEYWORDS'] = l10n('N/A'); 755 } 756 757 $template->assign_vars($infos); 758 759 // related categories 760 foreach ($related_categories as $category) 761 { 748 762 $template->assign_block_vars( 749 ' keywords',763 'category', 750 764 array( 751 'INFO'=>$lang['keywords'], 752 'VALUE'=>$content 753 )); 754 } 755 756 // related categories 757 $cat_output = ''; 758 $page['show_comments'] = false; 759 foreach ($related_categories as $category) 760 { 761 if ($cat_output != '') 762 { 763 $cat_output.= '<br />'; 764 } 765 766 if (count($related_categories) > 3) 767 { 768 $cat_output .= get_cat_display_name_cache($category['uppercats']); 769 } 770 else 771 { 772 $cat_info = get_cat_info($category['category_id']); 773 $cat_output .= get_cat_display_name($cat_info['name']); 774 } 775 // the picture is commentable if it belongs at least to one category which 776 // is commentable 777 if ($category['commentable'] == 'true') 778 { 779 $page['show_comments'] = true; 780 } 781 } 782 $template->assign_block_vars( 783 'associated', 784 array( 785 'INFO' => $lang['categories'], 786 'VALUE' => $cat_output 787 )); 765 'LINE' => count($related_categories) > 3 766 ? get_cat_display_name_cache($category['uppercats']) 767 : get_cat_display_name_from_id($category['category_id']) 768 ) 769 ); 770 } 788 771 789 772 //------------------------------------------------------------------- metadata … … 894 877 if ($conf['rate']) 895 878 { 896 $query = 'SELECT COUNT(rate) AS count 879 $query = ' 880 SELECT COUNT(rate) AS count 897 881 , ROUND(AVG(rate),2) AS average 898 882 , ROUND(STD(rate),2) AS STD … … 907 891 else 908 892 { 909 $value = $row['average']; 910 $value.= ' ('; 911 $value.= $row['count'].' '.$lang['rates']; 912 $value.= ', '.$lang['standard_deviation'].' : '.$row['STD']; 913 $value.= ')'; 893 $value = sprintf( 894 l10n('%.2f (rated %d times, standard deviation = %.2f)'), 895 $row['average'], 896 $row['count'], 897 $row['STD'] 898 ); 914 899 } 915 900 … … 935 920 'rate', 936 921 array( 937 'INFO' => $lang['element_rate'], 938 'VALUE' => $value, 922 'CONTENT' => $value, 939 923 'SENTENCE' => $sentence 940 924 )); 925 926 $template->assign_block_vars('info_rate', array('CONTENT' => $value)); 927 928 $template->assign_vars( 929 array( 930 'INFO_RATE' => $value 931 ) 932 ); 941 933 942 934 foreach ($rate_items as $num => $mark) … … 967 959 968 960 //---------------------------------------------------- users's comments display 961 962 // the picture is commentable if it belongs at least to one category which 963 // is commentable 964 $page['show_comments'] = false; 965 foreach ($related_categories as $category) 966 { 967 if ($category['commentable'] == 'true') 968 { 969 $page['show_comments'] = true; 970 } 971 } 972 969 973 if ($page['show_comments']) 970 974 { -
trunk/template/cclear/default-colors.css
r837 r847 26 26 27 27 A:hover { 28 color: # 754300;28 color: #858460; 29 29 } 30 30 … … 115 115 input, select, textarea { 116 116 color:black; 117 background-color:#eee; 117 background-color: lightgrey; 118 border: 1px solid gray; 118 119 } 119 120 .bouton { -
trunk/template/cclear/default-layout.css
r844 r847 36 36 A { 37 37 text-decoration:none; 38 /*border-bottom: 1px dotted #000000;*/38 border-bottom: 1px dotted #005e89; 39 39 } 40 40 A:hover { 41 border-bottom -style: solid;41 border-bottom: 1px solid #858460; 42 42 } 43 43 44 44 IMG { 45 45 border: none; 46 } 47 48 HR.separation { 49 visibility: hidden; 50 clear: both; 46 51 } 47 52 -
trunk/template/cclear/image.css
r820 r847 8 8 #imageHeaderBar H1 { 9 9 margin: 1ex 0; /* override default-layout for less bottom-margin */ 10 clear: both; 10 11 } 11 12 … … 74 75 margin: auto; 75 76 } 76 TABLE.infoTable TD{77 TABLE.infoTable .value { 77 78 text-align: left; 78 79 } … … 80 81 TABLE.infoTable .label { 81 82 font-weight: bold; 83 text-align: right; 84 padding-right: 0.5em; 85 } 86 87 TABLE.infoTable TD.value UL { 88 margin: 0; 89 padding: 0 0 0 1.5em; 90 list-style-type: square; 82 91 } 83 92 -
trunk/template/cclear/picture.tpl
r820 r847 11 11 <div id="imageToolBar"> 12 12 <div class="randomButtons"> 13 <a href="{U_SLIDESHOW}" title="{L_SLIDESHOW}"> 14 <img src="template/cclear/theme/slideshow.png" alt="{L_SLIDESHOW}"> 15 </a> 16 <a href="{U_METADATA}" title="{L_PICTURE_METADATA}"> 17 <img src="template/cclear/theme/metadata.png" alt="{L_PICTURE_METADATA}"> 18 </a> 13 <a href="{U_SLIDESHOW}" title="{L_SLIDESHOW}"><img src="template/cclear/theme/slideshow.png" alt="{L_SLIDESHOW}"></a> 14 <a href="{U_METADATA}" title="{L_PICTURE_METADATA}"><img src="template/cclear/theme/metadata.png" alt="{L_PICTURE_METADATA}"></a> 15 <!-- BEGIN representative --> 16 <a href="{representative.URL}" title="{lang:set as category representative}"><img src="template/cclear/theme/representative.png" alt="{lang:representative}" /></a> 17 <!-- END representative --> 19 18 <!-- BEGIN favorite --> 20 <a href="{favorite.U_FAVORITE}" title="{favorite.FAVORITE_HINT}"> 21 <img src="{favorite.FAVORITE_IMG}" alt="{favorite.FAVORITE_ALT}"> 22 </a> 19 <a href="{favorite.U_FAVORITE}" title="{favorite.FAVORITE_HINT}"><img src="{favorite.FAVORITE_IMG}" alt="{favorite.FAVORITE_ALT}"></a> 23 20 <!-- END favorite --> 24 21 <!-- BEGIN download --> 25 <a href="{download.U_DOWNLOAD}" title="{L_DOWNLOAD}"> 26 <img src="template/cclear/theme/save.png" alt="{L_DOWNLOAD}"> 27 </a> 22 <a href="{download.U_DOWNLOAD}" title="{L_DOWNLOAD}"><img src="template/cclear/theme/save.png" alt="{L_DOWNLOAD}"></a> 28 23 <!-- END download --> 29 24 <!-- BEGIN admin --> 30 <a href="{U_ADMIN}" title="{L_ADMIN}"> 31 <img src="template/cclear/theme/preferences.png" alt="{L_ADMIN}"> 32 </a> 25 <a href="{U_ADMIN}" title="{L_ADMIN}"><img src="template/cclear/theme/preferences.png" alt="{L_ADMIN}"></a> 33 26 <!-- END admin --> 34 27 </div> 35 28 <div class="navButtons"> 36 29 <!-- BEGIN next --> 37 <a class="navButton next" href="{next.U_IMG}" title="{L_NEXT_IMG}{next.TITLE_IMG}"> 38 <img src="template/cclear/theme/right.png" alt="next"> 39 </a> 30 <a class="navButton next" href="{next.U_IMG}" title="{L_NEXT_IMG}{next.TITLE_IMG}"><img src="template/cclear/theme/right.png" alt="next"></a> 40 31 <!-- END next --> 41 <a class="navButton up" href="{U_UP}" title="{L_UP_HINT}"> 42 <img src="template/cclear/theme/up.png" alt="{L_UP_ALT}"> 43 </a> 32 <a class="navButton up" href="{U_UP}" title="{L_UP_HINT}"><img src="template/cclear/theme/up.png" alt="{L_UP_ALT}"></a> 44 33 <!-- BEGIN previous --> 45 <a class="navButton prev" href="{previous.U_IMG}" title="{L_PREV_IMG}{previous.TITLE_IMG}"> 46 <img src="template/cclear/theme/left.png" alt="previous"> 47 </a> 34 <a class="navButton prev" href="{previous.U_IMG}" title="{L_PREV_IMG}{previous.TITLE_IMG}"><img src="template/cclear/theme/left.png" alt="previous"></a> 48 35 <!-- END previous --> 49 36 </div> 50 </div> 37 </div> <!-- imageToolBar --> 51 38 52 39 <div id="theImage"> … … 81 68 82 69 <table class="infoTable" summary="Some info about this picture"> 83 <!-- BEGIN info_line -->84 70 <tr> 85 <td class="label">{ info_line.INFO} :</td>86 <td class="value">{ info_line.VALUE}</td>71 <td class="label">{lang:Author}</td> 72 <td class="value">{INFO_AUTHOR}</td> 87 73 </tr> 88 <!-- END info_line --> 74 <tr> 75 <td class="label">{lang:Created on}</td> 76 <td class="value">{INFO_CREATION_DATE}</td> 77 </tr> 78 <tr> 79 <td class="label">{lang:Registered on}</td> 80 <td class="value">{INFO_AVAILABILITY_DATE}</td> 81 </tr> 82 <tr> 83 <td class="label">{lang:Dimensions}</td> 84 <td class="value">{INFO_DIMENSIONS}</td> 85 </tr> 86 <tr> 87 <td class="label">{lang:File}</td> 88 <td class="value">{INFO_FILE}</td> 89 </tr> 90 <tr> 91 <td class="label">{lang:Filesize}</td> 92 <td class="value">{INFO_FILESIZE}</td> 93 </tr> 94 <tr> 95 <td class="label">{lang:Keywords}</td> 96 <td class="value">{INFO_KEYWORDS}</td> 97 </tr> 98 <tr> 99 <td class="label">{lang:Categories}</td> 100 <td class="value"> 101 <ul> 102 <!-- BEGIN category --> 103 <li>{category.LINE}</li> 104 <!-- END category --> 105 </ul> 106 </td> 107 </tr> 108 <tr> 109 <td class="label">{lang:Visits}</td> 110 <td class="value">{INFO_VISITS}</td> 111 </tr> 112 <!-- BEGIN info_rate --> 113 <tr> 114 <td class="label">{lang:Average rate}</td> 115 <td class="value">{info_rate.CONTENT}</td> 116 </tr> 117 <!-- END info_rate --> 89 118 </table> 90 119 … … 113 142 </p> 114 143 <!-- END rate --> 144 145 <hr class="separation"> 115 146 116 147 <!-- BEGIN comments -->
Note: See TracChangeset
for help on using the changeset viewer.