johnburn

Decode for hackscript@wordpress.org

Jan 3rd, 2012
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.42 KB | None | 0 0
  1. <div class="price-list">
  2. Reg. Price     : <?php get_theme_option('amazon_currency');
  3. if (get_post_meta($post->ID, 'list_price', $single = true) != '') {
  4.     $listprice = get_post_meta($post->ID, 'list_price', $single = true);
  5.     $cur = array("$", 'EUR', '&#36;', '&#163;', '&#8355;', '&#128;');
  6.     $listprice = str_replace($cur, '', $listprice);
  7.     echo $listprice;
  8. } else {
  9.     $price = get_post_meta($post->ID, 'price', $single = true);
  10.     $cur = array("$", 'EUR', '&#36;', '&#163;', '&#8355;', '&#128;');
  11.     $price = str_replace($cur, '', $price);
  12.     echo $price;
  13. }
  14. ?>
  15. </div>  
  16.  
  17. <div class="price-now">
  18. SALE : <?php echo get_theme_option('amazon_currency');
  19. if (get_post_meta($post->ID, 'price', $single = true) != '') {
  20.     $price = get_post_meta($post->ID, 'price', $single = true);
  21.     $cur = array("$", 'EUR', '&#36;', '&#163;', '&#8355;', '&#128;');
  22.     $price = str_replace($cur, '', $price);
  23.     echo $price;
  24. } else {
  25.     $listprice = get_post_meta($post->ID, 'list_price', $single = true);
  26.     $cur = array("$", 'EUR', '&#36;', '&#163;', '&#8355;', '&#128;');
  27.     $listprice = str_replace($cur, '', $listprice);
  28.     echo $listprice;
  29. }
  30. ?>
  31. </div>
  32.  
  33.  
  34. <div class="price-saving">
  35. You save : <?php echo get_theme_option('amazon_currency');
  36. if (get_post_meta($post->ID, 'list_price', $single = true) != '') {
  37.     $listprice = get_post_meta($post->ID, 'list_price', $single = true);
  38.     $cur = array("$", 'EUR', '&#36;', '&#163;', '&#8355;', '&#128;');
  39.     $listprice = str_replace($cur, '', $listprice);
  40.     settype($listprice, 'double');
  41.     $price = get_post_meta($post->ID, 'price', $single = true);
  42.     $cur = array("$", 'EUR', '&#36;', '&#163;', '&#8355;', '&#128;');
  43.     $price = str_replace($cur, '', $price);
  44.     settype($price, 'double');
  45.     $hasil = $listprice - $price;
  46.     if ($listprice < 1) {
  47.         $save = $hasil / $hasil;
  48.         $persen = $save * 100;
  49.         settype($persen, 'integer');
  50.         echo ('0(0');
  51.         echo ('%');
  52.         echo ')';
  53.     } elseif ($price < 1) {
  54.         $save = $hasil / $hasil;
  55.         $persen = $save * 100;
  56.         settype($persen, 'integer');
  57.         echo ('0(0');
  58.         echo ('%');
  59.         echo ')';
  60.     } else {
  61.         $save = $hasil / $listprice;
  62.         $persen = $save * 100;
  63.         settype($persen, 'integer');
  64.         echo $hasil;
  65.         echo ('(');
  66.         echo $persen;
  67.         echo ('%');
  68.         echo ')';
  69.     }
  70. }
  71. ?>
  72. </div>
Add Comment
Please, Sign In to add comment