HeadSpace2 SEO - Version 3.6.37

Version Description

  • Fix bug with site modules not saving
Download this release

Release Info

Developer johnny5
Plugin Icon wp plugin HeadSpace2 SEO
Version 3.6.37
Comparing to
See all releases

Code changes from version 3.6.34 to 3.6.37

Files changed (64) hide show
  1. ajax.php +37 -37
  2. headspace.php +66 -73
  3. headspace_library.php +21 -22
  4. locale/cs_CZ.mo +0 -0
  5. locale/cs_CZ.po +1789 -0
  6. locale/headspace2.pot +1700 -0
  7. locale/it_IT.mo +0 -0
  8. locale/it_IT.po +1056 -1024
  9. locale/messages.po +0 -1710
  10. models/headspace.php +37 -64
  11. models/importer.php +4 -5
  12. models/inline_tags.php +36 -38
  13. models/mass_edit.php +2 -2
  14. models/modules.php +18 -18
  15. models/pager.php +67 -69
  16. models/site.php +17 -17
  17. models/term_pager.php +15 -16
  18. models/upgrade.php +22 -24
  19. modules/import/all-in-one-seo.php +9 -11
  20. modules/import/head_meta_description.php +5 -7
  21. modules/import/headspace_tags.php +4 -6
  22. modules/import/jerome.php +6 -8
  23. modules/import/lud.icro.us.php +5 -7
  24. modules/import/more_unique.php +5 -7
  25. modules/import/seo-title-tags.php +5 -7
  26. modules/import/simple-tagging.php +5 -7
  27. modules/import/simple-tags.php +11 -13
  28. modules/import/utw.php +5 -7
  29. modules/mass/description.php +10 -11
  30. modules/mass/keywords.php +10 -11
  31. modules/mass/more_text.php +10 -12
  32. modules/mass/page_slug.php +9 -10
  33. modules/mass/page_title.php +10 -12
  34. modules/mass/site_description.php +10 -12
  35. modules/mass/site_name.php +10 -12
  36. modules/mass/tags.php +13 -13
  37. modules/page/custom.php +10 -10
  38. modules/page/description.php +15 -15
  39. modules/page/follow-links.php +20 -20
  40. modules/page/javascript.php +8 -8
  41. modules/page/keywords.php +15 -15
  42. modules/page/more_text.php +18 -18
  43. modules/page/noindex.php +19 -19
  44. modules/page/page-links.php +36 -36
  45. modules/page/page_title.php +23 -23
  46. modules/page/plugin.php +31 -32
  47. modules/page/raw-footer.php +8 -9
  48. modules/page/raw.php +7 -8
  49. modules/page/relative-links.php +13 -13
  50. modules/page/rss_name.php +11 -12
  51. modules/page/rss_tagline.php +12 -13
  52. modules/page/site_name.php +11 -12
  53. modules/page/site_tagline.php +11 -12
  54. modules/page/stylesheet.php +12 -13
  55. modules/page/tags.php +45 -46
  56. modules/page/tags/auto_suggest.php +12 -14
  57. modules/page/tags/porter_stem.php +0 -1
  58. modules/page/tags/yahoo.php +5 -7
  59. modules/page/theme.php +22 -22
  60. modules/site/analytics.php +0 -2
  61. modules/site/google_webmaster.php +3 -3
  62. plugin.php +11 -11
  63. readme.txt +124 -110
  64. version.txt +0 -17
ajax.php CHANGED
@@ -29,18 +29,18 @@ class HeadspaceAjax extends HeadSpace_Plugin {
29
 
30
  add_action( 'init', array( &$this, 'init' ) );
31
  }
32
-
33
  function init() {
34
  if ( current_user_can( 'manage_options' ) ) {
35
  $this->register_ajax( 'hs_settings_edit' );
36
  $this->register_ajax( 'hs_settings_save' );
37
  $this->register_ajax( 'hs_settings_load' );
38
-
39
  $this->register_ajax( 'hs_module_edit' );
40
  $this->register_ajax( 'hs_module_load' );
41
  $this->register_ajax( 'hs_module_save' );
42
  $this->register_ajax( 'hs_module_order' );
43
-
44
  $this->register_ajax( 'hs_site_onoff' );
45
  $this->register_ajax( 'hs_site_edit' );
46
  $this->register_ajax( 'hs_site_load' );
@@ -51,7 +51,7 @@ class HeadspaceAjax extends HeadSpace_Plugin {
51
  $this->register_ajax( 'hs_auto_tag' );
52
  $this->register_ajax( 'hs_auto_description' );
53
  }
54
-
55
  function obj_to_array( $items ) {
56
  $merged = array();
57
  if ( !empty( $items ) > 0 ) {
@@ -60,15 +60,15 @@ class HeadspaceAjax extends HeadSpace_Plugin {
60
  $merged[$key] = $value;
61
  }
62
  }
63
-
64
  return $merged;
65
  }
66
-
67
  function hs_settings_edit() {
68
  $id = $_GET['page'];
69
  $headspace = HeadSpace2::get ();
70
  $types = $headspace->get_types();
71
-
72
  if ( in_array( $id, array_keys( $types ) ) && check_ajax_referer( 'headspace-edit_setting_'.$id ) ) {
73
  $settings = $this->obj_to_array( get_option( 'headspace_'.$id ) );
74
 
@@ -77,11 +77,11 @@ class HeadspaceAjax extends HeadSpace_Plugin {
77
 
78
  $this->render_admin( 'page-settings-item', array( 'type' => $id, 'name' => $types[$id][0], 'desc' => $types[$id][1], 'nolink' => true ) );
79
  $this->render_admin( 'page-settings-edit-ajax', array( 'simple' => $simple, 'advanced' => $advanced, 'type' => $id, 'area' => 'page' ) );
80
-
81
  die();
82
  }
83
  }
84
-
85
  function hs_settings_save() {
86
  $id = $_POST['module'];
87
  $headspace = HeadSpace2::get ();
@@ -94,12 +94,12 @@ class HeadspaceAjax extends HeadSpace_Plugin {
94
  $this->hs_settings_load();
95
  }
96
  }
97
-
98
  function hs_settings_load() {
99
  $id = $_POST['module'];
100
  $headspace = HeadSpace2::get ();
101
  $types = $headspace->get_types();
102
-
103
  if ( in_array( $id, array_keys( $types ) ) && check_ajax_referer( 'headspace-page_setting_'.$id ) ) {
104
  $settings = get_option( 'headspace_'.$id );
105
 
@@ -107,19 +107,19 @@ class HeadspaceAjax extends HeadSpace_Plugin {
107
  die();
108
  }
109
  }
110
-
111
  function hs_module_edit() {
112
  if ( check_ajax_referer( 'headspace-module_'.$_GET['module'] ) ) {
113
  $headspace = HeadSpace2::get ();
114
  $module = $headspace->modules->get( $_GET['module'] );
115
-
116
  if ( $module )
117
  $this->render_admin( 'page-module-edit', array( 'module' => $module, 'id' => $_GET['module'] ) );
118
-
119
  die();
120
  }
121
  }
122
-
123
  function hs_module_save() {
124
  if ( check_ajax_referer( 'headspace-module_save_'.$_POST['module'] ) ) {
125
  $headspace = HeadSpace2::get ();
@@ -132,7 +132,7 @@ class HeadspaceAjax extends HeadSpace_Plugin {
132
  }
133
  }
134
  }
135
-
136
  function hs_module_load() {
137
  if ( check_ajax_referer( 'headspace-module_'.$_GET['module'] ) ) {
138
  $headspace = HeadSpace2::get ();
@@ -140,7 +140,7 @@ class HeadspaceAjax extends HeadSpace_Plugin {
140
 
141
  if ( $module )
142
  $this->render_admin( 'page-module-item', array( 'module' => $module ) );
143
-
144
  die();
145
  }
146
  }
@@ -170,7 +170,7 @@ class HeadspaceAjax extends HeadSpace_Plugin {
170
 
171
  if ( count( $options['advanced_modules'] ) > 0 ) {
172
  $newmod = array ();
173
-
174
  foreach ( $options['advanced_modules'] AS $name ) {
175
  $name = 'hsm_'.str_replace( '-', '_', strtolower( $name ) );
176
  $module = new $name;
@@ -185,7 +185,7 @@ class HeadspaceAjax extends HeadSpace_Plugin {
185
  update_option( 'headspace_options', $options );
186
  }
187
  }
188
-
189
  function hs_site_edit() {
190
  if ( check_ajax_referer( 'headspace-site_module' ) ) {
191
  $headspace = HeadSpace2::get ();
@@ -193,11 +193,11 @@ class HeadspaceAjax extends HeadSpace_Plugin {
193
 
194
  if ( $module )
195
  $this->render_admin( 'site-module-edit', array( 'module' => $module, 'id' => $_GET['module'] ) );
196
-
197
  die();
198
  }
199
  }
200
-
201
  function hs_site_load() {
202
  if ( check_ajax_referer( 'headspace-site_module' ) ) {
203
  $headspace = HeadSpace2::get ();
@@ -205,11 +205,11 @@ class HeadspaceAjax extends HeadSpace_Plugin {
205
 
206
  if ($module)
207
  $this->render_admin( 'site-module-item', array( 'module' => $module ) );
208
-
209
  die();
210
  }
211
  }
212
-
213
  function hs_site_save() {
214
  if ( check_ajax_referer( 'headspace-site_save_'.$_POST['module'] ) ) {
215
  $headspace = HeadSpace2::get ();
@@ -223,7 +223,7 @@ class HeadspaceAjax extends HeadSpace_Plugin {
223
  die();
224
  }
225
  }
226
-
227
  function hs_site_onoff() {
228
  if ( check_ajax_referer( 'headspace-site_module' ) ) {
229
  $options = get_option( 'headspace_options' );
@@ -231,10 +231,10 @@ class HeadspaceAjax extends HeadSpace_Plugin {
231
  $options = array();
232
 
233
  $id = $_POST['module'];
234
-
235
- if ( $_POST['onoff'] == 'true' && !in_array( $id, $options['site_modules'] ) && isset( $_POST['file'] ) && $_POST['file'] )
236
  $options['site_modules'][$_POST['file']] = $id;
237
- elseif ( $_POST['onoff'] == 'false' && in_array( $id, $options['site_modules'] ) )
238
  unset( $options['site_modules'][$_POST['file']] );
239
 
240
  if ( count( $options['site_modules'] ) > 0 ) {
@@ -271,13 +271,13 @@ class HeadspaceAjax extends HeadSpace_Plugin {
271
  // Extract 1st paragraph first blank line
272
  if ( function_exists( 'mb_strpos' ) ) {
273
  $pos = mb_strpos( $excerpt, '.' );
274
-
275
  if ( $pos !== false )
276
  $excerpt = mb_substr( $excerpt, 0, $pos + 1 );
277
  }
278
  else {
279
  $pos = strpos( $excerpt, '.' );
280
-
281
  if ($pos !== false)
282
  $excerpt = substr( $excerpt, 0, $pos + 1 );
283
  }
@@ -285,27 +285,27 @@ class HeadspaceAjax extends HeadSpace_Plugin {
285
  // Replace all returns and HTML
286
  $excerpt = str_replace( "\r", '', $excerpt );
287
  $excerpt = str_replace( "\n", '', $excerpt );
288
-
289
  // Restrict it to HS description length setting
290
  if ( function_exists( 'mb_substr' ) )
291
  $excerpt = mb_substr( $excerpt, 0, 500 );
292
  else
293
  $excerpt = substr( $excerpt, 0, 500 );
294
-
295
  $excerpt = preg_replace( '/\s+/', ' ', $excerpt );
296
  echo $excerpt;
297
  die();
298
  }
299
  }
300
-
301
  function hs_tag_update() {
302
  $headspace = HeadSpace2::get ();
303
  $id = intval( $_GET['id'] );
304
-
305
  if ( check_ajax_referer( 'headspace-tags' ) && current_user_can( 'edit_post', $id ) ) {
306
  $tags = $headspace->modules->get( 'hsm_tags' );
307
  $tags->load( $headspace->get_post_settings( $id ) );
308
-
309
  $tags->suggestions( $id, $_POST['content'], $_GET['type'] );
310
  die();
311
  }
@@ -317,14 +317,14 @@ class HeadspaceAjax extends HeadSpace_Plugin {
317
  if ( current_user_can( 'edit_post', $id ) && check_ajax_referer( 'headspace-auto_tag_'.$id ) ) {
318
  $headspace = HeadSpace2::get();
319
  $settings = $headspace->get_post_settings( $id );
320
-
321
  $tags = $headspace->modules->get( 'hsm_tags' );
322
  $tags->load( $settings );
323
 
324
  include (ABSPATH.'wp-admin/admin-functions.php');
325
-
326
  $post = get_post( $id );
327
-
328
  $suggestions = $tags->get_suggestions( $post->post_content.' '.$post->post_title );
329
  echo HeadSpace_Plugin::specialchars( implode( ', ', $suggestions ) );
330
  die();
29
 
30
  add_action( 'init', array( &$this, 'init' ) );
31
  }
32
+
33
  function init() {
34
  if ( current_user_can( 'manage_options' ) ) {
35
  $this->register_ajax( 'hs_settings_edit' );
36
  $this->register_ajax( 'hs_settings_save' );
37
  $this->register_ajax( 'hs_settings_load' );
38
+
39
  $this->register_ajax( 'hs_module_edit' );
40
  $this->register_ajax( 'hs_module_load' );
41
  $this->register_ajax( 'hs_module_save' );
42
  $this->register_ajax( 'hs_module_order' );
43
+
44
  $this->register_ajax( 'hs_site_onoff' );
45
  $this->register_ajax( 'hs_site_edit' );
46
  $this->register_ajax( 'hs_site_load' );
51
  $this->register_ajax( 'hs_auto_tag' );
52
  $this->register_ajax( 'hs_auto_description' );
53
  }
54
+
55
  function obj_to_array( $items ) {
56
  $merged = array();
57
  if ( !empty( $items ) > 0 ) {
60
  $merged[$key] = $value;
61
  }
62
  }
63
+
64
  return $merged;
65
  }
66
+
67
  function hs_settings_edit() {
68
  $id = $_GET['page'];
69
  $headspace = HeadSpace2::get ();
70
  $types = $headspace->get_types();
71
+
72
  if ( in_array( $id, array_keys( $types ) ) && check_ajax_referer( 'headspace-edit_setting_'.$id ) ) {
73
  $settings = $this->obj_to_array( get_option( 'headspace_'.$id ) );
74
 
77
 
78
  $this->render_admin( 'page-settings-item', array( 'type' => $id, 'name' => $types[$id][0], 'desc' => $types[$id][1], 'nolink' => true ) );
79
  $this->render_admin( 'page-settings-edit-ajax', array( 'simple' => $simple, 'advanced' => $advanced, 'type' => $id, 'area' => 'page' ) );
80
+
81
  die();
82
  }
83
  }
84
+
85
  function hs_settings_save() {
86
  $id = $_POST['module'];
87
  $headspace = HeadSpace2::get ();
94
  $this->hs_settings_load();
95
  }
96
  }
97
+
98
  function hs_settings_load() {
99
  $id = $_POST['module'];
100
  $headspace = HeadSpace2::get ();
101
  $types = $headspace->get_types();
102
+
103
  if ( in_array( $id, array_keys( $types ) ) && check_ajax_referer( 'headspace-page_setting_'.$id ) ) {
104
  $settings = get_option( 'headspace_'.$id );
105
 
107
  die();
108
  }
109
  }
110
+
111
  function hs_module_edit() {
112
  if ( check_ajax_referer( 'headspace-module_'.$_GET['module'] ) ) {
113
  $headspace = HeadSpace2::get ();
114
  $module = $headspace->modules->get( $_GET['module'] );
115
+
116
  if ( $module )
117
  $this->render_admin( 'page-module-edit', array( 'module' => $module, 'id' => $_GET['module'] ) );
118
+
119
  die();
120
  }
121
  }
122
+
123
  function hs_module_save() {
124
  if ( check_ajax_referer( 'headspace-module_save_'.$_POST['module'] ) ) {
125
  $headspace = HeadSpace2::get ();
132
  }
133
  }
134
  }
135
+
136
  function hs_module_load() {
137
  if ( check_ajax_referer( 'headspace-module_'.$_GET['module'] ) ) {
138
  $headspace = HeadSpace2::get ();
140
 
141
  if ( $module )
142
  $this->render_admin( 'page-module-item', array( 'module' => $module ) );
143
+
144
  die();
145
  }
146
  }
170
 
171
  if ( count( $options['advanced_modules'] ) > 0 ) {
172
  $newmod = array ();
173
+
174
  foreach ( $options['advanced_modules'] AS $name ) {
175
  $name = 'hsm_'.str_replace( '-', '_', strtolower( $name ) );
176
  $module = new $name;
185
  update_option( 'headspace_options', $options );
186
  }
187
  }
188
+
189
  function hs_site_edit() {
190
  if ( check_ajax_referer( 'headspace-site_module' ) ) {
191
  $headspace = HeadSpace2::get ();
193
 
194
  if ( $module )
195
  $this->render_admin( 'site-module-edit', array( 'module' => $module, 'id' => $_GET['module'] ) );
196
+
197
  die();
198
  }
199
  }
200
+
201
  function hs_site_load() {
202
  if ( check_ajax_referer( 'headspace-site_module' ) ) {
203
  $headspace = HeadSpace2::get ();
205
 
206
  if ($module)
207
  $this->render_admin( 'site-module-item', array( 'module' => $module ) );
208
+
209
  die();
210
  }
211
  }
212
+
213
  function hs_site_save() {
214
  if ( check_ajax_referer( 'headspace-site_save_'.$_POST['module'] ) ) {
215
  $headspace = HeadSpace2::get ();
223
  die();
224
  }
225
  }
226
+
227
  function hs_site_onoff() {
228
  if ( check_ajax_referer( 'headspace-site_module' ) ) {
229
  $options = get_option( 'headspace_options' );
231
  $options = array();
232
 
233
  $id = $_POST['module'];
234
+
235
+ if ( isset( $_POST['onoff'] ) && !in_array( $id, $options['site_modules'] ) && isset( $_POST['file'] ) && $_POST['file'] )
236
  $options['site_modules'][$_POST['file']] = $id;
237
+ elseif ( !isset( $_POST['onoff'] ) && in_array( $id, $options['site_modules'] ) )
238
  unset( $options['site_modules'][$_POST['file']] );
239
 
240
  if ( count( $options['site_modules'] ) > 0 ) {
271
  // Extract 1st paragraph first blank line
272
  if ( function_exists( 'mb_strpos' ) ) {
273
  $pos = mb_strpos( $excerpt, '.' );
274
+
275
  if ( $pos !== false )
276
  $excerpt = mb_substr( $excerpt, 0, $pos + 1 );
277
  }
278
  else {
279
  $pos = strpos( $excerpt, '.' );
280
+
281
  if ($pos !== false)
282
  $excerpt = substr( $excerpt, 0, $pos + 1 );
283
  }
285
  // Replace all returns and HTML
286
  $excerpt = str_replace( "\r", '', $excerpt );
287
  $excerpt = str_replace( "\n", '', $excerpt );
288
+
289
  // Restrict it to HS description length setting
290
  if ( function_exists( 'mb_substr' ) )
291
  $excerpt = mb_substr( $excerpt, 0, 500 );
292
  else
293
  $excerpt = substr( $excerpt, 0, 500 );
294
+
295
  $excerpt = preg_replace( '/\s+/', ' ', $excerpt );
296
  echo $excerpt;
297
  die();
298
  }
299
  }
300
+
301
  function hs_tag_update() {
302
  $headspace = HeadSpace2::get ();
303
  $id = intval( $_GET['id'] );
304
+
305
  if ( check_ajax_referer( 'headspace-tags' ) && current_user_can( 'edit_post', $id ) ) {
306
  $tags = $headspace->modules->get( 'hsm_tags' );
307
  $tags->load( $headspace->get_post_settings( $id ) );
308
+
309
  $tags->suggestions( $id, $_POST['content'], $_GET['type'] );
310
  die();
311
  }
317
  if ( current_user_can( 'edit_post', $id ) && check_ajax_referer( 'headspace-auto_tag_'.$id ) ) {
318
  $headspace = HeadSpace2::get();
319
  $settings = $headspace->get_post_settings( $id );
320
+
321
  $tags = $headspace->modules->get( 'hsm_tags' );
322
  $tags->load( $settings );
323
 
324
  include (ABSPATH.'wp-admin/admin-functions.php');
325
+
326
  $post = get_post( $id );
327
+
328
  $suggestions = $tags->get_suggestions( $post->post_content.' '.$post->post_title );
329
  echo HeadSpace_Plugin::specialchars( implode( ', ', $suggestions ) );
330
  die();
headspace.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: HeadSpace2
4
  Plugin URI: http://urbangiraffe.com/plugins/headspace2/
5
  Description: Meta-data manager on steroids, allowing complete control over all SEO needs such as keywords/tags, titles, description, stylesheets, and many many other goodies.
6
- Version: 3.6.34
7
  Author: John Godley
8
  Author URI: http://urbangiraffe.com/
9
  ============================================================================================================
@@ -50,20 +50,15 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
50
  $this->add_action( 'edit_category_form' );
51
  $this->add_action( 'edit_category' );
52
  add_action( 'edit_term', array( &$this, 'edit_category' ) );
53
-
54
  $this->add_action( 'init', 'init', 15);
55
- $this->add_action( 'wp_dashboard_setup' );
56
-
57
  // WP 2.7 hooks
58
  $this->add_action( 'manage_posts_columns' );
59
  $this->add_action( 'manage_pages_columns', 'manage_posts_columns' );
60
 
61
  $this->add_action( 'manage_posts_custom_column', 'manage_posts_custom_column', 10, 2);
62
  $this->add_action( 'manage_pages_custom_column', 'manage_posts_custom_column', 10, 2);
63
-
64
- // $this->add_action( 'quick_edit_custom_box', 'quick_edit_custom_box', 10, 2);
65
- // $this->add_action( 'manage_categories_columns', 'manage_posts_columns' );
66
- // $this->add_action( 'bulk_edit_custom_box', 'bulk_edit_custom_box', 10, 2);
67
 
68
  $this->add_action( 'wp_print_scripts' );
69
  $this->add_action( 'admin_head', 'wp_print_styles' );
@@ -71,7 +66,7 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
71
  $this->add_action( 'admin_print_styles', 'wp_print_styles' );
72
  $this->add_filter( 'contextual_help', 'contextual_help', 10, 2 );
73
  $this->register_plugin_settings( __FILE__ );
74
-
75
  // Ajax functions
76
  if ( defined( 'DOING_AJAX' ) ) {
77
  include_once dirname( __FILE__ ).'/ajax.php';
@@ -79,7 +74,7 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
79
  }
80
  }
81
  }
82
-
83
  function print_scripts_array( $scripts ) {
84
  $farb = array_search( 'farbtastic', $scripts );
85
 
@@ -88,32 +83,18 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
88
 
89
  return $scripts;
90
  }
91
-
92
  function plugin_settings ($links) {
93
  $settings_link = '<a href="options-general.php?page='.basename( __FILE__ ).'">'.__('Settings', 'headspace').'</a>';
94
  array_unshift( $links, $settings_link );
95
  return $links;
96
  }
97
-
98
- function wp_dashboard_setup() {
99
- if (function_exists ('wp_add_dashboard_widget'))
100
- wp_add_dashboard_widget ('dashboard_headspace', __ ('HeadSpace', 'headspace'), array (&$this, 'dashboard'));
101
- }
102
-
103
- function dashboard() {
104
- $headspace = HeadSpace2::get ();
105
-
106
- $settings = $headspace->get_current_settings ();
107
- $simple = $headspace->modules->get_restricted ($headspace->get_simple_modules (), $settings, 'page' );
108
-
109
- $this->render_admin( 'dashboard', array ('simple' => $simple, 'advanced' => $advanced));
110
- }
111
-
112
  function manage_posts_columns($columns) {
113
  $headspace = HeadSpace2::get ();
114
-
115
  $settings = $headspace->get_current_settings ();
116
-
117
  $simple = $headspace->modules->get_restricted ($headspace->get_simple_modules (), $settings, 'page' );
118
  $advanced = $headspace->modules->get_restricted ($headspace->get_advanced_modules (), $settings, 'page' );
119
 
@@ -127,19 +108,19 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
127
 
128
  return $columns;
129
  }
130
-
131
  function manage_posts_custom_column($column, $id) {
132
  $hs2 = HeadSpace2::get ();
133
  $meta = $hs2->get_post_settings ($id);
134
-
135
  $module = $hs2->modules->get (array ($column), $meta);
136
  if (count ($module) > 0)
137
  $module[0]->quick_view ();
138
  }
139
-
140
  function bulk_edit_custom_box($column_name, $type) {
141
  }
142
-
143
  function quick_edit_custom_box($column_name, $type) {
144
  }
145
 
@@ -174,7 +155,7 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
174
  add_management_page (HEADSPACE_MENU, HEADSPACE_MENU, HEADSPACE_ROLE, basename (__FILE__), array ($this, 'admin_screen'));
175
  else
176
  add_options_page (HEADSPACE_MENU, HEADSPACE_MENU, HEADSPACE_ROLE, basename (__FILE__), array ($this, 'admin_screen'));
177
-
178
  add_management_page (HEADSPACE_META, HEADSPACE_META, HEADSPACE_ROLE, basename (__FILE__), array ($this, 'admin_mass'));
179
  }
180
 
@@ -195,7 +176,7 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
195
  else
196
  $cat->cat_ID = 0;
197
  }
198
-
199
  $headspace = HeadSpace2::get ();
200
  $settings = $headspace->get_current_settings (get_option( 'headspace_cat_'.$cat->cat_ID));
201
 
@@ -214,10 +195,10 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
214
  if ($tags !== false)
215
  $this->render_admin( 'edit_page', array ('post_ID' => $post->ID));
216
  }
217
-
218
  function metabox($post) {
219
  global $wp_meta_boxes;
220
-
221
  if (isset ($wp_meta_boxes['post']['normal']['sorted']['headspacestuff']))
222
  unset ($wp_meta_boxes['post']['normal']['sorted']['headspacestuff']);
223
 
@@ -232,7 +213,7 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
232
 
233
  $this->render_admin( 'page-settings-edit', array ('simple' => $simple, 'advanced' => $advanced, 'width' => 140, 'area' => 'page'));
234
  }
235
-
236
 
237
  /**
238
  * Extract meta-data when saving a post
@@ -242,9 +223,9 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
242
  **/
243
 
244
  function save_tags($id) {
245
- if (isset ($_POST['headspace'])) {
246
- $headspace = HeadSpace2::get ();
247
- $headspace->save_post_settings ($id, $headspace->extract_module_settings ($_POST, 'page'));
248
  }
249
  }
250
 
@@ -273,7 +254,7 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
273
  $sub = isset ($_GET['sub']) ? $_GET['sub'] : '';
274
  $url = explode ('&', $_SERVER['REQUEST_URI']);
275
  $url = $url[0];
276
-
277
  if ($inwrap == true)
278
  $this->render_admin( 'submenu', array ('url' => $url, 'sub' => $sub));
279
  return $sub;
@@ -288,39 +269,39 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
288
  else if ($sub == 'tags')
289
  $this->admin_tags ();
290
  }
291
-
292
-
293
  /**
294
  * Checks the current theme footer.php and header.php to ensure it contains the appropriate function calls* to allow HS to work. Hopefully this will reduce support questions regarding this
295
  */
296
  function check_theme_files() {
297
  $base = get_template_directory ();
298
-
299
  $messages = array ();
300
  if (file_exists ($base.DIRECTORY_SEPARATOR.'header.php')) {
301
  $theme_data = implode ('', file ($base.DIRECTORY_SEPARATOR.'header.php'));
302
-
303
  if (strpos ($theme_data, 'wp_head') === false)
304
  $messages[] = __ ('<code>wp_head</code> was not found in <code>header.php</code> (<a href="http://codex.wordpress.org/Hook_Reference/wp_head">documentation</a>)' );
305
  }
306
-
307
  if (file_exists ($base.DIRECTORY_SEPARATOR.'footer.php')) {
308
  $theme_data = implode ('', file ($base.DIRECTORY_SEPARATOR.'footer.php'));
309
-
310
  if (strpos ($theme_data, 'wp_footer') === false)
311
  $messages[] = __ ('<code>wp_footer</code> was not found in <code>footer.php</code> (<a href="http://codex.wordpress.org/Theme_Development">documentation</a>)' );
312
  }
313
-
314
  if (count ($messages) > 0) {
315
  $msg = '';
316
  foreach ($messages AS $message)
317
  $msg .= '<li>'.$message.'</li>';
318
-
319
  $this->render_error ('<p>There are some issues with your theme that may prevent HeadSpace functioning correctly.</p><ol>'.$msg.'</oi>' );
320
  }
321
  }
322
-
323
-
324
  /**
325
  * Choose which admin screen is displayed as well as displaying RSS version feed
326
  *
@@ -339,7 +320,7 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
339
  $sub = $this->submenu ();
340
 
341
  $this->check_theme_files ();
342
-
343
  // Display screen
344
  if ($sub == '')
345
  $this->admin_settings ();
@@ -363,7 +344,7 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
363
  $options = get_option( 'headspace_options' );
364
  if ($options === false)
365
  $options = array ();
366
-
367
  $defaults = array
368
  (
369
  'inherit' => true,
@@ -371,15 +352,15 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
371
  'debug' => false,
372
  'support' => false
373
  );
374
-
375
  foreach ($defaults AS $key => $value) {
376
  if (!isset ($options[$key]))
377
  $options[$key] = $value;
378
  }
379
-
380
  return $options;
381
  }
382
-
383
  function admin_mass_edit() {
384
  include dirname (__FILE__).'/models/pager.php';
385
  include dirname (__FILE__).'/models/mass_edit.php';
@@ -413,7 +394,7 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
413
 
414
  function admin_settings() {
415
  $headspace = HeadSpace2::get ();
416
-
417
  $this->render_admin( 'page-settings', array( 'types' => $headspace->get_types() ) );
418
  }
419
 
@@ -455,13 +436,13 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
455
 
456
  $this->render_admin( 'page-modules', array ('simple' => $simple, 'advanced' => $advanced, 'disabled' => $headspace->modules->get_disabled ($simple, $advanced)));
457
  }
458
-
459
  function admin_site() {
460
  $headspace = HeadSpace2::get ();
461
-
462
  $this->render_admin( 'site-modules', array ('site' => $headspace->site));
463
  }
464
-
465
  function admin_import() {
466
  include dirname (__FILE__).'/models/importer.php';
467
 
@@ -479,7 +460,7 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
479
 
480
  $this->render_admin( 'import', array ('modules' => $importmanager->available ()));
481
  }
482
-
483
  function wp_print_scripts() {
484
  global $wp_scripts;
485
 
@@ -488,11 +469,11 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
488
  add_meta_box ('headspacestuff', __ ('HeadSpace', 'headspace'), array (&$this, 'metabox'), 'page', 'normal', 'high' );
489
  add_meta_box ('tagsdiv', __ ('Tags', 'headspace'), array (&$this, 'metabox_tags'), 'page', 'side', 'high' );
490
  }
491
-
492
  // Rejig the localization
493
  if ($this->is_page ())
494
  $wp_scripts->registered['page']->extra['l10n'] = $wp_scripts->registered['post']->extra['l10n'];
495
-
496
  // We need to do this because the WP-Ecommerce plugin inserts some JS that interferes with HeadSpace
497
  if (isset ($wp_scripts->registered['ui-tabs']) && strpos ($_SERVER['REQUEST_URI'], 'headspace.php') !== false)
498
  unset ($wp_scripts->registered['ui-tabs']);
@@ -504,23 +485,23 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
504
  wp_enqueue_script( 'headspace', $this->url ().'/js/headspace.js', array ('jquery-form'), $this->version ());
505
  wp_enqueue_script( 'headspace-tags', $this->url ().'/js/headspace-tags.js', array ('headspace'), $this->version ());
506
  }
507
-
508
  // Stop this being called again
509
  remove_action( 'wp_print_scripts', array(&$this, 'wp_print_scripts'));
510
  }
511
-
512
  function is_category_edit() {
513
  if (strpos ($_SERVER['REQUEST_URI'], 'categories.php') || strpos( $_SERVER['REQUEST_URI'], 'taxonomy=category' ) )
514
  return true;
515
  return false;
516
  }
517
-
518
  function is_post_edit() {
519
  if (strpos ($_SERVER['REQUEST_URI'], 'post.php') !== false || strpos ($_SERVER['REQUEST_URI'], 'post-new.php') !== false)
520
  return true;
521
  return false;
522
  }
523
-
524
  function wp_print_styles() {
525
  if ( ( isset ($_GET['page']) && $_GET['page'] == 'headspace.php') || $this->is_page () || $this->is_category_edit () || $this->is_post_edit () ) {
526
  echo '<link rel="stylesheet" href="'.$this->url ().'/admin.css" type="text/css" media="screen" title="no title" charset="utf-8"/>';
@@ -543,8 +524,8 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
543
  </style>';
544
  }
545
  }
546
-
547
-
548
  /**
549
  * Insert CSS and JS into administration page
550
  *
@@ -555,15 +536,15 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
555
  if (strpos ($_SERVER['REQUEST_URI'], 'post.php') !== false || strpos ($_SERVER['REQUEST_URI'], 'post-new.php') !== false || $this->is_page () || strpos ($_SERVER['REQUEST_URI'], 'headspace') || strpos ($_SERVER['REQUEST_URI'], 'categories.php'))
556
  $this->render_admin( 'head_admin' );
557
  }
558
-
559
  function version() {
560
  $plugin_data = implode ('', file (__FILE__));
561
-
562
  if (preg_match ('|Version:(.*)|i', $plugin_data, $version))
563
  return trim ($version[1]);
564
  return '';
565
  }
566
-
567
  function contextual_help($help, $screen) {
568
  if ($screen == 'settings_page_headspace') {
569
  $help .= '<h5>' . __('HeadSpace Help', 'headspace') . '</h5><div class="metabox-prefs">';
@@ -574,11 +555,23 @@ class HeadSpace2_Admin extends HeadSpace_Plugin {
574
  $help .= __ ('Please read the documentation and FAQ, and check the bug tracker, before asking a question.', 'headspace' );
575
  $help .= '</div>';
576
  }
577
-
578
  return $help;
579
  }
580
  }
581
 
 
 
 
 
 
 
 
 
 
 
 
 
582
 
583
  /**
584
  * Instantiate the plugin
3
  Plugin Name: HeadSpace2
4
  Plugin URI: http://urbangiraffe.com/plugins/headspace2/
5
  Description: Meta-data manager on steroids, allowing complete control over all SEO needs such as keywords/tags, titles, description, stylesheets, and many many other goodies.
6
+ Version: 3.6.37
7
  Author: John Godley
8
  Author URI: http://urbangiraffe.com/
9
  ============================================================================================================
50
  $this->add_action( 'edit_category_form' );
51
  $this->add_action( 'edit_category' );
52
  add_action( 'edit_term', array( &$this, 'edit_category' ) );
53
+
54
  $this->add_action( 'init', 'init', 15);
55
+
 
56
  // WP 2.7 hooks
57
  $this->add_action( 'manage_posts_columns' );
58
  $this->add_action( 'manage_pages_columns', 'manage_posts_columns' );
59
 
60
  $this->add_action( 'manage_posts_custom_column', 'manage_posts_custom_column', 10, 2);
61
  $this->add_action( 'manage_pages_custom_column', 'manage_posts_custom_column', 10, 2);
 
 
 
 
62
 
63
  $this->add_action( 'wp_print_scripts' );
64
  $this->add_action( 'admin_head', 'wp_print_styles' );
66
  $this->add_action( 'admin_print_styles', 'wp_print_styles' );
67
  $this->add_filter( 'contextual_help', 'contextual_help', 10, 2 );
68
  $this->register_plugin_settings( __FILE__ );
69
+
70
  // Ajax functions
71
  if ( defined( 'DOING_AJAX' ) ) {
72
  include_once dirname( __FILE__ ).'/ajax.php';
74
  }
75
  }
76
  }
77
+
78
  function print_scripts_array( $scripts ) {
79
  $farb = array_search( 'farbtastic', $scripts );
80
 
83
 
84
  return $scripts;
85
  }
86
+
87
  function plugin_settings ($links) {
88
  $settings_link = '<a href="options-general.php?page='.basename( __FILE__ ).'">'.__('Settings', 'headspace').'</a>';
89
  array_unshift( $links, $settings_link );
90
  return $links;
91
  }
92
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  function manage_posts_columns($columns) {
94
  $headspace = HeadSpace2::get ();
95
+
96
  $settings = $headspace->get_current_settings ();
97
+
98
  $simple = $headspace->modules->get_restricted ($headspace->get_simple_modules (), $settings, 'page' );
99
  $advanced = $headspace->modules->get_restricted ($headspace->get_advanced_modules (), $settings, 'page' );
100
 
108
 
109
  return $columns;
110
  }
111
+
112
  function manage_posts_custom_column($column, $id) {
113
  $hs2 = HeadSpace2::get ();
114
  $meta = $hs2->get_post_settings ($id);
115
+
116
  $module = $hs2->modules->get (array ($column), $meta);
117
  if (count ($module) > 0)
118
  $module[0]->quick_view ();
119
  }
120
+
121
  function bulk_edit_custom_box($column_name, $type) {
122
  }
123
+
124
  function quick_edit_custom_box($column_name, $type) {
125
  }
126
 
155
  add_management_page (HEADSPACE_MENU, HEADSPACE_MENU, HEADSPACE_ROLE, basename (__FILE__), array ($this, 'admin_screen'));
156
  else
157
  add_options_page (HEADSPACE_MENU, HEADSPACE_MENU, HEADSPACE_ROLE, basename (__FILE__), array ($this, 'admin_screen'));
158
+
159
  add_management_page (HEADSPACE_META, HEADSPACE_META, HEADSPACE_ROLE, basename (__FILE__), array ($this, 'admin_mass'));
160
  }
161
 
176
  else
177
  $cat->cat_ID = 0;
178
  }
179
+
180
  $headspace = HeadSpace2::get ();
181
  $settings = $headspace->get_current_settings (get_option( 'headspace_cat_'.$cat->cat_ID));
182
 
195
  if ($tags !== false)
196
  $this->render_admin( 'edit_page', array ('post_ID' => $post->ID));
197
  }
198
+
199
  function metabox($post) {
200
  global $wp_meta_boxes;
201
+
202
  if (isset ($wp_meta_boxes['post']['normal']['sorted']['headspacestuff']))
203
  unset ($wp_meta_boxes['post']['normal']['sorted']['headspacestuff']);
204
 
213
 
214
  $this->render_admin( 'page-settings-edit', array ('simple' => $simple, 'advanced' => $advanced, 'width' => 140, 'area' => 'page'));
215
  }
216
+
217
 
218
  /**
219
  * Extract meta-data when saving a post
223
  **/
224
 
225
  function save_tags($id) {
226
+ if ( isset( $_POST['headspace'] ) ) {
227
+ $headspace = HeadSpace2::get();
228
+ $headspace->save_post_settings( $id, $headspace->extract_module_settings( $_POST, 'page' ) );
229
  }
230
  }
231
 
254
  $sub = isset ($_GET['sub']) ? $_GET['sub'] : '';
255
  $url = explode ('&', $_SERVER['REQUEST_URI']);
256
  $url = $url[0];
257
+
258
  if ($inwrap == true)
259
  $this->render_admin( 'submenu', array ('url' => $url, 'sub' => $sub));
260
  return $sub;
269
  else if ($sub == 'tags')
270
  $this->admin_tags ();
271
  }
272
+
273
+
274
  /**
275
  * Checks the current theme footer.php and header.php to ensure it contains the appropriate function calls* to allow HS to work. Hopefully this will reduce support questions regarding this
276
  */
277
  function check_theme_files() {
278
  $base = get_template_directory ();
279
+
280
  $messages = array ();
281
  if (file_exists ($base.DIRECTORY_SEPARATOR.'header.php')) {
282
  $theme_data = implode ('', file ($base.DIRECTORY_SEPARATOR.'header.php'));
283
+
284
  if (strpos ($theme_data, 'wp_head') === false)
285
  $messages[] = __ ('<code>wp_head</code> was not found in <code>header.php</code> (<a href="http://codex.wordpress.org/Hook_Reference/wp_head">documentation</a>)' );
286
  }
287
+
288
  if (file_exists ($base.DIRECTORY_SEPARATOR.'footer.php')) {
289
  $theme_data = implode ('', file ($base.DIRECTORY_SEPARATOR.'footer.php'));
290
+
291
  if (strpos ($theme_data, 'wp_footer') === false)
292
  $messages[] = __ ('<code>wp_footer</code> was not found in <code>footer.php</code> (<a href="http://codex.wordpress.org/Theme_Development">documentation</a>)' );
293
  }
294
+
295
  if (count ($messages) > 0) {
296
  $msg = '';
297
  foreach ($messages AS $message)
298
  $msg .= '<li>'.$message.'</li>';
299
+
300
  $this->render_error ('<p>There are some issues with your theme that may prevent HeadSpace functioning correctly.</p><ol>'.$msg.'</oi>' );
301
  }
302
  }
303
+
304
+
305
  /**
306
  * Choose which admin screen is displayed as well as displaying RSS version feed
307
  *
320
  $sub = $this->submenu ();
321
 
322
  $this->check_theme_files ();
323
+
324
  // Display screen
325
  if ($sub == '')
326
  $this->admin_settings ();
344
  $options = get_option( 'headspace_options' );
345
  if ($options === false)
346
  $options = array ();
347
+
348
  $defaults = array
349
  (
350
  'inherit' => true,
352
  'debug' => false,
353
  'support' => false
354
  );
355
+
356
  foreach ($defaults AS $key => $value) {
357
  if (!isset ($options[$key]))
358
  $options[$key] = $value;
359
  }
360
+
361
  return $options;
362
  }
363
+
364
  function admin_mass_edit() {
365
  include dirname (__FILE__).'/models/pager.php';
366
  include dirname (__FILE__).'/models/mass_edit.php';
394
 
395
  function admin_settings() {
396
  $headspace = HeadSpace2::get ();
397
+
398
  $this->render_admin( 'page-settings', array( 'types' => $headspace->get_types() ) );
399
  }
400
 
436
 
437
  $this->render_admin( 'page-modules', array ('simple' => $simple, 'advanced' => $advanced, 'disabled' => $headspace->modules->get_disabled ($simple, $advanced)));
438
  }
439
+
440
  function admin_site() {
441
  $headspace = HeadSpace2::get ();
442
+
443
  $this->render_admin( 'site-modules', array ('site' => $headspace->site));
444
  }
445
+
446
  function admin_import() {
447
  include dirname (__FILE__).'/models/importer.php';
448
 
460
 
461
  $this->render_admin( 'import', array ('modules' => $importmanager->available ()));
462
  }
463
+
464
  function wp_print_scripts() {
465
  global $wp_scripts;
466
 
469
  add_meta_box ('headspacestuff', __ ('HeadSpace', 'headspace'), array (&$this, 'metabox'), 'page', 'normal', 'high' );
470
  add_meta_box ('tagsdiv', __ ('Tags', 'headspace'), array (&$this, 'metabox_tags'), 'page', 'side', 'high' );
471
  }
472
+
473
  // Rejig the localization
474
  if ($this->is_page ())
475
  $wp_scripts->registered['page']->extra['l10n'] = $wp_scripts->registered['post']->extra['l10n'];
476
+
477
  // We need to do this because the WP-Ecommerce plugin inserts some JS that interferes with HeadSpace
478
  if (isset ($wp_scripts->registered['ui-tabs']) && strpos ($_SERVER['REQUEST_URI'], 'headspace.php') !== false)
479
  unset ($wp_scripts->registered['ui-tabs']);
485
  wp_enqueue_script( 'headspace', $this->url ().'/js/headspace.js', array ('jquery-form'), $this->version ());
486
  wp_enqueue_script( 'headspace-tags', $this->url ().'/js/headspace-tags.js', array ('headspace'), $this->version ());
487
  }
488
+
489
  // Stop this being called again
490
  remove_action( 'wp_print_scripts', array(&$this, 'wp_print_scripts'));
491
  }
492
+
493
  function is_category_edit() {
494
  if (strpos ($_SERVER['REQUEST_URI'], 'categories.php') || strpos( $_SERVER['REQUEST_URI'], 'taxonomy=category' ) )
495
  return true;
496
  return false;
497
  }
498
+
499
  function is_post_edit() {
500
  if (strpos ($_SERVER['REQUEST_URI'], 'post.php') !== false || strpos ($_SERVER['REQUEST_URI'], 'post-new.php') !== false)
501
  return true;
502
  return false;
503
  }
504
+
505
  function wp_print_styles() {
506
  if ( ( isset ($_GET['page']) && $_GET['page'] == 'headspace.php') || $this->is_page () || $this->is_category_edit () || $this->is_post_edit () ) {
507
  echo '<link rel="stylesheet" href="'.$this->url ().'/admin.css" type="text/css" media="screen" title="no title" charset="utf-8"/>';
524
  </style>';
525
  }
526
  }
527
+
528
+
529
  /**
530
  * Insert CSS and JS into administration page
531
  *
536
  if (strpos ($_SERVER['REQUEST_URI'], 'post.php') !== false || strpos ($_SERVER['REQUEST_URI'], 'post-new.php') !== false || $this->is_page () || strpos ($_SERVER['REQUEST_URI'], 'headspace') || strpos ($_SERVER['REQUEST_URI'], 'categories.php'))
537
  $this->render_admin( 'head_admin' );
538
  }
539
+
540
  function version() {
541
  $plugin_data = implode ('', file (__FILE__));
542
+
543
  if (preg_match ('|Version:(.*)|i', $plugin_data, $version))
544
  return trim ($version[1]);
545
  return '';
546
  }
547
+
548
  function contextual_help($help, $screen) {
549
  if ($screen == 'settings_page_headspace') {
550
  $help .= '<h5>' . __('HeadSpace Help', 'headspace') . '</h5><div class="metabox-prefs">';
555
  $help .= __ ('Please read the documentation and FAQ, and check the bug tracker, before asking a question.', 'headspace' );
556
  $help .= '</div>';
557
  }
558
+
559
  return $help;
560
  }
561
  }
562
 
563
+ // Thematic compat
564
+ function hs_child_headspace_doctitle() {
565
+ return wp_title( '', false) ;
566
+ }
567
+
568
+ function hs_child_meta_head_cleaning() {
569
+ return true;
570
+ }
571
+
572
+ add_filter( 'thematic_seo', 'hs_child_meta_head_cleaning' );
573
+ add_filter( 'thematic_doctitle','hs_child_headspace_doctitle' );
574
+
575
 
576
  /**
577
  * Instantiate the plugin
headspace_library.php CHANGED
@@ -25,28 +25,28 @@ if (!class_exists ('MetaData')) {
25
  function get_custom($field) {
26
  $hs2 = HeadSpace2::get ();
27
  $data = $hs2->get_current_settings ();
28
-
29
  if (isset ($data['custom_fields'])) {
30
  $custom = unserialize ($data['custom_fields']);
31
  if (!is_array($custom))
32
  $custom = unserialize($custom);
33
-
34
  if (is_array($custom) && isset ($custom[$field]))
35
  return $custom[$field];
36
  }
37
-
38
  return false;
39
  }
40
-
41
  function add_tags($postid, $tags) {
42
  $tags = array_filter (explode (',', $tags));
43
  wp_set_post_tags ($postid, $tags, false);
44
  }
45
-
46
  function add_description($postid, $description) {
47
  MetaData::add ($postid, 'description', $description);
48
  }
49
-
50
  function add_stylesheet($postid, $stylesheet) {
51
  MetaData::add ($postid, 'style', $script);
52
  }
@@ -54,23 +54,23 @@ if (!class_exists ('MetaData')) {
54
  function add_javascript($postid, $script) {
55
  MetaData::add ($postid, 'scripts', $script);
56
  }
57
-
58
  function add_more_text($postid, $moretext) {
59
  MetaData::add ($postid, 'more_text', $moretext);
60
  }
61
-
62
  function add_page_title($postid, $title) {
63
  MetaData::add ($postid, 'page_title', $title);
64
  }
65
-
66
  function add_raw($postid, $raw) {
67
  MetaData::add ($postid, 'raw', $raw);
68
  }
69
-
70
  function add_nofollow($postid, $nofollow = true) {
71
  MetaData::add ($postid, 'nofollow', $nofollow ? true : false);
72
  }
73
-
74
  function add_noindex($postid, $noindex = true) {
75
  MetaData::add ($postid, 'noindex', $noindex ? true : false);
76
  }
@@ -82,10 +82,10 @@ if (!class_exists ('MetaData')) {
82
  function get_description($postid) {
83
  return MetaData::get ($postid, 'description');
84
  }
85
-
86
  function get_tags($postid) {
87
  $tags = get_object_term_cache($postid, 'post_tag');
88
-
89
  if ( false === $tags)
90
  $tags = wp_get_object_terms($postid, 'post_tag');
91
 
@@ -98,31 +98,31 @@ if (!class_exists ('MetaData')) {
98
  }
99
  else
100
  $tags = '';
101
-
102
  return $tags;
103
  }
104
-
105
  function get($postid, $type) {
106
  return get_post_meta ($postid, '_headspace_'.$type, true);
107
  }
108
-
109
  function get_noindex($postid) {
110
  return MetaData::get ($postid, 'noindex');
111
  }
112
-
113
  function get_nofollow($postid) {
114
  return MetaData::get ($postid, 'nofollow');
115
  }
116
-
117
  function add($postid, $type, $data, $insert = false) {
118
  global $wpdb;
119
-
120
  $field = '_headspace_'.$type;
121
-
122
  if (!empty ($data)) {
123
  // Do we update or insert?
124
  $meta = get_post_meta ($postid, $field);
125
-
126
  if ($insert == true || empty ($meta) || $meta === false)
127
  $wpdb->query ("INSERT INTO {$wpdb->postmeta} (post_id,meta_key,meta_value) VALUES ('$postid','$field','".$wpdb->escape ($data)."')");
128
  else
@@ -134,4 +134,3 @@ if (!class_exists ('MetaData')) {
134
  }
135
  }
136
 
137
- ?>
25
  function get_custom($field) {
26
  $hs2 = HeadSpace2::get ();
27
  $data = $hs2->get_current_settings ();
28
+
29
  if (isset ($data['custom_fields'])) {
30
  $custom = unserialize ($data['custom_fields']);
31
  if (!is_array($custom))
32
  $custom = unserialize($custom);
33
+
34
  if (is_array($custom) && isset ($custom[$field]))
35
  return $custom[$field];
36
  }
37
+
38
  return false;
39
  }
40
+
41
  function add_tags($postid, $tags) {
42
  $tags = array_filter (explode (',', $tags));
43
  wp_set_post_tags ($postid, $tags, false);
44
  }
45
+
46
  function add_description($postid, $description) {
47
  MetaData::add ($postid, 'description', $description);
48
  }
49
+
50
  function add_stylesheet($postid, $stylesheet) {
51
  MetaData::add ($postid, 'style', $script);
52
  }
54
  function add_javascript($postid, $script) {
55
  MetaData::add ($postid, 'scripts', $script);
56
  }
57
+
58
  function add_more_text($postid, $moretext) {
59
  MetaData::add ($postid, 'more_text', $moretext);
60
  }
61
+
62
  function add_page_title($postid, $title) {
63
  MetaData::add ($postid, 'page_title', $title);
64
  }
65
+
66
  function add_raw($postid, $raw) {
67
  MetaData::add ($postid, 'raw', $raw);
68
  }
69
+
70
  function add_nofollow($postid, $nofollow = true) {
71
  MetaData::add ($postid, 'nofollow', $nofollow ? true : false);
72
  }
73
+
74
  function add_noindex($postid, $noindex = true) {
75
  MetaData::add ($postid, 'noindex', $noindex ? true : false);
76
  }
82
  function get_description($postid) {
83
  return MetaData::get ($postid, 'description');
84
  }
85
+
86
  function get_tags($postid) {
87
  $tags = get_object_term_cache($postid, 'post_tag');
88
+
89
  if ( false === $tags)
90
  $tags = wp_get_object_terms($postid, 'post_tag');
91
 
98
  }
99
  else
100
  $tags = '';
101
+
102
  return $tags;
103
  }
104
+
105
  function get($postid, $type) {
106
  return get_post_meta ($postid, '_headspace_'.$type, true);
107
  }
108
+
109
  function get_noindex($postid) {
110
  return MetaData::get ($postid, 'noindex');
111
  }
112
+
113
  function get_nofollow($postid) {
114
  return MetaData::get ($postid, 'nofollow');
115
  }
116
+
117
  function add($postid, $type, $data, $insert = false) {
118
  global $wpdb;
119
+
120
  $field = '_headspace_'.$type;
121
+
122
  if (!empty ($data)) {
123
  // Do we update or insert?
124
  $meta = get_post_meta ($postid, $field);
125
+
126
  if ($insert == true || empty ($meta) || $meta === false)
127
  $wpdb->query ("INSERT INTO {$wpdb->postmeta} (post_id,meta_key,meta_value) VALUES ('$postid','$field','".$wpdb->escape ($data)."')");
128
  else
134
  }
135
  }
136
 
 
locale/cs_CZ.mo ADDED
Binary file
locale/cs_CZ.po ADDED
@@ -0,0 +1,1789 @@