示例#1
0
文件: tags.php 项目: ecerta/webcomic
 /**
  * Render a formatted list of related webcomics.
  * 
  * <code class="php">
  * // render a comma-separated list of up to five related webcomics
  * the_related_webcomics();
  * 
  * // render an ordered list of up to to ten webcomics related by characters using small images
  * the_related_webcomics( '<ol class="related-webcomics"><li>', '</li><li>', '</li></ol>', 'thumbnail', 10, false, true );
  * 
  * // render a comma-separated list of all webcomics related by storyline (excluding crossovers) to the post with an ID of 42
  * the_related_webcomics( '<h2>Related Webcomics</h2><p>', ', ', '</p>', '', 0, true, false, false, 42 );
  * </code>
  * 
  * <code class="bbcode">
  * // render a comma-separated list of up to five related webcomics
  * [the_related_webcomics]
  * 
  * // render an ordered list of up to to ten webcomics related by characters using small images
  * [the_related_webcomics before="<ol class='related-webcomics'><li>" sep="</li><li>" after="</li></ol>" image="thumbnail" limit="10" storylines="false"]
  * 
  * // render a comma-separated list of all webcomics related by storyline (excluding crossovers) to the post with an ID of 42
  * [the_related_webcomics before="<h2>Related Webcomics</h2><p>" sep=", " after="</p>" limit="0" characters="false" crossovers="false" the_post="42"]
  * </code>
  * 
  * @package Webcomic
  * @param string $before Before list.
  * @param string $sep Separate items using this.
  * @param string $after After list.
  * @param string $image Image size to use when displaying webcomic images for links.
  * @param integer $limit The number of related webcomics to display.
  * @param boolean $storylines Match based on storylines.
  * @param boolean $characters Match based on characters.
  * @param mixed $the_post The post object or ID to match.
  * @uses WebcomicTag::the_related_webcomics()
  */
 function the_related_webcomics($before = '', $sep = ', ', $after = '', $image = '', $limit = 5, $storylines = true, $characters = true, $the_post = false)
 {
     echo WebcomicTag::the_related_webcomics($before, $sep, $after, $image, $limit, $storylines, $characters, $the_post);
 }
示例#2
0
 /**
  * Handle the_related_webcomics shortcode.
  * 
  * @param array $atts Shortcode attributes.
  * @return string
  * @uses WebcomicTag::webcomic_collection_link()
  */
 public function the_related_webcomics($atts)
 {
     extract(shortcode_atts(array('before' => '', 'sep' => ', ', 'after' => '', 'image' => '', 'limit' => 5, 'storylines' => true, 'characters' => true, 'the_post' => false), $atts));
     return WebcomicTag::the_related_webcomics($before, $sep, $after, $image, $limit, $storylines, $characters, $the_post);
 }