示例#1
0
文件: tags.php 项目: ecerta/webcomic
 /**
  * Render a formatted list of collections the current character crosses over with.
  * 
  * <code class="php">
  * // render a comma-separated list of collections the current character crosses over with
  * webcomic_character_crossovers();
  * 
  * // render an unordered list of collection thumbnail posters linked to the first webcomic that crosses over with the current character
  * webcomic_character_crossovers( '<ul><li>', '</li><li>', '</li></ul>', 'first', 'thumbnail' );
  * 
  * // render an ordered list of collectios the character with an ID of 42 from collection 42 crosses over with
  * webcomic_character_crossovers( '<ol><li>', '</li><li>', '</li></ol>', 'archive', 42, 'webcomic42' );
  * </code>
  * 
  * <code class="bbcode">
  * // render a comma-separated list of collections the current character crosses over with
  * [webcomic_character_crossovers]
  * 
  * // render an unordered list of collection thumbnail posters linked to the first webcomic that crosses over with the current character
  * [webcomic_character_crossovers before="<ul><li>" sep="</li><li>" after="</li></ul>" target="first" image="thumbnail"]
  * 
  * // render an ordered list of collectios the character with an ID of 42 from collection 42 crosses over with
  * [webcomic_character_crossovers before="<ol><li>" sep="</li><li>" after="</li></ol>" term="42" collection="webcomic42"]
  * </code>
  * 
  * @package Webcomic
  * @param string $before Before list.
  * @param string $sep Separate items using this.
  * @param string $after After list.
  * @param string $target Where the links should point to, one of 'archive', 'first', 'last', or 'random'.
  * @param string $image Image size to use when displaying crossover collections images for links.
  * @param integer $character character ID to render a crossover list for.
  * @param mixed $collection The collection the character belongs to.
  * @uses WebcomicTag::webcomic_term_crossovers()
  */
 function webcomic_character_crossovers($before = '', $sep = ', ', $after = '', $target = 'archive', $image = '', $character = 0, $collection = '')
 {
     echo WebcomicTag::webcomic_term_crossovers($character, $character ? "{$collection}_character" : '', $before, $sep, $after, $target, $image);
 }
示例#2
0
 /**
  * Handle webcomic_(storyline|character)_crossovers shortcode.
  * 
  * @param array $atts Shortcode attributes.
  * @param string $content Shortcode content.
  * @param string $name Shortcode name.
  * @return string
  * @uses WebcomicTag::webcomic_term_crossovers()
  */
 public function webcomic_term_crossovers($atts, $content, $name)
 {
     extract(shortcode_atts(array('before' => '', 'sep' => ', ', 'after' => '', 'target' => 'archive', 'image' => '', 'term' => 0, 'collection' => ''), $atts));
     if (false !== strpos($name, 'storyline')) {
         $tax = 'storyline';
     } elseif (false !== strpos($name, 'character')) {
         $tax = 'character';
     } else {
         $tax = '';
     }
     return WebcomicTag::webcomic_term_crossovers($term, $collection ? "{$collection}_{$tax}" : '', $before, $sep, $after, $target, $image);
 }