Version Description
- Fixed footer overlaping problem! Now users can customize top and bottom margins for the fixed widgets from the admin area (Appearance -> Fixed Widget Options).
- Added localization support
Download this release
Release Info
Developer | Max Bond |
Plugin | Q2W3 Fixed Widget |
Version | 2.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.3 to 2.0
- js/functions.js +0 -37
- js/q2w3-fixed-widget.js +75 -0
- lang/q2w3-fixed-widget.pot +15 -0
- lang/ru_RU.mo +0 -0
- lang/ru_RU.po +55 -0
- q2w3-fixed-widget.php +107 -9
- readme.txt +24 -10
- screenshot-2.jpg +0 -0
- screenshot-3.jpg +0 -0
- screenshot-4.jpg +0 -0
js/functions.js
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
jQuery(window).load(function () {
|
2 |
-
var offset_top = 10;
|
3 |
-
for (var i = 0; i < q2w3_fixed_widgets.length; i++) {
|
4 |
-
widget = jQuery('#' + q2w3_fixed_widgets[i]);
|
5 |
-
if ( widget.attr('id') ) { // element existsts
|
6 |
-
q2w3_fixed_widget(widget, offset_top);
|
7 |
-
offset_top += widget.outerHeight(true);
|
8 |
-
}
|
9 |
-
}
|
10 |
-
});
|
11 |
-
function q2w3_fixed_widget(widget, offset_top) {
|
12 |
-
var widget_width = widget.css('width');
|
13 |
-
var widget_margin = widget.css('margin');
|
14 |
-
var widget_padding = widget.css('padding');
|
15 |
-
var top = widget.offset().top - offset_top;
|
16 |
-
var parent_height = widget.parent().height();
|
17 |
-
var update_parent_height = false;
|
18 |
-
jQuery(window).scroll(function (event) {
|
19 |
-
if ( jQuery(this).scrollTop() >= top ) { // fixed
|
20 |
-
if ( !update_parent_height ) { // needed when sidebar is longer then main content
|
21 |
-
widget.parent().height(parent_height);
|
22 |
-
update_parent_height = true;
|
23 |
-
}
|
24 |
-
widget.css('position', 'fixed');
|
25 |
-
widget.css('width', widget_width);
|
26 |
-
widget.css('margin', widget_margin);
|
27 |
-
widget.css('padding', widget_padding);
|
28 |
-
widget.css('top', offset_top);
|
29 |
-
} else { // normal
|
30 |
-
if ( update_parent_height ) {
|
31 |
-
widget.parent().removeAttr('style');
|
32 |
-
update_parent_height = false;
|
33 |
-
}
|
34 |
-
widget.css('position', 'static');
|
35 |
-
}
|
36 |
-
});
|
37 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/q2w3-fixed-widget.js
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(window).load(function () {
|
2 |
+
var margin_top = q2w3_fixed_widgets_margin_top;
|
3 |
+
var margin_top_accumulate = margin_top;
|
4 |
+
var margin_bottom = q2w3_fixed_widgets_margin_bottom;
|
5 |
+
var widget_height = new Array();
|
6 |
+
for (var i = 0; i < q2w3_fixed_widgets.length; i++) {
|
7 |
+
widget = jQuery('#' + q2w3_fixed_widgets[i]);
|
8 |
+
if ( widget.attr('id') ) { // element existsts
|
9 |
+
widget_height[i] = widget.outerHeight(true);
|
10 |
+
} else {
|
11 |
+
widget_height[i] = 0;
|
12 |
+
}
|
13 |
+
}
|
14 |
+
for (var i = 0; i < q2w3_fixed_widgets.length; i++) {
|
15 |
+
widget = jQuery('#' + q2w3_fixed_widgets[i]);
|
16 |
+
if ( widget.attr('id') ) { // element existsts
|
17 |
+
q2w3_fixed_widget(widget, margin_top, margin_top_accumulate, margin_bottom, widget_height, i);
|
18 |
+
margin_top_accumulate += widget_height[i];
|
19 |
+
}
|
20 |
+
}
|
21 |
+
if (jQuery.browser.mozilla || jQuery.browser.opera) { // fixes mozilla, opera page refresh problem
|
22 |
+
var scroll = jQuery(document).scrollTop();
|
23 |
+
jQuery(document).scrollTop(0);
|
24 |
+
jQuery(document).scrollTop(scroll);
|
25 |
+
}
|
26 |
+
});
|
27 |
+
function q2w3_fixed_widget(widget, margin_top, margin_top_accumulate, margin_bottom, widget_height, i) {
|
28 |
+
var widget_width = widget.css('width');
|
29 |
+
var widget_margin = widget.css('margin');
|
30 |
+
var widget_padding = widget.css('padding');
|
31 |
+
var parent_height = widget.parent().height();
|
32 |
+
var update_parent_height = false;
|
33 |
+
var scroll_border_top = widget.offset().top - margin_top_accumulate;
|
34 |
+
for (var j = i + 1; j < widget_height.length; j++) {
|
35 |
+
margin_bottom += widget_height[j];
|
36 |
+
}
|
37 |
+
var scroll_border_bottom = jQuery(document).height() - margin_bottom;
|
38 |
+
var widgets_height_accumulate = 0;
|
39 |
+
for (var k = i; k >= 0; k--) {
|
40 |
+
widgets_height_accumulate += widget_height[k];
|
41 |
+
}
|
42 |
+
jQuery(window).scroll(function (event) {
|
43 |
+
var scroll_target = jQuery(this).scrollTop() + widgets_height_accumulate + margin_top;
|
44 |
+
var scroll_delta = scroll_target - scroll_border_bottom + ( jQuery(window).height() - widgets_height_accumulate - margin_top );
|
45 |
+
if ( scroll_target >= scroll_border_bottom ) { // fixed bottom
|
46 |
+
if ( !update_parent_height ) { // needed when sidebar is longer then main content
|
47 |
+
widget.parent().height(parent_height);
|
48 |
+
update_parent_height = true;
|
49 |
+
}
|
50 |
+
widget.css('position', 'fixed');
|
51 |
+
widget.css('top', '');
|
52 |
+
widget.css('bottom', scroll_delta);
|
53 |
+
widget.css('width', widget_width);
|
54 |
+
widget.css('margin', widget_margin);
|
55 |
+
widget.css('padding', widget_padding);
|
56 |
+
} else if ( jQuery(this).scrollTop() >= scroll_border_top ) { // fixed top
|
57 |
+
if ( !update_parent_height ) { // needed when sidebar is longer then main content
|
58 |
+
widget.parent().height(parent_height);
|
59 |
+
update_parent_height = true;
|
60 |
+
}
|
61 |
+
widget.css('position', 'fixed');
|
62 |
+
widget.css('top', margin_top_accumulate);
|
63 |
+
widget.css('bottom', '');
|
64 |
+
widget.css('width', widget_width);
|
65 |
+
widget.css('margin', widget_margin);
|
66 |
+
widget.css('padding', widget_padding);
|
67 |
+
} else { // normal
|
68 |
+
if ( update_parent_height ) {
|
69 |
+
widget.parent().removeAttr('style');
|
70 |
+
update_parent_height = false;
|
71 |
+
}
|
72 |
+
widget.css('position', '');
|
73 |
+
}
|
74 |
+
});
|
75 |
+
}
|
lang/q2w3-fixed-widget.pot
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Q2W3 Fixed Widget\n"
|
4 |
+
"POT-Creation-Date: 2012-12-12 12:20+0400\n"
|
5 |
+
"PO-Revision-Date: 2012-12-12 12:21+0400\n"
|
6 |
+
"Last-Translator: \n"
|
7 |
+
"Language-Team: \n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"X-Generator: Poedit 1.5.4\n"
|
12 |
+
"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
|
13 |
+
"X-Poedit-Basepath: .\n"
|
14 |
+
"X-Poedit-SearchPath-0: c:\\Program Files (x86)\\Zend\\Apache2\\htdocs\\q2w3."
|
15 |
+
"ru-dev\\wp-content\\plugins\\q2w3-fixed-widget\n"
|
lang/ru_RU.mo
ADDED
Binary file
|
lang/ru_RU.po
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Q2W3 Fixed Widget\n"
|
4 |
+
"POT-Creation-Date: 2012-12-12 12:28+0400\n"
|
5 |
+
"PO-Revision-Date: 2012-12-12 12:29+0400\n"
|
6 |
+
"Last-Translator: \n"
|
7 |
+
"Language-Team: \n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"X-Generator: Poedit 1.5.4\n"
|
12 |
+
"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
|
13 |
+
"X-Poedit-Basepath: .\n"
|
14 |
+
"X-Poedit-SearchPath-0: c:\\Program Files (x86)\\Zend\\Apache2\\htdocs\\q2w3."
|
15 |
+
"ru-dev\\wp-content\\plugins\\q2w3-fixed-widget\n"
|
16 |
+
|
17 |
+
#: c:\Program Files
|
18 |
+
#: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:89
|
19 |
+
msgid "Fixed widget"
|
20 |
+
msgstr "Зафиксировать виджет"
|
21 |
+
|
22 |
+
#: c:\Program Files
|
23 |
+
#: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:129
|
24 |
+
#: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:175
|
25 |
+
msgid "Fixed Widget Options"
|
26 |
+
msgstr "Фикс. Виджеты"
|
27 |
+
|
28 |
+
#: c:\Program Files
|
29 |
+
#: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:179
|
30 |
+
msgid "Settings saved."
|
31 |
+
msgstr ""
|
32 |
+
|
33 |
+
#: c:\Program Files
|
34 |
+
#: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:191
|
35 |
+
msgid "Margin Top:"
|
36 |
+
msgstr "Верхний отступ:"
|
37 |
+
|
38 |
+
#: c:\Program Files
|
39 |
+
#: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:191
|
40 |
+
#: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:193
|
41 |
+
msgid "px"
|
42 |
+
msgstr "пикс."
|
43 |
+
|
44 |
+
#: c:\Program Files
|
45 |
+
#: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:193
|
46 |
+
msgid "Margin Bottom:"
|
47 |
+
msgstr "Нижний отступ:"
|
48 |
+
|
49 |
+
#: c:\Program Files
|
50 |
+
#: (x86)\Zend\Apache2\htdocs\q2w3.ru-dev\wp-content\plugins\q2w3-fixed-widget/q2w3-fixed-widget.php:195
|
51 |
+
msgid "Save Changes"
|
52 |
+
msgstr ""
|
53 |
+
|
54 |
+
#~ msgid "Fixed Widget Options."
|
55 |
+
#~ msgstr "Настройки Фиксированных Виджетов"
|
q2w3-fixed-widget.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Q2W3 Fixed Widget
|
|
4 |
Plugin URI: http://www.q2w3.ru/q2w3-fixed-widget-wordpress-plugin/
|
5 |
Description: Fixes positioning of the selected widgets, when the page is scrolled down.
|
6 |
Author: Max Bond
|
7 |
-
Version:
|
8 |
Author URI: http://www.q2w3.ru/
|
9 |
*/
|
10 |
|
@@ -16,6 +16,10 @@ if ( is_admin() ) {
|
|
16 |
|
17 |
add_filter('widget_update_callback', array( 'q2w3_fixed_widget', 'update_option' ), 10, 3);
|
18 |
|
|
|
|
|
|
|
|
|
19 |
} else {
|
20 |
|
21 |
add_action('template_redirect', array( 'q2w3_fixed_widget', 'init' ));
|
@@ -26,25 +30,23 @@ if ( is_admin() ) {
|
|
26 |
|
27 |
}
|
28 |
|
29 |
-
|
30 |
// if class allready loaded return control to the main script
|
31 |
|
32 |
if ( class_exists('q2w3_fixed_widget', false) ) return;
|
33 |
|
34 |
-
|
35 |
// Plugin class
|
36 |
|
37 |
class q2w3_fixed_widget {
|
38 |
|
39 |
-
|
40 |
|
|
|
|
|
41 |
|
42 |
|
43 |
public static function init() {
|
44 |
|
45 |
-
wp_enqueue_script('jquery');
|
46 |
-
|
47 |
-
wp_enqueue_script('q2w3-fixed-widget', plugin_dir_url( __FILE__ ) . 'js/functions.js', array('jquery'), '1.3', true);
|
48 |
|
49 |
}
|
50 |
|
@@ -62,11 +64,13 @@ class q2w3_fixed_widget {
|
|
62 |
|
63 |
$array = implode(',', self::$fixed_widgets);
|
64 |
|
65 |
-
|
|
|
|
|
66 |
|
67 |
} else {
|
68 |
|
69 |
-
echo '<script type="text/javascript">q2w3_fixed_widgets = new Array();</script>'.PHP_EOL;
|
70 |
|
71 |
}
|
72 |
|
@@ -100,4 +104,98 @@ class q2w3_fixed_widget {
|
|
100 |
|
101 |
}
|
102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
}
|
4 |
Plugin URI: http://www.q2w3.ru/q2w3-fixed-widget-wordpress-plugin/
|
5 |
Description: Fixes positioning of the selected widgets, when the page is scrolled down.
|
6 |
Author: Max Bond
|
7 |
+
Version: 2.0
|
8 |
Author URI: http://www.q2w3.ru/
|
9 |
*/
|
10 |
|
16 |
|
17 |
add_filter('widget_update_callback', array( 'q2w3_fixed_widget', 'update_option' ), 10, 3);
|
18 |
|
19 |
+
add_action('admin_init', array( 'q2w3_fixed_widget', 'register_settings' ));
|
20 |
+
|
21 |
+
add_action('admin_menu', array( 'q2w3_fixed_widget', 'admin_init' ));
|
22 |
+
|
23 |
} else {
|
24 |
|
25 |
add_action('template_redirect', array( 'q2w3_fixed_widget', 'init' ));
|
30 |
|
31 |
}
|
32 |
|
|
|
33 |
// if class allready loaded return control to the main script
|
34 |
|
35 |
if ( class_exists('q2w3_fixed_widget', false) ) return;
|
36 |
|
|
|
37 |
// Plugin class
|
38 |
|
39 |
class q2w3_fixed_widget {
|
40 |
|
41 |
+
const ID = 'q2w3_fixed_widget';
|
42 |
|
43 |
+
protected static $fixed_widgets;
|
44 |
+
|
45 |
|
46 |
|
47 |
public static function init() {
|
48 |
|
49 |
+
wp_enqueue_script('q2w3-fixed-widget', plugin_dir_url( __FILE__ ) . 'js/q2w3-fixed-widget.js', array('jquery'), '2.0', true);
|
|
|
|
|
50 |
|
51 |
}
|
52 |
|
64 |
|
65 |
$array = implode(',', self::$fixed_widgets);
|
66 |
|
67 |
+
$options = self::load_options();
|
68 |
+
|
69 |
+
echo '<script type="text/javascript">q2w3_fixed_widgets = new Array('. $array .'); q2w3_fixed_widgets_margin_top = '.$options['margin-top'].'; q2w3_fixed_widgets_margin_bottom = '.$options['margin-bottom'].';</script>'.PHP_EOL;
|
70 |
|
71 |
} else {
|
72 |
|
73 |
+
echo '<script type="text/javascript">q2w3_fixed_widgets = new Array(); q2w3_fixed_widgets_margin_top = '.$options['margin-top'].'; q2w3_fixed_widgets_margin_bottom = '.$options['margin-bottom'].';</script>'.PHP_EOL;
|
74 |
|
75 |
}
|
76 |
|
104 |
|
105 |
}
|
106 |
|
107 |
+
protected static function load_language() {
|
108 |
+
|
109 |
+
$currentLocale = get_locale();
|
110 |
+
|
111 |
+
if (!empty($currentLocale)) {
|
112 |
+
|
113 |
+
$moFile = dirname(__FILE__).'/lang/'.$currentLocale.".mo";
|
114 |
+
|
115 |
+
if (@file_exists($moFile) && is_readable($moFile)) load_textdomain(self::ID, $moFile);
|
116 |
+
|
117 |
+
}
|
118 |
+
|
119 |
+
}
|
120 |
+
|
121 |
+
public static function admin_init() {
|
122 |
+
|
123 |
+
self::load_language();
|
124 |
+
|
125 |
+
add_submenu_page( 'themes.php', __('Fixed Widget Options', 'q2w3_fixed_widget'), __('Fixed Widget Options', 'q2w3_fixed_widget'), 'activate_plugins', 'q2w3_fixed_widget', array( __CLASS__, 'settings_page' ) );
|
126 |
+
|
127 |
+
}
|
128 |
+
|
129 |
+
protected static function defaults() {
|
130 |
+
|
131 |
+
$d['margin-top'] = 10;
|
132 |
+
|
133 |
+
$d['margin-bottom'] = 0;
|
134 |
+
|
135 |
+
return $d;
|
136 |
+
|
137 |
+
}
|
138 |
+
|
139 |
+
protected static function load_options() {
|
140 |
+
|
141 |
+
$options = get_option(self::ID);
|
142 |
+
|
143 |
+
if (!$options) $options = self::defaults();
|
144 |
+
|
145 |
+
return $options;
|
146 |
+
|
147 |
+
}
|
148 |
+
|
149 |
+
public static function register_settings() {
|
150 |
+
|
151 |
+
register_setting(self::ID, self::ID, array( __CLASS__, 'save_options_filter' ) );
|
152 |
+
|
153 |
+
}
|
154 |
+
|
155 |
+
public static function save_options_filter($input) {
|
156 |
+
|
157 |
+
// Sanitize user input
|
158 |
+
|
159 |
+
$input['margin-top'] = (int)$input['margin-top'];
|
160 |
+
|
161 |
+
$input['margin-bottom'] = (int)$input['margin-bottom'];
|
162 |
+
|
163 |
+
return $input;
|
164 |
+
|
165 |
+
}
|
166 |
+
|
167 |
+
public static function settings_page() {
|
168 |
+
|
169 |
+
$options = self::load_options();
|
170 |
+
|
171 |
+
echo '<div class="wrap"><h2>'. __('Fixed Widget Options', 'q2w3_fixed_widget') .'</h2>'.PHP_EOL;
|
172 |
+
|
173 |
+
if ( isset($_GET['settings-updated']) && $_GET['settings-updated'] == 'true' ) {
|
174 |
+
|
175 |
+
echo '<div id="message" class="updated"><p>'. __('Settings saved.') .'</p></div>'.PHP_EOL;
|
176 |
+
|
177 |
+
}
|
178 |
+
|
179 |
+
echo '<form method="post" action="options.php">'.PHP_EOL;
|
180 |
+
|
181 |
+
echo wp_nonce_field('update-options', '_wpnonce', true, false).PHP_EOL;
|
182 |
+
|
183 |
+
echo '<input type="hidden" name="action" value="update" />'.PHP_EOL;
|
184 |
+
|
185 |
+
echo '<input type="hidden" name="page_options" value="'. self::ID .'" />'.PHP_EOL;
|
186 |
+
|
187 |
+
echo '<p><span style="display: inline-block; width: 100px;">'. __('Margin Top:', 'q2w3_fixed_widget') .'</span><input type="text" name="'. self::ID .'[margin-top]" value="'. $options['margin-top'] .'" style="width: 50px; text-align: center;" /> '. __('px', 'q2w3_fixed_widget') .'</p>'.PHP_EOL;
|
188 |
+
|
189 |
+
echo '<p><span style="display: inline-block; width: 100px;">'. __('Margin Bottom:', 'q2w3_fixed_widget') .'</span><input type="text" name="'. self::ID .'[margin-bottom]" value="'. $options['margin-bottom'] .'" style="width: 50px; text-align: center;" /> '. __('px', 'q2w3_fixed_widget') .'</p>'.PHP_EOL;
|
190 |
+
|
191 |
+
echo '<p class="submit"><input type="submit" class="button-primary" value="'. __('Save Changes') .'" /></p>'.PHP_EOL;
|
192 |
+
|
193 |
+
echo '</form>'.PHP_EOL;
|
194 |
+
|
195 |
+
echo '<div style="position: absolute; top: 100px; right: 20px;"><form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="Q36H2MHNVVP7U"><input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><img alt="" border="0" src="https://www.paypalobjects.com/ru_RU/i/scr/pixel.gif" width="1" height="1"></form></div>'.PHP_EOL;
|
196 |
+
|
197 |
+
echo '</div><!-- .wrap -->'.PHP_EOL;
|
198 |
+
|
199 |
+
}
|
200 |
+
|
201 |
}
|
readme.txt
CHANGED
@@ -1,44 +1,54 @@
|
|
1 |
=== Q2W3 Fixed Widget (Sticky Widget) ===
|
2 |
Contributors: Max Bond
|
3 |
Donate link: http://www.q2w3.ru/q2w3-fixed-widget-wordpress-plugin/#donate
|
4 |
-
Tags:
|
5 |
Requires at least: 3.0
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag:
|
8 |
|
9 |
Fixes positioning of the selected widgets, when the page is scrolled down.
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
-
This is a very lightweight plugin with great functionality! )
|
14 |
-
|
15 |
Enable "Fixed widget" option on ANY active widget (see [screenshot](http://wordpress.org/extend/plugins/q2w3-fixed-widget/screenshots/)) and it will be always in sight when page is scrolled down.
|
16 |
|
17 |
-
There is no problem to "Fix" (or "Stick") more than one widget
|
|
|
|
|
18 |
|
19 |
[Watch the demo](http://store.places-finder.com/cp-ajax-post-load).
|
20 |
-
Right sidebar, last
|
|
|
|
|
21 |
|
22 |
== Installation ==
|
23 |
|
24 |
1. Follow standard WordPress plugin installation procedure
|
25 |
2. Activate the plugin through the Plugins menu in WordPress
|
26 |
3. Go to Appearance -> Widgets, enable "Fixed Widget" option on any active widget ([screenshot](http://wordpress.org/extend/plugins/q2w3-fixed-widget/screenshots/))
|
|
|
27 |
|
28 |
== Frequently Asked Questions ==
|
29 |
|
|
|
|
|
|
|
|
|
30 |
= Why plugin is not working? =
|
31 |
|
32 |
There are several reasons:
|
33 |
|
34 |
-
1.
|
35 |
-
2.
|
36 |
-
3.
|
37 |
|
38 |
|
39 |
== Screenshots ==
|
40 |
|
41 |
1. Widget with enabled "Fixed widget" option
|
|
|
|
|
|
|
42 |
|
43 |
== Other Notes ==
|
44 |
|
@@ -47,6 +57,10 @@ There are several reasons:
|
|
47 |
|
48 |
== Changelog ==
|
49 |
|
|
|
|
|
|
|
|
|
50 |
= 1.0.3 =
|
51 |
* Normalized plugin behavior when sidebar is longer then main content. Note: possible overlaping with footer is still exists.
|
52 |
|
1 |
=== Q2W3 Fixed Widget (Sticky Widget) ===
|
2 |
Contributors: Max Bond
|
3 |
Donate link: http://www.q2w3.ru/q2w3-fixed-widget-wordpress-plugin/#donate
|
4 |
+
Tags: sidebar, widget, scroll, fixed, floating, sticky, russian, q2w3
|
5 |
Requires at least: 3.0
|
6 |
+
Tested up to: 3.5
|
7 |
+
Stable tag: 2.0
|
8 |
|
9 |
Fixes positioning of the selected widgets, when the page is scrolled down.
|
10 |
|
11 |
== Description ==
|
12 |
|
|
|
|
|
13 |
Enable "Fixed widget" option on ANY active widget (see [screenshot](http://wordpress.org/extend/plugins/q2w3-fixed-widget/screenshots/)) and it will be always in sight when page is scrolled down.
|
14 |
|
15 |
+
There is no problem to "Fix" (or "Stick") more than one widget.
|
16 |
+
|
17 |
+
From version 2.0 you can customize top and bottom margins (Appearance -> Fixed Widget Options).
|
18 |
|
19 |
[Watch the demo](http://store.places-finder.com/cp-ajax-post-load).
|
20 |
+
Right sidebar, last three widgets. Scroll down to the bottom.
|
21 |
+
|
22 |
+
Supported languages: English, Russian
|
23 |
|
24 |
== Installation ==
|
25 |
|
26 |
1. Follow standard WordPress plugin installation procedure
|
27 |
2. Activate the plugin through the Plugins menu in WordPress
|
28 |
3. Go to Appearance -> Widgets, enable "Fixed Widget" option on any active widget ([screenshot](http://wordpress.org/extend/plugins/q2w3-fixed-widget/screenshots/))
|
29 |
+
4. Fine tune fixed widget margins on Appearance -> Fixed Widget Options page
|
30 |
|
31 |
== Frequently Asked Questions ==
|
32 |
|
33 |
+
= How to prevent overlaping with the footer? =
|
34 |
+
|
35 |
+
Make sure you have updated plugin to version 2.x. Go to WP admin area, Appearance -> Fixed Widget Options. Here you can define top and bottom margins. Set bottom margin value >= footer height. Check the result.
|
36 |
+
|
37 |
= Why plugin is not working? =
|
38 |
|
39 |
There are several reasons:
|
40 |
|
41 |
+
1. Widgets have no unique IDs. How to check. Place two text widgets in your sidebar. Then look at html source of your site. If these two widgets have the same IDs (widget_text) or they have no IDs at all - that's the problem. How to fix. Find `register_sidebar()` function (look first at functions.php file). Parameter `before_widget` should be like this: `<li id="%1$s" class="widget-container %2$s">`. Attention to this part: `id="%1$s"`.
|
42 |
+
2. Javascript errors on page. Commonly caused by buggy plugins. Check javascript console of your browser. If you find errors, try to locate and fix its source.
|
43 |
+
3. No `wp_head()` and `wp_footer()` functions in template. Check header.php and footer.php files of your active theme.
|
44 |
|
45 |
|
46 |
== Screenshots ==
|
47 |
|
48 |
1. Widget with enabled "Fixed widget" option
|
49 |
+
2. Fixed Widget Options
|
50 |
+
3. Margin top
|
51 |
+
4. Margin bottom
|
52 |
|
53 |
== Other Notes ==
|
54 |
|
57 |
|
58 |
== Changelog ==
|
59 |
|
60 |
+
= 2.0 =
|
61 |
+
* Fixed footer overlaping problem! Now users can customize top and bottom margins for the fixed widgets from the admin area (Appearance -> Fixed Widget Options).
|
62 |
+
* Added localization support
|
63 |
+
|
64 |
= 1.0.3 =
|
65 |
* Normalized plugin behavior when sidebar is longer then main content. Note: possible overlaping with footer is still exists.
|
66 |
|
screenshot-2.jpg
ADDED
Binary file
|
screenshot-3.jpg
ADDED
Binary file
|
screenshot-4.jpg
ADDED
Binary file
|