Advertisement
Guest User

Untitled

a guest
Nov 8th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.31 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.0.9.0
  8. * @ Author : DeZender
  9. * @ Release on : 08.08.2019
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function adsw_get_nice_attr($var = '')
  15. {
  16. $args = maybe_unserialize(ADSW_NICE);
  17.  
  18. if (!$args) {
  19. return false;
  20. }
  21.  
  22. return isset($args[$var]) ? $args[$var] : false;
  23. }
  24.  
  25. function adsw_nice_attributes_option()
  26. {
  27. $args = get_option('adsw-attributes-settings', []);
  28. $defaults = [
  29. 'status' => 1,
  30. 'text_only' => 0,
  31. 'customisation' => [
  32. 'css' => '',
  33. 'variation_image' => ['width' => '50', 'height' => '50', 'round_variations' => 0, 'variations_color_apply' => 0]
  34. ]
  35. ];
  36. $args = wp_parse_args($args, $defaults);
  37. return $args;
  38. }
  39.  
  40. function adsw_remove_mine($views)
  41. {
  42. unset($views['mine']);
  43. return $views;
  44. }
  45.  
  46. function adsw_set_bulk_footer()
  47. {
  48. global $typenow;
  49.  
  50. if ($typenow != 'product') {
  51. return NULL;
  52. }
  53.  
  54. echo ' <script type="text/javascript">' . "\r\n" . ' jQuery( document ).ready( function ( $ ) {' . "\r\n" . ' $( \'<option>\' ).val( \'publish_product\' ).text( \'';
  55. _e('Publish', 'adsw');
  56. echo '\' )' . "\r\n" . ' .appendTo( "select[name=\'action\'], select[name=\'action2\']" );' . "\r\n" . ' } );' . "\r\n" . ' </script>' . "\r\n\t";
  57. }
  58.  
  59. function adsw_get_bulk_request()
  60. {
  61. if (isset($_REQUEST['action']) || (('publish_product' == $_REQUEST['action']) && isset($_REQUEST['post']) && count($_REQUEST['post']))) {
  62. foreach ($_REQUEST['post'] as $post) {
  63. wp_publish_post($post);
  64. }
  65. }
  66. }
  67.  
  68. function adsw_post_status()
  69. {
  70. register_post_status('importlist', ['label' => _x('Import List', 'adsw'), 'public' => true, 'internal' => false, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop(__('Import List', 'adsw') . ' <span class="count">(%s)</span>', __('Import List', 'adsw') . ' <span class="count">(%s)</span>')]);
  71. }
  72.  
  73. function adsw_set_post_status()
  74. {
  75. if (is_admin() || current_user_can('level_8')) {
  76. adsw_post_status();
  77. }
  78. }
  79.  
  80. function adsw_status_dropdown()
  81. {
  82. global $post;
  83. echo ' <script>' . "\r\n" . ' jQuery( document ).ready( function ( $ ) {' . "\r\n" . ' $( "select#post_status" ).append(' . "\r\n" . ' "<option value=\'importlist\' ';
  84. selected('importlist', $post->post_status);
  85. echo '>';
  86. _e('Import List', 'adsw');
  87. echo '</option>" );' . "\r\n\r\n\t" . ' ';
  88.  
  89. if ('importlist' == $post->post_status) {
  90. echo "\r\n" . ' $( \'#post-status-display\' ).text("';
  91. _e('Import List', 'adsw');
  92. echo '");' . "\r\n\r\n\t" . ' ';
  93. }
  94.  
  95. echo "\r\n" . ' } );' . "\r\n\r\n\r\n" . ' </script>' . "\r\n\t";
  96. }
  97.  
  98. function adsw_quick_edit_status_dropdown()
  99. {
  100. echo ' <script>' . "\r\n" . ' jQuery( document ).ready( function ( $ ) {' . "\r\n\r\n" . ' $( \'select[name="_status"]\' ).each( function () {' . "\r\n" . ' $(this).append( "<option value=\'importlist\'>';
  101. _e('Import List', 'adsw');
  102. echo '</option>" );' . "\r\n" . ' } );' . "\r\n" . ' } );' . "\r\n\r\n\r\n" . ' </script>' . "\r\n\t";
  103. }
  104.  
  105. function adsw_set_default_setting()
  106. {
  107. new adsw\adsOptions(true);
  108. $args = get_option('adsw-settings');
  109. $args = maybe_unserialize($args);
  110. $defaults = [
  111. 'AppKey' => '',
  112. 'trackingId' => '',
  113. 'affiliateUrl' => '',
  114. 'currency' => ['rounding' => 0, 'assignCents' => '']
  115. ];
  116.  
  117. if (!$args) {
  118. $args = [];
  119. }
  120.  
  121. $args = wp_parse_args($args, $defaults);
  122. if (empty($args['AppKey']) || empty($args['trackingId'])) {
  123. $args['AppKey'] = '33503';
  124. $args['trackingId'] = 'aliplugin';
  125. }
  126.  
  127. if (!defined('ADSW_SITE_URL')) {
  128. define('ADSW_SITE_URL', str_replace(['http://', 'https://'], '', get_site_url()));
  129. }
  130.  
  131. if (!defined('ADSW_APPKEY')) {
  132. define('ADSW_APPKEY', $args['AppKey']);
  133. }
  134.  
  135. if (!defined('ADSW_TID')) {
  136. define('ADSW_TID', $args['trackingId']);
  137. }
  138.  
  139. if (!defined('ADSW_AFFILIATE')) {
  140. define('ADSW_AFFILIATE', $args['affiliateUrl']);
  141. }
  142.  
  143. if (!defined('ADSW_PRICE_ROUNDING')) {
  144. ..............................................................................
  145. .........................................
  146. ................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement