Changeset 12920 for trunk/include/functions_html.inc.php
- Timestamp:
- Jan 17, 2012, 10:58:18 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_html.inc.php
r12761 r12920 3 3 // | Piwigo - a PHP based photo gallery | 4 4 // +-----------------------------------------------------------------------+ 5 // | Copyright(C) 2008-201 1Piwigo Team http://piwigo.org |5 // | Copyright(C) 2008-2012 Piwigo Team http://piwigo.org | 6 6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | 7 7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | … … 179 179 } 180 180 } 181 181 182 182 if ($single_link and isset($single_url)) 183 183 { … … 296 296 { 297 297 global $page; 298 298 299 299 foreach (array($a, $b) as $tag) 300 300 { … … 534 534 } 535 535 536 /** 537 */ 538 function render_element_name($info) 539 { 540 $name = $info['name']; 541 if (!empty($name)) 542 { 543 $name = trigger_event('render_element_description', $name); 544 return $name; 545 } 546 547 return get_name_from_file($info['file']); 548 } 549 550 function render_element_description($info) 551 { 552 $comment = $info['comment']; 553 if (!empty($comment)) 554 { 555 $comment = trigger_event('render_element_description', $comment); 556 return $comment; 557 } 558 return ''; 559 } 560 561 /** 562 * returns the title of the thumbnail based on photo properties 563 */ 564 function get_thumbnail_title($info, $title, $comment) 565 { 566 global $conf, $user; 567 568 $details = array(); 569 570 if (!empty($info['hit'])) 571 { 572 $details[] = $info['hit'].' '.strtolower(l10n('Visits')); 573 } 574 575 if ($conf['rate'] and !empty($info['rating_score'])) 576 { 577 $details[] = strtolower(l10n('Rating score')).' '.$info['rating_score']; 578 } 579 580 if (isset($info['nb_comments']) and $info['nb_comments'] != 0) 581 { 582 $details[] = l10n_dec('%d comment', '%d comments', $info['nb_comments']); 583 } 584 585 if (count($details) > 0) 586 { 587 $title.= ' ('.implode(', ', $details).')'; 588 } 589 590 if (!empty($comment)) 591 { 592 $title.= ' '.substr($info['comment'], 0, 100).(strlen($info['comment']) > 100 ? '...' : ''); 593 } 594 595 $title = htmlspecialchars(strip_tags($title)); 596 $title = trigger_event('get_thumbnail_title', $title, $info); 597 return $title; 598 } 599 536 600 ?>
Note: See TracChangeset
for help on using the changeset viewer.