Changeset 927:247142804de0
- Timestamp:
- 10/28/12 07:34:51 (13 years ago)
- Branch:
- default
- Location:
- inc/public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/public/class.dc.template.php
r915 r927 1618 1618 with_category (1|0) #IMPLIED -- Search in entry category description if present (default 0) 1619 1619 no_tag (1|0) #IMPLIED -- Return image URL without HTML tag (default 0) 1620 content_only (1|0) #IMPLIED -- Search in content entry only, not in excerpt (default 0) 1620 1621 > 1621 1622 */ … … 1624 1625 $size = !empty($attr['size']) ? $attr['size'] : ''; 1625 1626 $class = !empty($attr['class']) ? $attr['class'] : ''; 1626 $with_category = !empty($attr['with_category']) ? 'true' : 'false'; 1627 $no_tag = !empty($attr['no_tag']) ? 'true' : 'false'; 1628 1629 return "<?php echo context::EntryFirstImageHelper('".addslashes($size)."',".$with_category.",'".addslashes($class).",'".$no_tag."'); ?>"; 1627 $with_category = !empty($attr['with_category']) ? 1 : 0; 1628 $no_tag = !empty($attr['no_tag']) ? 1 : 0; 1629 $content_only = !empty($attr['content_only']) ? 1 : 0; 1630 1631 return "<?php echo context::EntryFirstImageHelper('".addslashes($size)."',".$with_category.",'".addslashes($class)."',". 1632 $no_tag.",".$content_only."); ?>"; 1630 1633 } 1631 1634 -
inc/public/lib.tpl.context.php
r923 r927 341 341 342 342 # First post image helpers 343 public static function EntryFirstImageHelper($size,$with_category,$class="",$no_tag=false )343 public static function EntryFirstImageHelper($size,$with_category,$class="",$no_tag=false,$content_only=false) 344 344 { 345 345 global $core, $_ctx; … … 363 363 if ($_ctx->posts) 364 364 { 365 $subject = $_ctx->posts->post_excerpt_xhtml.$_ctx->posts->post_content_xhtml;365 $subject = ($content_only ? '' : $_ctx->posts->post_excerpt_xhtml).$_ctx->posts->post_content_xhtml; 366 366 if (preg_match_all($pattern,$subject,$m) > 0) 367 367 {
Note: See TracChangeset
for help on using the changeset viewer.