示例#1
0
文件: tags.php 项目: ecerta/webcomic
 /**
  * Render a formatted collection print amount.
  * 
  * <code class="php">
  * // render the current collection's print amount for a domestic print
  * webcomic_collection_print_amount( 'domestic' );
  * 
  * // render the original-print shipping amount for collection 42 using ',' for the decimal and '.' for the thousands separator
  * webcomic_collection_print_amount( 'original-shipping', ',', '.', 'webcomic42' );
  * </code>
  * 
  * <code class="bbcode">
  * // render the current collection's print amount for a domestic print.
  * [webcomic_collection_print_amount type="domestic"]
  * 
  * // render the original-print shipping amount for collection 42 using ',' for the decimal and '.' for the thousands separator.
  * [webcomic_collection_print_amount type="original-shipping" dec="," sep="." collection="42"]
  * </code>
  * 
  * @package Webcomic
  * @param string $type The amount to render, one of 'domestic', 'domestic-price', 'domestic-shipping', 'international', 'international-price', 'international-shipping', 'original', 'original-price', or 'original-shipping'.
  * @param string $dec Decimal point for number_format().
  * @param string $sep Thousands separator for number_format().
  * @param string $collection Collection ID. Will use Webcomic::$collection by default.
  * @uses WebcomicTag::webcomic_collection_print_amount()
  */
 function webcomic_collection_print_amount($type, $dec = '.', $sep = ',', $collection = '')
 {
     return WebcomicTag::webcomic_collection_print_amount($type, $dec, $sep, $collection);
 }
示例#2
0
 /**
  * Handle webcomic_collection_print_amount shortcode.
  * 
  * @param array $atts Shortcode attributes.
  * @return string
  * @uses WebcomicTag::webcomic_collection_print_amount()
  */
 public function webcomic_collection_print_amount($atts)
 {
     extract(shortcode_atts(array('type' => '', 'dec' => '.', 'sep' => ',', 'collection' => ''), $atts));
     return WebcomicTag::webcomic_collection_print_amount($type, $dec, $sep, $collection);
 }