Changeset 2349543
- Timestamp:
- 07/31/2020 04:22:05 AM (6 years ago)
- Location:
- bbcode-deluxe
- Files:
-
- 5 edited
- 7 copied
-
tags/2020.07.30 (copied) (copied from bbcode-deluxe/trunk)
-
tags/2020.07.30/bbcode-admin.php (copied) (copied from bbcode-deluxe/trunk/bbcode-admin.php) (2 diffs)
-
tags/2020.07.30/bbcode-deluxe.php (copied) (copied from bbcode-deluxe/trunk/bbcode-deluxe.php) (3 diffs)
-
tags/2020.07.30/class-bbcode.php (copied) (copied from bbcode-deluxe/trunk/class-bbcode.php) (5 diffs)
-
tags/2020.07.30/license.txt (copied) (copied from bbcode-deluxe/trunk/license.txt)
-
tags/2020.07.30/options-form-template.php (copied) (copied from bbcode-deluxe/trunk/options-form-template.php) (2 diffs)
-
tags/2020.07.30/readme.txt (copied) (copied from bbcode-deluxe/trunk/readme.txt) (3 diffs)
-
trunk/bbcode-admin.php (modified) (2 diffs)
-
trunk/bbcode-deluxe.php (modified) (3 diffs)
-
trunk/class-bbcode.php (modified) (5 diffs)
-
trunk/options-form-template.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bbcode-deluxe/tags/2020.07.30/bbcode-admin.php
r2037928 r2349543 1 1 <?php 2 2 3 function bbcode_deluxe_plugin_menu() { add_options_page('BBCode Deluxe', 'BBCode Deluxe', 'manage_options', 'bbcode-deluxe', 'bbcode_deluxe_plugin_options'); } 3 function bbcode_deluxe_plugin_menu() 4 { 5 add_options_page('BBCode Deluxe', 'BBCode Deluxe', 'manage_options', 'bbcode-deluxe', 'bbcode_deluxe_plugin_options'); 6 } 4 7 5 8 add_action('admin_menu', 'bbcode_deluxe_plugin_menu'); 6 9 7 function bbcode_deluxe_plugin_options() { 10 function bbcode_deluxe_plugin_options() 11 { 8 12 global $bbp_sc_whitelist; 9 13 if (is_admin() && current_user_can('manage_options')) { … … 12 16 if ($whitelist_enabled) { 13 17 $enabled_plugins = get_option('bbpscwl_enabled_plugins'); 14 if ($enabled_plugins === '') { $enabled_plugins = array(); } 15 else { $enabled_plugins = unserialize($enabled_plugins); } 18 if ($enabled_plugins) { 19 $enabled_plugins = unserialize($enabled_plugins); 20 } else { 21 $enabled_plugins = []; 22 } 16 23 $bbcodes_active = false; 17 24 foreach ($enabled_plugins as $plugin_tag) { 18 if ($plugin_tag === 'bbpress-bbcode') { $bbcodes_active = true; } 25 if ($plugin_tag === 'bbpress-bbcode') { 26 $bbcodes_active = true; 27 break; 28 } 19 29 } 20 30 } 21 require(dirname(__FILE__).'/options-form-template.php'); 22 } else { echo '<div><p>No options currently available.</p></div>'; } 31 require dirname(__FILE__) . '/options-form-template.php'; 32 } else { 33 echo '<div><p>No options currently available.</p></div>'; 34 } 23 35 } 24 25 ?> -
bbcode-deluxe/tags/2020.07.30/bbcode-deluxe.php
r2037957 r2349543 3 3 Plugin URI: http://dcjtech.info/ 4 4 Description: Adds support for BBCode to Wordpress and BBPress 5 Version: 20 19.02.245 Version: 2020.07.30 6 6 Author: Devyn Collier Johnson (DevynCJohnson) 7 7 Author URI: http://dcjtech.info/ … … 19 19 20 20 21 function quote_exempt_from_wptexturize($shortcodes) { 22 $shortcodes = ['quote', 'q', 'QUOTE', 'Q']; 23 return $shortcodes; 21 defined('ABSPATH') or die('Invalid entrance into the plugin BBCode Deluxe!'); 22 23 24 function quote_exempt_from_wptexturize($shortcodes) 25 { 26 return ['quote', 'q', 'QUOTE', 'Q']; 24 27 } 25 28 26 29 27 function code_exempt_from_wptexturize($shortcodes) {28 $shortcodes = ['no-highlight', 'pre', 'raw']; 29 return $shortcodes;30 function code_exempt_from_wptexturize($shortcodes) 31 { 32 return ['no-highlight', 'pre', 'raw']; 30 33 } 31 34 32 35 33 function caption_exempt_from_wptexturize($shortcodes) {34 $shortcodes[] = 'caption'; 35 return $shortcodes;36 function caption_exempt_from_wptexturize($shortcodes) 37 { 38 return ['caption']; 36 39 } 37 40 38 41 39 function nested_quotes($content, $not_used = false) { 42 function nested_quotes($content, $not_used = false) 43 { 40 44 $counter = 0; 41 45 $tag_counter_string = ''; 42 $content = preg_replace('/[\n\r]/', '', $content); 43 $content = str_replace('', '', $content); 44 $content = str_replace('[quote', '[', $content); 45 $content = str_replace('[/quote]', '[/]', $content); 46 $pos = strpos($content, '[/]'); 47 while ($pos !== false) { 48 $content = preg_replace('/(?<=\[)([^]*?)(?=\[\/\])/u', '[]$0[/]', $content, 1); 46 $content = preg_replace('/[\n\r]/gu', '', $content); 47 $content = str_replace('', '', $content); 48 $content = str_replace('[quote', '[', $content); 49 $content = str_replace('[/quote]', '[/]', $content); 50 while (strpos($content, '[/]')) { 51 $content = preg_replace('/(?<=\[)([^]*?)(?=\[\/\])/gu', '[]$0[/]', $content, 1); 49 52 $tag_counter_string = 'quote-'.strval($counter); 50 $content = str_replace(' []', $tag_counter_string, $content);51 $content = str_replace(' ][/', $tag_counter_string, $content);53 $content = str_replace('[]', $tag_counter_string, $content); 54 $content = str_replace('][/', $tag_counter_string, $content); 52 55 ++$counter; 53 $pos = strpos($content, '[/]');54 56 } 55 $content = str_replace('', "\n", $content); 56 return $content; 57 return str_replace('', "\n", $content); 57 58 } 58 59 59 60 60 function fix_captions($content, $not_used = false) { 61 $content = preg_replace('/[\n\r]/', '', $content); 62 $content = str_replace('', '', $content); 63 $content = str_replace('[/caption]', '', $content); 64 $content = str_replace('[caption', '', $content); 65 $content = preg_replace('/<\/a>([^>]*?)/u', '</a><figcaption class="wp-caption-text aligncenter">$0</figcaption></figure>', $content); 66 while (strpos($content, '') !== false) { 67 $content = preg_replace('/[^\]]*? align="alignleft"[^\]]*?\]/u', '<figure class="wp-caption alignleft">', $content); 68 $content = preg_replace('/[^\]]*? align="alignright"[^\]]*?\]/u', '<figure class="wp-caption alignright">', $content); 69 $content = preg_replace('/[^\]]*? align="aligncenter"[^\]]*?\]/u', '<figure class="wp-caption aligncenter">', $content); 70 $content = preg_replace('/[^\]]*? align="alignnone"[^\]]*?\]/u', '<figure class="wp-caption alignnone">', $content); 71 $content = preg_replace('/[^\]]*?\]/u', '<figure class="wp-caption">', $content); 72 $content = preg_replace('/size\-([a-z]*?) wp\-image\-/', 'size-$0 aligncenter wp-image-', $content); 73 $content = preg_replace('/wp\-image\-([0-9]*?) size\-/', 'size-$0 aligncenter wp-image-', $content); 61 function fix_captions($content, $not_used = false) 62 { 63 $content = preg_replace('/[\n\r]/gu', '', $content); 64 $content = str_replace('', '', $content); 65 $content = str_replace('[/caption]', '', $content); 66 $content = str_replace('[caption', '', $content); 67 $content = preg_replace('/<\/a>([^>]*?)/gu', '</a><figcaption class="wp-caption-text aligncenter">$0</figcaption></figure>', $content); 68 while (strpos($content, '')) { 69 $content = preg_replace('/[^\]]*? align="alignleft"[^\]]*?\]/gu', '<figure class="wp-caption alignleft">', $content); 70 $content = preg_replace('/[^\]]*? align="alignright"[^\]]*?\]/gu', '<figure class="wp-caption alignright">', $content); 71 $content = preg_replace('/[^\]]*? align="aligncenter"[^\]]*?\]/gu', '<figure class="wp-caption aligncenter">', $content); 72 $content = preg_replace('/[^\]]*? align="alignnone"[^\]]*?\]/gu', '<figure class="wp-caption alignnone">', $content); 73 $content = preg_replace('/[^\]]*?\]/gu', '<figure class="wp-caption">', $content); 74 $content = preg_replace('/size\-([A-Za-z0-9]*?) wp\-image\-/gu', 'size-$0 aligncenter wp-image-', $content); 75 $content = preg_replace('/wp\-image\-([A-Za-z0-9]*?) size\-/gu', 'size-$0 aligncenter wp-image-', $content); 74 76 } 75 $content = str_replace('', "\n", $content); 76 $content = str_replace('', '', $content); 77 $content = str_replace('', '', $content); 78 return $content; 77 $content = str_replace('', "\n", $content); 78 return str_replace('', '', str_replace('', '', $content)); 79 79 } 80 80 81 81 82 defined('ABSPATH') or die('Invalid entrance into the plugin BBCode Deluxe!');83 82 add_filter('no_texturize_shortcodes', 'caption_exempt_from_wptexturize', 8); 84 83 add_filter('no_texturize_shortcodes', 'code_exempt_from_wptexturize'); … … 92 91 add_filter('the_content', 'do_shortcode', 11); 93 92 add_filter('widget_text', 'do_shortcode', 11); 94 if (function_exists('get_comment_text')) { add_filter('get_comment_text', 'do_shortcode', 11); }95 if (function_exists('bbp_get_topic_content')) { add_filter('bbp_get_topic_content', 'do_shortcode', 11); }96 if (function_exists('bbp_get_reply_content')) { add_filter('bbp_get_reply_content', 'do_shortcode', 11); }97 if (function_exists('bp_get_activity_content_body')) { add_filter('bp_get_activity_content_body', 'do_shortcode', 11); }98 if (function_exists('bp_get_the_topic_post_content')) { add_filter('bp_get_the_topic_post_content', 'do_shortcode', 11); }99 if (function_exists('bp_get_the_thread_message_content')) { add_filter('bp_get_the_thread_message_content', 'do_shortcode', 11); }100 require_once(dirname(__FILE__).'/bbcode-admin.php');101 require_once(dirname(__FILE__).'/class-bbcode.php');102 add_action('plugins_loaded', function() { global $BBCode; $BBCode = new BBCode(); }, 14);103 93 104 ?> 94 if (function_exists('get_comment_text')) { 95 add_filter('get_comment_text', 'do_shortcode', 11); 96 } 97 if (function_exists('bbp_get_topic_content')) { 98 add_filter('bbp_get_topic_content', 'do_shortcode', 11); 99 } 100 if (function_exists('bbp_get_reply_content')) { 101 add_filter('bbp_get_reply_content', 'do_shortcode', 11); 102 } 103 if (function_exists('bp_get_activity_content_body')) { 104 add_filter('bp_get_activity_content_body', 'do_shortcode', 11); 105 } 106 if (function_exists('bp_get_the_topic_post_content')) { 107 add_filter('bp_get_the_topic_post_content', 'do_shortcode', 11); 108 } 109 if (function_exists('bp_get_the_thread_message_content')) { 110 add_filter('bp_get_the_thread_message_content', 'do_shortcode', 11); 111 } 112 113 require_once dirname(__FILE__) . '/bbcode-admin.php'; 114 require_once dirname(__FILE__) . '/class-bbcode.php'; 115 116 add_action( 117 'plugins_loaded', 118 function() { 119 global $BBCode; 120 $BBCode = new BBCode(); 121 }, 122 14 123 ); -
bbcode-deluxe/tags/2020.07.30/class-bbcode.php
r2037957 r2349543 1 <?php class BBCode { 2 3 public $use_whitelist = false; 4 function __construct() { 5 if (!function_exists('add_shortcode')) { return; } 1 <?php 2 3 class BBCode 4 { 5 6 private function __construct() 7 { 8 if (!function_exists('add_shortcode')) { 9 return; 10 } 6 11 // Shortcode Protection 7 12 add_shortcode('c', 'skip_enclosed_shortcodes'); … … 21 26 add_shortcode('sql', 'skip_enclosed_shortcodes'); 22 27 add_shortcode('xml', 'skip_enclosed_shortcodes'); 23 if (function_exists('tiny_mce_before_init')) { add_action('tiny_mce_before_init', 'tinymce_skip_enclosed_shortcodes'); } 28 if (function_exists('tiny_mce_before_init')) { 29 add_action('tiny_mce_before_init', 'tinymce_skip_enclosed_shortcodes'); 30 } 24 31 // Formatting + Style 25 add_shortcode('b', array(&$this, 'shortcode_bold'));26 add_shortcode('B', array(&$this, 'shortcode_bold'));27 add_shortcode('bold', array(&$this, 'shortcode_bold'));28 add_shortcode('BOLD', array(&$this, 'shortcode_bold'));29 add_shortcode('strong', array(&$this, 'shortcode_bold'));30 add_shortcode('STRONG', array(&$this, 'shortcode_bold'));31 add_shortcode('center', array(&$this, 'shortcode_center'));32 add_shortcode('CENTER', array(&$this, 'shortcode_center'));33 add_shortcode('color', array(&$this, 'shortcode_color'));34 add_shortcode('COLOR', array(&$this, 'shortcode_color'));35 add_shortcode('del', array(&$this, 'shortcode_del'));36 add_shortcode('DEL', array(&$this, 'shortcode_del'));37 add_shortcode('i', array(&$this, 'shortcode_italics'));38 add_shortcode('I', array(&$this, 'shortcode_italics'));39 add_shortcode('italic', array(&$this, 'shortcode_italics'));40 add_shortcode('ITALIC', array(&$this, 'shortcode_italics'));41 add_shortcode('em', array(&$this, 'shortcode_italics'));42 add_shortcode('EM', array(&$this, 'shortcode_italics'));43 add_shortcode('justify', array(&$this, 'shortcode_justify'));44 add_shortcode('JUSTIFY', array(&$this, 'shortcode_justify'));45 add_shortcode('left', array(&$this, 'shortcode_left'));46 add_shortcode('LEFT', array(&$this, 'shortcode_left'));47 add_shortcode('bdo', array(&$this, 'shortcode_reverse'));48 add_shortcode('BDO', array(&$this, 'shortcode_reverse'));49 add_shortcode('reverse', array(&$this, 'shortcode_reverse'));50 add_shortcode('REVERSE', array(&$this, 'shortcode_reverse'));51 add_shortcode('right', array(&$this, 'shortcode_right'));52 add_shortcode('RIGHT', array(&$this, 'shortcode_right'));53 add_shortcode('size', array(&$this, 'shortcode_size'));54 add_shortcode('SIZE', array(&$this, 'shortcode_size'));55 add_shortcode('s', array(&$this, 'shortcode_strikethrough'));56 add_shortcode('S', array(&$this, 'shortcode_strikethrough'));57 add_shortcode('strike', array(&$this, 'shortcode_strikethrough'));58 add_shortcode('STRIKE', array(&$this, 'shortcode_strikethrough'));59 add_shortcode('sub', array(&$this, 'shortcode_subscript'));60 add_shortcode('SUB', array(&$this, 'shortcode_subscript'));61 add_shortcode('sup', array(&$this, 'shortcode_superscript'));62 add_shortcode('SUP', array(&$this, 'shortcode_superscript'));63 add_shortcode('u', array(&$this, 'shortcode_underline'));64 add_shortcode('U', array(&$this, 'shortcode_underline'));65 add_shortcode('underline', array(&$this, 'shortcode_underline'));66 add_shortcode('UNDERLINE', array(&$this, 'shortcode_underline'));32 add_shortcode('b', [&$this, 'shortcode_bold']); 33 add_shortcode('B', [&$this, 'shortcode_bold']); 34 add_shortcode('bold', [&$this, 'shortcode_bold']); 35 add_shortcode('BOLD', [&$this, 'shortcode_bold']); 36 add_shortcode('strong', [&$this, 'shortcode_bold']); 37 add_shortcode('STRONG', [&$this, 'shortcode_bold']); 38 add_shortcode('center', [&$this, 'shortcode_center']); 39 add_shortcode('CENTER', [&$this, 'shortcode_center']); 40 add_shortcode('color', [&$this, 'shortcode_color']); 41 add_shortcode('COLOR', [&$this, 'shortcode_color']); 42 add_shortcode('del', [&$this, 'shortcode_del']); 43 add_shortcode('DEL', [&$this, 'shortcode_del']); 44 add_shortcode('i', [&$this, 'shortcode_italics']); 45 add_shortcode('I', [&$this, 'shortcode_italics']); 46 add_shortcode('italic', [&$this, 'shortcode_italics']); 47 add_shortcode('ITALIC', [&$this, 'shortcode_italics']); 48 add_shortcode('em', [&$this, 'shortcode_italics']); 49 add_shortcode('EM', [&$this, 'shortcode_italics']); 50 add_shortcode('justify', [&$this, 'shortcode_justify']); 51 add_shortcode('JUSTIFY', [&$this, 'shortcode_justify']); 52 add_shortcode('left', [&$this, 'shortcode_left']); 53 add_shortcode('LEFT', [&$this, 'shortcode_left']); 54 add_shortcode('bdo', [&$this, 'shortcode_reverse']); 55 add_shortcode('BDO', [&$this, 'shortcode_reverse']); 56 add_shortcode('reverse', [&$this, 'shortcode_reverse']); 57 add_shortcode('REVERSE', [&$this, 'shortcode_reverse']); 58 add_shortcode('right', [&$this, 'shortcode_right']); 59 add_shortcode('RIGHT', [&$this, 'shortcode_right']); 60 add_shortcode('size', [&$this, 'shortcode_size']); 61 add_shortcode('SIZE', [&$this, 'shortcode_size']); 62 add_shortcode('s', [&$this, 'shortcode_strikethrough']); 63 add_shortcode('S', [&$this, 'shortcode_strikethrough']); 64 add_shortcode('strike', [&$this, 'shortcode_strikethrough']); 65 add_shortcode('STRIKE', [&$this, 'shortcode_strikethrough']); 66 add_shortcode('sub', [&$this, 'shortcode_subscript']); 67 add_shortcode('SUB', [&$this, 'shortcode_subscript']); 68 add_shortcode('sup', [&$this, 'shortcode_superscript']); 69 add_shortcode('SUP', [&$this, 'shortcode_superscript']); 70 add_shortcode('u', [&$this, 'shortcode_underline']); 71 add_shortcode('U', [&$this, 'shortcode_underline']); 72 add_shortcode('underline', [&$this, 'shortcode_underline']); 73 add_shortcode('UNDERLINE', [&$this, 'shortcode_underline']); 67 74 // Quotes 68 add_shortcode('q', array(&$this, 'shortcode_quote'));69 add_shortcode('q-0', array(&$this, 'shortcode_quote'));70 add_shortcode('q-1', array(&$this, 'shortcode_quote'));71 add_shortcode('q-2', array(&$this, 'shortcode_quote'));72 add_shortcode('q-3', array(&$this, 'shortcode_quote'));73 add_shortcode('q-4', array(&$this, 'shortcode_quote'));74 add_shortcode('q-5', array(&$this, 'shortcode_quote'));75 add_shortcode('q-6', array(&$this, 'shortcode_quote'));76 add_shortcode('q-7', array(&$this, 'shortcode_quote'));77 add_shortcode('q-8', array(&$this, 'shortcode_quote'));78 add_shortcode('q-9', array(&$this, 'shortcode_quote'));79 add_shortcode('q-10', array(&$this, 'shortcode_quote'));80 add_shortcode('Q', array(&$this, 'shortcode_quote'));81 add_shortcode('Q-0', array(&$this, 'shortcode_quote'));82 add_shortcode('Q-1', array(&$this, 'shortcode_quote'));83 add_shortcode('Q-2', array(&$this, 'shortcode_quote'));84 add_shortcode('Q-3', array(&$this, 'shortcode_quote'));85 add_shortcode('Q-4', array(&$this, 'shortcode_quote'));86 add_shortcode('Q-5', array(&$this, 'shortcode_quote'));87 add_shortcode('Q-6', array(&$this, 'shortcode_quote'));88 add_shortcode('Q-7', array(&$this, 'shortcode_quote'));89 add_shortcode('Q-8', array(&$this, 'shortcode_quote'));90 add_shortcode('Q-9', array(&$this, 'shortcode_quote'));91 add_shortcode('Q-10', array(&$this, 'shortcode_quote'));92 add_shortcode('quote', array(&$this, 'shortcode_quote'));93 add_shortcode('quote-0', array(&$this, 'shortcode_quote'));94 add_shortcode('quote-1', array(&$this, 'shortcode_quote'));95 add_shortcode('quote-2', array(&$this, 'shortcode_quote'));96 add_shortcode('quote-3', array(&$this, 'shortcode_quote'));97 add_shortcode('quote-4', array(&$this, 'shortcode_quote'));98 add_shortcode('quote-5', array(&$this, 'shortcode_quote'));99 add_shortcode('quote-6', array(&$this, 'shortcode_quote'));100 add_shortcode('quote-7', array(&$this, 'shortcode_quote'));101 add_shortcode('quote-8', array(&$this, 'shortcode_quote'));102 add_shortcode('quote-9', array(&$this, 'shortcode_quote'));103 add_shortcode('quote-10', array(&$this, 'shortcode_quote'));104 add_shortcode('quote-11', array(&$this, 'shortcode_quote'));105 add_shortcode('quote-12', array(&$this, 'shortcode_quote'));106 add_shortcode('quote-13', array(&$this, 'shortcode_quote'));107 add_shortcode('quote-14', array(&$this, 'shortcode_quote'));108 add_shortcode('quote-15', array(&$this, 'shortcode_quote'));109 add_shortcode('quote-16', array(&$this, 'shortcode_quote'));110 add_shortcode('quote-17', array(&$this, 'shortcode_quote'));111 add_shortcode('quote-18', array(&$this, 'shortcode_quote'));112 add_shortcode('quote-19', array(&$this, 'shortcode_quote'));113 add_shortcode('quote-20', array(&$this, 'shortcode_quote'));114 add_shortcode('quote-21', array(&$this, 'shortcode_quote'));115 add_shortcode('quote-22', array(&$this, 'shortcode_quote'));116 add_shortcode('quote-23', array(&$this, 'shortcode_quote'));117 add_shortcode('quote-24', array(&$this, 'shortcode_quote'));118 add_shortcode('quote-25', array(&$this, 'shortcode_quote'));119 add_shortcode('quote-26', array(&$this, 'shortcode_quote'));120 add_shortcode('quote-27', array(&$this, 'shortcode_quote'));121 add_shortcode('quote-28', array(&$this, 'shortcode_quote'));122 add_shortcode('quote-29', array(&$this, 'shortcode_quote'));123 add_shortcode('quote-30', array(&$this, 'shortcode_quote'));124 add_shortcode('quote-31', array(&$this, 'shortcode_quote'));125 add_shortcode('quote-32', array(&$this, 'shortcode_quote'));126 add_shortcode('quote-33', array(&$this, 'shortcode_quote'));127 add_shortcode('quote-34', array(&$this, 'shortcode_quote'));128 add_shortcode('quote-35', array(&$this, 'shortcode_quote'));129 add_shortcode('quote-36', array(&$this, 'shortcode_quote'));130 add_shortcode('quote-37', array(&$this, 'shortcode_quote'));131 add_shortcode('quote-38', array(&$this, 'shortcode_quote'));132 add_shortcode('quote-39', array(&$this, 'shortcode_quote'));133 add_shortcode('quote-40', array(&$this, 'shortcode_quote'));134 add_shortcode('quote-41', array(&$this, 'shortcode_quote'));135 add_shortcode('quote-42', array(&$this, 'shortcode_quote'));136 add_shortcode('quote-43', array(&$this, 'shortcode_quote'));137 add_shortcode('quote-44', array(&$this, 'shortcode_quote'));138 add_shortcode('quote-45', array(&$this, 'shortcode_quote'));139 add_shortcode('quote-46', array(&$this, 'shortcode_quote'));140 add_shortcode('quote-47', array(&$this, 'shortcode_quote'));141 add_shortcode('quote-48', array(&$this, 'shortcode_quote'));142 add_shortcode('quote-49', array(&$this, 'shortcode_quote'));143 add_shortcode('QUOTE', array(&$this, 'shortcode_quote'));144 add_shortcode('QUOTE-0', array(&$this, 'shortcode_quote'));145 add_shortcode('QUOTE-1', array(&$this, 'shortcode_quote'));146 add_shortcode('QUOTE-2', array(&$this, 'shortcode_quote'));147 add_shortcode('QUOTE-3', array(&$this, 'shortcode_quote'));148 add_shortcode('QUOTE-4', array(&$this, 'shortcode_quote'));149 add_shortcode('QUOTE-5', array(&$this, 'shortcode_quote'));150 add_shortcode('QUOTE-6', array(&$this, 'shortcode_quote'));151 add_shortcode('QUOTE-7', array(&$this, 'shortcode_quote'));152 add_shortcode('QUOTE-8', array(&$this, 'shortcode_quote'));153 add_shortcode('QUOTE-9', array(&$this, 'shortcode_quote'));154 add_shortcode('QUOTE-10', array(&$this, 'shortcode_quote'));155 add_shortcode('cite', array(&$this, 'shortcode_cite'));156 add_shortcode('CITE', array(&$this, 'shortcode_cite'));75 add_shortcode('q', [&$this, 'shortcode_quote']); 76 add_shortcode('q-0', [&$this, 'shortcode_quote']); 77 add_shortcode('q-1', [&$this, 'shortcode_quote']); 78 add_shortcode('q-2', [&$this, 'shortcode_quote']); 79 add_shortcode('q-3', [&$this, 'shortcode_quote']); 80 add_shortcode('q-4', [&$this, 'shortcode_quote']); 81 add_shortcode('q-5', [&$this, 'shortcode_quote']); 82 add_shortcode('q-6', [&$this, 'shortcode_quote']); 83 add_shortcode('q-7', [&$this, 'shortcode_quote']); 84 add_shortcode('q-8', [&$this, 'shortcode_quote']); 85 add_shortcode('q-9', [&$this, 'shortcode_quote']); 86 add_shortcode('q-10', [&$this, 'shortcode_quote']); 87 add_shortcode('Q', [&$this, 'shortcode_quote']); 88 add_shortcode('Q-0', [&$this, 'shortcode_quote']); 89 add_shortcode('Q-1', [&$this, 'shortcode_quote']); 90 add_shortcode('Q-2', [&$this, 'shortcode_quote']); 91 add_shortcode('Q-3', [&$this, 'shortcode_quote']); 92 add_shortcode('Q-4', [&$this, 'shortcode_quote']); 93 add_shortcode('Q-5', [&$this, 'shortcode_quote']); 94 add_shortcode('Q-6', [&$this, 'shortcode_quote']); 95 add_shortcode('Q-7', [&$this, 'shortcode_quote']); 96 add_shortcode('Q-8', [&$this, 'shortcode_quote']); 97 add_shortcode('Q-9', [&$this, 'shortcode_quote']); 98 add_shortcode('Q-10', [&$this, 'shortcode_quote']); 99 add_shortcode('quote', [&$this, 'shortcode_quote']); 100 add_shortcode('quote-0', [&$this, 'shortcode_quote']); 101 add_shortcode('quote-1', [&$this, 'shortcode_quote']); 102 add_shortcode('quote-2', [&$this, 'shortcode_quote']); 103 add_shortcode('quote-3', [&$this, 'shortcode_quote']); 104 add_shortcode('quote-4', [&$this, 'shortcode_quote']); 105 add_shortcode('quote-5', [&$this, 'shortcode_quote']); 106 add_shortcode('quote-6', [&$this, 'shortcode_quote']); 107 add_shortcode('quote-7', [&$this, 'shortcode_quote']); 108 add_shortcode('quote-8', [&$this, 'shortcode_quote']); 109 add_shortcode('quote-9', [&$this, 'shortcode_quote']); 110 add_shortcode('quote-10', [&$this, 'shortcode_quote']); 111 add_shortcode('quote-11', [&$this, 'shortcode_quote']); 112 add_shortcode('quote-12', [&$this, 'shortcode_quote']); 113 add_shortcode('quote-13', [&$this, 'shortcode_quote']); 114 add_shortcode('quote-14', [&$this, 'shortcode_quote']); 115 add_shortcode('quote-15', [&$this, 'shortcode_quote']); 116 add_shortcode('quote-16', [&$this, 'shortcode_quote']); 117 add_shortcode('quote-17', [&$this, 'shortcode_quote']); 118 add_shortcode('quote-18', [&$this, 'shortcode_quote']); 119 add_shortcode('quote-19', [&$this, 'shortcode_quote']); 120 add_shortcode('quote-20', [&$this, 'shortcode_quote']); 121 add_shortcode('quote-21', [&$this, 'shortcode_quote']); 122 add_shortcode('quote-22', [&$this, 'shortcode_quote']); 123 add_shortcode('quote-23', [&$this, 'shortcode_quote']); 124 add_shortcode('quote-24', [&$this, 'shortcode_quote']); 125 add_shortcode('quote-25', [&$this, 'shortcode_quote']); 126 add_shortcode('quote-26', [&$this, 'shortcode_quote']); 127 add_shortcode('quote-27', [&$this, 'shortcode_quote']); 128 add_shortcode('quote-28', [&$this, 'shortcode_quote']); 129 add_shortcode('quote-29', [&$this, 'shortcode_quote']); 130 add_shortcode('quote-30', [&$this, 'shortcode_quote']); 131 add_shortcode('quote-31', [&$this, 'shortcode_quote']); 132 add_shortcode('quote-32', [&$this, 'shortcode_quote']); 133 add_shortcode('quote-33', [&$this, 'shortcode_quote']); 134 add_shortcode('quote-34', [&$this, 'shortcode_quote']); 135 add_shortcode('quote-35', [&$this, 'shortcode_quote']); 136 add_shortcode('quote-36', [&$this, 'shortcode_quote']); 137 add_shortcode('quote-37', [&$this, 'shortcode_quote']); 138 add_shortcode('quote-38', [&$this, 'shortcode_quote']); 139 add_shortcode('quote-39', [&$this, 'shortcode_quote']); 140 add_shortcode('quote-40', [&$this, 'shortcode_quote']); 141 add_shortcode('quote-41', [&$this, 'shortcode_quote']); 142 add_shortcode('quote-42', [&$this, 'shortcode_quote']); 143 add_shortcode('quote-43', [&$this, 'shortcode_quote']); 144 add_shortcode('quote-44', [&$this, 'shortcode_quote']); 145 add_shortcode('quote-45', [&$this, 'shortcode_quote']); 146 add_shortcode('quote-46', [&$this, 'shortcode_quote']); 147 add_shortcode('quote-47', [&$this, 'shortcode_quote']); 148 add_shortcode('quote-48', [&$this, 'shortcode_quote']); 149 add_shortcode('quote-49', [&$this, 'shortcode_quote']); 150 add_shortcode('QUOTE', [&$this, 'shortcode_quote']); 151 add_shortcode('QUOTE-0', [&$this, 'shortcode_quote']); 152 add_shortcode('QUOTE-1', [&$this, 'shortcode_quote']); 153 add_shortcode('QUOTE-2', [&$this, 'shortcode_quote']); 154 add_shortcode('QUOTE-3', [&$this, 'shortcode_quote']); 155 add_shortcode('QUOTE-4', [&$this, 'shortcode_quote']); 156 add_shortcode('QUOTE-5', [&$this, 'shortcode_quote']); 157 add_shortcode('QUOTE-6', [&$this, 'shortcode_quote']); 158 add_shortcode('QUOTE-7', [&$this, 'shortcode_quote']); 159 add_shortcode('QUOTE-8', [&$this, 'shortcode_quote']); 160 add_shortcode('QUOTE-9', [&$this, 'shortcode_quote']); 161 add_shortcode('QUOTE-10', [&$this, 'shortcode_quote']); 162 add_shortcode('cite', [&$this, 'shortcode_cite']); 163 add_shortcode('CITE', [&$this, 'shortcode_cite']); 157 164 // Code 158 add_shortcode('code', array(&$this, 'shortcode_code'));159 add_shortcode('CODE', array(&$this, 'shortcode_code'));160 add_shortcode('kbd', array(&$this, 'shortcode_kbd'));161 add_shortcode('KBD', array(&$this, 'shortcode_kbd'));162 add_shortcode('key', array(&$this, 'shortcode_kbd'));163 add_shortcode('KEY', array(&$this, 'shortcode_kbd'));164 add_shortcode('keyboard', array(&$this, 'shortcode_kbd'));165 add_shortcode('KEYBOARD', array(&$this, 'shortcode_kbd'));165 add_shortcode('code', [&$this, 'shortcode_code']); 166 add_shortcode('CODE', [&$this, 'shortcode_code']); 167 add_shortcode('kbd', [&$this, 'shortcode_kbd']); 168 add_shortcode('KBD', [&$this, 'shortcode_kbd']); 169 add_shortcode('key', [&$this, 'shortcode_kbd']); 170 add_shortcode('KEY', [&$this, 'shortcode_kbd']); 171 add_shortcode('keyboard', [&$this, 'shortcode_kbd']); 172 add_shortcode('KEYBOARD', [&$this, 'shortcode_kbd']); 166 173 // Lists 167 add_shortcode('ol', array(&$this, 'shortcode_orderedlist'));168 add_shortcode('OL', array(&$this, 'shortcode_orderedlist'));169 add_shortcode('ul', array(&$this, 'shortcode_unorderedlist'));170 add_shortcode('UL', array(&$this, 'shortcode_unorderedlist'));171 add_shortcode('list', array(&$this, 'shortcode_unorderedlist'));172 add_shortcode('LIST', array(&$this, 'shortcode_unorderedlist'));173 add_shortcode('li', array(&$this, 'shortcode_listitem'));174 add_shortcode('LI', array(&$this, 'shortcode_listitem'));174 add_shortcode('ol', [&$this, 'shortcode_orderedlist']); 175 add_shortcode('OL', [&$this, 'shortcode_orderedlist']); 176 add_shortcode('ul', [&$this, 'shortcode_unorderedlist']); 177 add_shortcode('UL', [&$this, 'shortcode_unorderedlist']); 178 add_shortcode('list', [&$this, 'shortcode_unorderedlist']); 179 add_shortcode('LIST', [&$this, 'shortcode_unorderedlist']); 180 add_shortcode('li', [&$this, 'shortcode_listitem']); 181 add_shortcode('LI', [&$this, 'shortcode_listitem']); 175 182 // Tables 176 add_shortcode('table', array(&$this, 'shortcode_table'));177 add_shortcode('TABLE', array(&$this, 'shortcode_table'));178 add_shortcode('thead', array(&$this, 'shortcode_thead'));179 add_shortcode('THEAD', array(&$this, 'shortcode_thead'));180 add_shortcode('tbody', array(&$this, 'shortcode_tbody'));181 add_shortcode('TBODY', array(&$this, 'shortcode_tbody'));182 add_shortcode('tfoot', array(&$this, 'shortcode_tfoot'));183 add_shortcode('TFOOT', array(&$this, 'shortcode_tfoot'));184 add_shortcode('th', array(&$this, 'shortcode_th'));185 add_shortcode('TH', array(&$this, 'shortcode_th'));186 add_shortcode('tr', array(&$this, 'shortcode_tr'));187 add_shortcode('TR', array(&$this, 'shortcode_tr'));188 add_shortcode('td', array(&$this, 'shortcode_td'));189 add_shortcode('TD', array(&$this, 'shortcode_td'));183 add_shortcode('table', [&$this, 'shortcode_table']); 184 add_shortcode('TABLE', [&$this, 'shortcode_table']); 185 add_shortcode('thead', [&$this, 'shortcode_thead']); 186 add_shortcode('THEAD', [&$this, 'shortcode_thead']); 187 add_shortcode('tbody', [&$this, 'shortcode_tbody']); 188 add_shortcode('TBODY', [&$this, 'shortcode_tbody']); 189 add_shortcode('tfoot', [&$this, 'shortcode_tfoot']); 190 add_shortcode('TFOOT', [&$this, 'shortcode_tfoot']); 191 add_shortcode('th', [&$this, 'shortcode_th']); 192 add_shortcode('TH', [&$this, 'shortcode_th']); 193 add_shortcode('tr', [&$this, 'shortcode_tr']); 194 add_shortcode('TR', [&$this, 'shortcode_tr']); 195 add_shortcode('td', [&$this, 'shortcode_td']); 196 add_shortcode('TD', [&$this, 'shortcode_td']); 190 197 // Links and Images 191 add_shortcode('email', array(&$this, 'shortcode_email'));192 add_shortcode('EMAIL', array(&$this, 'shortcode_email'));193 add_shortcode('tel', array(&$this, 'shortcode_telephone'));194 add_shortcode('TEL', array(&$this, 'shortcode_telephone'));195 add_shortcode('img', array(&$this, 'shortcode_image'));196 add_shortcode('IMG', array(&$this, 'shortcode_image'));197 add_shortcode('url', array(&$this, 'shortcode_url'));198 add_shortcode('URL', array(&$this, 'shortcode_url'));199 add_shortcode('link', array(&$this, 'shortcode_url'));200 add_shortcode('LINK', array(&$this, 'shortcode_url'));198 add_shortcode('email', [&$this, 'shortcode_email']); 199 add_shortcode('EMAIL', [&$this, 'shortcode_email']); 200 add_shortcode('tel', [&$this, 'shortcode_telephone']); 201 add_shortcode('TEL', [&$this, 'shortcode_telephone']); 202 add_shortcode('img', [&$this, 'shortcode_image']); 203 add_shortcode('IMG', [&$this, 'shortcode_image']); 204 add_shortcode('url', [&$this, 'shortcode_url']); 205 add_shortcode('URL', [&$this, 'shortcode_url']); 206 add_shortcode('link', [&$this, 'shortcode_url']); 207 add_shortcode('LINK', [&$this, 'shortcode_url']); 201 208 // Videos and Audio 202 add_shortcode('freesound', array(&$this, 'shortcode_freesound')); 203 add_shortcode('FREESOUND', array(&$this, 'shortcode_freesound')); 204 add_shortcode('gvideo', array(&$this, 'shortcode_gvideo')); 205 add_shortcode('GVIDEO', array(&$this, 'shortcode_gvideo')); 206 add_shortcode('vimeo', array(&$this, 'shortcode_vimeo')); 207 add_shortcode('VIMEO', array(&$this, 'shortcode_vimeo')); 208 add_shortcode('youtube', array(&$this, 'shortcode_youtube')); 209 add_shortcode('YOUTUBE', array(&$this, 'shortcode_youtube')); 209 add_shortcode('bitchute', [&$this, 'shortcode_bitchute']); 210 add_shortcode('BITCHUTE', [&$this, 'shortcode_bitchute']); 211 add_shortcode('dailymotion', [&$this, 'shortcode_dailymotion']); 212 add_shortcode('DAILYMOTION', [&$this, 'shortcode_dailymotion']); 213 add_shortcode('freesound', [&$this, 'shortcode_freesound']); 214 add_shortcode('FREESOUND', [&$this, 'shortcode_freesound']); 215 add_shortcode('gvideo', [&$this, 'shortcode_gvideo']); 216 add_shortcode('GVIDEO', [&$this, 'shortcode_gvideo']); 217 add_shortcode('vimeo', [&$this, 'shortcode_vimeo']); 218 add_shortcode('VIMEO', [&$this, 'shortcode_vimeo']); 219 add_shortcode('youtube', [&$this, 'shortcode_youtube']); 220 add_shortcode('YOUTUBE', [&$this, 'shortcode_youtube']); 210 221 // Special/Miscellaneous Content 211 add_shortcode('abbr', array(&$this, 'shortcode_abbr'));212 add_shortcode('ABBR', array(&$this, 'shortcode_abbr'));213 add_shortcode('acronym', array(&$this, 'shortcode_abbr'));214 add_shortcode('ACRONYM', array(&$this, 'shortcode_abbr'));215 add_shortcode('ip', array(&$this, 'shortcode_clientip'));216 add_shortcode('IP', array(&$this, 'shortcode_clientip'));217 add_shortcode('hr', array(&$this, 'shortcode_hr'));218 add_shortcode('HR', array(&$this, 'shortcode_hr'));219 add_shortcode('note', array(&$this, 'shortcode_note'));220 add_shortcode('NOTE', array(&$this, 'shortcode_note'));221 add_shortcode('useragent', array(&$this, 'shortcode_useragent'));222 add_shortcode('USERAGENT', array(&$this, 'shortcode_useragent'));222 add_shortcode('abbr', [&$this, 'shortcode_abbr']); 223 add_shortcode('ABBR', [&$this, 'shortcode_abbr']); 224 add_shortcode('acronym', [&$this, 'shortcode_abbr']); 225 add_shortcode('ACRONYM', [&$this, 'shortcode_abbr']); 226 add_shortcode('ip', [&$this, 'shortcode_clientip']); 227 add_shortcode('IP', [&$this, 'shortcode_clientip']); 228 add_shortcode('hr', [&$this, 'shortcode_hr']); 229 add_shortcode('HR', [&$this, 'shortcode_hr']); 230 add_shortcode('note', [&$this, 'shortcode_note']); 231 add_shortcode('NOTE', [&$this, 'shortcode_note']); 232 add_shortcode('useragent', [&$this, 'shortcode_useragent']); 233 add_shortcode('USERAGENT', [&$this, 'shortcode_useragent']); 223 234 // Hide and Display Content 224 add_shortcode('spoiler', array(&$this, 'shortcode_spoiler'));225 add_shortcode('SPOILER', array(&$this, 'shortcode_spoiler'));226 add_shortcode('user', array(&$this, 'shortcode_user'));227 add_shortcode('USER', array(&$this, 'shortcode_user'));228 add_shortcode('guest', array(&$this, 'shortcode_guest'));229 add_shortcode('GUEST', array(&$this, 'shortcode_guest'));235 add_shortcode('spoiler', [&$this, 'shortcode_spoiler']); 236 add_shortcode('SPOILER', [&$this, 'shortcode_spoiler']); 237 add_shortcode('user', [&$this, 'shortcode_user']); 238 add_shortcode('USER', [&$this, 'shortcode_user']); 239 add_shortcode('guest', [&$this, 'shortcode_guest']); 240 add_shortcode('GUEST', [&$this, 'shortcode_guest']); 230 241 $this->use_whitelist = false; 231 if (function_exists('bbp_whitelist_do_shortcode')) { $this->use_whitelist = true; } 232 } 233 234 function do_shortcode($content) { 235 if (function_exists('bbp_whitelist_do_shortcode')) { return bbp_whitelist_do_shortcode($content); } 236 else { return do_shortcode($content); } 237 } 238 239 function attributefix($atts = array()) { 240 if (empty($atts[0])) { return $atts; } 241 if (0 !== preg_match('#=("|\')(.*?)("|\')#', $atts[0], $match)) { $atts[0] = $match[2]; } 242 if (function_exists('bbp_whitelist_do_shortcode')) { 243 $this->use_whitelist = true; 244 } 245 } 246 247 public function do_shortcode($content) 248 { 249 if (function_exists('bbp_whitelist_do_shortcode')) { 250 return bbp_whitelist_do_shortcode($content); 251 } 252 return do_shortcode($content); 253 } 254 255 public function attributefix($atts = []) 256 { 257 if (empty($atts[0])) { 258 return $atts; 259 } 260 $match = []; 261 if (preg_match('#=("|\')(.*?)("|\')#u', $atts[0], $match) !== 0) { 262 $atts[0] = $match[2]; 263 } 242 264 return $atts; 243 265 } 244 266 245 267 246 / / SHORTCODES //268 /* SHORTCODES */ 247 269 248 270 249 271 // Shortcode Protection 250 272 251 function skip_enclosed_shortcodes($atts, $content = null) { 273 public function skip_enclosed_shortcodes($atts, $content = null) 274 { 252 275 return $content; 253 276 } 254 277 255 function tinymce_skip_enclosed_shortcodes($datainput) { 278 public function tinymce_skip_enclosed_shortcodes($datainput) 279 { 256 280 $datainput['protect'] = "[/\<\?php[\s\S]*?\?\>/g, /\[insert_php\][\s\S]*?\[\/insert_php\]/g, /\[ignore_code\][\s\S]*?\[\/ignore_code\]/g]"; 257 281 return $datainput; … … 260 284 // Formatting + Style 261 285 262 function shortcode_bold($atts = array(), $content = null) { 263 if (null === $content) { return ''; } 264 return '<strong>'.$this->do_shortcode($content).'</strong>'; 265 } 266 267 function shortcode_center($atts = array(), $content = null) { 268 if (null === $content) { return ''; } 269 return '<span style="text-align:center">'.$this->do_shortcode($content).'</span>'; 270 } 271 272 function shortcode_color($atts = array(), $content = null) { 273 if (null === $content || '' === $atts) { return ''; } 274 $color = substr(implode('', $atts), 1); 275 if (ctype_xdigit($color)) { $color = '#'.$color; } 276 return '<span style="color:'.$color.'">'.$this->do_shortcode($content).'</span>'; 277 } 278 279 function shortcode_del($atts = array(), $content = null) { 280 if (null === $content) { return ''; } 281 return '<del>'.$this->do_shortcode($content).'</del>'; 282 } 283 284 function shortcode_italics($atts = array(), $content = null) { 285 if (null === $content) { return ''; } 286 return '<em>'.$this->do_shortcode($content).'</em>'; 287 } 288 289 function shortcode_justify($atts = array(), $content = null) { 290 if (null === $content) { return ''; } 291 return '<span style="text-align:justify">'.$this->do_shortcode($content).'</span>'; 292 } 293 294 function shortcode_left($atts = array(), $content = null) { 295 if (null === $content) { return ''; } 296 return '<span style="text-align:left">'.$this->do_shortcode($content).'</span>'; 297 } 298 299 function shortcode_reverse($atts = array(), $content = null) { 300 if (null === $content) { return ''; } 301 return '<bdo dir="rtl">'.$this->do_shortcode($content).'</bdo>'; 302 } 303 304 function shortcode_right($atts = array(), $content = null) { 305 if (null === $content) { return ''; } 306 return '<span style="text-align:right">'.$this->do_shortcode($content).'</span>'; 307 } 308 309 function shortcode_size($atts = array(), $content = null) { 310 if (null === $content || '' === $atts) { return ''; } 311 $subattribs = substr(implode('', $atts), 1); 312 return '<span style="font-size:'.$subattribs.'px">'.$this->do_shortcode($content).'</span>'; 313 } 314 315 function shortcode_strikethrough($atts = array(), $content = null) { 316 if (null === $content) { return ''; } 317 return '<s>'.$this->do_shortcode($content).'</s>'; 318 } 319 320 function shortcode_subscript($atts = array(), $content = null) { 321 if (null === $content) { return ''; } 322 return '<sub>'.$this->do_shortcode($content).'</sub>'; 323 } 324 325 function shortcode_superscript($atts = array(), $content = null) { 326 if (null === $content) { return ''; } 327 return '<sup>'.$this->do_shortcode($content).'</sup>'; 328 } 329 330 function shortcode_underline($atts = array(), $content = null) { 331 if (null === $content) { return ''; } 332 return '<span style="text-decoration:underline">'.$this->do_shortcode($content).'</span>'; 286 public function shortcode_bold($atts = [], $content = null) 287 { 288 return $content ? '<strong>' . $this->do_shortcode($content) . '</strong>' : ''; 289 } 290 291 public function shortcode_center($atts = [], $content = null) 292 { 293 return $content ? '<span style="text-align:center">' . $this->do_shortcode($content) . '</span>' : ''; 294 } 295 296 public function shortcode_color($atts = [], $content = null) 297 { 298 if (!$content || !$atts) { 299 return ''; 300 } 301 $color = mb_substr(implode('', $atts), 1); 302 if (ctype_xdigit($color)) { 303 $color = '#' . $color; 304 } 305 return '<span style="color:' . $color . '">' . $this->do_shortcode($content) . '</span>'; 306 } 307 308 public function shortcode_del($atts = [], $content = null) 309 { 310 return $content ? '<del>' . $this->do_shortcode($content) . '</del>' : ''; 311 } 312 313 public function shortcode_italics($atts = [], $content = null) 314 { 315 return $content ? '<em>' . $this->do_shortcode($content) . '</em>' : ''; 316 } 317 318 public function shortcode_justify($atts = [], $content = null) 319 { 320 return $content ? '<span style="text-align:justify">' . $this->do_shortcode($content) . '</span>' : ''; 321 } 322 323 public function shortcode_left($atts = [], $content = null) 324 { 325 return $content ? '<span style="text-align:left">' . $this->do_shortcode($content) . '</span>' : ''; 326 } 327 328 public function shortcode_reverse($atts = [], $content = null) 329 { 330 return $content ? '<bdo dir="rtl">' . $this->do_shortcode($content) . '</bdo>' : ''; 331 } 332 333 public function shortcode_right($atts = [], $content = null) 334 { 335 return $content ? '<span style="text-align:right">' . $this->do_shortcode($content) . '</span>' : ''; 336 } 337 338 public function shortcode_size($atts = [], $content = null) 339 { 340 if (!$content || !$atts) { 341 return ''; 342 } 343 $subattribs = mb_substr(implode('', $atts), 1); 344 return '<span style="font-size:' . $subattribs . 'px">' . $this->do_shortcode($content) . '</span>'; 345 } 346 347 public function shortcode_strikethrough($atts = [], $content = null) 348 { 349 return $content ? '<s>' . $this->do_shortcode($content) . '</s>' : ''; 350 } 351 352 public function shortcode_subscript($atts = [], $content = null) 353 { 354 return $content ? '<sub>' . $this->do_shortcode($content) . '</sub>' : ''; 355 } 356 357 public function shortcode_superscript($atts = [], $content = null) 358 { 359 return $content ? '<sup>' . $this->do_shortcode($content) . '</sup>' : ''; 360 } 361 362 public function shortcode_underline($atts = [], $content = null) 363 { 364 return $content ? '<span style="text-decoration:underline">' . $this->do_shortcode($content) . '</span>' : ''; 333 365 } 334 366 … … 336 368 // Quotes 337 369 338 function shortcode_quote($atts = array(), $content = null) { 370 public function shortcode_quote($atts = [], $content = null) 371 { 339 372 global $bp; 340 373 global $bbp; 341 $css_classes = array('bbcode-quote'); 342 if ($content === null) { return ''; } 343 elseif (empty($atts)){ 344 return '<div class="'.implode(' ',$css_classes).'"><blockquote>'.$this->do_shortcode($content).'</blockquote></div>'; 345 } else { 346 $name = trim(array_shift($atts), '="'); 347 $css_classes[] = 'bbcode-quote-'.$name; 348 $user = get_user_by('login', $name); 349 if (false !== $user){ 350 $css_classes[] = 'bbcode-quote-user'; 351 if (function_exists('bp_is_active')) { $name = '<a href="'.site_url().'/members/'.$user->user_login.'">'.$user->display_name.'</a>'; } 352 elseif ('bbPress' === get_class($bbp)) { $name = '<a href="'.site_url().'?bbp_user='.$user->ID.'">'.$user->display_name.'</a>'; } 353 else { $name = $user->display_name; } 374 if (!$content) { 375 return ''; 376 } 377 $css_classes = ['bbcode-quote']; 378 if (empty($atts)){ 379 return '<div class="' . implode(' ', $css_classes) . '"><blockquote>' . $this->do_shortcode($content) . '</blockquote></div>'; 380 } 381 $name = trim(array_shift($atts), '="'); 382 $css_classes[] = 'bbcode-quote-' . $name; 383 $user = get_user_by('login', $name); 384 if ($user) { 385 $css_classes[] = 'bbcode-quote-user'; 386 if (function_exists('bp_is_active')) { 387 $name = '<a href="' . site_url() . '/members/' . $user->user_login . '">' . $user->display_name . '</a>'; 388 } elseif (get_class($bbp) === 'bbPress') { 389 $name = '<a href="' . site_url() . '?bbp_user=' . $user->ID . '">' . $user->display_name . '</a>'; 390 } elseif ($user->display_name) { 391 $name = $user->display_name; 354 392 } 355 return '<div class="'.implode(' ', $css_classes).'"><strong>'.$name.' wrote: </strong><blockquote>'.$this->do_shortcode($content).'</blockquote></div>';356 }357 } 358 359 function shortcode_cite($atts = array(), $content = null) {360 if (null === $content) { return ''; }361 return '<cite>'.$this->do_shortcode($content).'</cite>';393 } 394 return '<div class="' . implode(' ', $css_classes) . '"><strong>' . $name . ' wrote: </strong><blockquote>' . $this->do_shortcode($content) . '</blockquote></div>'; 395 } 396 397 public function shortcode_cite($atts = [], $content = null) 398 { 399 return $content ? '<cite>' . $this->do_shortcode($content) . '</cite>' : ''; 362 400 } 363 401 364 402 // Code 365 403 366 function shortcode_code($atts = array(), $content = null) {367 if (null === $content) { return ''; }368 return '<code>'.$this->do_shortcode($content).'</code>';369 } 370 371 function shortcode_kbd($atts = array(), $content = null) {372 if (null === $content) { return ''; }373 return '<kbd>'.$this->do_shortcode($content).'</kbd>';404 public function shortcode_code($atts = [], $content = null) 405 { 406 return $content ? '<code>' . $this->do_shortcode($content) . '</code>' : ''; 407 } 408 409 public function shortcode_kbd($atts = [], $content = null) 410 { 411 return $content ? '<kbd>' . $this->do_shortcode($content) . '</kbd>' : ''; 374 412 } 375 413 376 414 // Lists 377 415 378 function shortcode_orderedlist($atts = array(), $content = null) {379 if (null === $content) { return ''; }380 return '<ol>'.$this->do_shortcode($content).'</ol>';381 } 382 383 function shortcode_unorderedlist($atts = array(), $content = null) {384 if (null === $content) { return ''; }385 return '<ul>'.$this->do_shortcode($content).'</ul>';386 } 387 388 function shortcode_listitem($atts = array(), $content = null) {389 if (null === $content) { return ''; }390 return '<li>'.$this->do_shortcode($content).'</li>';416 public function shortcode_orderedlist($atts = [], $content = null) 417 { 418 return $content ? '<ol>' . $this->do_shortcode($content) . '</ol>' : ''; 419 } 420 421 public function shortcode_unorderedlist($atts = [], $content = null) 422 { 423 return $content ? '<ul>' . $this->do_shortcode($content) . '</ul>' : ''; 424 } 425 426 public function shortcode_listitem($atts = [], $content = null) 427 { 428 return $content ? '<li>' . $this->do_shortcode($content) . '</li>' : ''; 391 429 } 392 430 393 431 // Tables 394 432 395 function shortcode_table($atts = array(), $content = null) {396 if (null === $content) { return ''; }397 return '<table>'.$this->do_shortcode($content).'</table>';398 } 399 400 function shortcode_thead($atts = array(), $content = null) {401 if (null === $content) { return ''; }402 return '<thead>'.$this->do_shortcode($content).'</thead>';403 } 404 405 function shortcode_tbody($atts = array(), $content = null) {406 if (null === $content) { return ''; }407 return '<tbody>'.$this->do_shortcode($content).'</tbody>';408 } 409 410 function shortcode_tfoot($atts = array(), $content = null) {411 if (null === $content) { return ''; }412 return '<tfoot>'.$this->do_shortcode($content).'</tfoot>';413 } 414 415 function shortcode_th($atts = array(), $content = null) {416 if (null === $content) { return ''; }417 return '<th>'.$this->do_shortcode($content).'</th>';418 } 419 420 function shortcode_tr($atts = array(), $content = null) {421 if (null === $content) { return ''; }422 return '<tr>'.$this->do_shortcode($content).'</tr>';423 } 424 425 function shortcode_td($atts = array(), $content = null) {426 if (null === $content) { return ''; }427 return '<td>'.$this->do_shortcode($content).'</td>';433 public function shortcode_table($atts = [], $content = null) 434 { 435 return $content ? '<table>' . $this->do_shortcode($content) . '</table>' : ''; 436 } 437 438 public function shortcode_thead($atts = [], $content = null) 439 { 440 return $content ? '<thead>' . $this->do_shortcode($content) . '</thead>' : ''; 441 } 442 443 public function shortcode_tbody($atts = [], $content = null) 444 { 445 return $content ? '<tbody>' . $this->do_shortcode($content) . '</tbody>' : ''; 446 } 447 448 public function shortcode_tfoot($atts = [], $content = null) 449 { 450 return $content ? '<tfoot>' . $this->do_shortcode($content) . '</tfoot>' : ''; 451 } 452 453 public function shortcode_th($atts = [], $content = null) 454 { 455 return $content ? '<th>' . $this->do_shortcode($content) . '</th>' : ''; 456 } 457 458 public function shortcode_tr($atts = [], $content = null) 459 { 460 return $content ? '<tr>' . $this->do_shortcode($content) . '</tr>' : ''; 461 } 462 463 public function shortcode_td($atts = [], $content = null) 464 { 465 return $content ? '<td>' . $this->do_shortcode($content) . '</td>' : ''; 428 466 } 429 467 430 468 // Links and Images 431 469 432 function shortcode_email($atts = array(), $content = null) { 433 if (empty($atts)) { // [email][email protected][/email] 434 $url = $content; 435 } else { // [[email protected]]text[/email] or [email="[email protected]"]text[/email] 436 $atts = $this->attributefix($atts); 437 $url = trim(array_shift($atts), '="'); 438 } 439 if (empty($url)) { return ''; } 470 public function shortcode_email($atts = [], $content = null) 471 { 472 $url = $content; // [email][email protected][/email] 473 if ($atts) { // [[email protected]]text[/email] or [email="[email protected]"]text[/email] 474 $url = trim(array_shift($this->attributefix($atts)), '="'); 475 } 476 if (!$url) { 477 return ''; 478 } 440 479 $url = str_replace(' at ', '@', str_replace(' ', ' ', $url)); 441 return '<a href="mailto:'.$url.'">'.$this->do_shortcode($content).'</a>'; 442 } 443 444 function shortcode_telephone($atts = array(), $content = null) { 445 if (empty($atts)) { // [tel]123-456-7890[/tel] 480 return '<a href="mailto:' . $url . '">' . $this->do_shortcode($content) . '</a>'; 481 } 482 483 public function shortcode_telephone($atts = [], $content = null) 484 { 485 if (!$atts) { // [tel]123-456-7890[/tel] 446 486 $phone = $content; 447 487 } else { // [tel=123-456-7890]text[/tel] or [tel="123-456-7890"]text[/tel] 488 $phone = trim(array_shift($this->attributefix($atts)), '="'); 489 } 490 if (!$phone) { 491 return ''; 492 } 493 $phone = $phone.replace('-', '').replace('.', '').replace('+', ''); 494 return '<a href="tel:' . $phone . '">' . $this->do_shortcode($content) . '</a>'; 495 } 496 497 public function shortcode_image($atts = [], $content = null) 498 { 499 if (!$content) { 500 return ''; 501 } 502 $alt = ''; 503 if (!$atts) { // [img=alttext]imageurl[/img] 504 $alt = trim(implode(' ', $atts), '="'); 505 } 506 return '<img src="' . $content . '" alt="' . $alt . '" title="' . $alt . ' />'; 507 } 508 509 public function shortcode_url($atts = [], $content = null) 510 { 511 if (!$atts) { // [url]http://www.example.com/[/url] 512 $url = $content; 513 } else { // [url=http://www.example.com/]text[/url] or [url="http://www.example.com/"]text[/url] 514 $url = trim(array_shift($this->attributefix($atts)), '="'); 515 } 516 if (!$url) { 517 return ''; 518 } 519 return '<a href="' . $url . '">' . $this->do_shortcode($content) . '</a>'; 520 } 521 522 // Videos and Audio 523 524 public function shortcode_bitchute($atts = [], $content = null) 525 { 526 if (!$content) { 527 return 'No BitChute Video ID Set'; 528 } 529 $vidID = $content; 530 $height = '330'; 531 $width = '400'; 532 if (!$atts) { 533 $match = []; 448 534 $atts = $this->attributefix($atts); 449 $ phone = trim(array_shift($atts), '="');450 }451 if (empty($phone)) { return ''; }452 $phone = $phone.replace('-', '').replace('.', '').replace('+', '');453 return '<a href="tel:'.$phone.'">'.$this->do_shortcode($content).'</a>';454 }455 456 function shortcode_image($atts = array(), $content = null) { 457 if (null === $content) { return ''; }458 $alt = '';459 if (! empty($atts)) { $alt = trim(implode(' ', $atts ), '="'); } // [img=alttext]imageurl[/img]460 return '<img src="'.$content.'" alt="'.$alt.'" title="'.$alt.' />';461 }462 463 function shortcode_url($atts = array(), $content = null) {464 if (empty($atts)) { // [url]http://www.example.com/[/url]465 $url = $text = $content;466 } else { // [url=http://www.example.com/]text[/url] or [url="http://www.example.com/"]text[/url]535 $autoplay = $atts['autoplay'] === 'yes' ? '&autoplay=1' : ''; 536 $vidID = (preg_match('%(?:bitchute(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=))([^"&?/ ]{11})%iu', $atts['url'], $match)) ? $match[1] : false; 537 $height = (isset($atts['height']) && is_numeric($atts['height'])) ? $atts['height'] : '330'; 538 $width = (isset($atts['width']) && is_numeric($atts['width'])) ? $atts['width'] : '400'; 539 } 540 return '<iframe width="' . $width . '" height="' . $height . '" src="https://www.bitchute.com/embed/' . $vidID . '?html5=1' . $autoplay . '" frameborder="0" allowfullscreen="true"></iframe>'; 541 } 542 543 public function shortcode_dailymotion($atts = [], $content = null) 544 { 545 if (!$content) { 546 return 'No DailyMotion Video ID Set'; 547 } 548 $vidID = $content; 549 $height = '330'; 550 $width = '400'; 551 if (!$atts) { 552 $match = []; 467 553 $atts = $this->attributefix($atts); 468 $url = trim(array_shift($atts), '="'); 469 } 470 if (empty($url)) { return ''; } 471 if (empty($text)) { $text=$url; } 472 return '<a href="'.$url.'">'.$this->do_shortcode($content).'</a>'; 473 } 474 475 // Videos and Audio 476 477 function shortcode_freesound($atts = array(), $content = null) { 478 if ('' === $content) { return 'No Freesound Audio ID Set'; } 479 if (empty($atts)) { // [freesound]164929[/freesound] 554 $autoplay = $atts['autoplay'] === 'yes' ? '&autoplay=1' : ''; 555 $vidID = (preg_match('%(?:dailymotion(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed/)?|(?:video/)?)/|.*[?&]v=))([^"&?/ ]{11})%iu', $atts['url'], $match)) ? $match[1] : false; 556 $height = (isset($atts['height']) && is_numeric($atts['height'])) ? $atts['height'] : '330'; 557 $width = (isset($atts['width']) && is_numeric($atts['width'])) ? $atts['width'] : '400'; 558 } 559 return '<iframe width="' . $width . '" height="' . $height . '" src="https://www.dailymotion.com/embed/video/' . $vidID . '?html5=1' . $autoplay . '" frameborder="0" allowfullscreen="true"></iframe>'; 560 } 561 562 public function shortcode_freesound($atts = [], $content = null) 563 { 564 if (!$content) { 565 return 'No Freesound Audio ID Set'; 566 } 567 if (!$atts) { // [freesound]164929[/freesound] 480 568 $size = 'medium'; 481 569 } else { // [freesound=large]164929[/freesound] or [freesound=small]164929[/freesound] 482 $size = $this->attributefix($atts); 483 $size = trim(array_shift($size), '="'); 484 } 485 $vidID = $content; 570 $size = strtolower(trim(array_shift($this->attributefix($atts)), '="')); 571 } 486 572 switch ($size) { 487 573 case 'big': 488 574 case 'large': 489 575 case 'l': 490 return '<iframe frameborder="0" scrolling="no" src="http://www.freesound.org/embed/sound/iframe/' .$vidID.'/simple/large/" width="920" height="245"></iframe>';576 return '<iframe frameborder="0" scrolling="no" src="http://www.freesound.org/embed/sound/iframe/' . $content . '/simple/large/" width="920" height="245"></iframe>'; 491 577 case 'little': 492 578 case 'short': 493 579 case 'small': 494 580 case 's': 495 return '<iframe frameborder="0" scrolling="no" src="http://www.freesound.org/embed/sound/iframe/' .$vidID.'/simple/small/" width="375" height="30"></iframe>';581 return '<iframe frameborder="0" scrolling="no" src="http://www.freesound.org/embed/sound/iframe/' . $content . '/simple/small/" width="375" height="30"></iframe>'; 496 582 case 'mid': 497 583 case 'medium': 498 584 case 'm': 499 585 default: 500 return '<iframe frameborder="0" scrolling="no" src="http://www.freesound.org/embed/sound/iframe/'.$vidID.'/simple/medium/" width="481" height="86"></iframe>'; 501 } 502 } 503 504 function shortcode_gvideo($atts = array(), $content = null) { 505 if ('' === $content) { return 'No Google Video ID Set'; } 586 return '<iframe frameborder="0" scrolling="no" src="http://www.freesound.org/embed/sound/iframe/' . $content . '/simple/medium/" width="480" height="86"></iframe>'; 587 } 588 } 589 590 public function shortcode_gvideo($atts = [], $content = null) 591 { 592 if (!$content) { 593 return 'No Google Video ID Set'; 594 } 595 return '<embed style="width:400px;height:330px" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=' . $content . '&hl=en"></embed>'; 596 } 597 598 public function shortcode_vimeo($atts = [], $content = null) 599 { 600 if (!$content) { 601 return 'No Vimeo Video ID Set'; 602 } 506 603 $vidID = $content; 507 return '<embed style="width:400px;height:325px" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId='.$vidID.'&hl=en"></embed>'; 508 } 509 510 function shortcode_vimeo($atts = array(), $content = null) { 511 if ('' === $content) { return 'No Vimeo Video ID Set'; } 512 $vidID = $content; 513 $height = '325'; 604 $height = '330'; 514 605 $width = '400'; 515 if (!empty($atts)){ 606 if (!$atts) { 607 $match = []; 516 608 $atts = $this->attributefix($atts); 517 609 $autoplay = $atts['autoplay'] === 'yes' ? '&autoplay=1' : ''; 518 $vidID = (preg_match('~(?:<iframe [^>]*src=")?(?:https?:\/\/(?:[\w]+\.)*vimeo\.com(?:[\/\w]*\/videos?)?\/([0-9]+)[^\s]*)"?(?:[^>]*></iframe>)?(?:<p>.*</p>)?~i x', $atts['url'], $match)) ? $match[1] : false;519 $height = (isset($atts['height']) && is_numeric($atts['height'])) ? $atts['height'] : '3 25';610 $vidID = (preg_match('~(?:<iframe [^>]*src=")?(?:https?:\/\/(?:[\w]+\.)*vimeo\.com(?:[\/\w]*\/videos?)?\/([0-9]+)[^\s]*)"?(?:[^>]*></iframe>)?(?:<p>.*</p>)?~iux', $atts['url'], $match)) ? $match[1] : false; 611 $height = (isset($atts['height']) && is_numeric($atts['height'])) ? $atts['height'] : '330'; 520 612 $width = (isset($atts['width']) && is_numeric($atts['width'])) ? $atts['width'] : '400'; 521 613 } 522 return '<iframe width="'.$width.'" height="'.$height.'" src="//player.vimeo.com/video/'.$vidID.'?title=0&byline=0&portrait=0&color=ffffff'.$autoplay.'" frameborder="0" allowfullscreen="true"></iframe>'; 523 } 524 525 function shortcode_youtube($atts = array(), $content = null) { 526 if ('' === $content) { return 'No YouTube Video ID Set'; } 614 return '<iframe width="' . $width . '" height="' . $height . '" src="//player.vimeo.com/video/' . $vidID . '?title=0&byline=0&portrait=0&color=ffffff' . $autoplay . '" frameborder="0" allowfullscreen="true"></iframe>'; 615 } 616 617 public function shortcode_youtube($atts = [], $content = null) 618 { 619 if (!$content) { 620 return 'No YouTube Video ID Set'; 621 } 527 622 $vidID = $content; 528 $height = '3 25';623 $height = '330'; 529 624 $width = '400'; 530 if (!empty($atts)){ 625 if (!$atts) { 626 $match = []; 531 627 $atts = $this->attributefix($atts); 532 $autoplay = $atts['autoplay'] === 'yes' ? ' ?autoplay=1' : '';533 $vidID = (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i ', $atts['url'], $match)) ? $match[1] : false;534 $height = (isset($atts['height']) && is_numeric($atts['height'])) ? $atts['height'] : '3 25';628 $autoplay = $atts['autoplay'] === 'yes' ? '&autoplay=1' : ''; 629 $vidID = (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%iu', $atts['url'], $match)) ? $match[1] : false; 630 $height = (isset($atts['height']) && is_numeric($atts['height'])) ? $atts['height'] : '330'; 535 631 $width = (isset($atts['width']) && is_numeric($atts['width'])) ? $atts['width'] : '400'; 536 632 } 537 return '<iframe width="' .$width.'" height="'.$height.'" src="http://www.youtube.com/embed/'.$vidID.$autoplay.'" frameborder="0" allowfullscreen="true"></iframe>';633 return '<iframe width="' . $width . '" height="' . $height . '" src="https://www.youtube.com/embed/' . $vidID . '?html5=1' . $autoplay . '" frameborder="0" allowfullscreen="true"></iframe>'; 538 634 } 539 635 540 636 // Special/Miscellaneous Content 541 637 542 function shortcode_abbr($atts = array(), $content = null) { 543 if (null === $content || !isset($atts['title'])) { return ''; } 638 public function shortcode_abbr($atts = [], $content = null) 639 { 640 if (!$content || !isset($atts['title'])) { 641 return ''; 642 } 544 643 $atts = $this->attributefix($atts); 545 return '<abbr title="'.$atts['title'].'">'.$this->do_shortcode($content).'</abbr>'; 546 } 547 548 function shortcode_clientip($atts = array(), $content = null) { 644 return '<abbr title="' . $atts['title'] . '">' . $this->do_shortcode($content) . '</abbr>'; 645 } 646 647 public function shortcode_clientip($atts = [], $content = null) 648 { 549 649 return $_SERVER['REMOTE_ADDR']; 550 650 } 551 651 552 function shortcode_hr($atts = array(), $content = null) { 652 public function shortcode_hr($atts = [], $content = null) 653 { 553 654 return '<hr/>'; 554 655 } 555 656 556 function shortcode_note($atts = array(), $content = null) { 557 if (null === $content) { return ''; } 558 return '<!--'.$content.'-->'; 559 } 560 561 function shortcode_useragent($atts = array(), $content = null) { 657 public function shortcode_note($atts = [], $content = null) 658 { 659 return $content ? '<!--' . $content . '-->' : ''; 660 } 661 662 public function shortcode_useragent($atts = [], $content = null) 663 { 562 664 return $_SERVER['HTTP_USER_AGENT']; 563 665 } … … 565 667 // Hide and Display Content 566 668 567 function shortcode_spoiler($atts = array(), $content = null) { 568 if ($content === null) { return ''; } 569 if ($atts === '') { return '<div style="margin:20px;margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><strong>Spoiler: </strong><input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px" onClick="if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'\') { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'\'; this.innerText = \'\'; this.value = \'Hide\'; } else { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\'; this.innerText = \'\'; this.value = \'Show\'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;"><div style="display:none">'. $this->do_shortcode($content) .'</div></div></div>'; } 669 public function shortcode_spoiler($atts = [], $content = null) 670 { 671 if (!$content) { 672 return ''; 673 } 674 if (!$atts) { 675 return '<div style="margin:20px;margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><strong>Spoiler: </strong><input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px" onClick="if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'\') { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'\'; this.innerText = \'\'; this.value = \'Hide\'; } else { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\'; this.innerText = \'\'; this.value = \'Show\'; }"></div><div class="alt2" style="margin: 0px; padding: 4px; border: 1px inset;"><div style="display:none">' . $this->do_shortcode($content) . '</div></div></div>'; 676 } 570 677 $subattribs = substr(implode(' ', $atts), 1); 571 return '<div style="margin:20px;margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><strong>Spoiler</strong> for <em>'. $subattribs .'</em> <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px" onClick="if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'\') { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'\'; this.innerText = \'\'; this.value = \'Hide\'; } else { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\'; this.innerText = \'\'; this.value = \'Show\'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;"><div style="display:none">'. $this->do_shortcode($content) .'</div></div></div>'; 572 } 573 574 function shortcode_guest($atts = array(), $content = null) { 575 if ($content === null || is_user_logged_in()) { return ''; } 576 return '<div>'.$this->do_shortcode($content).'</div>'; 577 } 578 579 function shortcode_user($atts = array(), $content = null) { 580 if ($content === null || !is_user_logged_in()) { return ''; } 581 return '<div>'.$this->do_shortcode($content).'</div>'; 582 } 583 584 }?> 678 return '<div style="margin:20px;margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><strong>Spoiler</strong> for <em>' . $subattribs . '</em> <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px" onClick="if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'\') { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'\'; this.innerText = \'\'; this.value = \'Hide\'; } else { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\'; this.innerText = \'\'; this.value = \'Show\'; }"></div><div class="alt2" style="margin: 0px; padding: 4px; border: 1px inset;"><div style="display:none">' . $this->do_shortcode($content) . '</div></div></div>'; 679 } 680 681 public function shortcode_guest($atts = [], $content = null) 682 { 683 if (!$content || is_user_logged_in()) { 684 return ''; 685 } 686 return '<div>' . $this->do_shortcode($content) . '</div>'; 687 } 688 689 public function shortcode_user($atts = [], $content = null) 690 { 691 if (!$content || !is_user_logged_in()) { 692 return ''; 693 } 694 return '<div>' . $this->do_shortcode($content) . '</div>'; 695 } 696 } -
bbcode-deluxe/tags/2020.07.30/options-form-template.php
r2037928 r2349543 2 2 <h1>BBCode Deluxe</h1> 3 3 <p>BBCode (Bulletin Board Code) is a lightweight markup language used as an alternative to HTML for formatting. <a href="http://www.bbcode.org/reference.php">http://www.bbcode.org/reference.php</a></p> 4 <?php if ( $whitelist_enabled) {5 if ( $bbcodes_active) { ?>4 <?php if (isset($whitelist_enabled) && $whitelist_enabled) { 5 if (isset($bbcodes_active) && $bbcodes_active) { ?> 6 6 <p>BBCodes are enabled and <a href="http://wordpress.org/extend/plugins/bbpress2-shortcode-whitelist/">bbPress shortcode whitelist</a> has been detected as activated. Users should be able to use BBCodes in blogs, comments, and forums.</p> 7 7 <?php } else { ?> … … 62 62 <h3>Loaded Extensions</h3> 63 63 <ul><?php 64 $conf_array = get_loaded_extensions();65 foreach ($conf_array as $val_pair) {66 echo '<li>'.strval($val_pair).'</li>';67 }64 $conf_array = get_loaded_extensions(); 65 foreach ($conf_array as $val_pair) { 66 echo '<li>' . strval($val_pair) . '</li>'; 67 } 68 68 ?></ul> 69 69 </div> -
bbcode-deluxe/tags/2020.07.30/readme.txt
r2176519 r2349543 4 4 Tags: bbcode, bbpress, buddypress, bbpress-plugin, bbpress2, forum, html5, information, markup, nested-quotes, php-version, server-info, shortcode 5 5 Requires at least: 3.9 6 Tested up to: 5. 46 Tested up to: 5.5 7 7 Stable tag: trunk 8 8 License: GPLv3 … … 22 22 * Plugin URI: https://wordpress.org/plugins/bbcode-deluxe/ 23 23 * Description: Adds support for BBCode to Wordpress and BBPress 24 * Version: 20 19.10.2024 * Version: 2020.07.30 25 25 * Author: Devyn Collier Johnson (DevynCJohnson) 26 26 * Author URI: http://dcjtech.info/ … … 150 150 151 151 == Changelog == 152 = 2020.07.30 = 153 * Bug fixes & minor improvements 154 * Added support for BitChute & DailyMotion 155 * Made Youtube shortcodes use HTTPS and full embedding 152 156 = 2019.10.20 = 153 157 * Bug fixes -
bbcode-deluxe/trunk/bbcode-admin.php
r2037928 r2349543 1 1 <?php 2 2 3 function bbcode_deluxe_plugin_menu() { add_options_page('BBCode Deluxe', 'BBCode Deluxe', 'manage_options', 'bbcode-deluxe', 'bbcode_deluxe_plugin_options'); } 3 function bbcode_deluxe_plugin_menu() 4 { 5 add_options_page('BBCode Deluxe', 'BBCode Deluxe', 'manage_options', 'bbcode-deluxe', 'bbcode_deluxe_plugin_options'); 6 } 4 7 5 8 add_action('admin_menu', 'bbcode_deluxe_plugin_menu'); 6 9 7 function bbcode_deluxe_plugin_options() { 10 function bbcode_deluxe_plugin_options() 11 { 8 12 global $bbp_sc_whitelist; 9 13 if (is_admin() && current_user_can('manage_options')) { … … 12 16 if ($whitelist_enabled) { 13 17 $enabled_plugins = get_option('bbpscwl_enabled_plugins'); 14 if ($enabled_plugins === '') { $enabled_plugins = array(); } 15 else { $enabled_plugins = unserialize($enabled_plugins); } 18 if ($enabled_plugins) { 19 $enabled_plugins = unserialize($enabled_plugins); 20 } else { 21 $enabled_plugins = []; 22 } 16 23 $bbcodes_active = false; 17 24 foreach ($enabled_plugins as $plugin_tag) { 18 if ($plugin_tag === 'bbpress-bbcode') { $bbcodes_active = true; } 25 if ($plugin_tag === 'bbpress-bbcode') { 26 $bbcodes_active = true; 27 break; 28 } 19 29 } 20 30 } 21 require(dirname(__FILE__).'/options-form-template.php'); 22 } else { echo '<div><p>No options currently available.</p></div>'; } 31 require dirname(__FILE__) . '/options-form-template.php'; 32 } else { 33 echo '<div><p>No options currently available.</p></div>'; 34 } 23 35 } 24 25 ?> -
bbcode-deluxe/trunk/bbcode-deluxe.php
r2037957 r2349543 3 3 Plugin URI: http://dcjtech.info/ 4 4 Description: Adds support for BBCode to Wordpress and BBPress 5 Version: 20 19.02.245 Version: 2020.07.30 6 6 Author: Devyn Collier Johnson (DevynCJohnson) 7 7 Author URI: http://dcjtech.info/ … … 19 19 20 20 21 function quote_exempt_from_wptexturize($shortcodes) { 22 $shortcodes = ['quote', 'q', 'QUOTE', 'Q']; 23 return $shortcodes; 21 defined('ABSPATH') or die('Invalid entrance into the plugin BBCode Deluxe!'); 22 23 24 function quote_exempt_from_wptexturize($shortcodes) 25 { 26 return ['quote', 'q', 'QUOTE', 'Q']; 24 27 } 25 28 26 29 27 function code_exempt_from_wptexturize($shortcodes) {28 $shortcodes = ['no-highlight', 'pre', 'raw']; 29 return $shortcodes;30 function code_exempt_from_wptexturize($shortcodes) 31 { 32 return ['no-highlight', 'pre', 'raw']; 30 33 } 31 34 32 35 33 function caption_exempt_from_wptexturize($shortcodes) {34 $shortcodes[] = 'caption'; 35 return $shortcodes;36 function caption_exempt_from_wptexturize($shortcodes) 37 { 38 return ['caption']; 36 39 } 37 40 38 41 39 function nested_quotes($content, $not_used = false) { 42 function nested_quotes($content, $not_used = false) 43 { 40 44 $counter = 0; 41 45 $tag_counter_string = ''; 42 $content = preg_replace('/[\n\r]/', '', $content); 43 $content = str_replace('', '', $content); 44 $content = str_replace('[quote', '[', $content); 45 $content = str_replace('[/quote]', '[/]', $content); 46 $pos = strpos($content, '[/]'); 47 while ($pos !== false) { 48 $content = preg_replace('/(?<=\[)([^]*?)(?=\[\/\])/u', '[]$0[/]', $content, 1); 46 $content = preg_replace('/[\n\r]/gu', '', $content); 47 $content = str_replace('', '', $content); 48 $content = str_replace('[quote', '[', $content); 49 $content = str_replace('[/quote]', '[/]', $content); 50 while (strpos($content, '[/]')) { 51 $content = preg_replace('/(?<=\[)([^]*?)(?=\[\/\])/gu', '[]$0[/]', $content, 1); 49 52 $tag_counter_string = 'quote-'.strval($counter); 50 $content = str_replace(' []', $tag_counter_string, $content);51 $content = str_replace(' ][/', $tag_counter_string, $content);53 $content = str_replace('[]', $tag_counter_string, $content); 54 $content = str_replace('][/', $tag_counter_string, $content); 52 55 ++$counter; 53 $pos = strpos($content, '[/]');54 56 } 55 $content = str_replace('', "\n", $content); 56 return $content; 57 return str_replace('', "\n", $content); 57 58 } 58 59 59 60 60 function fix_captions($content, $not_used = false) { 61 $content = preg_replace('/[\n\r]/', '', $content); 62 $content = str_replace('', '', $content); 63 $content = str_replace('[/caption]', '', $content); 64 $content = str_replace('[caption', '', $content); 65 $content = preg_replace('/<\/a>([^>]*?)/u', '</a><figcaption class="wp-caption-text aligncenter">$0</figcaption></figure>', $content); 66 while (strpos($content, '') !== false) { 67 $content = preg_replace('/[^\]]*? align="alignleft"[^\]]*?\]/u', '<figure class="wp-caption alignleft">', $content); 68 $content = preg_replace('/[^\]]*? align="alignright"[^\]]*?\]/u', '<figure class="wp-caption alignright">', $content); 69 $content = preg_replace('/[^\]]*? align="aligncenter"[^\]]*?\]/u', '<figure class="wp-caption aligncenter">', $content); 70 $content = preg_replace('/[^\]]*? align="alignnone"[^\]]*?\]/u', '<figure class="wp-caption alignnone">', $content); 71 $content = preg_replace('/[^\]]*?\]/u', '<figure class="wp-caption">', $content); 72 $content = preg_replace('/size\-([a-z]*?) wp\-image\-/', 'size-$0 aligncenter wp-image-', $content); 73 $content = preg_replace('/wp\-image\-([0-9]*?) size\-/', 'size-$0 aligncenter wp-image-', $content); 61 function fix_captions($content, $not_used = false) 62 { 63 $content = preg_replace('/[\n\r]/gu', '', $content); 64 $content = str_replace('', '', $content); 65 $content = str_replace('[/caption]', '', $content); 66 $content = str_replace('[caption', '', $content); 67 $content = preg_replace('/<\/a>([^>]*?)/gu', '</a><figcaption class="wp-caption-text aligncenter">$0</figcaption></figure>', $content); 68 while (strpos($content, '')) { 69 $content = preg_replace('/[^\]]*? align="alignleft"[^\]]*?\]/gu', '<figure class="wp-caption alignleft">', $content); 70 $content = preg_replace('/[^\]]*? align="alignright"[^\]]*?\]/gu', '<figure class="wp-caption alignright">', $content); 71 $content = preg_replace('/[^\]]*? align="aligncenter"[^\]]*?\]/gu', '<figure class="wp-caption aligncenter">', $content); 72 $content = preg_replace('/[^\]]*? align="alignnone"[^\]]*?\]/gu', '<figure class="wp-caption alignnone">', $content); 73 $content = preg_replace('/[^\]]*?\]/gu', '<figure class="wp-caption">', $content); 74 $content = preg_replace('/size\-([A-Za-z0-9]*?) wp\-image\-/gu', 'size-$0 aligncenter wp-image-', $content); 75 $content = preg_replace('/wp\-image\-([A-Za-z0-9]*?) size\-/gu', 'size-$0 aligncenter wp-image-', $content); 74 76 } 75 $content = str_replace('', "\n", $content); 76 $content = str_replace('', '', $content); 77 $content = str_replace('', '', $content); 78 return $content; 77 $content = str_replace('', "\n", $content); 78 return str_replace('', '', str_replace('', '', $content)); 79 79 } 80 80 81 81 82 defined('ABSPATH') or die('Invalid entrance into the plugin BBCode Deluxe!');83 82 add_filter('no_texturize_shortcodes', 'caption_exempt_from_wptexturize', 8); 84 83 add_filter('no_texturize_shortcodes', 'code_exempt_from_wptexturize'); … … 92 91 add_filter('the_content', 'do_shortcode', 11); 93 92 add_filter('widget_text', 'do_shortcode', 11); 94 if (function_exists('get_comment_text')) { add_filter('get_comment_text', 'do_shortcode', 11); }95 if (function_exists('bbp_get_topic_content')) { add_filter('bbp_get_topic_content', 'do_shortcode', 11); }96 if (function_exists('bbp_get_reply_content')) { add_filter('bbp_get_reply_content', 'do_shortcode', 11); }97 if (function_exists('bp_get_activity_content_body')) { add_filter('bp_get_activity_content_body', 'do_shortcode', 11); }98 if (function_exists('bp_get_the_topic_post_content')) { add_filter('bp_get_the_topic_post_content', 'do_shortcode', 11); }99 if (function_exists('bp_get_the_thread_message_content')) { add_filter('bp_get_the_thread_message_content', 'do_shortcode', 11); }100 require_once(dirname(__FILE__).'/bbcode-admin.php');101 require_once(dirname(__FILE__).'/class-bbcode.php');102 add_action('plugins_loaded', function() { global $BBCode; $BBCode = new BBCode(); }, 14);103 93 104 ?> 94 if (function_exists('get_comment_text')) { 95 add_filter('get_comment_text', 'do_shortcode', 11); 96 } 97 if (function_exists('bbp_get_topic_content')) { 98 add_filter('bbp_get_topic_content', 'do_shortcode', 11); 99 } 100 if (function_exists('bbp_get_reply_content')) { 101 add_filter('bbp_get_reply_content', 'do_shortcode', 11); 102 } 103 if (function_exists('bp_get_activity_content_body')) { 104 add_filter('bp_get_activity_content_body', 'do_shortcode', 11); 105 } 106 if (function_exists('bp_get_the_topic_post_content')) { 107 add_filter('bp_get_the_topic_post_content', 'do_shortcode', 11); 108 } 109 if (function_exists('bp_get_the_thread_message_content')) { 110 add_filter('bp_get_the_thread_message_content', 'do_shortcode', 11); 111 } 112 113 require_once dirname(__FILE__) . '/bbcode-admin.php'; 114 require_once dirname(__FILE__) . '/class-bbcode.php'; 115 116 add_action( 117 'plugins_loaded', 118 function() { 119 global $BBCode; 120 $BBCode = new BBCode(); 121 }, 122 14 123 ); -
bbcode-deluxe/trunk/class-bbcode.php
r2037957 r2349543 1 <?php class BBCode { 2 3 public $use_whitelist = false; 4 function __construct() { 5 if (!function_exists('add_shortcode')) { return; } 1 <?php 2 3 class BBCode 4 { 5 6 private function __construct() 7 { 8 if (!function_exists('add_shortcode')) { 9 return; 10 } 6 11 // Shortcode Protection 7 12 add_shortcode('c', 'skip_enclosed_shortcodes'); … … 21 26 add_shortcode('sql', 'skip_enclosed_shortcodes'); 22 27 add_shortcode('xml', 'skip_enclosed_shortcodes'); 23 if (function_exists('tiny_mce_before_init')) { add_action('tiny_mce_before_init', 'tinymce_skip_enclosed_shortcodes'); } 28 if (function_exists('tiny_mce_before_init')) { 29 add_action('tiny_mce_before_init', 'tinymce_skip_enclosed_shortcodes'); 30 } 24 31 // Formatting + Style 25 add_shortcode('b', array(&$this, 'shortcode_bold'));26 add_shortcode('B', array(&$this, 'shortcode_bold'));27 add_shortcode('bold', array(&$this, 'shortcode_bold'));28 add_shortcode('BOLD', array(&$this, 'shortcode_bold'));29 add_shortcode('strong', array(&$this, 'shortcode_bold'));30 add_shortcode('STRONG', array(&$this, 'shortcode_bold'));31 add_shortcode('center', array(&$this, 'shortcode_center'));32 add_shortcode('CENTER', array(&$this, 'shortcode_center'));33 add_shortcode('color', array(&$this, 'shortcode_color'));34 add_shortcode('COLOR', array(&$this, 'shortcode_color'));35 add_shortcode('del', array(&$this, 'shortcode_del'));36 add_shortcode('DEL', array(&$this, 'shortcode_del'));37 add_shortcode('i', array(&$this, 'shortcode_italics'));38 add_shortcode('I', array(&$this, 'shortcode_italics'));39 add_shortcode('italic', array(&$this, 'shortcode_italics'));40 add_shortcode('ITALIC', array(&$this, 'shortcode_italics'));41 add_shortcode('em', array(&$this, 'shortcode_italics'));42 add_shortcode('EM', array(&$this, 'shortcode_italics'));43 add_shortcode('justify', array(&$this, 'shortcode_justify'));44 add_shortcode('JUSTIFY', array(&$this, 'shortcode_justify'));45 add_shortcode('left', array(&$this, 'shortcode_left'));46 add_shortcode('LEFT', array(&$this, 'shortcode_left'));47 add_shortcode('bdo', array(&$this, 'shortcode_reverse'));48 add_shortcode('BDO', array(&$this, 'shortcode_reverse'));49 add_shortcode('reverse', array(&$this, 'shortcode_reverse'));50 add_shortcode('REVERSE', array(&$this, 'shortcode_reverse'));51 add_shortcode('right', array(&$this, 'shortcode_right'));52 add_shortcode('RIGHT', array(&$this, 'shortcode_right'));53 add_shortcode('size', array(&$this, 'shortcode_size'));54 add_shortcode('SIZE', array(&$this, 'shortcode_size'));55 add_shortcode('s', array(&$this, 'shortcode_strikethrough'));56 add_shortcode('S', array(&$this, 'shortcode_strikethrough'));57 add_shortcode('strike', array(&$this, 'shortcode_strikethrough'));58 add_shortcode('STRIKE', array(&$this, 'shortcode_strikethrough'));59 add_shortcode('sub', array(&$this, 'shortcode_subscript'));60 add_shortcode('SUB', array(&$this, 'shortcode_subscript'));61 add_shortcode('sup', array(&$this, 'shortcode_superscript'));62 add_shortcode('SUP', array(&$this, 'shortcode_superscript'));63 add_shortcode('u', array(&$this, 'shortcode_underline'));64 add_shortcode('U', array(&$this, 'shortcode_underline'));65 add_shortcode('underline', array(&$this, 'shortcode_underline'));66 add_shortcode('UNDERLINE', array(&$this, 'shortcode_underline'));32 add_shortcode('b', [&$this, 'shortcode_bold']); 33 add_shortcode('B', [&$this, 'shortcode_bold']); 34 add_shortcode('bold', [&$this, 'shortcode_bold']); 35 add_shortcode('BOLD', [&$this, 'shortcode_bold']); 36 add_shortcode('strong', [&$this, 'shortcode_bold']); 37 add_shortcode('STRONG', [&$this, 'shortcode_bold']); 38 add_shortcode('center', [&$this, 'shortcode_center']); 39 add_shortcode('CENTER', [&$this, 'shortcode_center']); 40 add_shortcode('color', [&$this, 'shortcode_color']); 41 add_shortcode('COLOR', [&$this, 'shortcode_color']); 42 add_shortcode('del', [&$this, 'shortcode_del']); 43 add_shortcode('DEL', [&$this, 'shortcode_del']); 44 add_shortcode('i', [&$this, 'shortcode_italics']); 45 add_shortcode('I', [&$this, 'shortcode_italics']); 46 add_shortcode('italic', [&$this, 'shortcode_italics']); 47 add_shortcode('ITALIC', [&$this, 'shortcode_italics']); 48 add_shortcode('em', [&$this, 'shortcode_italics']); 49 add_shortcode('EM', [&$this, 'shortcode_italics']); 50 add_shortcode('justify', [&$this, 'shortcode_justify']); 51 add_shortcode('JUSTIFY', [&$this, 'shortcode_justify']); 52 add_shortcode('left', [&$this, 'shortcode_left']); 53 add_shortcode('LEFT', [&$this, 'shortcode_left']); 54 add_shortcode('bdo', [&$this, 'shortcode_reverse']); 55 add_shortcode('BDO', [&$this, 'shortcode_reverse']); 56 add_shortcode('reverse', [&$this, 'shortcode_reverse']); 57 add_shortcode('REVERSE', [&$this, 'shortcode_reverse']); 58 add_shortcode('right', [&$this, 'shortcode_right']); 59 add_shortcode('RIGHT', [&$this, 'shortcode_right']); 60 add_shortcode('size', [&$this, 'shortcode_size']); 61 add_shortcode('SIZE', [&$this, 'shortcode_size']); 62 add_shortcode('s', [&$this, 'shortcode_strikethrough']); 63 add_shortcode('S', [&$this, 'shortcode_strikethrough']); 64 add_shortcode('strike', [&$this, 'shortcode_strikethrough']); 65 add_shortcode('STRIKE', [&$this, 'shortcode_strikethrough']); 66 add_shortcode('sub', [&$this, 'shortcode_subscript']); 67 add_shortcode('SUB', [&$this, 'shortcode_subscript']); 68 add_shortcode('sup', [&$this, 'shortcode_superscript']); 69 add_shortcode('SUP', [&$this, 'shortcode_superscript']); 70 add_shortcode('u', [&$this, 'shortcode_underline']); 71 add_shortcode('U', [&$this, 'shortcode_underline']); 72 add_shortcode('underline', [&$this, 'shortcode_underline']); 73 add_shortcode('UNDERLINE', [&$this, 'shortcode_underline']); 67 74 // Quotes 68 add_shortcode('q', array(&$this, 'shortcode_quote'));69 add_shortcode('q-0', array(&$this, 'shortcode_quote'));70 add_shortcode('q-1', array(&$this, 'shortcode_quote'));71 add_shortcode('q-2', array(&$this, 'shortcode_quote'));72 add_shortcode('q-3', array(&$this, 'shortcode_quote'));73 add_shortcode('q-4', array(&$this, 'shortcode_quote'));74 add_shortcode('q-5', array(&$this, 'shortcode_quote'));75 add_shortcode('q-6', array(&$this, 'shortcode_quote'));76 add_shortcode('q-7', array(&$this, 'shortcode_quote'));77 add_shortcode('q-8', array(&$this, 'shortcode_quote'));78 add_shortcode('q-9', array(&$this, 'shortcode_quote'));79 add_shortcode('q-10', array(&$this, 'shortcode_quote'));80 add_shortcode('Q', array(&$this, 'shortcode_quote'));81 add_shortcode('Q-0', array(&$this, 'shortcode_quote'));82 add_shortcode('Q-1', array(&$this, 'shortcode_quote'));83 add_shortcode('Q-2', array(&$this, 'shortcode_quote'));84 add_shortcode('Q-3', array(&$this, 'shortcode_quote'));85 add_shortcode('Q-4', array(&$this, 'shortcode_quote'));86 add_shortcode('Q-5', array(&$this, 'shortcode_quote'));87 add_shortcode('Q-6', array(&$this, 'shortcode_quote'));88 add_shortcode('Q-7', array(&$this, 'shortcode_quote'));89 add_shortcode('Q-8', array(&$this, 'shortcode_quote'));90 add_shortcode('Q-9', array(&$this, 'shortcode_quote'));91 add_shortcode('Q-10', array(&$this, 'shortcode_quote'));92 add_shortcode('quote', array(&$this, 'shortcode_quote'));93 add_shortcode('quote-0', array(&$this, 'shortcode_quote'));94 add_shortcode('quote-1', array(&$this, 'shortcode_quote'));95 add_shortcode('quote-2', array(&$this, 'shortcode_quote'));96 add_shortcode('quote-3', array(&$this, 'shortcode_quote'));97 add_shortcode('quote-4', array(&$this, 'shortcode_quote'));98 add_shortcode('quote-5', array(&$this, 'shortcode_quote'));99 add_shortcode('quote-6', array(&$this, 'shortcode_quote'));100 add_shortcode('quote-7', array(&$this, 'shortcode_quote'));101 add_shortcode('quote-8', array(&$this, 'shortcode_quote'));102 add_shortcode('quote-9', array(&$this, 'shortcode_quote'));103 add_shortcode('quote-10', array(&$this, 'shortcode_quote'));104 add_shortcode('quote-11', array(&$this, 'shortcode_quote'));105 add_shortcode('quote-12', array(&$this, 'shortcode_quote'));106 add_shortcode('quote-13', array(&$this, 'shortcode_quote'));107 add_shortcode('quote-14', array(&$this, 'shortcode_quote'));108 add_shortcode('quote-15', array(&$this, 'shortcode_quote'));109 add_shortcode('quote-16', array(&$this, 'shortcode_quote'));110 add_shortcode('quote-17', array(&$this, 'shortcode_quote'));111 add_shortcode('quote-18', array(&$this, 'shortcode_quote'));112 add_shortcode('quote-19', array(&$this, 'shortcode_quote'));113 add_shortcode('quote-20', array(&$this, 'shortcode_quote'));114 add_shortcode('quote-21', array(&$this, 'shortcode_quote'));115 add_shortcode('quote-22', array(&$this, 'shortcode_quote'));116 add_shortcode('quote-23', array(&$this, 'shortcode_quote'));117 add_shortcode('quote-24', array(&$this, 'shortcode_quote'));118 add_shortcode('quote-25', array(&$this, 'shortcode_quote'));119 add_shortcode('quote-26', array(&$this, 'shortcode_quote'));120 add_shortcode('quote-27', array(&$this, 'shortcode_quote'));121 add_shortcode('quote-28', array(&$this, 'shortcode_quote'));122 add_shortcode('quote-29', array(&$this, 'shortcode_quote'));123 add_shortcode('quote-30', array(&$this, 'shortcode_quote'));124 add_shortcode('quote-31', array(&$this, 'shortcode_quote'));125 add_shortcode('quote-32', array(&$this, 'shortcode_quote'));126 add_shortcode('quote-33', array(&$this, 'shortcode_quote'));127 add_shortcode('quote-34', array(&$this, 'shortcode_quote'));128 add_shortcode('quote-35', array(&$this, 'shortcode_quote'));129 add_shortcode('quote-36', array(&$this, 'shortcode_quote'));130 add_shortcode('quote-37', array(&$this, 'shortcode_quote'));131 add_shortcode('quote-38', array(&$this, 'shortcode_quote'));132 add_shortcode('quote-39', array(&$this, 'shortcode_quote'));133 add_shortcode('quote-40', array(&$this, 'shortcode_quote'));134 add_shortcode('quote-41', array(&$this, 'shortcode_quote'));135 add_shortcode('quote-42', array(&$this, 'shortcode_quote'));136 add_shortcode('quote-43', array(&$this, 'shortcode_quote'));137 add_shortcode('quote-44', array(&$this, 'shortcode_quote'));138 add_shortcode('quote-45', array(&$this, 'shortcode_quote'));139 add_shortcode('quote-46', array(&$this, 'shortcode_quote'));140 add_shortcode('quote-47', array(&$this, 'shortcode_quote'));141 add_shortcode('quote-48', array(&$this, 'shortcode_quote'));142 add_shortcode('quote-49', array(&$this, 'shortcode_quote'));143 add_shortcode('QUOTE', array(&$this, 'shortcode_quote'));144 add_shortcode('QUOTE-0', array(&$this, 'shortcode_quote'));145 add_shortcode('QUOTE-1', array(&$this, 'shortcode_quote'));146 add_shortcode('QUOTE-2', array(&$this, 'shortcode_quote'));147 add_shortcode('QUOTE-3', array(&$this, 'shortcode_quote'));148 add_shortcode('QUOTE-4', array(&$this, 'shortcode_quote'));149 add_shortcode('QUOTE-5', array(&$this, 'shortcode_quote'));150 add_shortcode('QUOTE-6', array(&$this, 'shortcode_quote'));151 add_shortcode('QUOTE-7', array(&$this, 'shortcode_quote'));152 add_shortcode('QUOTE-8', array(&$this, 'shortcode_quote'));153 add_shortcode('QUOTE-9', array(&$this, 'shortcode_quote'));154 add_shortcode('QUOTE-10', array(&$this, 'shortcode_quote'));155 add_shortcode('cite', array(&$this, 'shortcode_cite'));156 add_shortcode('CITE', array(&$this, 'shortcode_cite'));75 add_shortcode('q', [&$this, 'shortcode_quote']); 76 add_shortcode('q-0', [&$this, 'shortcode_quote']); 77 add_shortcode('q-1', [&$this, 'shortcode_quote']); 78 add_shortcode('q-2', [&$this, 'shortcode_quote']); 79 add_shortcode('q-3', [&$this, 'shortcode_quote']); 80 add_shortcode('q-4', [&$this, 'shortcode_quote']); 81 add_shortcode('q-5', [&$this, 'shortcode_quote']); 82 add_shortcode('q-6', [&$this, 'shortcode_quote']); 83 add_shortcode('q-7', [&$this, 'shortcode_quote']); 84 add_shortcode('q-8', [&$this, 'shortcode_quote']); 85 add_shortcode('q-9', [&$this, 'shortcode_quote']); 86 add_shortcode('q-10', [&$this, 'shortcode_quote']); 87 add_shortcode('Q', [&$this, 'shortcode_quote']); 88 add_shortcode('Q-0', [&$this, 'shortcode_quote']); 89 add_shortcode('Q-1', [&$this, 'shortcode_quote']); 90 add_shortcode('Q-2', [&$this, 'shortcode_quote']); 91 add_shortcode('Q-3', [&$this, 'shortcode_quote']); 92 add_shortcode('Q-4', [&$this, 'shortcode_quote']); 93 add_shortcode('Q-5', [&$this, 'shortcode_quote']); 94 add_shortcode('Q-6', [&$this, 'shortcode_quote']); 95 add_shortcode('Q-7', [&$this, 'shortcode_quote']); 96 add_shortcode('Q-8', [&$this, 'shortcode_quote']); 97 add_shortcode('Q-9', [&$this, 'shortcode_quote']); 98 add_shortcode('Q-10', [&$this, 'shortcode_quote']); 99 add_shortcode('quote', [&$this, 'shortcode_quote']); 100 add_shortcode('quote-0', [&$this, 'shortcode_quote']); 101 add_shortcode('quote-1', [&$this, 'shortcode_quote']); 102 add_shortcode('quote-2', [&$this, 'shortcode_quote']); 103 add_shortcode('quote-3', [&$this, 'shortcode_quote']); 104 add_shortcode('quote-4', [&$this, 'shortcode_quote']); 105 add_shortcode('quote-5', [&$this, 'shortcode_quote']); 106 add_shortcode('quote-6', [&$this, 'shortcode_quote']); 107 add_shortcode('quote-7', [&$this, 'shortcode_quote']); 108 add_shortcode('quote-8', [&$this, 'shortcode_quote']); 109 add_shortcode('quote-9', [&$this, 'shortcode_quote']); 110 add_shortcode('quote-10', [&$this, 'shortcode_quote']); 111 add_shortcode('quote-11', [&$this, 'shortcode_quote']); 112 add_shortcode('quote-12', [&$this, 'shortcode_quote']); 113 add_shortcode('quote-13', [&$this, 'shortcode_quote']); 114 add_shortcode('quote-14', [&$this, 'shortcode_quote']); 115 add_shortcode('quote-15', [&$this, 'shortcode_quote']); 116 add_shortcode('quote-16', [&$this, 'shortcode_quote']); 117 add_shortcode('quote-17', [&$this, 'shortcode_quote']); 118 add_shortcode('quote-18', [&$this, 'shortcode_quote']); 119 add_shortcode('quote-19', [&$this, 'shortcode_quote']); 120 add_shortcode('quote-20', [&$this, 'shortcode_quote']); 121 add_shortcode('quote-21', [&$this, 'shortcode_quote']); 122 add_shortcode('quote-22', [&$this, 'shortcode_quote']); 123 add_shortcode('quote-23', [&$this, 'shortcode_quote']); 124 add_shortcode('quote-24', [&$this, 'shortcode_quote']); 125 add_shortcode('quote-25', [&$this, 'shortcode_quote']); 126 add_shortcode('quote-26', [&$this, 'shortcode_quote']); 127 add_shortcode('quote-27', [&$this, 'shortcode_quote']); 128 add_shortcode('quote-28', [&$this, 'shortcode_quote']); 129 add_shortcode('quote-29', [&$this, 'shortcode_quote']); 130 add_shortcode('quote-30', [&$this, 'shortcode_quote']); 131 add_shortcode('quote-31', [&$this, 'shortcode_quote']); 132 add_shortcode('quote-32', [&$this, 'shortcode_quote']); 133 add_shortcode('quote-33', [&$this, 'shortcode_quote']); 134 add_shortcode('quote-34', [&$this, 'shortcode_quote']); 135 add_shortcode('quote-35', [&$this, 'shortcode_quote']); 136 add_shortcode('quote-36', [&$this, 'shortcode_quote']); 137 add_shortcode('quote-37', [&$this, 'shortcode_quote']); 138 add_shortcode('quote-38', [&$this, 'shortcode_quote']); 139 add_shortcode('quote-39', [&$this, 'shortcode_quote']); 140 add_shortcode('quote-40', [&$this, 'shortcode_quote']); 141 add_shortcode('quote-41', [&$this, 'shortcode_quote']); 142 add_shortcode('quote-42', [&$this, 'shortcode_quote']); 143 add_shortcode('quote-43', [&$this, 'shortcode_quote']); 144 add_shortcode('quote-44', [&$this, 'shortcode_quote']); 145 add_shortcode('quote-45', [&$this, 'shortcode_quote']); 146 add_shortcode('quote-46', [&$this, 'shortcode_quote']); 147 add_shortcode('quote-47', [&$this, 'shortcode_quote']); 148 add_shortcode('quote-48', [&$this, 'shortcode_quote']); 149 add_shortcode('quote-49', [&$this, 'shortcode_quote']); 150 add_shortcode('QUOTE', [&$this, 'shortcode_quote']); 151 add_shortcode('QUOTE-0', [&$this, 'shortcode_quote']); 152 add_shortcode('QUOTE-1', [&$this, 'shortcode_quote']); 153 add_shortcode('QUOTE-2', [&$this, 'shortcode_quote']); 154 add_shortcode('QUOTE-3', [&$this, 'shortcode_quote']); 155 add_shortcode('QUOTE-4', [&$this, 'shortcode_quote']); 156 add_shortcode('QUOTE-5', [&$this, 'shortcode_quote']); 157 add_shortcode('QUOTE-6', [&$this, 'shortcode_quote']); 158 add_shortcode('QUOTE-7', [&$this, 'shortcode_quote']); 159 add_shortcode('QUOTE-8', [&$this, 'shortcode_quote']); 160 add_shortcode('QUOTE-9', [&$this, 'shortcode_quote']); 161 add_shortcode('QUOTE-10', [&$this, 'shortcode_quote']); 162 add_shortcode('cite', [&$this, 'shortcode_cite']); 163 add_shortcode('CITE', [&$this, 'shortcode_cite']); 157 164 // Code 158 add_shortcode('code', array(&$this, 'shortcode_code'));159 add_shortcode('CODE', array(&$this, 'shortcode_code'));160 add_shortcode('kbd', array(&$this, 'shortcode_kbd'));161 add_shortcode('KBD', array(&$this, 'shortcode_kbd'));162 add_shortcode('key', array(&$this, 'shortcode_kbd'));163 add_shortcode('KEY', array(&$this, 'shortcode_kbd'));164 add_shortcode('keyboard', array(&$this, 'shortcode_kbd'));165 add_shortcode('KEYBOARD', array(&$this, 'shortcode_kbd'));165 add_shortcode('code', [&$this, 'shortcode_code']); 166 add_shortcode('CODE', [&$this, 'shortcode_code']); 167 add_shortcode('kbd', [&$this, 'shortcode_kbd']); 168 add_shortcode('KBD', [&$this, 'shortcode_kbd']); 169 add_shortcode('key', [&$this, 'shortcode_kbd']); 170 add_shortcode('KEY', [&$this, 'shortcode_kbd']); 171 add_shortcode('keyboard', [&$this, 'shortcode_kbd']); 172 add_shortcode('KEYBOARD', [&$this, 'shortcode_kbd']); 166 173 // Lists 167 add_shortcode('ol', array(&$this, 'shortcode_orderedlist'));168 add_shortcode('OL', array(&$this, 'shortcode_orderedlist'));169 add_shortcode('ul', array(&$this, 'shortcode_unorderedlist'));170 add_shortcode('UL', array(&$this, 'shortcode_unorderedlist'));171 add_shortcode('list', array(&$this, 'shortcode_unorderedlist'));172 add_shortcode('LIST', array(&$this, 'shortcode_unorderedlist'));173 add_shortcode('li', array(&$this, 'shortcode_listitem'));174 add_shortcode('LI', array(&$this, 'shortcode_listitem'));174 add_shortcode('ol', [&$this, 'shortcode_orderedlist']); 175 add_shortcode('OL', [&$this, 'shortcode_orderedlist']); 176 add_shortcode('ul', [&$this, 'shortcode_unorderedlist']); 177 add_shortcode('UL', [&$this, 'shortcode_unorderedlist']); 178 add_shortcode('list', [&$this, 'shortcode_unorderedlist']); 179 add_shortcode('LIST', [&$this, 'shortcode_unorderedlist']); 180 add_shortcode('li', [&$this, 'shortcode_listitem']); 181 add_shortcode('LI', [&$this, 'shortcode_listitem']); 175 182 // Tables 176 add_shortcode('table', array(&$this, 'shortcode_table'));177 add_shortcode('TABLE', array(&$this, 'shortcode_table'));178 add_shortcode('thead', array(&$this, 'shortcode_thead'));179 add_shortcode('THEAD', array(&$this, 'shortcode_thead'));180 add_shortcode('tbody', array(&$this, 'shortcode_tbody'));181 add_shortcode('TBODY', array(&$this, 'shortcode_tbody'));182 add_shortcode('tfoot', array(&$this, 'shortcode_tfoot'));183 add_shortcode('TFOOT', array(&$this, 'shortcode_tfoot'));184 add_shortcode('th', array(&$this, 'shortcode_th'));185 add_shortcode('TH', array(&$this, 'shortcode_th'));186 add_shortcode('tr', array(&$this, 'shortcode_tr'));187 add_shortcode('TR', array(&$this, 'shortcode_tr'));188 add_shortcode('td', array(&$this, 'shortcode_td'));189 add_shortcode('TD', array(&$this, 'shortcode_td'));183 add_shortcode('table', [&$this, 'shortcode_table']); 184 add_shortcode('TABLE', [&$this, 'shortcode_table']); 185 add_shortcode('thead', [&$this, 'shortcode_thead']); 186 add_shortcode('THEAD', [&$this, 'shortcode_thead']); 187 add_shortcode('tbody', [&$this, 'shortcode_tbody']); 188 add_shortcode('TBODY', [&$this, 'shortcode_tbody']); 189 add_shortcode('tfoot', [&$this, 'shortcode_tfoot']); 190 add_shortcode('TFOOT', [&$this, 'shortcode_tfoot']); 191 add_shortcode('th', [&$this, 'shortcode_th']); 192 add_shortcode('TH', [&$this, 'shortcode_th']); 193 add_shortcode('tr', [&$this, 'shortcode_tr']); 194 add_shortcode('TR', [&$this, 'shortcode_tr']); 195 add_shortcode('td', [&$this, 'shortcode_td']); 196 add_shortcode('TD', [&$this, 'shortcode_td']); 190 197 // Links and Images 191 add_shortcode('email', array(&$this, 'shortcode_email'));192 add_shortcode('EMAIL', array(&$this, 'shortcode_email'));193 add_shortcode('tel', array(&$this, 'shortcode_telephone'));194 add_shortcode('TEL', array(&$this, 'shortcode_telephone'));195 add_shortcode('img', array(&$this, 'shortcode_image'));196 add_shortcode('IMG', array(&$this, 'shortcode_image'));197 add_shortcode('url', array(&$this, 'shortcode_url'));198 add_shortcode('URL', array(&$this, 'shortcode_url'));199 add_shortcode('link', array(&$this, 'shortcode_url'));200 add_shortcode('LINK', array(&$this, 'shortcode_url'));198 add_shortcode('email', [&$this, 'shortcode_email']); 199 add_shortcode('EMAIL', [&$this, 'shortcode_email']); 200 add_shortcode('tel', [&$this, 'shortcode_telephone']); 201 add_shortcode('TEL', [&$this, 'shortcode_telephone']); 202 add_shortcode('img', [&$this, 'shortcode_image']); 203 add_shortcode('IMG', [&$this, 'shortcode_image']); 204 add_shortcode('url', [&$this, 'shortcode_url']); 205 add_shortcode('URL', [&$this, 'shortcode_url']); 206 add_shortcode('link', [&$this, 'shortcode_url']); 207 add_shortcode('LINK', [&$this, 'shortcode_url']); 201 208 // Videos and Audio 202 add_shortcode('freesound', array(&$this, 'shortcode_freesound')); 203 add_shortcode('FREESOUND', array(&$this, 'shortcode_freesound')); 204 add_shortcode('gvideo', array(&$this, 'shortcode_gvideo')); 205 add_shortcode('GVIDEO', array(&$this, 'shortcode_gvideo')); 206 add_shortcode('vimeo', array(&$this, 'shortcode_vimeo')); 207 add_shortcode('VIMEO', array(&$this, 'shortcode_vimeo')); 208 add_shortcode('youtube', array(&$this, 'shortcode_youtube')); 209 add_shortcode('YOUTUBE', array(&$this, 'shortcode_youtube')); 209 add_shortcode('bitchute', [&$this, 'shortcode_bitchute']); 210 add_shortcode('BITCHUTE', [&$this, 'shortcode_bitchute']); 211 add_shortcode('dailymotion', [&$this, 'shortcode_dailymotion']); 212 add_shortcode('DAILYMOTION', [&$this, 'shortcode_dailymotion']); 213 add_shortcode('freesound', [&$this, 'shortcode_freesound']); 214 add_shortcode('FREESOUND', [&$this, 'shortcode_freesound']); 215 add_shortcode('gvideo', [&$this, 'shortcode_gvideo']); 216 add_shortcode('GVIDEO', [&$this, 'shortcode_gvideo']); 217 add_shortcode('vimeo', [&$this, 'shortcode_vimeo']); 218 add_shortcode('VIMEO', [&$this, 'shortcode_vimeo']); 219 add_shortcode('youtube', [&$this, 'shortcode_youtube']); 220 add_shortcode('YOUTUBE', [&$this, 'shortcode_youtube']); 210 221 // Special/Miscellaneous Content 211 add_shortcode('abbr', array(&$this, 'shortcode_abbr'));212 add_shortcode('ABBR', array(&$this, 'shortcode_abbr'));213 add_shortcode('acronym', array(&$this, 'shortcode_abbr'));214 add_shortcode('ACRONYM', array(&$this, 'shortcode_abbr'));215 add_shortcode('ip', array(&$this, 'shortcode_clientip'));216 add_shortcode('IP', array(&$this, 'shortcode_clientip'));217 add_shortcode('hr', array(&$this, 'shortcode_hr'));218 add_shortcode('HR', array(&$this, 'shortcode_hr'));219 add_shortcode('note', array(&$this, 'shortcode_note'));220 add_shortcode('NOTE', array(&$this, 'shortcode_note'));221 add_shortcode('useragent', array(&$this, 'shortcode_useragent'));222 add_shortcode('USERAGENT', array(&$this, 'shortcode_useragent'));222 add_shortcode('abbr', [&$this, 'shortcode_abbr']); 223 add_shortcode('ABBR', [&$this, 'shortcode_abbr']); 224 add_shortcode('acronym', [&$this, 'shortcode_abbr']); 225 add_shortcode('ACRONYM', [&$this, 'shortcode_abbr']); 226 add_shortcode('ip', [&$this, 'shortcode_clientip']); 227 add_shortcode('IP', [&$this, 'shortcode_clientip']); 228 add_shortcode('hr', [&$this, 'shortcode_hr']); 229 add_shortcode('HR', [&$this, 'shortcode_hr']); 230 add_shortcode('note', [&$this, 'shortcode_note']); 231 add_shortcode('NOTE', [&$this, 'shortcode_note']); 232 add_shortcode('useragent', [&$this, 'shortcode_useragent']); 233 add_shortcode('USERAGENT', [&$this, 'shortcode_useragent']); 223 234 // Hide and Display Content 224 add_shortcode('spoiler', array(&$this, 'shortcode_spoiler'));225 add_shortcode('SPOILER', array(&$this, 'shortcode_spoiler'));226 add_shortcode('user', array(&$this, 'shortcode_user'));227 add_shortcode('USER', array(&$this, 'shortcode_user'));228 add_shortcode('guest', array(&$this, 'shortcode_guest'));229 add_shortcode('GUEST', array(&$this, 'shortcode_guest'));235 add_shortcode('spoiler', [&$this, 'shortcode_spoiler']); 236 add_shortcode('SPOILER', [&$this, 'shortcode_spoiler']); 237 add_shortcode('user', [&$this, 'shortcode_user']); 238 add_shortcode('USER', [&$this, 'shortcode_user']); 239 add_shortcode('guest', [&$this, 'shortcode_guest']); 240 add_shortcode('GUEST', [&$this, 'shortcode_guest']); 230 241 $this->use_whitelist = false; 231 if (function_exists('bbp_whitelist_do_shortcode')) { $this->use_whitelist = true; } 232 } 233 234 function do_shortcode($content) { 235 if (function_exists('bbp_whitelist_do_shortcode')) { return bbp_whitelist_do_shortcode($content); } 236 else { return do_shortcode($content); } 237 } 238 239 function attributefix($atts = array()) { 240 if (empty($atts[0])) { return $atts; } 241 if (0 !== preg_match('#=("|\')(.*?)("|\')#', $atts[0], $match)) { $atts[0] = $match[2]; } 242 if (function_exists('bbp_whitelist_do_shortcode')) { 243 $this->use_whitelist = true; 244 } 245 } 246 247 public function do_shortcode($content) 248 { 249 if (function_exists('bbp_whitelist_do_shortcode')) { 250 return bbp_whitelist_do_shortcode($content); 251 } 252 return do_shortcode($content); 253 } 254 255 public function attributefix($atts = []) 256 { 257 if (empty($atts[0])) { 258 return $atts; 259 } 260 $match = []; 261 if (preg_match('#=("|\')(.*?)("|\')#u', $atts[0], $match) !== 0) { 262 $atts[0] = $match[2]; 263 } 242 264 return $atts; 243 265 } 244 266 245 267 246 / / SHORTCODES //268 /* SHORTCODES */ 247 269 248 270 249 271 // Shortcode Protection 250 272 251 function skip_enclosed_shortcodes($atts, $content = null) { 273 public function skip_enclosed_shortcodes($atts, $content = null) 274 { 252 275 return $content; 253 276 } 254 277 255 function tinymce_skip_enclosed_shortcodes($datainput) { 278 public function tinymce_skip_enclosed_shortcodes($datainput) 279 { 256 280 $datainput['protect'] = "[/\<\?php[\s\S]*?\?\>/g, /\[insert_php\][\s\S]*?\[\/insert_php\]/g, /\[ignore_code\][\s\S]*?\[\/ignore_code\]/g]"; 257 281 return $datainput; … … 260 284 // Formatting + Style 261 285 262 function shortcode_bold($atts = array(), $content = null) { 263 if (null === $content) { return ''; } 264 return '<strong>'.$this->do_shortcode($content).'</strong>'; 265 } 266 267 function shortcode_center($atts = array(), $content = null) { 268 if (null === $content) { return ''; } 269 return '<span style="text-align:center">'.$this->do_shortcode($content).'</span>'; 270 } 271 272 function shortcode_color($atts = array(), $content = null) { 273 if (null === $content || '' === $atts) { return ''; } 274 $color = substr(implode('', $atts), 1); 275 if (ctype_xdigit($color)) { $color = '#'.$color; } 276 return '<span style="color:'.$color.'">'.$this->do_shortcode($content).'</span>'; 277 } 278 279 function shortcode_del($atts = array(), $content = null) { 280 if (null === $content) { return ''; } 281 return '<del>'.$this->do_shortcode($content).'</del>'; 282 } 283 284 function shortcode_italics($atts = array(), $content = null) { 285 if (null === $content) { return ''; } 286 return '<em>'.$this->do_shortcode($content).'</em>'; 287 } 288 289 function shortcode_justify($atts = array(), $content = null) { 290 if (null === $content) { return ''; } 291 return '<span style="text-align:justify">'.$this->do_shortcode($content).'</span>'; 292 } 293 294 function shortcode_left($atts = array(), $content = null) { 295 if (null === $content) { return ''; } 296 return '<span style="text-align:left">'.$this->do_shortcode($content).'</span>'; 297 } 298 299 function shortcode_reverse($atts = array(), $content = null) { 300 if (null === $content) { return ''; } 301 return '<bdo dir="rtl">'.$this->do_shortcode($content).'</bdo>'; 302 } 303 304 function shortcode_right($atts = array(), $content = null) { 305 if (null === $content) { return ''; } 306 return '<span style="text-align:right">'.$this->do_shortcode($content).'</span>'; 307 } 308 309 function shortcode_size($atts = array(), $content = null) { 310 if (null === $content || '' === $atts) { return ''; } 311 $subattribs = substr(implode('', $atts), 1); 312 return '<span style="font-size:'.$subattribs.'px">'.$this->do_shortcode($content).'</span>'; 313 } 314 315 function shortcode_strikethrough($atts = array(), $content = null) { 316 if (null === $content) { return ''; } 317 return '<s>'.$this->do_shortcode($content).'</s>'; 318 } 319 320 function shortcode_subscript($atts = array(), $content = null) { 321 if (null === $content) { return ''; } 322 return '<sub>'.$this->do_shortcode($content).'</sub>'; 323 } 324 325 function shortcode_superscript($atts = array(), $content = null) { 326 if (null === $content) { return ''; } 327 return '<sup>'.$this->do_shortcode($content).'</sup>'; 328 } 329 330 function shortcode_underline($atts = array(), $content = null) { 331 if (null === $content) { return ''; } 332 return '<span style="text-decoration:underline">'.$this->do_shortcode($content).'</span>'; 286 public function shortcode_bold($atts = [], $content = null) 287 { 288 return $content ? '<strong>' . $this->do_shortcode($content) . '</strong>' : ''; 289 } 290 291 public function shortcode_center($atts = [], $content = null) 292 { 293 return $content ? '<span style="text-align:center">' . $this->do_shortcode($content) . '</span>' : ''; 294 } 295 296 public function shortcode_color($atts = [], $content = null) 297 { 298 if (!$content || !$atts) { 299 return ''; 300 } 301 $color = mb_substr(implode('', $atts), 1); 302 if (ctype_xdigit($color)) { 303 $color = '#' . $color; 304 } 305 return '<span style="color:' . $color . '">' . $this->do_shortcode($content) . '</span>'; 306 } 307 308 public function shortcode_del($atts = [], $content = null) 309 { 310 return $content ? '<del>' . $this->do_shortcode($content) . '</del>' : ''; 311 } 312 313 public function shortcode_italics($atts = [], $content = null) 314 { 315 return $content ? '<em>' . $this->do_shortcode($content) . '</em>' : ''; 316 } 317 318 public function shortcode_justify($atts = [], $content = null) 319 { 320 return $content ? '<span style="text-align:justify">' . $this->do_shortcode($content) . '</span>' : ''; 321 } 322 323 public function shortcode_left($atts = [], $content = null) 324 { 325 return $content ? '<span style="text-align:left">' . $this->do_shortcode($content) . '</span>' : ''; 326 } 327 328 public function shortcode_reverse($atts = [], $content = null) 329 { 330 return $content ? '<bdo dir="rtl">' . $this->do_shortcode($content) . '</bdo>' : ''; 331 } 332 333 public function shortcode_right($atts = [], $content = null) 334 { 335 return $content ? '<span style="text-align:right">' . $this->do_shortcode($content) . '</span>' : ''; 336 } 337 338 public function shortcode_size($atts = [], $content = null) 339 { 340 if (!$content || !$atts) { 341 return ''; 342 } 343 $subattribs = mb_substr(implode('', $atts), 1); 344 return '<span style="font-size:' . $subattribs . 'px">' . $this->do_shortcode($content) . '</span>'; 345 } 346 347 public function shortcode_strikethrough($atts = [], $content = null) 348 { 349 return $content ? '<s>' . $this->do_shortcode($content) . '</s>' : ''; 350 } 351 352 public function shortcode_subscript($atts = [], $content = null) 353 { 354 return $content ? '<sub>' . $this->do_shortcode($content) . '</sub>' : ''; 355 } 356 357 public function shortcode_superscript($atts = [], $content = null) 358 { 359 return $content ? '<sup>' . $this->do_shortcode($content) . '</sup>' : ''; 360 } 361 362 public function shortcode_underline($atts = [], $content = null) 363 { 364 return $content ? '<span style="text-decoration:underline">' . $this->do_shortcode($content) . '</span>' : ''; 333 365 } 334 366 … … 336 368 // Quotes 337 369 338 function shortcode_quote($atts = array(), $content = null) { 370 public function shortcode_quote($atts = [], $content = null) 371 { 339 372 global $bp; 340 373 global $bbp; 341 $css_classes = array('bbcode-quote'); 342 if ($content === null) { return ''; } 343 elseif (empty($atts)){ 344 return '<div class="'.implode(' ',$css_classes).'"><blockquote>'.$this->do_shortcode($content).'</blockquote></div>'; 345 } else { 346 $name = trim(array_shift($atts), '="'); 347 $css_classes[] = 'bbcode-quote-'.$name; 348 $user = get_user_by('login', $name); 349 if (false !== $user){ 350 $css_classes[] = 'bbcode-quote-user'; 351 if (function_exists('bp_is_active')) { $name = '<a href="'.site_url().'/members/'.$user->user_login.'">'.$user->display_name.'</a>'; } 352 elseif ('bbPress' === get_class($bbp)) { $name = '<a href="'.site_url().'?bbp_user='.$user->ID.'">'.$user->display_name.'</a>'; } 353 else { $name = $user->display_name; } 374 if (!$content) { 375 return ''; 376 } 377 $css_classes = ['bbcode-quote']; 378 if (empty($atts)){ 379 return '<div class="' . implode(' ', $css_classes) . '"><blockquote>' . $this->do_shortcode($content) . '</blockquote></div>'; 380 } 381 $name = trim(array_shift($atts), '="'); 382 $css_classes[] = 'bbcode-quote-' . $name; 383 $user = get_user_by('login', $name); 384 if ($user) { 385 $css_classes[] = 'bbcode-quote-user'; 386 if (function_exists('bp_is_active')) { 387 $name = '<a href="' . site_url() . '/members/' . $user->user_login . '">' . $user->display_name . '</a>'; 388 } elseif (get_class($bbp) === 'bbPress') { 389 $name = '<a href="' . site_url() . '?bbp_user=' . $user->ID . '">' . $user->display_name . '</a>'; 390 } elseif ($user->display_name) { 391 $name = $user->display_name; 354 392 } 355 return '<div class="'.implode(' ', $css_classes).'"><strong>'.$name.' wrote: </strong><blockquote>'.$this->do_shortcode($content).'</blockquote></div>';356 }357 } 358 359 function shortcode_cite($atts = array(), $content = null) {360 if (null === $content) { return ''; }361 return '<cite>'.$this->do_shortcode($content).'</cite>';393 } 394 return '<div class="' . implode(' ', $css_classes) . '"><strong>' . $name . ' wrote: </strong><blockquote>' . $this->do_shortcode($content) . '</blockquote></div>'; 395 } 396 397 public function shortcode_cite($atts = [], $content = null) 398 { 399 return $content ? '<cite>' . $this->do_shortcode($content) . '</cite>' : ''; 362 400 } 363 401 364 402 // Code 365 403 366 function shortcode_code($atts = array(), $content = null) {367 if (null === $content) { return ''; }368 return '<code>'.$this->do_shortcode($content).'</code>';369 } 370 371 function shortcode_kbd($atts = array(), $content = null) {372 if (null === $content) { return ''; }373 return '<kbd>'.$this->do_shortcode($content).'</kbd>';404 public function shortcode_code($atts = [], $content = null) 405 { 406 return $content ? '<code>' . $this->do_shortcode($content) . '</code>' : ''; 407 } 408 409 public function shortcode_kbd($atts = [], $content = null) 410 { 411 return $content ? '<kbd>' . $this->do_shortcode($content) . '</kbd>' : ''; 374 412 } 375 413 376 414 // Lists 377 415 378 function shortcode_orderedlist($atts = array(), $content = null) {379 if (null === $content) { return ''; }380 return '<ol>'.$this->do_shortcode($content).'</ol>';381 } 382 383 function shortcode_unorderedlist($atts = array(), $content = null) {384 if (null === $content) { return ''; }385 return '<ul>'.$this->do_shortcode($content).'</ul>';386 } 387 388 function shortcode_listitem($atts = array(), $content = null) {389 if (null === $content) { return ''; }390 return '<li>'.$this->do_shortcode($content).'</li>';416 public function shortcode_orderedlist($atts = [], $content = null) 417 { 418 return $content ? '<ol>' . $this->do_shortcode($content) . '</ol>' : ''; 419 } 420 421 public function shortcode_unorderedlist($atts = [], $content = null) 422 { 423 return $content ? '<ul>' . $this->do_shortcode($content) . '</ul>' : ''; 424 } 425 426 public function shortcode_listitem($atts = [], $content = null) 427 { 428 return $content ? '<li>' . $this->do_shortcode($content) . '</li>' : ''; 391 429 } 392 430 393 431 // Tables 394 432 395 function shortcode_table($atts = array(), $content = null) {396 if (null === $content) { return ''; }397 return '<table>'.$this->do_shortcode($content).'</table>';398 } 399 400 function shortcode_thead($atts = array(), $content = null) {401 if (null === $content) { return ''; }402 return '<thead>'.$this->do_shortcode($content).'</thead>';403 } 404 405 function shortcode_tbody($atts = array(), $content = null) {406 if (null === $content) { return ''; }407 return '<tbody>'.$this->do_shortcode($content).'</tbody>';408 } 409 410 function shortcode_tfoot($atts = array(), $content = null) {411 if (null === $content) { return ''; }412 return '<tfoot>'.$this->do_shortcode($content).'</tfoot>';413 } 414 415 function shortcode_th($atts = array(), $content = null) {416 if (null === $content) { return ''; }417 return '<th>'.$this->do_shortcode($content).'</th>';418 } 419 420 function shortcode_tr($atts = array(), $content = null) {421 if (null === $content) { return ''; }422 return '<tr>'.$this->do_shortcode($content).'</tr>';423 } 424 425 function shortcode_td($atts = array(), $content = null) {426 if (null === $content) { return ''; }427 return '<td>'.$this->do_shortcode($content).'</td>';433 public function shortcode_table($atts = [], $content = null) 434 { 435 return $content ? '<table>' . $this->do_shortcode($content) . '</table>' : ''; 436 } 437 438 public function shortcode_thead($atts = [], $content = null) 439 { 440 return $content ? '<thead>' . $this->do_shortcode($content) . '</thead>' : ''; 441 } 442 443 public function shortcode_tbody($atts = [], $content = null) 444 { 445 return $content ? '<tbody>' . $this->do_shortcode($content) . '</tbody>' : ''; 446 } 447 448 public function shortcode_tfoot($atts = [], $content = null) 449 { 450 return $content ? '<tfoot>' . $this->do_shortcode($content) . '</tfoot>' : ''; 451 } 452 453 public function shortcode_th($atts = [], $content = null) 454 { 455 return $content ? '<th>' . $this->do_shortcode($content) . '</th>' : ''; 456 } 457 458 public function shortcode_tr($atts = [], $content = null) 459 { 460 return $content ? '<tr>' . $this->do_shortcode($content) . '</tr>' : ''; 461 } 462 463 public function shortcode_td($atts = [], $content = null) 464 { 465 return $content ? '<td>' . $this->do_shortcode($content) . '</td>' : ''; 428 466 } 429 467 430 468 // Links and Images 431 469 432 function shortcode_email($atts = array(), $content = null) { 433 if (empty($atts)) { // [email][email protected][/email] 434 $url = $content; 435 } else { // [[email protected]]text[/email] or [email="[email protected]"]text[/email] 436 $atts = $this->attributefix($atts); 437 $url = trim(array_shift($atts), '="'); 438 } 439 if (empty($url)) { return ''; } 470 public function shortcode_email($atts = [], $content = null) 471 { 472 $url = $content; // [email][email protected][/email] 473 if ($atts) { // [[email protected]]text[/email] or [email="[email protected]"]text[/email] 474 $url = trim(array_shift($this->attributefix($atts)), '="'); 475 } 476 if (!$url) { 477 return ''; 478 } 440 479 $url = str_replace(' at ', '@', str_replace(' ', ' ', $url)); 441 return '<a href="mailto:'.$url.'">'.$this->do_shortcode($content).'</a>'; 442 } 443 444 function shortcode_telephone($atts = array(), $content = null) { 445 if (empty($atts)) { // [tel]123-456-7890[/tel] 480 return '<a href="mailto:' . $url . '">' . $this->do_shortcode($content) . '</a>'; 481 } 482 483 public function shortcode_telephone($atts = [], $content = null) 484 { 485 if (!$atts) { // [tel]123-456-7890[/tel] 446 486 $phone = $content; 447 487 } else { // [tel=123-456-7890]text[/tel] or [tel="123-456-7890"]text[/tel] 488 $phone = trim(array_shift($this->attributefix($atts)), '="'); 489 } 490 if (!$phone) { 491 return ''; 492 } 493 $phone = $phone.replace('-', '').replace('.', '').replace('+', ''); 494 return '<a href="tel:' . $phone . '">' . $this->do_shortcode($content) . '</a>'; 495 } 496 497 public function shortcode_image($atts = [], $content = null) 498 { 499 if (!$content) { 500 return ''; 501 } 502 $alt = ''; 503 if (!$atts) { // [img=alttext]imageurl[/img] 504 $alt = trim(implode(' ', $atts), '="'); 505 } 506 return '<img src="' . $content . '" alt="' . $alt . '" title="' . $alt . ' />'; 507 } 508 509 public function shortcode_url($atts = [], $content = null) 510 { 511 if (!$atts) { // [url]http://www.example.com/[/url] 512 $url = $content; 513 } else { // [url=http://www.example.com/]text[/url] or [url="http://www.example.com/"]text[/url] 514 $url = trim(array_shift($this->attributefix($atts)), '="'); 515 } 516 if (!$url) { 517 return ''; 518 } 519 return '<a href="' . $url . '">' . $this->do_shortcode($content) . '</a>'; 520 } 521 522 // Videos and Audio 523 524 public function shortcode_bitchute($atts = [], $content = null) 525 { 526 if (!$content) { 527 return 'No BitChute Video ID Set'; 528 } 529 $vidID = $content; 530 $height = '330'; 531 $width = '400'; 532 if (!$atts) { 533 $match = []; 448 534 $atts = $this->attributefix($atts); 449 $ phone = trim(array_shift($atts), '="');450 }451 if (empty($phone)) { return ''; }452 $phone = $phone.replace('-', '').replace('.', '').replace('+', '');453 return '<a href="tel:'.$phone.'">'.$this->do_shortcode($content).'</a>';454 }455 456 function shortcode_image($atts = array(), $content = null) { 457 if (null === $content) { return ''; }458 $alt = '';459 if (! empty($atts)) { $alt = trim(implode(' ', $atts ), '="'); } // [img=alttext]imageurl[/img]460 return '<img src="'.$content.'" alt="'.$alt.'" title="'.$alt.' />';461 }462 463 function shortcode_url($atts = array(), $content = null) {464 if (empty($atts)) { // [url]http://www.example.com/[/url]465 $url = $text = $content;466 } else { // [url=http://www.example.com/]text[/url] or [url="http://www.example.com/"]text[/url]535 $autoplay = $atts['autoplay'] === 'yes' ? '&autoplay=1' : ''; 536 $vidID = (preg_match('%(?:bitchute(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=))([^"&?/ ]{11})%iu', $atts['url'], $match)) ? $match[1] : false; 537 $height = (isset($atts['height']) && is_numeric($atts['height'])) ? $atts['height'] : '330'; 538 $width = (isset($atts['width']) && is_numeric($atts['width'])) ? $atts['width'] : '400'; 539 } 540 return '<iframe width="' . $width . '" height="' . $height . '" src="https://www.bitchute.com/embed/' . $vidID . '?html5=1' . $autoplay . '" frameborder="0" allowfullscreen="true"></iframe>'; 541 } 542 543 public function shortcode_dailymotion($atts = [], $content = null) 544 { 545 if (!$content) { 546 return 'No DailyMotion Video ID Set'; 547 } 548 $vidID = $content; 549 $height = '330'; 550 $width = '400'; 551 if (!$atts) { 552 $match = []; 467 553 $atts = $this->attributefix($atts); 468 $url = trim(array_shift($atts), '="'); 469 } 470 if (empty($url)) { return ''; } 471 if (empty($text)) { $text=$url; } 472 return '<a href="'.$url.'">'.$this->do_shortcode($content).'</a>'; 473 } 474 475 // Videos and Audio 476 477 function shortcode_freesound($atts = array(), $content = null) { 478 if ('' === $content) { return 'No Freesound Audio ID Set'; } 479 if (empty($atts)) { // [freesound]164929[/freesound] 554 $autoplay = $atts['autoplay'] === 'yes' ? '&autoplay=1' : ''; 555 $vidID = (preg_match('%(?:dailymotion(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed/)?|(?:video/)?)/|.*[?&]v=))([^"&?/ ]{11})%iu', $atts['url'], $match)) ? $match[1] : false; 556 $height = (isset($atts['height']) && is_numeric($atts['height'])) ? $atts['height'] : '330'; 557 $width = (isset($atts['width']) && is_numeric($atts['width'])) ? $atts['width'] : '400'; 558 } 559 return '<iframe width="' . $width . '" height="' . $height . '" src="https://www.dailymotion.com/embed/video/' . $vidID . '?html5=1' . $autoplay . '" frameborder="0" allowfullscreen="true"></iframe>'; 560 } 561 562 public function shortcode_freesound($atts = [], $content = null) 563 { 564 if (!$content) { 565 return 'No Freesound Audio ID Set'; 566 } 567 if (!$atts) { // [freesound]164929[/freesound] 480 568 $size = 'medium'; 481 569 } else { // [freesound=large]164929[/freesound] or [freesound=small]164929[/freesound] 482 $size = $this->attributefix($atts); 483 $size = trim(array_shift($size), '="'); 484 } 485 $vidID = $content; 570 $size = strtolower(trim(array_shift($this->attributefix($atts)), '="')); 571 } 486 572 switch ($size) { 487 573 case 'big': 488 574 case 'large': 489 575 case 'l': 490 return '<iframe frameborder="0" scrolling="no" src="http://www.freesound.org/embed/sound/iframe/' .$vidID.'/simple/large/" width="920" height="245"></iframe>';576 return '<iframe frameborder="0" scrolling="no" src="http://www.freesound.org/embed/sound/iframe/' . $content . '/simple/large/" width="920" height="245"></iframe>'; 491 577 case 'little': 492 578 case 'short': 493 579 case 'small': 494 580 case 's': 495 return '<iframe frameborder="0" scrolling="no" src="http://www.freesound.org/embed/sound/iframe/' .$vidID.'/simple/small/" width="375" height="30"></iframe>';581 return '<iframe frameborder="0" scrolling="no" src="http://www.freesound.org/embed/sound/iframe/' . $content . '/simple/small/" width="375" height="30"></iframe>'; 496 582 case 'mid': 497 583 case 'medium': 498 584 case 'm': 499 585 default: 500 return '<iframe frameborder="0" scrolling="no" src="http://www.freesound.org/embed/sound/iframe/'.$vidID.'/simple/medium/" width="481" height="86"></iframe>'; 501 } 502 } 503 504 function shortcode_gvideo($atts = array(), $content = null) { 505 if ('' === $content) { return 'No Google Video ID Set'; } 586 return '<iframe frameborder="0" scrolling="no" src="http://www.freesound.org/embed/sound/iframe/' . $content . '/simple/medium/" width="480" height="86"></iframe>'; 587 } 588 } 589 590 public function shortcode_gvideo($atts = [], $content = null) 591 { 592 if (!$content) { 593 return 'No Google Video ID Set'; 594 } 595 return '<embed style="width:400px;height:330px" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=' . $content . '&hl=en"></embed>'; 596 } 597 598 public function shortcode_vimeo($atts = [], $content = null) 599 { 600 if (!$content) { 601 return 'No Vimeo Video ID Set'; 602 } 506 603 $vidID = $content; 507 return '<embed style="width:400px;height:325px" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId='.$vidID.'&hl=en"></embed>'; 508 } 509 510 function shortcode_vimeo($atts = array(), $content = null) { 511 if ('' === $content) { return 'No Vimeo Video ID Set'; } 512 $vidID = $content; 513 $height = '325'; 604 $height = '330'; 514 605 $width = '400'; 515 if (!empty($atts)){ 606 if (!$atts) { 607 $match = []; 516 608 $atts = $this->attributefix($atts); 517 609 $autoplay = $atts['autoplay'] === 'yes' ? '&autoplay=1' : ''; 518 $vidID = (preg_match('~(?:<iframe [^>]*src=")?(?:https?:\/\/(?:[\w]+\.)*vimeo\.com(?:[\/\w]*\/videos?)?\/([0-9]+)[^\s]*)"?(?:[^>]*></iframe>)?(?:<p>.*</p>)?~i x', $atts['url'], $match)) ? $match[1] : false;519 $height = (isset($atts['height']) && is_numeric($atts['height'])) ? $atts['height'] : '3 25';610 $vidID = (preg_match('~(?:<iframe [^>]*src=")?(?:https?:\/\/(?:[\w]+\.)*vimeo\.com(?:[\/\w]*\/videos?)?\/([0-9]+)[^\s]*)"?(?:[^>]*></iframe>)?(?:<p>.*</p>)?~iux', $atts['url'], $match)) ? $match[1] : false; 611 $height = (isset($atts['height']) && is_numeric($atts['height'])) ? $atts['height'] : '330'; 520 612 $width = (isset($atts['width']) && is_numeric($atts['width'])) ? $atts['width'] : '400'; 521 613 } 522 return '<iframe width="'.$width.'" height="'.$height.'" src="//player.vimeo.com/video/'.$vidID.'?title=0&byline=0&portrait=0&color=ffffff'.$autoplay.'" frameborder="0" allowfullscreen="true"></iframe>'; 523 } 524 525 function shortcode_youtube($atts = array(), $content = null) { 526 if ('' === $content) { return 'No YouTube Video ID Set'; } 614 return '<iframe width="' . $width . '" height="' . $height . '" src="//player.vimeo.com/video/' . $vidID . '?title=0&byline=0&portrait=0&color=ffffff' . $autoplay . '" frameborder="0" allowfullscreen="true"></iframe>'; 615 } 616 617 public function shortcode_youtube($atts = [], $content = null) 618 { 619 if (!$content) { 620 return 'No YouTube Video ID Set'; 621 } 527 622 $vidID = $content; 528 $height = '3 25';623 $height = '330'; 529 624 $width = '400'; 530 if (!empty($atts)){ 625 if (!$atts) { 626 $match = []; 531 627 $atts = $this->attributefix($atts); 532 $autoplay = $atts['autoplay'] === 'yes' ? ' ?autoplay=1' : '';533 $vidID = (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i ', $atts['url'], $match)) ? $match[1] : false;534 $height = (isset($atts['height']) && is_numeric($atts['height'])) ? $atts['height'] : '3 25';628 $autoplay = $atts['autoplay'] === 'yes' ? '&autoplay=1' : ''; 629 $vidID = (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%iu', $atts['url'], $match)) ? $match[1] : false; 630 $height = (isset($atts['height']) && is_numeric($atts['height'])) ? $atts['height'] : '330'; 535 631 $width = (isset($atts['width']) && is_numeric($atts['width'])) ? $atts['width'] : '400'; 536 632 } 537 return '<iframe width="' .$width.'" height="'.$height.'" src="http://www.youtube.com/embed/'.$vidID.$autoplay.'" frameborder="0" allowfullscreen="true"></iframe>';633 return '<iframe width="' . $width . '" height="' . $height . '" src="https://www.youtube.com/embed/' . $vidID . '?html5=1' . $autoplay . '" frameborder="0" allowfullscreen="true"></iframe>'; 538 634 } 539 635 540 636 // Special/Miscellaneous Content 541 637 542 function shortcode_abbr($atts = array(), $content = null) { 543 if (null === $content || !isset($atts['title'])) { return ''; } 638 public function shortcode_abbr($atts = [], $content = null) 639 { 640 if (!$content || !isset($atts['title'])) { 641 return ''; 642 } 544 643 $atts = $this->attributefix($atts); 545 return '<abbr title="'.$atts['title'].'">'.$this->do_shortcode($content).'</abbr>'; 546 } 547 548 function shortcode_clientip($atts = array(), $content = null) { 644 return '<abbr title="' . $atts['title'] . '">' . $this->do_shortcode($content) . '</abbr>'; 645 } 646 647 public function shortcode_clientip($atts = [], $content = null) 648 { 549 649 return $_SERVER['REMOTE_ADDR']; 550 650 } 551 651 552 function shortcode_hr($atts = array(), $content = null) { 652 public function shortcode_hr($atts = [], $content = null) 653 { 553 654 return '<hr/>'; 554 655 } 555 656 556 function shortcode_note($atts = array(), $content = null) { 557 if (null === $content) { return ''; } 558 return '<!--'.$content.'-->'; 559 } 560 561 function shortcode_useragent($atts = array(), $content = null) { 657 public function shortcode_note($atts = [], $content = null) 658 { 659 return $content ? '<!--' . $content . '-->' : ''; 660 } 661 662 public function shortcode_useragent($atts = [], $content = null) 663 { 562 664 return $_SERVER['HTTP_USER_AGENT']; 563 665 } … … 565 667 // Hide and Display Content 566 668 567 function shortcode_spoiler($atts = array(), $content = null) { 568 if ($content === null) { return ''; } 569 if ($atts === '') { return '<div style="margin:20px;margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><strong>Spoiler: </strong><input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px" onClick="if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'\') { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'\'; this.innerText = \'\'; this.value = \'Hide\'; } else { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\'; this.innerText = \'\'; this.value = \'Show\'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;"><div style="display:none">'. $this->do_shortcode($content) .'</div></div></div>'; } 669 public function shortcode_spoiler($atts = [], $content = null) 670 { 671 if (!$content) { 672 return ''; 673 } 674 if (!$atts) { 675 return '<div style="margin:20px;margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><strong>Spoiler: </strong><input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px" onClick="if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'\') { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'\'; this.innerText = \'\'; this.value = \'Hide\'; } else { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\'; this.innerText = \'\'; this.value = \'Show\'; }"></div><div class="alt2" style="margin: 0px; padding: 4px; border: 1px inset;"><div style="display:none">' . $this->do_shortcode($content) . '</div></div></div>'; 676 } 570 677 $subattribs = substr(implode(' ', $atts), 1); 571 return '<div style="margin:20px;margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><strong>Spoiler</strong> for <em>'. $subattribs .'</em> <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px" onClick="if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'\') { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'\'; this.innerText = \'\'; this.value = \'Hide\'; } else { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\'; this.innerText = \'\'; this.value = \'Show\'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;"><div style="display:none">'. $this->do_shortcode($content) .'</div></div></div>'; 572 } 573 574 function shortcode_guest($atts = array(), $content = null) { 575 if ($content === null || is_user_logged_in()) { return ''; } 576 return '<div>'.$this->do_shortcode($content).'</div>'; 577 } 578 579 function shortcode_user($atts = array(), $content = null) { 580 if ($content === null || !is_user_logged_in()) { return ''; } 581 return '<div>'.$this->do_shortcode($content).'</div>'; 582 } 583 584 }?> 678 return '<div style="margin:20px;margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><strong>Spoiler</strong> for <em>' . $subattribs . '</em> <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px" onClick="if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'\') { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'\'; this.innerText = \'\'; this.value = \'Hide\'; } else { this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\'; this.innerText = \'\'; this.value = \'Show\'; }"></div><div class="alt2" style="margin: 0px; padding: 4px; border: 1px inset;"><div style="display:none">' . $this->do_shortcode($content) . '</div></div></div>'; 679 } 680 681 public function shortcode_guest($atts = [], $content = null) 682 { 683 if (!$content || is_user_logged_in()) { 684 return ''; 685 } 686 return '<div>' . $this->do_shortcode($content) . '</div>'; 687 } 688 689 public function shortcode_user($atts = [], $content = null) 690 { 691 if (!$content || !is_user_logged_in()) { 692 return ''; 693 } 694 return '<div>' . $this->do_shortcode($content) . '</div>'; 695 } 696 } -
bbcode-deluxe/trunk/options-form-template.php
r2037928 r2349543 2 2 <h1>BBCode Deluxe</h1> 3 3 <p>BBCode (Bulletin Board Code) is a lightweight markup language used as an alternative to HTML for formatting. <a href="http://www.bbcode.org/reference.php">http://www.bbcode.org/reference.php</a></p> 4 <?php if ( $whitelist_enabled) {5 if ( $bbcodes_active) { ?>4 <?php if (isset($whitelist_enabled) && $whitelist_enabled) { 5 if (isset($bbcodes_active) && $bbcodes_active) { ?> 6 6 <p>BBCodes are enabled and <a href="http://wordpress.org/extend/plugins/bbpress2-shortcode-whitelist/">bbPress shortcode whitelist</a> has been detected as activated. Users should be able to use BBCodes in blogs, comments, and forums.</p> 7 7 <?php } else { ?> … … 62 62 <h3>Loaded Extensions</h3> 63 63 <ul><?php 64 $conf_array = get_loaded_extensions();65 foreach ($conf_array as $val_pair) {66 echo '<li>'.strval($val_pair).'</li>';67 }64 $conf_array = get_loaded_extensions(); 65 foreach ($conf_array as $val_pair) { 66 echo '<li>' . strval($val_pair) . '</li>'; 67 } 68 68 ?></ul> 69 69 </div> -
bbcode-deluxe/trunk/readme.txt
r2176519 r2349543 4 4 Tags: bbcode, bbpress, buddypress, bbpress-plugin, bbpress2, forum, html5, information, markup, nested-quotes, php-version, server-info, shortcode 5 5 Requires at least: 3.9 6 Tested up to: 5. 46 Tested up to: 5.5 7 7 Stable tag: trunk 8 8 License: GPLv3 … … 22 22 * Plugin URI: https://wordpress.org/plugins/bbcode-deluxe/ 23 23 * Description: Adds support for BBCode to Wordpress and BBPress 24 * Version: 20 19.10.2024 * Version: 2020.07.30 25 25 * Author: Devyn Collier Johnson (DevynCJohnson) 26 26 * Author URI: http://dcjtech.info/ … … 150 150 151 151 == Changelog == 152 = 2020.07.30 = 153 * Bug fixes & minor improvements 154 * Added support for BitChute & DailyMotion 155 * Made Youtube shortcodes use HTTPS and full embedding 152 156 = 2019.10.20 = 153 157 * Bug fixes
Note: See TracChangeset
for help on using the changeset viewer.