Advertisement
plas71k

@nug => phplockit file 2 => decoded

May 13th, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.73 KB | None | 0 0
  1. <?php
  2. /*
  3. * @ Pirate-Sky Crew :: PHP Decoder v2
  4. * @ Author: pLa$71k
  5. * @ Web: http://pirate-sky.com
  6. * @ Pirate-Sky Crew (c) 2008 - 2013
  7. */
  8.  
  9. function add_custom_meta_box()
  10. {
  11.     add_meta_box('custom_meta_box', 'VIRTARICH Detail Produk', 'show_custom_meta_box', 'post', 'normal', 'high');
  12. }
  13. add_action('add_meta_boxes', 'add_custom_meta_box');
  14. $prefix             = 'custom_';
  15. $custom_meta_fields = array(
  16.     array(
  17.         'label' => 'Produk Habis ?',
  18.         'desc' => 'centang , jika produk ini habis, fungsi ini akan mendisable tombol beli untuk produk ini',
  19.         'id' => 'habis',
  20.         'type' => 'checkbox'
  21.     ),
  22.     array(
  23.         'label' => 'Apakah Produk ini DROPSHIP ?',
  24.         'desc' => 'Centang jika produk ini adalah dropship,  sehingga produk ini hanya bisa di order via sms saja',
  25.         'id' => 'dropship',
  26.         'type' => 'checkbox'
  27.     ),
  28.     array(
  29.         'label' => 'Stok Barang',
  30.         'desc' => 'tulis jumlah stok barang , atau bisa juga di tulis, contoh : Ready , Kosong, Habis, 10 pcs',
  31.         'id' => 'stok',
  32.         'type' => 'text'
  33.     ),
  34.     array(
  35.         'label' => 'Kode Produk',
  36.         'desc' => 'Tulis Kode produk anda.',
  37.         'id' => 'kode',
  38.         'type' => 'text'
  39.     ),
  40.     array(
  41.         'label' => 'Label',
  42.         'desc' => 'pilih , jika anda ingin memberikan label tertentu pada produk',
  43.         'id' => 'label',
  44.         'type' => 'select',
  45.         'options' => array(
  46.             'one' => array(
  47.                 'label' => '-',
  48.                 'value' => ''
  49.             ),
  50.             'two' => array(
  51.                 'label' => 'Sale',
  52.                 'value' => 'sale'
  53.             ),
  54.             'three' => array(
  55.                 'label' => 'Best Seller',
  56.                 'value' => 'best'
  57.             ),
  58.             'four' => array(
  59.                 'label' => 'NEW',
  60.                 'value' => 'new'
  61.             ),
  62.             'five' => array(
  63.                 'label' => 'Limited',
  64.                 'value' => 'limited'
  65.             ),
  66.             'six' => array(
  67.                 'label' => 'Pre Order',
  68.                 'value' => 'preorder'
  69.             )
  70.         )
  71.     ),
  72.     array(
  73.         'label' => 'Harga Produk',
  74.         'desc' => 'Tulis Harga Produk anda tanpa Rp, contoh : 150.000',
  75.         'id' => 'harga',
  76.         'type' => 'text'
  77.     ),
  78.     array(
  79.         'label' => 'Harga Diskon',
  80.         'desc' => 'Tulis Harga Produk anda tanpa Rp, contoh : 99.000',
  81.         'id' => 'harga_diskon',
  82.         'type' => 'text'
  83.     ),
  84.     array(
  85.         'label' => 'Berat barang',
  86.         'desc' => 'tulis berat barang , contoh : 0.5',
  87.         'id' => 'berat',
  88.         'type' => 'text'
  89.     ),
  90.     array(
  91.         'label' => 'Tampilkan Pilihan Produk',
  92.         'desc' => 'centang , jika anda ingin menampilkan pilihan , contoh size S ,M ,L , XL',
  93.         'id' => 'pilihan',
  94.         'type' => 'checkbox'
  95.     ),
  96.     array(
  97.         'label' => 'Pilihan 1',
  98.         'desc' => 'tulis nama pilihan 1, contoh : S',
  99.         'id' => 'pilihan1',
  100.         'type' => 'text'
  101.     ),
  102.     array(
  103.         'label' => 'Harga Pilihan 1',
  104.         'desc' => 'tulis harga pilihan 1, contoh : 120.000',
  105.         'id' => 'harga_pilihan1',
  106.         'type' => 'text'
  107.     ),
  108.     array(
  109.         'label' => 'Pilihan 2',
  110.         'desc' => 'tulis nama pilihan 2, contoh : M',
  111.         'id' => 'pilihan2',
  112.         'type' => 'text'
  113.     ),
  114.     array(
  115.         'label' => 'Harga Pilihan 2',
  116.         'desc' => 'tulis harga pilihan 2, contoh : 130.000',
  117.         'id' => 'harga_pilihan2',
  118.         'type' => 'text'
  119.     ),
  120.     array(
  121.         'label' => 'Pilihan 3',
  122.         'desc' => 'tulis nama pilihan 3, contoh : L',
  123.         'id' => 'pilihan3',
  124.         'type' => 'text'
  125.     ),
  126.     array(
  127.         'label' => 'Harga Pilihan 3',
  128.         'desc' => 'tulis harga pilihan 3, contoh : 140.000',
  129.         'id' => 'harga_pilihan3',
  130.         'type' => 'text'
  131.     ),
  132.     array(
  133.         'label' => 'Pilihan 4',
  134.         'desc' => 'tulis nama pilihan 4, contoh : XL',
  135.         'id' => 'pilihan4',
  136.         'type' => 'text'
  137.     ),
  138.     array(
  139.         'label' => 'Harga Pilihan 4',
  140.         'desc' => 'tulis harga pilihan 4, contoh : 150.000',
  141.         'id' => 'harga_pilihan4',
  142.         'type' => 'text'
  143.     ),
  144.     array(
  145.         'label' => 'Pilihan 5',
  146.         'desc' => 'tulis nama pilihan 5, contoh : XXL',
  147.         'id' => 'pilihan5',
  148.         'type' => 'text'
  149.     ),
  150.     array(
  151.         'label' => 'Harga Pilihan 5',
  152.         'desc' => 'tulis harga pilihan 5, contoh : 160.000',
  153.         'id' => 'harga_pilihan5',
  154.         'type' => 'text'
  155.     ),
  156.     array(
  157.         'label' => 'Pilihan 6',
  158.         'desc' => 'tulis nama pilihan 6, contoh : XXXL',
  159.         'id' => 'pilihan6',
  160.         'type' => 'text'
  161.     ),
  162.     array(
  163.         'label' => 'Harga Pilihan 6',
  164.         'desc' => 'tulis harga pilihan 6, contoh : 170.000',
  165.         'id' => 'harga_pilihan6',
  166.         'type' => 'text'
  167.     )
  168. );
  169. function show_custom_meta_box()
  170. {
  171.     global $custom_meta_fields, $post;
  172.     echo '<input type="hidden" name="custom_meta_box_nonce" value="' . wp_create_nonce(basename('2b93226186_copy.php')) . '" />';
  173.     echo '<table class="form-table">';
  174.     foreach ($custom_meta_fields as $field) {
  175.         $meta = get_post_meta($post->ID, $field['id'], true);
  176.         echo '<tr>  
  177.                    <th><label for="' . $field['id'] . '">' . $field['label'] . '</label></th>  
  178.                    <td>';
  179.         switch ($field['type']) {
  180.             case 'text':
  181.                 echo '<input type="text" name="' . $field['id'] . '" id="' . $field['id'] . '" value="' . $meta . '" size="30" />  
  182.            <br /><span class="description">' . $field['desc'] . '</span>';
  183.                 break;
  184.             case 'textarea':
  185.                 echo '<textarea name="' . $field['id'] . '" id="' . $field['id'] . '" cols="60" rows="4">' . $meta . '</textarea>  
  186.            <br /><span class="description">' . $field['desc'] . '</span>';
  187.                 break;
  188.             case 'checkbox':
  189.                 echo '<input type="checkbox" name="' . $field['id'] . '" id="' . $field['id'] . '" ', $meta ? ' checked="checked"' : '', '/>
  190.            <label for="' . $field['id'] . '">' . $field['desc'] . '</label>';
  191.                 break;
  192.             case 'select':
  193.                 echo '<select name="' . $field['id'] . '" id="' . $field['id'] . '">';
  194.                 foreach ($field['options'] as $option) {
  195.                     echo '<option', $meta == $option['value'] ? ' selected="selected"' : '', ' value="' . $option['value'] . '">' . $option['label'] . '</option>';
  196.                 }
  197.                 echo '</select><br /><span class="description">' . $field['desc'] . '</span>';
  198.                 break;
  199.         }
  200.         echo '</td></tr>';
  201.     }
  202.     echo '</table>';
  203. }
  204. function save_custom_meta($post_id)
  205. {
  206.     global $custom_meta_fields;
  207.     if (!isset($_POST['custom_meta_box_nonce'])) {
  208.         return $post_id;
  209.     }
  210.     if (!wp_verify_nonce($_POST['custom_meta_box_nonce'], basename('2b93226186_copy.php')))
  211.         return $post_id;
  212.     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
  213.         return $post_id;
  214.     if ('page' == $_POST['post_type']) {
  215.         if (!current_user_can('edit_page', $post_id))
  216.             return $post_id;
  217.     } elseif (!current_user_can('edit_post', $post_id)) {
  218.         return $post_id;
  219.     }
  220.     foreach ($custom_meta_fields as $field) {
  221.         $old = get_post_meta($post_id, $field['id'], true);
  222.         $new = $_POST[$field['id']];
  223.         if ($new && $new != $old) {
  224.             update_post_meta($post_id, $field['id'], $new);
  225.         } elseif ('' == $new && $old) {
  226.             delete_post_meta($post_id, $field['id'], $old);
  227.         }
  228.     }
  229. }
  230. add_action('save_post', 'save_custom_meta');
  231. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement