Changeset 1906154
- Timestamp:
- 07/09/2018 03:35:06 AM (8 years ago)
- Location:
- bitwords-io/trunk
- Files:
-
- 3 added
- 1 deleted
- 6 edited
-
admin/BitwordsSerializer.php (modified) (1 diff)
-
admin/views/tab_settings.php (modified) (1 diff)
-
assets/script.v4.js (added)
-
assets/script.v4.min.js (added)
-
assets/style.css (deleted)
-
bitwords_admin_settings.php (modified) (3 diffs)
-
include/shortcode.php (modified) (2 diffs)
-
include/widget.php (modified) (2 diffs)
-
lib/BitwordsAPI.php (modified) (2 diffs)
-
views/widget.php (added)
Legend:
- Unmodified
- Added
- Removed
-
bitwords-io/trunk/admin/BitwordsSerializer.php
r1897786 r1906154 76 76 } 77 77 78 if (isset($_POST['bitwordsBlacklistDomains'])) { 79 $bitwordsBlacklistDomains = sanitize_text_field($_POST['bitwordsBlacklistDomains']); 80 $api->updatePlugin(array('blacklistedDomains' => $bitwordsBlacklistDomains)); 81 } 82 78 83 break; 79 84 } -
bitwords-io/trunk/admin/views/tab_settings.php
r1897786 r1906154 38 38 </div> 39 39 40 41 <div class="bitwords-input-group"> 42 <b>Blacklist domains:</b><br /> 43 <span>Here you can specify which domains you'd like to blacklist. Ads from these sites will not be 44 displayed on this website. </span> 45 <br /> 46 <input 47 style="min-width: 300px" 48 name="bitwordsBlacklistDomains" type="text" placeholder="example1.com,example2.com" 49 value="<?php echo $dataForPublisher->blacklistedDomains; ?>"/> 50 </div> 51 40 52 <!-- <div class="bitwords-input-group"> 41 53 <b>Custom CSS</b><br /> -
bitwords-io/trunk/bitwords_admin_settings.php
r1900694 r1906154 6 6 * Plugin Name: Bitwords.io 7 7 * Description: Show ads from the Bitwords.io site 8 * Version: 1. 3.08 * Version: 1.4.0 9 9 */ 10 10 if (!defined('WPINC')) die; … … 18 18 include_once plugin_dir_path(__FILE__) . "admin/BitwordsSerializer.php"; 19 19 20 include_once plugin_dir_path(__FILE__) . "include/shortcode.php"; 21 // include_once plugin_dir_path(__FILE__) . "include/widget.php"; 22 20 23 21 24 function bitwordsInsertAfterContent ($content) { 22 25 // bail if the user has not accepted the license and the T&C 23 26 if (get_option('bitwordsLicense') != '1') return $content; 27 28 if (!is_single()) return $content; 24 29 25 30 $publisherId = get_option('bitwordsPublisherId'); … … 85 90 function bitwordsScripts() { 86 91 wp_enqueue_style('bitwords_style', plugin_dir_url(__FILE__) . 'assets/style.v3.min.css', array(), '1.3.0'); 87 wp_enqueue_script('bitwords_script', plugin_dir_url(__FILE__) . 'assets/script.v 3.min.js', array(), '1.3.0', true);92 wp_enqueue_script('bitwords_script', plugin_dir_url(__FILE__) . 'assets/script.v4.min.js', array(), '1.3.0', true); 88 93 } 89 94 add_action('wp_enqueue_scripts', 'bitwordsScripts'); -
bitwords-io/trunk/include/shortcode.php
r1897786 r1906154 5 5 */ 6 6 function bitwordsShortcodePublisher($atts) { 7 extract(shortcode_atts(array('id' => ''), $atts)); 7 extract(shortcode_atts(array( 8 'posts_count' => '4' 9 ), $atts)); 8 10 9 switch ($id) {10 case 1: $shortCodeContent = 'Publisher1'; break;11 case 2: $shortCodeContent = 'Publisher2'; break;12 case 3: $shortCodeContent = 'Publisher3'; break;13 default: break;14 }11 // switch ($id) { 12 // case 1: $shortCodeContent = 'Publisher1'; break; 13 // case 2: $shortCodeContent = 'Publisher2'; break; 14 // case 3: $shortCodeContent = 'Publisher3'; break; 15 // default: break; 16 // } 15 17 16 require_once( plugin_dir_path(__FILE__) . 'views/publisher.php' ); 17 return $html; 18 $pluginLogo = plugin_dir_url(__FILE__) . '../assets/logo.png'; 19 20 // process the php view file and capture the output in a variable 21 ob_start(); 22 include(plugin_dir_path(__FILE__) . '../views/publisher.php'); 23 $output = ob_get_contents(); 24 ob_end_clean(); // Clear the buffer. 25 26 // require_once(plugin_dir_path(__FILE__) . '../views/publisher.php' ); 27 return $output; 18 28 } 19 29 … … 22 32 * Define publisher shortcode name 23 33 */ 24 function wpc_register_shortcode() {34 function bitwordsRegisterShortcode() { 25 35 add_shortcode('bitwords', 'bitwordsShortcodePublisher'); 26 36 } 27 add_action('init', ' wpc_register_shortcode');37 add_action('init', 'bitwordsRegisterShortcode'); -
bitwords-io/trunk/include/widget.php
r1892920 r1906154 4 4 * Register and load the widget 5 5 */ 6 function bitwords _load_widget() {6 function bitwordsRegisterWidget() { 7 7 register_widget('bitwords_widget'); 8 8 } 9 add_action('widgets_init', 'bitwords _load_widget');9 add_action('widgets_init', 'bitwordsRegisterWidget'); 10 10 11 11 … … 66 66 </p> 67 67 <p> 68 <input 69 name="bitwordsAfterArticleMaxStories" 70 type="number" min="0" max="10" placeholder="6" 71 value="<?php echo $this->get_field_id('bitwordsAfterArticleMaxStories'); ?>" /> 72 <label for="<?php echo $this->get_field_id('bitwords_checkbox'); ?>"><?php _e('Display publishers?'); ?></label> 73 </p> 74 <p> 68 75 <input class="checkbox" type="checkbox"<?php checked($bitwords_checkbox); ?> id="<?php echo $this->get_field_id('bitwords_checkbox'); ?>" name="<?php echo $this->get_field_name('bitwords_checkbox'); ?>" /> 69 76 <label for="<?php echo $this->get_field_id('bitwords_checkbox'); ?>"><?php _e('Display publishers?'); ?></label> -
bitwords-io/trunk/lib/BitwordsAPI.php
r1900694 r1906154 16 16 */ 17 17 private function _api($url, $data = array()) { 18 $HOST = "https://app.bitwords.io/api/v1"; 18 // $HOST = "https://app.bitwords.io/api/v1"; 19 $HOST = "http://172.16.0.157:5999/api/v1"; 19 20 20 21 // Find the publisher's key so that we can authenticate with the server … … 77 78 78 79 /** 79 * send published or updated articles to bitwords80 * Send published or updated articles to bitwords 80 81 */ 81 82 public function sendPost ($post) { 82 83 $this-> _api('/publishers/wordpress/post', $post); 83 84 } 85 86 87 /** 88 * Update the plublisher's plugin 89 */ 90 public function updatePlugin ($plugin) { 91 $this-> _api('/publishers/wordpress/update', $plugin); 92 } 84 93 }
Note: See TracChangeset
for help on using the changeset viewer.