Footer Putter - Version 1.8

Version Description

Added options to use HTML5 microdata and to apply rel=nofollow automatically to footer trademark links

Download this release

Release Info

Developer powerblogservice
Plugin Icon 128x128 Footer Putter
Version 1.8
Comparing to
See all releases

Code changes from version 1.7.1 to 1.8

classes/footer-credits-admin.php CHANGED
@@ -9,11 +9,19 @@ class FooterCreditsAdmin {
9
private static $screen_id;
10
private static $keys;
11
private static $tips = array(
12
- 'owner' => array('heading' => 'Owner or Business Name', 'tip' => 'Enter the name of the legal entity that owns and operates the site.'),
13
- 'address' => array('heading' => 'Full Address', 'tip' => 'Enter the full address that you want to appear in the footer and the privacy and terms pages.'),
14
- 'country' => array('heading' => 'Country', 'tip' => 'Enter the country where the legal entity is domiciled.'),
15
- 'telephone' => array('heading' => 'Telephone Number', 'tip' => 'Enter a telephone number here if you want it to appear in the footer of the installed site.'),
16
- 'email' => array('heading' => 'Email Address', 'tip' => 'Enter the email address here if you want it to appear in the footer and in the privacy statement.'),
17
'courts' => array('heading' => 'Legal Jurisdiction' , 'tip' => 'The Courts that have jurisdiction over any legal disputes regarding this site. For example: <i>the state and federal courts in Santa Clara County, California</i>, or <i>the Law Courts of England and Wales</i>'),
18
'updated' => array('heading' => 'Last Updated' , 'tip' => 'This will be defaulted as today. For example, Oct 23rd, 2012'),
19
'copyright_start_year' => array('heading' => 'Copyright Start' , 'tip' => 'The start year of the business appears in the copyright statement in the footer and an on the Terms and Conditions page.'),
@@ -158,41 +166,61 @@ INTRO_PANEL;
158
159
public static function owner_panel($post,$metabox){
160
$terms = $metabox['args']['options']['terms'];
161
- $tip1 = self::$tooltips->tip('owner');
162
- $tip2 = self::$tooltips->tip('address');
163
- $tip3 = self::$tooltips->tip('country');
164
- $tip4 = self::$tooltips->tip('privacy_contact');
165
- $privacy_contact = $terms['privacy_contact'] ? 'checked="checked"' : '';
166
- print <<< OWNER_PANEL
167
- <label>{$tip1}</label><input type="text" name="owner" size="25" value="{$terms['owner']}" /><br/>
168
- <label>{$tip2}</label><input type="text" name="address" size="80" value="{$terms['address']}" /><br/>
169
- <label>{$tip3}</label><input type="text" name="country" size="25" value="{$terms['country']}" /><br/>
170
- <label>{$tip4}</label><input type="checkbox" name="privacy_contact" {$privacy_contact} value="1" /><br/>
171
OWNER_PANEL;
172
- }
173
-
174
- public static function contact_panel($post,$metabox){
175
- $terms = $metabox['args']['options']['terms'];
176
$tip2 = self::$tooltips->tip('telephone');
177
- $tip1 = self::$tooltips->tip('email');
178
print <<< CONTACT_PANEL
179
<label>{$tip1}</label><input type="text" name="email" size="30" value="{$terms['email']}" /><br/>
180
- <label>{$tip2}</label><input type="text" name="telephone" size="20" value="{$terms['telephone']}" /><br/>
181
CONTACT_PANEL;
182
}
183
-
184
- public static function legal_panel($post,$metabox){
185
- $terms = $metabox['args']['options']['terms'];
186
$tip1 = self::$tooltips->tip('courts');
187
$tip2 = self::$tooltips->tip('updated');
188
- $tip3 = self::$tooltips->tip('copyright_start_year');
189
- $tip4 = self::$tooltips->tip('terms_contact');
190
- $terms_contact = $terms['terms_contact'] ? 'checked="checked"' : '';
191
print <<< LEGAL_PANEL
192
<label>{$tip1}</label><input type="text" name="courts" size="80" value="{$terms['courts']}" /><br/>
193
- <label>{$tip2}</label><input type="text" name="updated" size="20" value="{$terms['updated']}" /><br/>
194
<label>{$tip3}</label><input type="text" name="copyright_start_year" size="5" value="{$terms['copyright_start_year']}" /><br/>
195
- <label>{$tip4}</label><input type="checkbox" name="terms_contact" {$terms_contact} value="1" /><br/>
196
LEGAL_PANEL;
197
}
198
9
private static $screen_id;
10
private static $keys;
11
private static $tips = array(
12
+ 'owner' => array('heading' => 'Owner or Business Name', 'tip' => 'Enter the name of the legal entity that owns and operates the site.'),
13
+ 'microdata' => array('heading' => 'Use Microdata', 'tip' => 'Markup the organization details with HTML5 microdata.'),
14
+ 'address' => array('heading' => 'Full Address', 'tip' => 'Enter the full address that you want to appear in the footer and the privacy and terms pages.'),
15
+ 'street_address' => array('heading' => 'Street Address', 'tip' => 'Enter the firat line of the address that you want to appear in the footer and the privacy and terms pages.'),
16
+ 'locality' => array('heading' => 'Locality (City)', 'tip' => 'Enter the town or city.'),
17
+ 'region' => array('heading' => 'State (Region)', 'tip' => 'Enter the state, province, region or county.'),
18
+ 'postal_code' => array('heading' => 'Postal Code', 'tip' => 'Enter the postal code.'),
19
+ 'country' => array('heading' => 'Country', 'tip' => 'Enter the country where the legal entity is domiciled.'),
20
+ 'latitude' => array('heading' => 'Latitude', 'tip' => 'Enter the latitude of the organization&#39;s location - maybe be used by Google or local search.'),
21
+ 'longitude' => array('heading' => 'Longitude', 'tip' => 'Enter the longitude of the organization&#39;s location - maybe be used by Google or local search.'),
22
+ 'map' => array('heading' => 'Map URL', 'tip' => 'Enter the URL of a map that shows the organization&#39;s location.'),
23
+ 'telephone' => array('heading' => 'Telephone Number', 'tip' => 'Enter a telephone number here if you want it to appear in the footer of the installed site.'),
24
+ 'email' => array('heading' => 'Email Address', 'tip' => 'Enter the email address here if you want it to appear in the footer and in the privacy statement.'),
25
'courts' => array('heading' => 'Legal Jurisdiction' , 'tip' => 'The Courts that have jurisdiction over any legal disputes regarding this site. For example: <i>the state and federal courts in Santa Clara County, California</i>, or <i>the Law Courts of England and Wales</i>'),
26
'updated' => array('heading' => 'Last Updated' , 'tip' => 'This will be defaulted as today. For example, Oct 23rd, 2012'),
27
'copyright_start_year' => array('heading' => 'Copyright Start' , 'tip' => 'The start year of the business appears in the copyright statement in the footer and an on the Terms and Conditions page.'),
166
167
public static function owner_panel($post,$metabox){
168
$terms = $metabox['args']['options']['terms'];
169
+ $tip1 = self::$tooltips->tip('owner');
170
+ $tip2 = self::$tooltips->tip('country');
171
+ $tip3 = self::$tooltips->tip('address');
172
+ $tip4 = self::$tooltips->tip('street_address');
173
+ $tip5 = self::$tooltips->tip('locality');
174
+ $tip6 = self::$tooltips->tip('region');
175
+ $tip7 = self::$tooltips->tip('postal_code');
176
+ $tip8 = self::$tooltips->tip('latitude');
177
+ $tip9 = self::$tooltips->tip('longitude');
178
+ $tip10 = self::$tooltips->tip('map');
179
+ print <<< OWNER_PANEL
180
+ <label>{$tip1}</label><input type="text" name="owner" size="30" value="{$terms['owner']}" /><br/>
181
+ <label>{$tip2}</label><input type="text" name="country" size="30" value="{$terms['country']}" /><br/>
182
+ <label>{$tip3}</label><input type="text" name="address" size="80" value="{$terms['address']}" /><br/>
183
OWNER_PANEL;
184
+ if (FooterCredits::is_html5()) print <<< ADDRESS_DATA
185
+ <p>Leave the above address field blank and fill in the various parts of the organization address below if you want to use HTML5 microdata.</p>
186
+ <h4>Organization Address</h4>
187
+ <label>{$tip4}</label><input type="text" name="street_address" size="30" value="{$terms['street_address']}" /><br/>
188
+ <label>{$tip5}</label><input type="text" name="locality" size="30" value="{$terms['locality']}" /><br/>
189
+ <label>{$tip6}</label><input type="text" name="region" size="30" value="{$terms['region']}" /><br/>
190
+ <label>{$tip7}</label><input type="text" name="postal_code" size="12" value="{$terms['postal_code']}" /><br/>
191
+ <h4>Geogrpahical Co-ordinates</h4>
192
+ <p>The geographical co-ordinates are optional and are visible only to the search engines.</p>
193
+ <label>{$tip8}</label><input type="text" name="latitude" size="12" value="{$terms['latitude']}" /><br/>
194
+ <label>{$tip9}</label><input type="text" name="longitude" size="12" value="{$terms['longitude']}" /><br/>
195
+ <label>{$tip10}</label><input type="text" name="map" size="30" value="{$terms['map']}" /><br/>
196
+ ADDRESS_DATA;
197
+ }
198
+
199
+ public static function contact_panel($post,$metabox){
200
+ $terms = $metabox['args']['options']['terms'];
201
+ $tip1 = self::$tooltips->tip('email');
202
$tip2 = self::$tooltips->tip('telephone');
203
+ $tip3 = self::$tooltips->tip('privacy_contact');
204
+ $tip4 = self::$tooltips->tip('terms_contact');
205
+ $privacy_contact = $terms['privacy_contact'] ? 'checked="checked"' : '';
206
+ $terms_contact = $terms['terms_contact'] ? 'checked="checked"' : '';
207
print <<< CONTACT_PANEL
208
<label>{$tip1}</label><input type="text" name="email" size="30" value="{$terms['email']}" /><br/>
209
+ <label>{$tip2}</label><input type="text" name="telephone" size="30" value="{$terms['telephone']}" /><br/>
210
+ <label>{$tip3}</label><input type="checkbox" name="privacy_contact" {$privacy_contact} value="1" /><br/>
211
+ <label>{$tip4}</label><input type="checkbox" name="terms_contact" {$terms_contact} value="1" /><br/>
212
CONTACT_PANEL;
213
}
214
+
215
+ public static function legal_panel($post,$metabox){
216
+ $terms = $metabox['args']['options']['terms'];
217
$tip1 = self::$tooltips->tip('courts');
218
$tip2 = self::$tooltips->tip('updated');
219
+ $tip3 = self::$tooltips->tip('copyright_start_year');
220
print <<< LEGAL_PANEL
221
<label>{$tip1}</label><input type="text" name="courts" size="80" value="{$terms['courts']}" /><br/>
222
+ <label>{$tip2}</label><input type="text" name="updated" size="30" value="{$terms['updated']}" /><br/>
223
<label>{$tip3}</label><input type="text" name="copyright_start_year" size="5" value="{$terms['copyright_start_year']}" /><br/>
224
LEGAL_PANEL;
225
}
226
classes/footer-credits.php CHANGED
@@ -1,9 +1,9 @@
1
<?php
2
class FooterCredits {
3
const CODE = 'footer-credits'; //element prefix
4
- const OPTIONS_NAME = 'footer_credits_options';
5
const SIDEBAR_ID = 'last-footer';
6
- const VERSION = '1.7';
7
private static $version;
8
9
protected static $is_html5 = false;
@@ -13,14 +13,21 @@ class FooterCredits {
13
'terms' => array(
14
'site' => '',
15
'owner' => '',
16
- 'copyright' => '',
17
- 'copyright_start_year' => '',
18
'country' => '',
19
- 'courts' => '',
20
'email' => '',
21
'telephone' => '',
22
- 'address' => '',
23
- 'updated' => '',
24
'privacy_contact' => '',
25
'terms_contact' => ''),
26
'nav_menu' => 0,
@@ -34,24 +41,29 @@ class FooterCredits {
34
'show_return' => true,
35
'return_text' => 'Return To Top',
36
'return_class' => '',
37
- 'footer_class' => '',
38
'footer_hook' => '',
39
'footer_remove' => true,
40
'footer_filter_hook' => '',
41
- 'visibility' => ''
42
);
43
-
44
private static function get_version(){
45
return self::$version;
46
}
47
-
48
public static function init() {
49
self::$version = self::VERSION;
50
- self::$is_html5 = function_exists('current_theme_supports') && current_theme_supports('html5');
51
self::theme_specific_defaults();
52
- add_action('widgets_init',array(__CLASS__,'register'),20);
53
add_filter( 'wp_nav_menu_items', array(__CLASS__, 'fix_home_link'), 10, 2 );
54
- if (!is_admin()) add_action('wp',array(__CLASS__,'prepare'));
55
}
56
57
public static function register() {
@@ -91,7 +103,7 @@ class FooterCredits {
91
92
private static function register_sidebars() {
93
if (self::get_option('footer_hook')) {
94
- $tag = self::$is_html5 ? 'section' : 'div';
95
register_sidebar( array(
96
'id' => self::SIDEBAR_ID,
97
'name' => __( 'Credibility Footer', __CLASS__ ),
@@ -227,37 +239,112 @@ class FooterCredits {
227
return sprintf( '<div id="footer-return" class="%1$s"><a rel="nofollow" href="#" onclick="window.scrollTo(0,0); return false;" >%2$s</a></div>', trim($class), $text);
228
}
229
230
public static function footer($atts = array()) {
231
- $params = shortcode_atts( self::get_options(), $atts ); //apply plugin defaults
232
-
233
if ($params['center']) {
234
- $section_separator = '&nbsp;';
235
- $item_separator = $params['two_lines'] ? '<br/>' : $params['separator'];
236
$params['return_class'] .= ' return-center';
237
$params['footer_class'] .= ' footer-center';
238
$clear = '';
239
} else {
240
- $section_separator = $params['two_lines'] ? $params['separator'] : '<br/>' ;
241
- $item_separator = '<br/>';
242
$params['return_class'] .= ' return-left';
243
$params['footer_class'] .= ' footer-right';
244
$clear = '<div class="clear"></div>';
245
}
246
- $copyright = self::copyright_owner(self::get_terms());
247
- $telephone = self::get_term('telephone');
248
- $email = self::get_term('email');
249
- $address = self::get_term('address');
250
return (empty($params['show_return']) ? '' :
251
self::return_to_top($params['return_text'], $params['return_class'])) .
252
- sprintf('<div id="%1$s" class="%2$s">%3$s%4$s%5$s%6$s%7$s</div>%8$s<!-- end #%1$s -->',
253
self::CODE,
254
$params['footer_class'],
255
- (empty($params['nav_menu']) ? '' : self::footer_menu($params['nav_menu'])),
256
- (empty($params['show_copyright']) ? '' : sprintf('%1$s%2$s', $section_separator, $copyright)),
257
- ((empty($address) || empty($params['show_address'])) ? '' : sprintf('%1$s<span class="address">%2$s%3$s</span>', $item_separator, self::format_address($address, $params['separator']), self::get_term('country')) ),
258
- ((empty($telephone) || empty($params['show_telephone'])) ? '' : sprintf('%1$s<span class="telephone">%2$s</span>', $section_separator, $telephone) ),
259
- ((empty($email) || empty($params['show_email'])) ? '' : sprintf('%1$s<span class="email"><a href="mailto:%2$s">%2$s</a></span>', $section_separator, $email) ),
260
- $clear
261
);
262
}
263
@@ -270,14 +357,14 @@ class FooterCredits {
270
$to[] = $value;
271
}
272
return str_replace($from,$to,$content);
273
- }
274
return $content;
275
}
276
277
public static function custom_footer() {
278
if ( is_active_sidebar( self::SIDEBAR_ID) ) {
279
- if (self::$is_html5) {
280
- echo '<footer class="custom-footer" role="contentinfo" itemscope="" itemtype="http://schema.org/WPFooter">';
281
dynamic_sidebar( self::SIDEBAR_ID );
282
echo '</footer><!-- end .custom-footer -->';
283
} else {
@@ -461,8 +548,9 @@ class Footer_Putter_Copyright_Widget extends WP_Widget {
461
$instance['show_telephone'] = !empty($new_instance['show_telephone']) ? 1 : 0;
462
$instance['show_email'] = !empty($new_instance['show_email']) ? 1 : 0;
463
$instance['show_address'] = !empty($new_instance['show_address']) ? 1 : 0;
464
$instance['center'] = !empty($new_instance['center']) ? 1 : 0;
465
- $instance['two_lines'] = !empty($new_instance['two_lines']) ? 1 : 0;
466
$instance['show_return'] = !empty($new_instance['show_return']) ? 1 : 0;
467
$instance['return_class'] = trim($new_instance['return_class']);
468
$instance['footer_class'] = trim($new_instance['footer_class']);
@@ -489,6 +577,7 @@ class Footer_Putter_Copyright_Widget extends WP_Widget {
489
$this->print_form_field($instance, 'show_telephone', 'Show Telephone number', 'checkbox');
490
$this->print_form_field($instance, 'show_email', 'Show Email Address', 'checkbox');
491
$this->print_form_field($instance, 'show_return', 'Show Return To Top Links', 'checkbox');
492
493
print <<< CUSTOM_CLASSES
494
<h4>Custom Classes (Optional)</h4>
1
<?php
2
class FooterCredits {
3
const CODE = 'footer-credits'; //element prefix
4
+ const OPTIONS_NAME = 'footer_credits_options';
5
const SIDEBAR_ID = 'last-footer';
6
+ const VERSION = '1.8';
7
private static $version;
8
9
protected static $is_html5 = false;
13
'terms' => array(
14
'site' => '',
15
'owner' => '',
16
+ 'address' => '',
17
+ 'street_address' => '',
18
+ 'locality' => '',
19
+ 'region' => '',
20
+ 'postal_code' => '',
21
'country' => '',
22
+ 'latitude' => '',
23
+ 'longitude' => '',
24
+ 'map' => '',
25
'email' => '',
26
'telephone' => '',
27
+ 'copyright' => '',
28
+ 'copyright_start_year' => '',
29
+ 'courts' => '',
30
+ 'updated' => '',
31
'privacy_contact' => '',
32
'terms_contact' => ''),
33
'nav_menu' => 0,
41
'show_return' => true,
42
'return_text' => 'Return To Top',
43
'return_class' => '',
44
+ 'footer_class' => '',
45
'footer_hook' => '',
46
'footer_remove' => true,
47
'footer_filter_hook' => '',
48
+ 'visibility' => '' ,
49
+ 'use_microdata' => false
50
);
51
+
52
private static function get_version(){
53
return self::$version;
54
}
55
+
56
+ public static function is_html5(){
57
+ return self::$is_html5;
58
+ }
59
+
60
public static function init() {
61
self::$version = self::VERSION;
62
+ self::$is_html5 = function_exists('current_theme_supports') && current_theme_supports('html5');
63
self::theme_specific_defaults();
64
+ add_action('widgets_init',array(__CLASS__,'register'),20);
65
add_filter( 'wp_nav_menu_items', array(__CLASS__, 'fix_home_link'), 10, 2 );
66
+ if (!is_admin()) add_action('wp',array(__CLASS__,'prepare'));
67
}
68
69
public static function register() {
103
104
private static function register_sidebars() {
105
if (self::get_option('footer_hook')) {
106
+ $tag = self::is_html5() ? 'section' : 'div';
107
register_sidebar( array(
108
'id' => self::SIDEBAR_ID,
109
'name' => __( 'Credibility Footer', __CLASS__ ),
239
return sprintf( '<div id="footer-return" class="%1$s"><a rel="nofollow" href="#" onclick="window.scrollTo(0,0); return false;" >%2$s</a></div>', trim($class), $text);
240
}
241
242
+ private static function contact_info($params, $item_separator, $section_separator) {
243
+ $org ='';
244
+ if ($address = self::contact_address($params['show_address'], $params['use_microdata'], $params['separator'], $section_separator)) $org .= $address;
245
+ if ($telephone = self::contact_telephone($params['show_telephone'], $params['use_microdata'], $item_separator)) $org .= $telephone;
246
+ if ($email = self::contact_email($params['show_email'], $params['use_microdata'], $item_separator)) $org .= $email;
247
+ if ($org && $params['use_microdata'])
248
+ return sprintf('<span itemscope="itemscope" itemtype="http://schema.org/Organization">%1$s</span>', $org);
249
+ else
250
+ return $org;
251
+ }
252
+
253
+ private static function contact_telephone($show_telephone, $microdata, $prefix) {
254
+ if ($show_telephone && ($telephone = self::get_term('telephone')))
255
+ if ($microdata)
256
+ return sprintf('%1$s<span itemprop="telephone" class="telephone">%2$s</span>', $prefix, $telephone) ;
257
+ else
258
+ return sprintf('%1$s<span class="telephone">%2$s</span>', $prefix, $telephone) ;
259
+ else
260
+ return '';
261
+ }
262
+
263
+ private static function contact_email($show_email, $microdata, $prefix) {
264
+ if ($show_email && ($email = self::get_term('email')))
265
+ return sprintf('%1$s<a href="mailto:%2$s" class="email"%3$s>%2$s</a>', $prefix, $email, $microdata ? ' itemprop="email"' : '') ;
266
+ else
267
+ return '';
268
+ }
269
+
270
+ private static function contact_address($show_address, $microdata, $separator, $prefix) {
271
+ if ($show_address)
272
+ if ($microdata) {
273
+ return self::org_location($separator, $prefix);
274
+ } elseif ($address = self::get_term('address'))
275
+ return sprintf('%1$s<span class="address">%2$s%3$s</span>', $prefix, self::format_address($address, $separator), self::get_term('country'));
276
+ return '';
277
+ }
278
+
279
+ private static function org_location($separator, $prefix) {
280
+ $location = '';
281
+ if ($loc_address = self::location_address( $separator)) $location .= $loc_address;
282
+ if ($loc_geo = self::location_geo()) $location .= $loc_geo;
283
+ if ($loc_map = self::location_map()) $location .= $loc_map;
284
+ if ($location)
285
+ return sprintf('%1$s<span itemprop="location" itemscope="itemscope" itemtype="http://schema.org/Place">%2$s</span>', $prefix, $location) ;
286
+ else
287
+ return '';
288
+ }
289
+
290
+ private static function location_address($separator) {
291
+ $address = '';
292
+ if ( $street_address = self::get_term('street_address'))
293
+ $address .= sprintf('<span itemprop="streetAddress">%1$s</span>', self::format_address($street_address, $separator)) ;
294
+ if ( $locality = self::get_term('locality'))
295
+ $address .= sprintf('<span itemprop="addressLocality">%1$s</span>', self::format_address($locality, $separator)) ;
296
+ if ( $region = self::get_term('region'))
297
+ $address .= sprintf('<span itemprop="addressRegion">%1$s</span>', self::format_address($region, $separator)) ;
298
+ if ( $postal_code = self::get_term('postal_code'))
299
+ $address .= sprintf('<span itemprop="postalCode">%1$s</span>', self::format_address($postal_code, $separator)) ;
300
+ if ( $country = self::get_term('country'))
301
+ $address .= sprintf('<span itemprop="addressCountry">%1$s</span>', $country) ;
302
+
303
+ if ($address)
304
+ return sprintf('<span class="address" itemprop="address" itemscope="itemscope" itemtype="http://schema.org/PostalAddress">%1$s</span>',$address) ;
305
+ else
306
+ return '';
307
+ }
308
+
309
+ private static function location_geo() {
310
+ $geo = '';
311
+ if ( $latitude = self::get_term('latitude')) $geo .= sprintf('<meta itemprop="latitude" content="%1$s" />', $latitude) ;
312
+ if ( $longitude = self::get_term('longitude')) $geo .= sprintf('<meta itemprop="longitude" content="%1$s" />', $longitude) ;
313
+ return $geo ? sprintf('<span itemprop="geo" itemscope="itemscope" itemtype="http://schema.org/GeoCoordinates">%1$s</span>', $geo) : '';
314
+ }
315
+
316
+ private static function location_map() {
317
+ if ( $map = self::get_term('map'))
318
+ return sprintf('<a rel="nofollow external" target="_blank" class="map" itemprop="map" href="%1$s">%2$s</a>', $map, __('Map')) ;
319
+ else
320
+ return '';
321
+ }
322
+
323
public static function footer($atts = array()) {
324
+ $params = shortcode_atts( self::get_options(), $atts ); //apply plugin defaults
325
+
326
if ($params['center']) {
327
+ $item_separator = '&nbsp;';
328
+ $section_separator = $params['two_lines'] ? '<br/>' : $params['separator'];
329
$params['return_class'] .= ' return-center';
330
$params['footer_class'] .= ' footer-center';
331
$clear = '';
332
} else {
333
+ $item_separator = $params['two_lines'] ? $params['separator'] : '<br/>' ;
334
+ $section_separator = '<br/>';
335
$params['return_class'] .= ' return-left';
336
$params['footer_class'] .= ' footer-right';
337
$clear = '<div class="clear"></div>';
338
}
339
return (empty($params['show_return']) ? '' :
340
self::return_to_top($params['return_text'], $params['return_class'])) .
341
+ sprintf('<div id="%1$s" class="%2$s">%3$s%4$s%5$s</div>%6$s<!-- end #%1$s -->',
342
self::CODE,
343
$params['footer_class'],
344
+ (empty($params['nav_menu']) ? '' : self::footer_menu($params['nav_menu'])),
345
+ (empty($params['show_copyright']) ? '' : sprintf('%1$s%2$s', $item_separator, self::copyright_owner(self::get_terms()))),
346
+ self::contact_info($params, $item_separator, $section_separator),
347
+ $clear
348
);
349
}
350
357
$to[] = $value;
358
}
359
return str_replace($from,$to,$content);
360
+ }
361
return $content;
362
}
363
364
public static function custom_footer() {
365
if ( is_active_sidebar( self::SIDEBAR_ID) ) {
366
+ if (self::is_html5()) {
367
+ echo '<footer class="custom-footer" role="contentinfo" itemscope="itemscope" itemtype="http://schema.org/WPFooter">';
368
dynamic_sidebar( self::SIDEBAR_ID );
369
echo '</footer><!-- end .custom-footer -->';
370
} else {
548
$instance['show_telephone'] = !empty($new_instance['show_telephone']) ? 1 : 0;
549
$instance['show_email'] = !empty($new_instance['show_email']) ? 1 : 0;
550
$instance['show_address'] = !empty($new_instance['show_address']) ? 1 : 0;
551
+ $instance['use_microdata'] = !empty($new_instance['use_microdata']);
552
$instance['center'] = !empty($new_instance['center']) ? 1 : 0;
553
+ $instance['two_lines'] = !empty($new_instance['two_lines']) ? 1 : 0;
554
$instance['show_return'] = !empty($new_instance['show_return']) ? 1 : 0;
555
$instance['return_class'] = trim($new_instance['return_class']);
556
$instance['footer_class'] = trim($new_instance['footer_class']);
577
$this->print_form_field($instance, 'show_telephone', 'Show Telephone number', 'checkbox');
578
$this->print_form_field($instance, 'show_email', 'Show Email Address', 'checkbox');
579
$this->print_form_field($instance, 'show_return', 'Show Return To Top Links', 'checkbox');
580
+ if (FooterCredits::is_html5()) $this->print_form_field($instance, 'use_microdata', 'Use HTML5 Microdata', 'checkbox');
581
582
print <<< CUSTOM_CLASSES
583
<h4>Custom Classes (Optional)</h4>
classes/footer-trademarks.php CHANGED
@@ -1,14 +1,35 @@
1
<?php
2
class Footer_Putter_TradeMark_Widget extends WP_Widget {
3
4
- private $defaults = array(
5
- 'category' => false, 'orderby' => 'name', 'limit' => '', 'visibility' => '');
6
7
function __construct() {
8
$widget_ops = array('description' => __( 'Trademarks, Service Marks and Kitemarks', GENESIS_CLUB_DOMAIN) );
9
parent::__construct('footer_trademarks', __('TradeMarks Widget', GENESIS_CLUB_DOMAIN), $widget_ops);
10
}
11
12
function widget( $args, $instance ) {
13
extract($args, EXTR_SKIP);
14
if (FooterCredits::hide_widget($instance)) return; //check visibility requirements
@@ -17,12 +38,13 @@ class Footer_Putter_TradeMark_Widget extends WP_Widget {
17
$orderby = isset( $instance['orderby'] ) ? $instance['orderby'] : 'name';
18
$order = $orderby == 'rating' ? 'DESC' : 'ASC';
19
$limit = (isset( $instance['limit'] ) && $instance['limit']) ? $instance['limit'] : -1;
20
21
$links = wp_list_bookmarks(apply_filters('widget_links_args', array(
22
- 'echo' => 0,
23
'title_before' => $before_title, 'title_after' => $after_title,
24
- 'title_li' => '', 'categorize' => false,
25
- 'before' => '', 'after' => '',
26
'category_before' => '', 'category_after' => '',
27
'show_images' => true, 'show_description' => false,
28
'show_name' => false, 'show_rating' => false,
@@ -31,18 +53,21 @@ class Footer_Putter_TradeMark_Widget extends WP_Widget {
31
'limit' => $limit,
32
)));
33
echo $before_widget;
34
- echo $links;
35
echo $after_widget;
36
}
37
38
function update( $new_instance, $old_instance ) {
39
$new_instance = (array) $new_instance;
40
-
41
$instance['orderby'] = 'name';
42
if ( in_array( $new_instance['orderby'], array( 'name', 'rating', 'id', 'rand' ) ) )
43
$instance['orderby'] = $new_instance['orderby'];
44
$instance['category'] = intval( $new_instance['category'] );
45
$instance['limit'] = ! empty( $new_instance['limit'] ) ? intval( $new_instance['limit'] ) : '';
46
$instance['visibility'] = trim($new_instance['visibility']);
47
return $instance;
48
}
@@ -57,16 +82,17 @@ class Footer_Putter_TradeMark_Widget extends WP_Widget {
57
}
58
$this->print_form_field($instance, 'category', 'Select Link Category for Your Trademarks', 'select', $links);
59
$this->print_form_field($instance, 'orderby', 'Sort by', 'select', array(
60
- 'name' => __( 'Link title', GENESIS_CLUB_DOMAIN),
61
- 'rating' => __( 'Link rating', GENESIS_CLUB_DOMAIN),
62
- 'id' => __( 'Link ID', GENESIS_CLUB_DOMAIN),
63
- 'rand' => __( 'Random', GENESIS_CLUB_DOMAIN)
64
));
65
$this->print_form_field($instance, 'limit', 'Number of links to show', 'text', array(), array('size' => 3 ,'maxlength' => 3));
66
- $this->print_form_field($instance, 'visibility', '<h4>Widget Visibility</h4>', 'radio',
67
FooterCredits::get_visibility_options(), array('separator' => '<br/>'));
68
}
69
-
70
function print_form_field($instance, $fld, $label, $type, $options = array(), $args = array()) {
71
$value = array_key_exists($fld,$instance) ? $instance[$fld] : false;
72
print FooterCredits::form_field(
1
<?php
2
class Footer_Putter_TradeMark_Widget extends WP_Widget {
3
4
+ private $defaults = array(
5
+ 'category' => false, 'orderby' => 'name', 'limit' => '', 'visibility' => '', 'nofollow' => false);
6
7
function __construct() {
8
$widget_ops = array('description' => __( 'Trademarks, Service Marks and Kitemarks', GENESIS_CLUB_DOMAIN) );
9
parent::__construct('footer_trademarks', __('TradeMarks Widget', GENESIS_CLUB_DOMAIN), $widget_ops);
10
}
11
12
+
13
+ function nofollow_links( $content) {
14
+ return preg_replace_callback( '/<a([^>]*)>(.*?)<\/a[^>]*>/is', array( &$this, 'nofollow_link' ), $content ) ;
15
+ }
16
+
17
+ function nofollow_link($matches) { //make link nofollow
18
+ $attrs = shortcode_parse_atts( stripslashes ($matches[ 1 ]) );
19
+ $atts='';
20
+ $rel = ' rel="nofollow"';
21
+ foreach ( $attrs AS $key => $value ) {
22
+ $key = strtolower($key);
23
+ $nofollow = '';
24
+ if ('rel' == $key) {
25
+ $rel = '';
26
+ if (strpos($value, 'follow') === FALSE) $nofollow = ' nofollow';
27
+ }
28
+ $atts .= sprintf(' %1$s="%2$s%3$s"', $key, $value, $nofollow);
29
+ }
30
+ return sprintf('<a%1$s%2$s>%3$s</a>', $rel, $atts, $matches[ 2 ]);
31
+ }
32
+
33
function widget( $args, $instance ) {
34
extract($args, EXTR_SKIP);
35
if (FooterCredits::hide_widget($instance)) return; //check visibility requirements
38
$orderby = isset( $instance['orderby'] ) ? $instance['orderby'] : 'name';
39
$order = $orderby == 'rating' ? 'DESC' : 'ASC';
40
$limit = (isset( $instance['limit'] ) && $instance['limit']) ? $instance['limit'] : -1;
41
+ $nofollow = isset( $instance['nofollow'] ) && $instance['nofollow'];
42
43
$links = wp_list_bookmarks(apply_filters('widget_links_args', array(
44
+ 'echo' => 0,
45
'title_before' => $before_title, 'title_after' => $after_title,
46
+ 'title_li' => '', 'categorize' => false,
47
+ 'before' => '', 'after' => '',
48
'category_before' => '', 'category_after' => '',
49
'show_images' => true, 'show_description' => false,
50
'show_name' => false, 'show_rating' => false,
53
'limit' => $limit,
54
)));
55
echo $before_widget;
56
+ if ($nofollow)
57
+ echo $this->nofollow_links($links);
58
+ else
59
+ echo $links;
60
echo $after_widget;
61
}
62
63
function update( $new_instance, $old_instance ) {
64
$new_instance = (array) $new_instance;
65
$instance['orderby'] = 'name';
66
if ( in_array( $new_instance['orderby'], array( 'name', 'rating', 'id', 'rand' ) ) )
67
$instance['orderby'] = $new_instance['orderby'];
68
$instance['category'] = intval( $new_instance['category'] );
69
$instance['limit'] = ! empty( $new_instance['limit'] ) ? intval( $new_instance['limit'] ) : '';
70
+ $instance['nofollow'] = !empty($new_instance['nofollow']);
71
$instance['visibility'] = trim($new_instance['visibility']);
72
return $instance;
73
}
82
}
83
$this->print_form_field($instance, 'category', 'Select Link Category for Your Trademarks', 'select', $links);
84
$this->print_form_field($instance, 'orderby', 'Sort by', 'select', array(
85
+ 'name' => __( 'Link title'),
86
+ 'rating' => __( 'Link rating'),
87
+ 'id' => __( 'Link ID'),
88
+ 'rand' => __( 'Random')
89
));
90
$this->print_form_field($instance, 'limit', 'Number of links to show', 'text', array(), array('size' => 3 ,'maxlength' => 3));
91
+ $this->print_form_field($instance, 'nofollow', ' NoFollow links', 'checkbox');
92
+ $this->print_form_field($instance, 'visibility', '<h4>Widget Visibility</h4>', 'radio',
93
FooterCredits::get_visibility_options(), array('separator' => '<br/>'));
94
}
95
+
96
function print_form_field($instance, $fld, $label, $type, $options = array(), $args = array()) {
97
$value = array_key_exists($fld,$instance) ? $instance[$fld] : false;
98
print FooterCredits::form_field(
main.php CHANGED
@@ -3,13 +3,13 @@
3
* Plugin Name: Footer Putter
4
* Plugin URI: http://www.diywebmastery.com/plugins/footer-putter/
5
* Description: Put a footer on your site that boosts your credibility with both search engines and human visitors.
6
- * Version: 1.7.1
7
* Author: Russell Jamieson
8
* Author URI: http://www.diywebmastery.com/about/
9
* License: GPLv2+
10
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
*/
12
- define('FOOTER_PUTTER_VERSION','1.7.1');
13
define('FOOTER_PUTTER_FRIENDLY_NAME', 'Footer Putter') ;
14
define('FOOTER_PUTTER_PLUGIN_NAME', plugin_basename(dirname(__FILE__))) ;
15
define('FOOTER_PUTTER_HOME_URL','http://www.diywebmastery.com/plugins/footer-putter/');
3
* Plugin Name: Footer Putter
4
* Plugin URI: http://www.diywebmastery.com/plugins/footer-putter/
5
* Description: Put a footer on your site that boosts your credibility with both search engines and human visitors.
6
+ * Version: 1.8
7
* Author: Russell Jamieson
8
* Author URI: http://www.diywebmastery.com/about/
9
* License: GPLv2+
10
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
*/
12
+ define('FOOTER_PUTTER_VERSION','1.8');
13
define('FOOTER_PUTTER_FRIENDLY_NAME', 'Footer Putter') ;
14
define('FOOTER_PUTTER_PLUGIN_NAME', plugin_basename(dirname(__FILE__))) ;
15
define('FOOTER_PUTTER_HOME_URL','http://www.diywebmastery.com/plugins/footer-putter/');
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.diywebmastery.com/donate/
4
Tags: footer, copyright, trademark
5
Requires at least: 3.0
6
Tested up to: 3.8.1
7
- Stable tag: 1.7.1
8
License: GPLv2+
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -22,9 +22,11 @@ Put a footer on your site that boosts your credibility with both search engines
22
* Supports both a single line centred footer and a multi-line right aligned footer
23
* The Footer hook setting allows you to add the footer in just the right place on themes that do not have suitable widget areas
24
* Predefined classes tiny, small, light, dark and white make it easy to change footer size and color if required.
25
- * Added widget visibility control: show always, don�t show on landing pages, only show on landing pages.
26
- * Automatic HTML5 support
27
* Can append company contact information to Privacy and Terms and Conditions pages.
28
29
== Installation ==
30
@@ -46,6 +48,7 @@ Put a footer on your site that boosts your credibility with both search engines
46
47
== Changelog ==
48
49
= 1.7.1 = Fix bug when loaded under AJAX
50
= 1.7 = Made email address a mailto link. Added pre-defined classes, tiny and small, to make it easy to use a smaller font size in the footer on pages such as landing pages. Added widget visibility setting to make it easy to either hide or show the footer widgets on landing pages. Replaced the plugin icon image in admin menu with a dashicons font character. Automatically uses HTML5 if theme supports HTML5 - no manual setting required.
51
= 1.6 = Add option to include email address in the copyright footer widget, remove the automatic adding of rel=nofollow in footer links, and add optional sub-footer sections to the privacy and terms pages
@@ -59,8 +62,8 @@ Put a footer on your site that boosts your credibility with both search engines
59
60
== Upgrade Notice ==
61
62
- = 1.7.1 =
63
- * Mandatory - Fix bug when loaded under AJAX.
64
65
== Links ==
66
@@ -68,3 +71,5 @@ Here are some of the useful Footer Putter WordPress Plugin links
68
69
* Footer Putter Plugin: http://www.diywebmastery.com/plugins/footer-putter/
70
* Compatible Themes and Hooks: http://www.diywebmastery.com/footer-credits-compatible-themes-and-hooks
4
Tags: footer, copyright, trademark
5
Requires at least: 3.0
6
Tested up to: 3.8.1
7
+ Stable tag: 1.8
8
License: GPLv2+
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
22
* Supports both a single line centred footer and a multi-line right aligned footer
23
* The Footer hook setting allows you to add the footer in just the right place on themes that do not have suitable widget areas
24
* Predefined classes tiny, small, light, dark and white make it easy to change footer size and color if required.
25
* Can append company contact information to Privacy and Terms and Conditions pages.
26
+ * Added widget visibility control: show always, do not show on landing pages, only show on landing pages.
27
+ * Automatic HTML5 support
28
+ * Option to use HTML5 microdata for Organization in accordance with Google recommendations
29
+ * Option to apply rel=nofollow automatically to footer trademark links
30
31
== Installation ==
32
48
49
== Changelog ==
50
51
+ = 1.8 = Added options to use HTML5 microdata and to apply rel=nofollow automatically to footer trademark links
52
= 1.7.1 = Fix bug when loaded under AJAX
53
= 1.7 = Made email address a mailto link. Added pre-defined classes, tiny and small, to make it easy to use a smaller font size in the footer on pages such as landing pages. Added widget visibility setting to make it easy to either hide or show the footer widgets on landing pages. Replaced the plugin icon image in admin menu with a dashicons font character. Automatically uses HTML5 if theme supports HTML5 - no manual setting required.
54
= 1.6 = Add option to include email address in the copyright footer widget, remove the automatic adding of rel=nofollow in footer links, and add optional sub-footer sections to the privacy and terms pages
62
63
== Upgrade Notice ==
64
65
+ = 1.8 =
66
+ * Optional - Option to use HTML5 microdata for Organization in accordance with Google recommendations.
67
68
== Links ==
69
71
72
* Footer Putter Plugin: http://www.diywebmastery.com/plugins/footer-putter/
73
* Compatible Themes and Hooks: http://www.diywebmastery.com/footer-credits-compatible-themes-and-hooks
74
+ * How To Use A Different Footer On Landing Pages: http://www.diywebmastery.com/4098/how-to-add-a-different-footer-on-landing-pages
75
+ * Using HTML5 Microdata for better SEO and Local Search: http://www.diywebmastery.com/4109/using-html5-microdata-footer
styles/footer-credits.css CHANGED
@@ -1,31 +1,31 @@
1
- #footer .footer-center, #footer .return-center, .footer-center, .return-center { text-align: center; margin: 10px 0px; }
2
- #footer .return-left, .return-left { float: left; width : 20%; }
3
- #footer .footer-right, .footer-right { float: right; text-align: right; width: 70%; margin-bottom: 10px; }
4
- #footer #footer-credits ul, #footer #footer-credits ul li, #footer-credits ul, #footer-credits ul li {
5
- display : inline-block; list-style-type: none; background: none; border: 0; margin: 0px; padding: 0; vertical-align: middle; }
6
- #footer #footer-credits ul li:before, #footer-credits ul li:before {
7
- content : '\B7'; }
8
- #footer #footer-credits ul li:first-child:before, #footer-credits ul li:first-child:before {
9
- content : ''; }
10
- #footer #footer-credits ul li a, #footer-credits ul li a {
11
- text-decoration: none; color: inherit; font-weight: normal; letter-spacing : normal; text-transform: none; margin:0 10px; }
12
- #footer #footer-credits ul li a:hover, #footer-credits ul li a:hover {
13
- text-decoration: underline; }
14
- #footer-credits span.copyright, #footer-credits span.telephone, #footer-credits span.address,
15
- #footer-credits span.email, #footer-credits span.email a {
16
- font-weight: normal; letter-spacing : normal; text-transform: none; margin: 0 10px; vertical-align: middle;
17
- background: inherit; border : none; float: none; display: inline; color: inherit; text-decoration: none; }
18
-
19
- #footer-credits.dark, #footer-credits.dark li, #footer-credits.dark a, #footer-return.dark a , #footer-return.dark a:visited { color : #222222; }
20
- #footer-credits.light, #footer-credits.light li, #footer-credits.light a, #footer-return.light a, #footer-return.light a:visited { color : #DDDDDD; }
21
- #footer-credits.white, #footer-credits.white li, #footer-credits.white a, #footer-return.white a, #footer-return.white a:visited { color : white; }
22
- #footer-credits.small, #footer-credits.small ul li a, #footer-return.small a { font-size : small; }
23
- #footer-credits.tiny, #footer-credits.tiny ul li a, #footer-return.tiny a { font-size : x-small; }
24
-
25
- .widget_footer_trademarks { text-align: center; margin: 10px 0;}
26
- .widget_footer_trademarks a { margin: 10px; }
27
- .widget_footer_trademarks img { border: 0 !important; }
28
-
29
- .widget_footer_copyright, .widget_footer_trademarks
30
- { margin: 0 !important; padding: 0 !important; width: 100% !important; float:none !important; }
31
- .site-info .custom-footer { margin: 0 !important; border: 0 !important; padding : 0!important; width: 100% !important;}
1
+ #footer .footer-center, #footer .return-center, .footer-center, .return-center { text-align: center; margin: 10px 0px; border:none;}
2
+ #footer .return-left, .return-left { float: left; width : 20%; }
3
+ #footer .footer-right, .footer-right { float: right; text-align: right; width: 70%; margin-bottom: 10px; }
4
+ #footer #footer-credits ul, #footer #footer-credits ul li, #footer-credits ul, #footer-credits ul li {
5
+ display : inline-block; list-style-type: none; background: none; border: 0; margin: 0px; padding: 0; vertical-align: middle; }
6
+ #footer #footer-credits ul li:before, #footer-credits ul li:before {
7
+ content : '\B7'; }
8
+ #footer #footer-credits ul li:first-child:before, #footer-credits ul li:first-child:before {
9
+ content : ''; }
10
+ #footer #footer-credits ul li a, #footer-credits ul li a {
11
+ text-decoration: none; color: inherit; font-weight: normal; letter-spacing : normal; text-transform: none; margin:0 10px; }
12
+ #footer #footer-credits ul li a:hover, #footer-credits ul li a:hover, #footer-credits a.email:hover, #footer-credits a.map:hover {
13
+ text-decoration: underline; }
14
+ #footer-credits span.copyright, #footer-credits span.telephone, #footer-credits span.address,
15
+ #footer-credits a.email, #footer-credits a.map {
16
+ font-weight: normal; letter-spacing : normal; text-transform: none; margin: 0 10px; vertical-align: middle;
17
+ background: inherit; border : none; float: none; display: inline; color: inherit; text-decoration: none; }
18
+
19
+ #footer-credits.dark, #footer-credits.dark li, #footer-credits.dark a, #footer-return.dark a , #footer-return.dark a:visited { color : #222222; }
20
+ #footer-credits.light, #footer-credits.light li, #footer-credits.light a, #footer-return.light a, #footer-return.light a:visited { color : #DDDDDD; }
21
+ #footer-credits.white, #footer-credits.white li, #footer-credits.white a, #footer-return.white a, #footer-return.white a:visited { color : white; }
22
+ #footer-credits.small, #footer-credits.small ul li a, #footer-return.small a { font-size : small; }
23
+ #footer-credits.tiny, #footer-credits.tiny ul li a, #footer-return.tiny a { font-size : x-small; }
24
+
25
+ .widget_footer_trademarks { text-align: center; margin: 10px 0;}
26
+ .widget_footer_trademarks a { margin: 10px; border: 0 !important;}
27
+ .widget_footer_trademarks img { border: 0 !important; }
28
+
29
+ .widget_footer_copyright, .widget_footer_trademarks
30
+ { margin: 0 !important; padding: 0 !important; width: 100% !important; float:none !important; }
31
+ .site-info .custom-footer { margin: 0 !important; border: 0 !important; padding : 0!important; width: 100% !important;}