PageRenderTime 59ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/all-in-one-seo-pack/aioseop.class.php

https://bitbucket.org/openfarmtech/weblog-content
PHP | 2273 lines | 1966 code | 170 blank | 137 comment | 192 complexity | 241d83c577a6736d3bbb13a95e8b4ac7 MD5 | raw file
Possible License(s): GPL-2.0, AGPL-1.0, LGPL-2.0, LGPL-3.0, BSD-3-Clause, GPL-3.0, LGPL-2.1, AGPL-3.0, CC-BY-SA-3.0
  1. <?php
  2. class All_in_One_SEO_Pack {
  3. var $version = "1.6.12.1";
  4. /** Max numbers of chars in auto-generated description */
  5. var $maximum_description_length = 160;
  6. /** Minimum number of chars an excerpt should be so that it can be used
  7. * as description. Touch only if you know what you're doing
  8. */
  9. var $minimum_description_length = 1;
  10. var $ob_start_detected = false;
  11. var $title_start = -1;
  12. var $title_end = -1;
  13. /** The title before rewriting */
  14. var $orig_title = '';
  15. /** Temp filename for the latest version. */
  16. // var $upgrade_filename = 'temp.zip';
  17. /** Where to extract the downloaded newest version. */
  18. // var $upgrade_folder;
  19. /** Any error in upgrading. */
  20. // var $upgrade_error;
  21. /** Which zip to download in order to upgrade .*/
  22. // var $upgrade_url = 'http://downloads.wordpress.org/plugin/all-in-one-seo-pack.zip';
  23. /** Filename of log file. */
  24. var $log_file;
  25. /** Flag whether there should be logging. */
  26. var $do_log;
  27. var $wp_version;
  28. var $aioseop_op;
  29. //var $aioseop_options = get_option('aioseop_options');
  30. function All_in_One_SEO_Pack() {
  31. global $wp_version;
  32. global $aioseop_options;
  33. $this->wp_version = $wp_version;
  34. $this->log_file = dirname(__FILE__) . '/all_in_one_seo_pack.log';
  35. if ($aioseop_options['aiosp_do_log']) {
  36. $this->do_log = true;
  37. } else {
  38. $this->do_log = false;
  39. }
  40. // $this->upgrade_filename = dirname(__FILE__) . '/' . $this->upgrade_filename;
  41. // $this->upgrade_folder = dirname(__FILE__);
  42. }
  43. /**
  44. * Convert a string to lower case
  45. * Compatible with mb_strtolower(), an UTF-8 friendly replacement for strtolower()
  46. */
  47. function strtolower($str) {
  48. global $UTF8_TABLES;
  49. return strtr($str, $UTF8_TABLES['strtolower']);
  50. }
  51. /**
  52. * Convert a string to upper case
  53. * Compatible with mb_strtoupper(), an UTF-8 friendly replacement for strtoupper()
  54. */
  55. function strtoupper($str) {
  56. global $UTF8_TABLES;
  57. return strtr($str, $UTF8_TABLES['strtoupper']);
  58. }
  59. function template_redirect() {
  60. global $wp_query;
  61. global $aioseop_options;
  62. $post = $wp_query->get_queried_object();
  63. if( $this->aioseop_mrt_exclude_this_page()){
  64. return;
  65. }
  66. if (is_feed()) {
  67. return;
  68. }
  69. if (is_single() || is_page()) {
  70. $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post->ID, '_aioseop_disable', true)));
  71. if ($aiosp_disable) {
  72. return;
  73. }
  74. }
  75. if ($aioseop_options['aiosp_rewrite_titles']) {
  76. ob_start(array($this, 'output_callback_for_title'));
  77. }
  78. }
  79. function aioseop_mrt_exclude_this_page(){
  80. global $aioseop_options;
  81. $currenturl = trim($_SERVER['REQUEST_URI'],'/');
  82. /* echo "<br /><br />";
  83. echo $aioseop_options['aiosp_ex_pages'];
  84. echo "<br /><br />";
  85. */
  86. $excludedstuff = explode(',',$aioseop_options['aiosp_ex_pages']);
  87. foreach($excludedstuff as $exedd){
  88. //echo $exedd;
  89. $exedd = trim($exedd);
  90. if($exedd){
  91. if(stristr($currenturl, $exedd)){
  92. return true;
  93. }
  94. }
  95. }
  96. return false;
  97. }
  98. function output_callback_for_title($content) {
  99. return $this->rewrite_title($content);
  100. }
  101. //
  102. //CHECK IF ARRAY EXISTS IN DB, IF SO, GET ARRAY, ADD EVERYTHING, CHECK FOR ISSET?
  103. //
  104. function init() {
  105. if (function_exists('load_plugin_textdomain')) {
  106. if ( !defined('WP_PLUGIN_DIR') ) {
  107. load_plugin_textdomain('all_in_one_seo_pack', str_replace( ABSPATH, '', dirname(__FILE__)));
  108. } else {
  109. load_plugin_textdomain('all_in_one_seo_pack', false, dirname(plugin_basename(__FILE__)));
  110. }
  111. }
  112. /*
  113. if (function_exists('load_plugin_textdomain')) {
  114. load_plugin_textdomain('all_in_one_seo_pack', WP_PLUGIN_DIR . '/all-in-one-seo-pack');
  115. }
  116. */
  117. }
  118. function is_static_front_page() {
  119. global $wp_query;
  120. global $aioseop_options;
  121. $post = $wp_query->get_queried_object();
  122. return get_option('show_on_front') == 'page' && is_page() && $post->ID == get_option('page_on_front');
  123. }
  124. function is_static_posts_page() {
  125. global $wp_query;
  126. $post = $wp_query->get_queried_object();
  127. return get_option('show_on_front') == 'page' && is_home() && $post->ID == get_option('page_for_posts');
  128. }
  129. function get_base() {
  130. return '/'.end(explode('/', str_replace(array('\\','/all_in_one_seo_pack.php'),array('/',''),__FILE__)));
  131. }
  132. function seo_mrt_admin_head() {
  133. $home = get_settings('siteurl');
  134. $stylesheet = WP_PLUGIN_URL . '/all-in-one-seo-pack/style.css';
  135. echo '<link rel="stylesheet" href="' . $stylesheet . '" type="text/css" media="screen" />';
  136. }
  137. function wp_head() {
  138. if (is_feed()) {
  139. return;
  140. }
  141. global $wp_query;
  142. global $aioseop_options;
  143. $post = $wp_query->get_queried_object();
  144. $meta_string = null;
  145. if($this->is_static_posts_page()){
  146. $title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) );
  147. }
  148. //echo("wp_head() " . wp_title('', false) . " is_home() => " . is_home() . ", is_page() => " . is_page() . ", is_single() => " . is_single() . ", is_static_front_page() => " . $this->is_static_front_page() . ", is_static_posts_page() => " . $this->is_static_posts_page());
  149. if (is_single() || is_page()) {
  150. $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post->ID, '_aioseop_disable', true)));
  151. if ($aiosp_disable) {
  152. return;
  153. }
  154. }
  155. if( $this->aioseop_mrt_exclude_this_page()==TRUE ){
  156. return;
  157. }
  158. if ($aioseop_options['aiosp_rewrite_titles']) {
  159. // make the title rewrite as short as possible
  160. if (function_exists('ob_list_handlers')) {
  161. $active_handlers = ob_list_handlers();
  162. } else {
  163. $active_handlers = array();
  164. }
  165. if (sizeof($active_handlers) > 0 &&
  166. strtolower($active_handlers[sizeof($active_handlers) - 1]) ==
  167. strtolower('All_in_One_SEO_Pack::output_callback_for_title')) {
  168. ob_end_flush();
  169. } else {
  170. $this->log("another plugin interfering?");
  171. // if we get here there *could* be trouble with another plugin :(
  172. $this->ob_start_detected = true;
  173. if (function_exists('ob_list_handlers')) {
  174. foreach (ob_list_handlers() as $handler) {
  175. $this->log("detected output handler $handler");
  176. }
  177. }
  178. }
  179. }
  180. /*
  181. echo trim($_SERVER['REQUEST_URI'],'/');
  182. $currenturl = trim($_SERVER['REQUEST_URI'],'/');
  183. echo "<br /><br />";
  184. echo $aioseop_options['aiosp_ex_pages'];
  185. echo "<br /><br />";
  186. $excludedstuff = explode(',',$aioseop_options['aiosp_ex_pages']);
  187. foreach($excludedstuff as $exedd){
  188. echo $exedd;
  189. //echo "<br /><br />substring: ". stristr($currenturl,trim($exedd)) . "<br />";
  190. if(stristr($currenturl, trim($exedd))){
  191. echo "<br />match, should not display<br /><br />";
  192. }else{
  193. echo "<br />( " . $exedd . " was not found in " . $currenturl . " ) - no match<br /><br />";
  194. }
  195. }
  196. //print_r($excludedstuff);
  197. */
  198. echo "\n<!-- All in One SEO Pack $this->version by Michael Torbert of Semper Fi Web Design";
  199. if ($this->ob_start_detected) {
  200. echo "ob_start_detected ";
  201. }
  202. echo "[$this->title_start,$this->title_end] ";
  203. echo "-->\n";
  204. if ((is_home() && $aioseop_options['aiosp_home_keywords'] && !$this->is_static_posts_page()) || $this->is_static_front_page()) {
  205. $keywords = trim($this->internationalize($aioseop_options['aiosp_home_keywords']));
  206. } elseif($this->is_static_posts_page() && !$aioseop_options['aiosp_dynamic_postspage_keywords']){ // and if option = use page set keywords instead of keywords from recent posts
  207. //$keywords = "posts keyyysss" . stripcslashes(get_post_meta($post->ID,'keywords',true));
  208. $keywords = stripcslashes($this->internationalize(get_post_meta($post->ID, "_aioseop_keywords", true)));
  209. // $keywords = $this->get_unique_keywords($keywords);
  210. } else {
  211. $keywords = $this->get_all_keywords();
  212. }
  213. if (is_single() || is_page() || $this->is_static_posts_page()) {
  214. if ($this->is_static_front_page()) {
  215. $description = trim(stripcslashes($this->internationalize($aioseop_options['aiosp_home_description'])));
  216. } else {
  217. $description = $this->get_post_description($post);
  218. $description = apply_filters('aioseop_description',$description);
  219. }
  220. } else if (is_home()) {
  221. $description = trim(stripcslashes($this->internationalize($aioseop_options['aiosp_home_description'])));
  222. } else if (is_category()) {
  223. $description = $this->internationalize(category_description());
  224. }
  225. if (isset($description) && (strlen($description) > $this->minimum_description_length) && !(is_home() && is_paged())) {
  226. $description = trim(strip_tags($description));
  227. $description = str_replace('"', '', $description);
  228. // replace newlines on mac / windows?
  229. $description = str_replace("\r\n", ' ', $description);
  230. // maybe linux uses this alone
  231. $description = str_replace("\n", ' ', $description);
  232. if (isset($meta_string)) {
  233. //$meta_string .= "\n";
  234. } else {
  235. $meta_string = '';
  236. }
  237. // description format
  238. $description_format = $aioseop_options['aiosp_description_format'];
  239. if (!isset($description_format) || empty($description_format)) {
  240. $description_format = "%description%";
  241. }
  242. $description = str_replace('%description%', $description, $description_format);
  243. $description = str_replace('%blog_title%', get_bloginfo('name'), $description);
  244. $description = str_replace('%blog_description%', get_bloginfo('description'), $description);
  245. $description = str_replace('%wp_title%', $this->get_original_title(), $description);
  246. //$description = html_entity_decode($description, ENT_COMPAT, get_bloginfo('charset'));
  247. if($aioseop_options['aiosp_can'] && is_attachment()){
  248. $url = $this->aiosp_mrt_get_url($wp_query);
  249. if ($url) {
  250. preg_match_all('/(\d+)/', $url, $matches);
  251. if (is_array($matches)){
  252. $uniqueDesc = join('',$matches[0]);
  253. }
  254. }
  255. $description .= ' ' . $uniqueDesc;
  256. }
  257. $meta_string .= sprintf("<meta name=\"description\" content=\"%s\" />", $description);
  258. }
  259. $keywords = apply_filters('aioseop_keywords',$keywords);
  260. if (isset ($keywords) && !empty($keywords) && !(is_home() && is_paged())) {
  261. if (isset($meta_string)) {
  262. $meta_string .= "\n";
  263. }
  264. $keywords = str_replace('"','',$keywords);
  265. $meta_string .= sprintf("<meta name=\"keywords\" content=\"%s\" />", $keywords);
  266. }
  267. if (function_exists('is_tag')) {
  268. $is_tag = is_tag();
  269. }
  270. if ((is_category() && $aioseop_options['aiosp_category_noindex']) || (!is_category() && is_archive() &&!$is_tag && $aioseop_options['aiosp_archive_noindex']) || ($aioseop_options['aiosp_tags_noindex'] && $is_tag)) {
  271. if (isset($meta_string)) {
  272. $meta_string .= "\n";
  273. }
  274. $meta_string .= '<meta name="robots" content="noindex,follow" />';
  275. }
  276. $page_meta = stripcslashes($aioseop_options['aiosp_page_meta_tags']);
  277. $post_meta = stripcslashes($aioseop_options['aiosp_post_meta_tags']);
  278. $home_meta = stripcslashes($aioseop_options['aiosp_home_meta_tags']);
  279. if (is_page() && isset($page_meta) && !empty($page_meta) || $this->is_static_posts_page()) {
  280. if (isset($meta_string)) {
  281. $meta_string .= "\n";
  282. }
  283. echo "\n$page_meta";
  284. }
  285. if (is_single() && isset($post_meta) && !empty($post_meta)) {
  286. if (isset($meta_string)) {
  287. $meta_string .= "\n";
  288. }
  289. $meta_string .= "$post_meta";
  290. }
  291. if (is_home() && !empty($home_meta)) {
  292. if (isset($meta_string)) {
  293. $meta_string .= "\n";
  294. }
  295. $meta_string .= "$home_meta";
  296. }
  297. if ($meta_string != null) {
  298. echo "$meta_string\n";
  299. }
  300. if($aioseop_options['aiosp_can']){
  301. $url = $this->aiosp_mrt_get_url($wp_query);
  302. if ($url) {
  303. $url = apply_filters('aioseop_canonical_url',$url);
  304. echo "".'<link rel="canonical" href="'.$url.'" />'."\n";
  305. }
  306. }
  307. echo "<!-- /all in one seo pack -->\n";
  308. }
  309. // Thank you, Yoast de Valk, for much of this code.
  310. function aiosp_mrt_get_url($query) {
  311. global $aioseop_options;
  312. if ($query->is_404 || $query->is_search) {
  313. return false;
  314. }
  315. $haspost = count($query->posts) > 0;
  316. $has_ut = function_exists('user_trailingslashit');
  317. if (get_query_var('m')) {
  318. $m = preg_replace('/[^0-9]/', '', get_query_var('m'));
  319. switch (strlen($m)) {
  320. case 4:
  321. $link = get_year_link($m);
  322. break;
  323. case 6:
  324. $link = get_month_link(substr($m, 0, 4), substr($m, 4, 2));
  325. break;
  326. case 8:
  327. $link = get_day_link(substr($m, 0, 4), substr($m, 4, 2), substr($m, 6, 2));
  328. break;
  329. default:
  330. return false;
  331. }
  332. } elseif (($query->is_single || $query->is_page) && $haspost) {
  333. $post = $query->posts[0];
  334. $link = get_permalink($post->ID);
  335. $link = $this->yoast_get_paged($link);
  336. /* if ($page && $page > 1) {
  337. $link = trailingslashit($link) . "page/". "$page";
  338. if ($has_ut) {
  339. $link = user_trailingslashit($link, 'paged');
  340. } else {
  341. $link .= '/';
  342. }
  343. }
  344. if ($query->is_page && ('page' == get_option('show_on_front')) &&
  345. $post->ID == get_option('page_on_front'))
  346. {
  347. $link = trailingslashit($link);
  348. }*/
  349. } elseif ($query->is_author && $haspost) {
  350. global $wp_version;
  351. if ($wp_version >= '2') {
  352. $author = get_userdata(get_query_var('author'));
  353. if ($author === false)
  354. return false;
  355. $link = get_author_link(false, $author->ID, $author->user_nicename);
  356. } else {
  357. global $cache_userdata;
  358. $userid = get_query_var('author');
  359. $link = get_author_link(false, $userid, $cache_userdata[$userid]->user_nicename);
  360. }
  361. } elseif ($query->is_category && $haspost) {
  362. $link = get_category_link(get_query_var('cat'));
  363. $link = $this->yoast_get_paged($link);
  364. } else if ($query->is_tag && $haspost) {
  365. $tag = get_term_by('slug',get_query_var('tag'),'post_tag');
  366. if (!empty($tag->term_id)) {
  367. $link = get_tag_link($tag->term_id);
  368. }
  369. $link = $this->yoast_get_paged($link);
  370. } elseif ($query->is_day && $haspost) {
  371. $link = get_day_link(get_query_var('year'),
  372. get_query_var('monthnum'),
  373. get_query_var('day'));
  374. } elseif ($query->is_month && $haspost) {
  375. $link = get_month_link(get_query_var('year'),
  376. get_query_var('monthnum'));
  377. } elseif ($query->is_year && $haspost) {
  378. $link = get_year_link(get_query_var('year'));
  379. } elseif ($query->is_home) {
  380. if ((get_option('show_on_front') == 'page') &&
  381. ($pageid = get_option('page_for_posts')))
  382. {
  383. $link = get_permalink($pageid);
  384. $link = $this->yoast_get_paged($link);
  385. $link = trailingslashit($link);
  386. } else {
  387. $link = get_option('home');
  388. $link = $this->yoast_get_paged($link);
  389. $link = trailingslashit($link); }
  390. } else {
  391. return false;
  392. }
  393. return $link;
  394. }
  395. function yoast_get_paged($link) {
  396. $page = get_query_var('paged');
  397. if ($page && $page > 1) {
  398. $link = trailingslashit($link) ."page/". "$page";
  399. if ($has_ut) {
  400. $link = user_trailingslashit($link, 'paged');
  401. } else {
  402. $link .= '/';
  403. }
  404. }
  405. return $link;
  406. }
  407. function get_post_description($post) {
  408. global $aioseop_options;
  409. $description = trim(stripcslashes($this->internationalize(get_post_meta($post->ID, "_aioseop_description", true))));
  410. if (!$description) {
  411. $description = $this->trim_excerpt_without_filters_full_length($this->internationalize($post->post_excerpt));
  412. if (!$description && $aioseop_options["aiosp_generate_descriptions"]) {
  413. $description = $this->trim_excerpt_without_filters($this->internationalize($post->post_content));
  414. }
  415. }
  416. // "internal whitespace trim"
  417. $description = preg_replace("/\s\s+/", " ", $description);
  418. return $description;
  419. }
  420. function replace_title($content, $title) {
  421. $title = trim(strip_tags($title));
  422. $title_tag_start = "<title>";
  423. $title_tag_end = "</title>";
  424. $len_start = strlen($title_tag_start);
  425. $len_end = strlen($title_tag_end);
  426. $title = stripcslashes(trim($title));
  427. $start = strpos($content, $title_tag_start);
  428. $end = strpos($content, $title_tag_end);
  429. $this->title_start = $start;
  430. $this->title_end = $end;
  431. $this->orig_title = $title;
  432. if ($start && $end) {
  433. $header = substr($content, 0, $start + $len_start) . $title . substr($content, $end);
  434. } else {
  435. // this breaks some sitemap plugins (like wpg2)
  436. //$header = $content . "<title>$title</title>";
  437. $header = $content;
  438. }
  439. return $header;
  440. }
  441. function internationalize($in) {
  442. if (function_exists('langswitch_filter_langs_with_message')) {
  443. $in = langswitch_filter_langs_with_message($in);
  444. }
  445. if (function_exists('polyglot_filter')) {
  446. $in = polyglot_filter($in);
  447. }
  448. if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
  449. $in = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($in);
  450. }
  451. $in = apply_filters('localization', $in);
  452. return $in;
  453. }
  454. /** @return The original title as delivered by WP (well, in most cases) */
  455. function get_original_title() {
  456. global $wp_query;
  457. global $aioseop_options;
  458. if (!$wp_query) {
  459. return null;
  460. }
  461. $post = $wp_query->get_queried_object();
  462. // the_search_query() is not suitable, it cannot just return
  463. global $s;
  464. $title = null;
  465. if (is_home()) {
  466. $title = get_option('blogname');
  467. } else if (is_single()) {
  468. $title = $this->internationalize(wp_title('', false));
  469. } else if (is_search() && isset($s) && !empty($s)) {
  470. if (function_exists('attribute_escape')) {
  471. $search = attribute_escape(stripcslashes($s));
  472. } else {
  473. $search = wp_specialchars(stripcslashes($s), true);
  474. }
  475. $search = $this->capitalize($search);
  476. $title = $search;
  477. } else if (is_category() && !is_feed()) {
  478. $category_description = $this->internationalize(category_description());
  479. $category_name = ucwords($this->internationalize(single_cat_title('', false)));
  480. $title = $category_name;
  481. } else if (is_page()) {
  482. $title = $this->internationalize(wp_title('', false));
  483. } else if (function_exists('is_tag') && is_tag()) {
  484. global $utw;
  485. if ($utw) {
  486. $tags = $utw->GetCurrentTagSet();
  487. $tag = $tags[0]->tag;
  488. $tag = str_replace('-', ' ', $tag);
  489. } else {
  490. // wordpress > 2.3
  491. $tag = $this->internationalize(wp_title('', false));
  492. }
  493. if ($tag) {
  494. $title = $tag;
  495. }
  496. } else if (is_archive()) {
  497. $title = $this->internationalize(wp_title('', false));
  498. } else if (is_404()) {
  499. $title_format = $aioseop_options['aiosp_404_title_format'];
  500. $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
  501. $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
  502. $new_title = str_replace('%request_url%', $_SERVER['REQUEST_URI'], $new_title);
  503. $new_title = str_replace('%request_words%', $this->request_as_words($_SERVER['REQUEST_URI']), $new_title);
  504. $title = $new_title;
  505. }
  506. return trim($title);
  507. }
  508. function paged_title($title) {
  509. // the page number if paged
  510. global $paged;
  511. global $aioseop_options;
  512. // simple tagging support
  513. global $STagging;
  514. if (is_paged() || (isset($STagging) && $STagging->is_tag_view() && $paged)) {
  515. $part = $this->internationalize($aioseop_options['aiosp_paged_format']);
  516. if (isset($part) || !empty($part)) {
  517. $part = " " . trim($part);
  518. $part = str_replace('%page%', $paged, $part);
  519. $this->log("paged_title() [$title] [$part]");
  520. $title .= $part;
  521. }
  522. }
  523. return $title;
  524. }
  525. function rewrite_title($header) {
  526. global $aioseop_options;
  527. global $wp_query;
  528. if (!$wp_query) {
  529. $header .= "<!-- no wp_query found! -->\n";
  530. return $header;
  531. }
  532. $post = $wp_query->get_queried_object();
  533. // the_search_query() is not suitable, it cannot just return
  534. global $s;
  535. global $STagging;
  536. if (is_home() && !$this->is_static_posts_page()) {
  537. $title = $this->internationalize($aioseop_options['aiosp_home_title']);
  538. if (empty($title)) {
  539. $title = $this->internationalize(get_option('blogname'));
  540. }
  541. $title = $this->paged_title($title);
  542. $header = $this->replace_title($header, $title);
  543. } else if (is_attachment()) {
  544. $title = get_the_title($post->post_parent).' '.$post->post_title.' – '.get_option('blogname');
  545. $header = $this->replace_title($header,$title);
  546. } else if (is_single()) {
  547. // we're not in the loop :(
  548. $authordata = get_userdata($post->post_author);
  549. $categories = get_the_category();
  550. $category = '';
  551. if (count($categories) > 0) {
  552. $category = $categories[0]->cat_name;
  553. }
  554. $title = $this->internationalize(get_post_meta($post->ID, "_aioseop_title", true));
  555. if (!$title) {
  556. $title = $this->internationalize(get_post_meta($post->ID, "title_tag", true));
  557. if (!$title) {
  558. $title = $this->internationalize(wp_title('', false));
  559. }
  560. }
  561. $title_format = $aioseop_options['aiosp_post_title_format'];
  562. /*
  563. $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
  564. $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
  565. $new_title = str_replace('%post_title%', $title, $new_title);
  566. $new_title = str_replace('%category%', $category, $new_title);
  567. $new_title = str_replace('%category_title%', $category, $new_title);
  568. $new_title = str_replace('%post_author_login%', $authordata->user_login, $new_title);
  569. $new_title = str_replace('%post_author_nicename%', $authordata->user_nicename, $new_title);
  570. $new_title = str_replace('%post_author_firstname%', ucwords($authordata->first_name), $new_title);
  571. $new_title = str_replace('%post_author_lastname%', ucwords($authordata->last_name), $new_title);
  572. */
  573. $r_title = array('%blog_title%','%blog_description%','%post_title%','%category%','%category_title%','%post_author_login%','%post_author_nicename%','%post_author_firstname%','%post_author_lastname%');
  574. $d_title = array($this->internationalize(get_bloginfo('name')),$this->internationalize(get_bloginfo('description')),$title, $category, $category, $authordata->user_login, $authordata->user_nicename, ucwords($authordata->first_name), ucwords($authordata->last_name));
  575. $title = trim(str_replace($r_title, $d_title, $title_format));
  576. // $title = $new_title;
  577. // $title = trim($title);
  578. $title = apply_filters('aioseop_title_single',$title);
  579. $header = $this->replace_title($header, $title);
  580. } else if (is_search() && isset($s) && !empty($s)) {
  581. if (function_exists('attribute_escape')) {
  582. $search = attribute_escape(stripcslashes($s));
  583. } else {
  584. $search = wp_specialchars(stripcslashes($s), true);
  585. }
  586. $search = $this->capitalize($search);
  587. $title_format = $aioseop_options['aiosp_search_title_format'];
  588. $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
  589. $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
  590. $title = str_replace('%search%', $search, $title);
  591. $header = $this->replace_title($header, $title);
  592. } else if (is_category() && !is_feed()) {
  593. $category_description = $this->internationalize(category_description());
  594. if($aioseop_options['aiosp_cap_cats']){
  595. $category_name = ucwords($this->internationalize(single_cat_title('', false)));
  596. }else{
  597. $category_name = $this->internationalize(single_cat_title('', false));
  598. }
  599. //$category_name = ucwords($this->internationalize(single_cat_title('', false)));
  600. $title_format = $aioseop_options['aiosp_category_title_format'];
  601. $title = str_replace('%category_title%', $category_name, $title_format);
  602. $title = str_replace('%category_description%', $category_description, $title);
  603. $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title);
  604. $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
  605. $title = $this->paged_title($title);
  606. $header = $this->replace_title($header, $title);
  607. } else if (is_page() || $this->is_static_posts_page()) {
  608. // we're not in the loop :(
  609. $authordata = get_userdata($post->post_author);
  610. if ($this->is_static_front_page()) {
  611. if ($this->internationalize($aioseop_options['aiosp_home_title'])) {
  612. //home title filter
  613. $home_title = $this->internationalize($aioseop_options['aiosp_home_title']);
  614. $home_title = apply_filters('aioseop_home_page_title',$home_title);
  615. $header = $this->replace_title($header, $home_title);
  616. }
  617. } else {
  618. $title = $this->internationalize(get_post_meta($post->ID, "_aioseop_title", true));
  619. if (!$title) {
  620. $title = $this->internationalize(wp_title('', false));
  621. }
  622. $title_format = $aioseop_options['aiosp_page_title_format'];
  623. $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
  624. $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
  625. $new_title = str_replace('%page_title%', $title, $new_title);
  626. $new_title = str_replace('%page_author_login%', $authordata->user_login, $new_title);
  627. $new_title = str_replace('%page_author_nicename%', $authordata->user_nicename, $new_title);
  628. $new_title = str_replace('%page_author_firstname%', ucwords($authordata->first_name), $new_title);
  629. $new_title = str_replace('%page_author_lastname%', ucwords($authordata->last_name), $new_title);
  630. $title = trim($new_title);
  631. $title = $this->paged_title($title);
  632. $title = apply_filters('aioseop_title_page',$title);
  633. $header = $this->replace_title($header, $title);
  634. }
  635. } else if (function_exists('is_tag') && is_tag()) {
  636. global $utw;
  637. if ($utw) {
  638. $tags = $utw->GetCurrentTagSet();
  639. $tag = $tags[0]->tag;
  640. $tag = str_replace('-', ' ', $tag);
  641. } else {
  642. // wordpress > 2.3
  643. $tag = $this->internationalize(wp_title('', false));
  644. }
  645. if ($tag) {
  646. $tag = $this->capitalize($tag);
  647. $title_format = $aioseop_options['aiosp_tag_title_format'];
  648. $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
  649. $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
  650. $title = str_replace('%tag%', $tag, $title);
  651. $title = $this->paged_title($title);
  652. $header = $this->replace_title($header, $title);
  653. }
  654. } else if (isset($STagging) && $STagging->is_tag_view()) { // simple tagging support
  655. $tag = $STagging->search_tag;
  656. if ($tag) {
  657. $tag = $this->capitalize($tag);
  658. $title_format = $aioseop_options['aiosp_tag_title_format'];
  659. $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
  660. $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
  661. $title = str_replace('%tag%', $tag, $title);
  662. $title = $this->paged_title($title);
  663. $header = $this->replace_title($header, $title);
  664. }
  665. } else if (is_archive()) {
  666. $date = $this->internationalize(wp_title('', false));
  667. $title_format = $aioseop_options['aiosp_archive_title_format'];
  668. $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
  669. $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
  670. $new_title = str_replace('%date%', $date, $new_title);
  671. $title = trim($new_title);
  672. $title = $this->paged_title($title);
  673. $header = $this->replace_title($header, $title);
  674. } else if (is_404()) {
  675. $title_format = $aioseop_options['aiosp_404_title_format'];
  676. $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
  677. $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
  678. $new_title = str_replace('%request_url%', $_SERVER['REQUEST_URI'], $new_title);
  679. $new_title = str_replace('%request_words%', $this->request_as_words($_SERVER['REQUEST_URI']), $new_title);
  680. $new_title = str_replace('%404_title%', $this->internationalize(wp_title('', false)), $new_title);
  681. $header = $this->replace_title($header, $new_title);
  682. }
  683. return $header;
  684. }
  685. /**
  686. * @return User-readable nice words for a given request.
  687. */
  688. function request_as_words($request) {
  689. $request = htmlspecialchars($request);
  690. $request = str_replace('.html', ' ', $request);
  691. $request = str_replace('.htm', ' ', $request);
  692. $request = str_replace('.', ' ', $request);
  693. $request = str_replace('/', ' ', $request);
  694. $request_a = explode(' ', $request);
  695. $request_new = array();
  696. foreach ($request_a as $token) {
  697. $request_new[] = ucwords(trim($token));
  698. }
  699. $request = implode(' ', $request_new);
  700. return $request;
  701. }
  702. function capitalize($s) {
  703. $s = trim($s);
  704. $tokens = explode(' ', $s);
  705. while (list($key, $val) = each($tokens)) {
  706. $tokens[$key] = trim($tokens[$key]);
  707. $tokens[$key] = strtoupper(substr($tokens[$key], 0, 1)) . substr($tokens[$key], 1);
  708. }
  709. $s = implode(' ', $tokens);
  710. return $s;
  711. }
  712. function trim_excerpt_without_filters($text) {
  713. $text = str_replace(']]>', ']]&gt;', $text);
  714. $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
  715. $text = strip_tags($text);
  716. $max = $this->maximum_description_length;
  717. if ($max < strlen($text)) {
  718. while($text[$max] != ' ' && $max > $this->minimum_description_length) {
  719. $max--;
  720. }
  721. }
  722. $text = substr($text, 0, $max);
  723. return trim(stripcslashes($text));
  724. }
  725. function trim_excerpt_without_filters_full_length($text) {
  726. $text = str_replace(']]>', ']]&gt;', $text);
  727. $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
  728. $text = strip_tags($text);
  729. return trim(stripcslashes($text));
  730. }
  731. /**
  732. * @return comma-separated list of unique keywords
  733. */
  734. function get_all_keywords() {
  735. global $posts;
  736. global $aioseop_options;
  737. if (is_404()) {
  738. return null;
  739. }
  740. // if we are on synthetic pages
  741. if (!is_home() && !is_page() && !is_single() &&!$this->is_static_front_page() && !$this->is_static_posts_page()) {
  742. return null;
  743. }
  744. $keywords = array();
  745. if (is_array($posts)) {
  746. foreach ($posts as $post) {
  747. if ($post) {
  748. // custom field keywords
  749. $keywords_a = $keywords_i = null;
  750. $description_a = $description_i = null;
  751. $id = (is_attachment())?($post->post_parent):($post->ID); // if attachment then use parent post id
  752. $keywords_i = stripcslashes($this->internationalize(get_post_meta($id, "_aioseop_keywords", true)));
  753. //$id = $post->ID;
  754. //$keywords_i = stripcslashes($this->internationalize(get_post_meta($post->ID, "_aioseop_keywords", true)));
  755. $keywords_i = str_replace('"', '', $keywords_i);
  756. if (isset($keywords_i) && !empty($keywords_i)) {
  757. $traverse = explode(',', $keywords_i);
  758. foreach ($traverse as $keyword) {
  759. $keywords[] = $keyword;
  760. }
  761. }
  762. // WP 2.3 tags
  763. if ($aioseop_options['aiosp_use_tags_as_keywords']){
  764. if (function_exists('get_the_tags')) {
  765. //$tags = get_the_tags($post->ID);
  766. $tags = get_the_tags($id);
  767. if ($tags && is_array($tags)) {
  768. foreach ($tags as $tag) {
  769. $keywords[] = $this->internationalize($tag->name);
  770. }
  771. }
  772. }
  773. }
  774. // Ultimate Tag Warrior integration
  775. global $utw;
  776. if ($utw) {
  777. $tags = $utw->GetTagsForPost($post);
  778. if (is_array($tags)) {
  779. foreach ($tags as $tag) {
  780. $tag = $tag->tag;
  781. $tag = str_replace('_',' ', $tag);
  782. $tag = str_replace('-',' ',$tag);
  783. $tag = stripcslashes($tag);
  784. $keywords[] = $tag;
  785. }
  786. }
  787. }
  788. // autometa
  789. $autometa = stripcslashes(get_post_meta($id, 'autometa', true));
  790. //$autometa = stripcslashes(get_post_meta($post->ID, "autometa", true));
  791. if (isset($autometa) && !empty($autometa)) {
  792. $autometa_array = explode(' ', $autometa);
  793. foreach ($autometa_array as $e) {
  794. $keywords[] = $e;
  795. }
  796. }
  797. if ($aioseop_options['aiosp_use_categories'] && !is_page()) {
  798. $categories = get_the_category($id);
  799. //$categories = get_the_category($post->ID);
  800. foreach ($categories as $category) {
  801. $keywords[] = $this->internationalize($category->cat_name);
  802. }
  803. }
  804. }
  805. }
  806. }
  807. return $this->get_unique_keywords($keywords);
  808. }
  809. function get_meta_keywords() {
  810. global $posts;
  811. $keywords = array();
  812. if (is_array($posts)) {
  813. foreach ($posts as $post) {
  814. if ($post) {
  815. // custom field keywords
  816. $keywords_a = $keywords_i = null;
  817. $description_a = $description_i = null;
  818. $id = $post->ID;
  819. $keywords_i = stripcslashes(get_post_meta($post->ID, "_aioseop_keywords", true));
  820. $keywords_i = str_replace('"', '', $keywords_i);
  821. if (isset($keywords_i) && !empty($keywords_i)) {
  822. $keywords[] = $keywords_i;
  823. }
  824. }
  825. }
  826. }
  827. return $this->get_unique_keywords($keywords);
  828. }
  829. function get_unique_keywords($keywords) {
  830. $small_keywords = array();
  831. foreach ($keywords as $word) {
  832. if (function_exists('mb_strtolower'))
  833. $small_keywords[] = mb_strtolower($word, get_bloginfo('charset'));
  834. else
  835. $small_keywords[] = $this->strtolower($word);
  836. }
  837. $keywords_ar = array_unique($small_keywords);
  838. return implode(',', $keywords_ar);
  839. }
  840. function get_url($url) {
  841. if (function_exists('file_get_contents')) {
  842. $file = file_get_contents($url);
  843. } else {
  844. $curl = curl_init($url);
  845. curl_setopt($curl, CURLOPT_HEADER, 0);
  846. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  847. $file = curl_exec($curl);
  848. curl_close($curl);
  849. }
  850. return $file;
  851. }
  852. function log($message) {
  853. if ($this->do_log) {
  854. error_log(date('Y-m-d H:i:s') . " " . $message . "\n", 3, $this->log_file);
  855. }
  856. }
  857. function download_newest_version() {
  858. $success = true;
  859. $file_content = $this->get_url($this->upgrade_url);
  860. if ($file_content === false) {
  861. $this->upgrade_error = sprintf(__("Could not download distribution (%s)"), $this->upgrade_url);
  862. $success = false;
  863. } else if (strlen($file_content) < 100) {
  864. $this->upgrade_error = sprintf(__("Could not download distribution (%s): %s"), $this->upgrade_url, $file_content);
  865. $success = false;
  866. } else {
  867. $this->log(sprintf("filesize of download ZIP: %d", strlen($file_content)));
  868. $fh = @fopen($this->upgrade_filename, 'w');
  869. $this->log("fh is $fh");
  870. if (!$fh) {
  871. $this->upgrade_error = sprintf(__("Could not open %s for writing"), $this->upgrade_filename);
  872. $this->upgrade_error .= "<br />";
  873. $this->upgrade_error .= sprintf(__("Please make sure %s is writable"), $this->upgrade_folder);
  874. $success = false;
  875. } else {
  876. $bytes_written = @fwrite($fh, $file_content);
  877. $this->log("wrote $bytes_written bytes");
  878. if (!$bytes_written) {
  879. $this->upgrade_error = sprintf(__("Could not write to %s"), $this->upgrade_filename);
  880. $success = false;
  881. }
  882. }
  883. if ($success) {
  884. fclose($fh);
  885. }
  886. }
  887. return $success;
  888. }
  889. function install_newest_version() {
  890. $success = $this->download_newest_version();
  891. if ($success) {
  892. $success = $this->extract_plugin();
  893. unlink($this->upgrade_filename);
  894. }
  895. return $success;
  896. }
  897. function extract_plugin() {
  898. if (!class_exists('PclZip')) {
  899. require_once ('pclzip.lib.php');
  900. }
  901. $archive = new PclZip($this->upgrade_filename);
  902. $files = $archive->extract(PCLZIP_OPT_STOP_ON_ERROR, PCLZIP_OPT_REPLACE_NEWER, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_PATH, $this->upgrade_folder);
  903. $this->log("files is $files");
  904. if (is_array($files)) {
  905. $num_extracted = sizeof($files);
  906. $this->log("extracted $num_extracted files to $this->upgrade_folder");
  907. $this->log(print_r($files, true));
  908. return true;
  909. } else {
  910. $this->upgrade_error = $archive->errorInfo();
  911. return false;
  912. }
  913. }
  914. /** crude approximization of whether current user is an admin */
  915. function is_admin() {
  916. return current_user_can('level_8');
  917. }
  918. function is_directory_writable($directory) {
  919. $filename = $directory . '/' . 'tmp_file_' . time();
  920. $fh = @fopen($filename, 'w');
  921. if (!$fh) {
  922. return false;
  923. }
  924. $written = fwrite($fh, "test");
  925. fclose($fh);
  926. unlink($filename);
  927. if ($written) {
  928. return true;
  929. } else {
  930. return false;
  931. }
  932. }
  933. function is_upgrade_directory_writable() {
  934. //return $this->is_directory_writable($this->upgrade_folder);
  935. // let's assume it is
  936. return true;
  937. }
  938. function post_meta_tags($id) {
  939. $awmp_edit = $_POST["aiosp_edit"];
  940. $nonce = $_POST['nonce-aioseop-edit'];
  941. // if (!wp_verify_nonce($nonce, 'edit-aioseop-nonce')) die ( 'Security Check - If you receive this in error, log out and back in to WordPress');
  942. if (isset($awmp_edit) && !empty($awmp_edit) && wp_verify_nonce($nonce, 'edit-aioseop-nonce')) {
  943. $keywords = $_POST["aiosp_keywords"];
  944. $description = $_POST["aiosp_description"];
  945. $title = $_POST["aiosp_title"];
  946. $aiosp_meta = $_POST["aiosp_meta"];
  947. $aiosp_disable = $_POST["aiosp_disable"];
  948. $aiosp_titleatr = $_POST["aiosp_titleatr"];
  949. $aiosp_menulabel = $_POST["aiosp_menulabel"];
  950. delete_post_meta($id, '_aioseop_keywords');
  951. delete_post_meta($id, '_aioseop_description');
  952. delete_post_meta($id, '_aioseop_title');
  953. delete_post_meta($id, '_aioseop_titleatr');
  954. delete_post_meta($id, '_aioseop_menulabel');
  955. if ($this->is_admin()) {
  956. delete_post_meta($id, '_aioseop_disable');
  957. }
  958. //delete_post_meta($id, 'aiosp_meta');
  959. if (isset($keywords) && !empty($keywords)) {
  960. add_post_meta($id, '_aioseop_keywords', $keywords);
  961. }
  962. if (isset($description) && !empty($description)) {
  963. add_post_meta($id, '_aioseop_description', $description);
  964. }
  965. if (isset($title) && !empty($title)) {
  966. add_post_meta($id, '_aioseop_title', $title);
  967. }
  968. if (isset($aiosp_titleatr) && !empty($aiosp_titleatr)) {
  969. add_post_meta($id, '_aioseop_titleatr', $aiosp_titleatr);
  970. }
  971. if (isset($aiosp_menulabel) && !empty($aiosp_menulabel)) {
  972. add_post_meta($id, '_aioseop_menulabel', $aiosp_menulabel);
  973. }
  974. if (isset($aiosp_disable) && !empty($aiosp_disable) && $this->is_admin()) {
  975. add_post_meta($id, '_aioseop_disable', $aiosp_disable);
  976. }
  977. /*
  978. if (isset($aiosp_meta) && !empty($aiosp_meta)) {
  979. add_post_meta($id, 'aiosp_meta', $aiosp_meta);
  980. }
  981. */
  982. }
  983. }
  984. function edit_category($id) {
  985. global $wpdb;
  986. $id = $wpdb->escape($id);
  987. $awmp_edit = $_POST["aiosp_edit"];
  988. if (isset($awmp_edit) && !empty($awmp_edit)) {
  989. $keywords = $wpdb->escape($_POST["aiosp_keywords"]);
  990. $title = $wpdb->escape($_POST["aiosp_title"]);
  991. $old_category = $wpdb->get_row("select * from $this->table_categories where category_id=$id", OBJECT);
  992. if ($old_category) {
  993. $wpdb->query($wpdb->prepare("update $this->table_categories
  994. set meta_title='$title', meta_keywords='$keywords'
  995. where category_id=$id"));
  996. } else {
  997. $wpdb->query($wpdb->prepare("insert into $this->table_categories(meta_title, meta_keywords, category_id)
  998. values ('$title', '$keywords', $id"));
  999. }
  1000. //$wpdb->query($wpdb->prepare("insert into $this->table_categories"))
  1001. /*
  1002. delete_post_meta($id, 'keywords');
  1003. delete_post_meta($id, 'description');
  1004. delete_post_meta($id, 'title');
  1005. if (isset($keywords) && !empty($keywords)) {
  1006. add_post_meta($id, 'keywords', $keywords);
  1007. }
  1008. if (isset($description) && !empty($description)) {
  1009. add_post_meta($id, 'description', $description);
  1010. }
  1011. if (isset($title) && !empty($title)) {
  1012. add_post_meta($id, 'title', $title);
  1013. }
  1014. */
  1015. }
  1016. }
  1017. /**
  1018. * @deprecated This was for the feature of dedicated meta tags for categories which never went mainstream.
  1019. */
  1020. function edit_category_form() {
  1021. global $post;
  1022. $keywords = stripcslashes(get_post_meta($post->ID, '_aioseop_keywords', true));
  1023. $title = stripcslashes(get_post_meta($post->ID, '_aioseop_title', true));
  1024. $description = stripcslashes(get_post_meta($post->ID, '_aioseop_description', true));
  1025. ?>
  1026. <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
  1027. <table class="editform" width="100%" cellspacing="2" cellpadding="5">
  1028. <tr>
  1029. <th width="33%" scope="row" valign="top">
  1030. <a href="http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/"><?php _e('All in One SEO Pack', 'all_in_one_seo_pack') ?></a>
  1031. </th>
  1032. </tr>
  1033. <tr>
  1034. <th width="33%" scope="row" valign="top"><label for="aiosp_title"><?php _e('Title:', 'all_in_one_seo_pack') ?></label></th>
  1035. <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="70"/></td>
  1036. </tr>
  1037. <tr>
  1038. <th width="33%" scope="row" valign="top"><label for="aiosp_keywords"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></label></th>
  1039. <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="70"/></td>
  1040. </tr>
  1041. </table>
  1042. <?php
  1043. }
  1044. function add_meta_tags_textinput() {
  1045. global $post;
  1046. $post_id = $post;
  1047. if (is_object($post_id)) {
  1048. $post_id = $post_id->ID;
  1049. }
  1050. $keywords = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_keywords', true)));
  1051. $title = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_title', true)));
  1052. $description = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_description', true)));
  1053. $aiosp_meta = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_meta', true)));
  1054. $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_disable', true)));
  1055. $aiosp_titleatr = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_titleatr', true)));
  1056. $aiosp_menulabel = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_menulabel', true)));
  1057. ?>
  1058. <SCRIPT LANGUAGE="JavaScript">
  1059. <!-- Begin
  1060. function countChars(field,cntfield) {
  1061. cntfield.value = field.value.length;
  1062. }
  1063. // End -->
  1064. </script>
  1065. <?php if (substr($this->wp_version, 0, 3) >= '2.5') { ?>
  1066. <div id="postaiosp" class="postbox closed">
  1067. <h3><?php _e('All in One SEO Pack', 'all_in_one_seo_pack') ?></h3>
  1068. <div class="inside">
  1069. <div id="postaiosp">
  1070. <?php } else { ?>
  1071. <div class="dbx-b-ox-wrapper">
  1072. <fieldset id="seodiv" class="dbx-box">
  1073. <div class="dbx-h-andle-wrapper">
  1074. <h3 class="dbx-handle"><?php _e('All in One SEO Pack', 'all_in_one_seo_pack') ?></h3>
  1075. </div>
  1076. <div class="dbx-c-ontent-wrapper">
  1077. <div class="dbx-content">
  1078. <?php } ?>
  1079. <a target="__blank" href="http://semperfiwebdesign.com/portfolio/wordpress/wordpress-plugins/all-in-one-seo-pack/"><?php _e('Click here for Support', 'all_in_one_seo_pack') ?></a>
  1080. <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
  1081. <table style="margin-bottom:40px">
  1082. <tr>
  1083. <th style="text-align:left;" colspan="2">
  1084. </th>
  1085. </tr>
  1086. <tr>
  1087. <th scope="row" style="text-align:right;"><?php _e('Title:', 'all_in_one_seo_pack') ?></th>
  1088. <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="62"/></td>
  1089. </tr>
  1090. <tr>
  1091. <th scope="row" style="text-align:right;"><?php _e('Description:', 'all_in_one_seo_pack') ?></th>
  1092. <td><textarea name="aiosp_description" rows="1" cols="60" onKeyDown="countChars(document.post.aiosp_description,document.post.length1)" onKeyUp="countChars(document.post.aiosp_description,document.post.length1)"><?php echo $description ?>
  1093. </textarea><br />
  1094. <input readonly type="text" name="length1" size="3" maxlength="3" value="<?php echo strlen($description);?>" />
  1095. <?php _e(' characters. Most search engines use a maximum of 160 chars for the description.', 'all_in_one_seo_pack') ?>
  1096. </td>
  1097. </tr>
  1098. <tr>
  1099. <th scope="row" style="text-align:right;"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></th>
  1100. <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="62"/></td>
  1101. </tr>
  1102. <input type="hidden" name="nonce-aioseop-edit" value="<?php echo wp_create_nonce('edit-aioseop-nonce'); ?>" />
  1103. <?php if ($this->is_admin()) { ?>
  1104. <tr>
  1105. <th scope="row" style="text-align:right; vertical-align:top;">
  1106. <?php _e('Disable on this page/post:', 'all_in_one_seo_pack')?>
  1107. </th>
  1108. <td>
  1109. <input type="checkbox" name="aiosp_disable" <?php if ($aiosp_disable) echo "checked=\"1\""; ?>/>
  1110. </td>
  1111. </tr>
  1112. <tr>
  1113. <th scope="row" style="text-align:right;"><?php _e('Title Attribute:', 'all_in_one_seo_pack') ?></th>
  1114. <td><input value="<?php echo $aiosp_titleatr ?>" type="text" name="aiosp_titleatr" size="62"/></td>
  1115. </tr>
  1116. <tr>
  1117. <th scope="row" style="text-align:right;"><?php _e('Menu Label:', 'all_in_one_seo_pack') ?></th>
  1118. <td><input value="<?php echo $aiosp_menulabel ?>" type="text" name="aiosp_menulabel" size="62"/></td>
  1119. </tr>
  1120. <?php } ?>
  1121. </table>
  1122. <?php if (substr($this->wp_version, 0, 3) >= '2.5') { ?>
  1123. </div>
  1124. </div>
  1125. </div>
  1126. <?php } else { ?>
  1127. </div>
  1128. </fieldset>
  1129. </div>
  1130. <?php } ?>
  1131. <?php
  1132. }
  1133. function admin_menu() {
  1134. $file = __FILE__;
  1135. // hack for 1.5
  1136. if (substr($this->wp_version, 0, 3) == '1.5') {
  1137. $file = 'all-in-one-seo-pack/all_in_one_seo_pack.php';
  1138. }
  1139. //add_management_page(__('All in One SEO Title', 'all_in_one_seo_pack'), __('All in One SEO', 'all_in_one_seo_pack'), 10, $file, array($this, 'management_panel'));
  1140. add_submenu_page('options-general.php', __('All in One SEO', 'all_in_one_seo_pack'), __('All in One SEO', 'all_in_one_seo_pack'), 'manage_options', $file, array($this, 'options_panel'));
  1141. }
  1142. function management_panel() {
  1143. $message = null;
  1144. $base_url = "edit.php?page=" . __FILE__;
  1145. //echo($base_url);
  1146. $type = $_REQUEST['type'];
  1147. if (!isset($type)) {
  1148. $type = "posts";
  1149. }
  1150. ?>
  1151. <ul class="aiosp_menu">
  1152. <li><a href="<?php echo $base_url ?>&type=posts">Posts</a>
  1153. </li>
  1154. <li><a href="<?php echo $base_url ?>&type=pages">Pages</a>
  1155. </li>
  1156. </ul>
  1157. <?php
  1158. if ($type == "posts") {
  1159. echo("posts");
  1160. } elseif ($type == "pages") {
  1161. echo("pages");
  1162. }
  1163. }
  1164. function options_panel() {
  1165. $message = null;
  1166. //$message_updated = __("All in One SEO Options Updated.", 'all_in_one_seo_pack');
  1167. global $aioseop_options;
  1168. if(!$aioseop_options['aiosp_cap_cats']) {
  1169. $aioseop_options['aiosp_cap_cats'] = '1';
  1170. }
  1171. if (isset($_POST['action']) && $_POST['action'] == 'aiosp_update' && isset($_POST['Submit_Default'])) {
  1172. $nonce = $_POST['nonce-aioseop'];
  1173. if (!wp_verify_nonce($nonce, 'aioseop-nonce')) die ( 'Security Check - If you receive this in error, log out and back in to WordPress');
  1174. $message = __("All in One SEO Options Reset.", 'all_in_one_seo_pack');
  1175. delete_option('aioseop_options');
  1176. $res_aioseop_options = array(
  1177. "aiosp_can"=>1,
  1178. "aiosp_donate"=>0,
  1179. "aiosp_home_title"=>null,
  1180. "aiosp_home_description"=>'',
  1181. "aiosp_home_keywords"=>null,
  1182. "aiosp_max_words_excerpt"=>'something',
  1183. "aiosp_rewrite_titles"=>1,
  1184. "aiosp_post_title_format"=>'%post_title% | %blog_title%',
  1185. "aiosp_page_title_format"=>'%page_title% | %blog_title%',
  1186. "aiosp_category_title_format"=>'%category_title% | %blog_title%',
  1187. "aiosp_archive_title_format"=>'%date% | %blog_title%',
  1188. "aiosp_tag_title_format"=>'%tag% | %blog_title%',
  1189. "aiosp_search_title_format"=>'%search% | %blog_title%',
  1190. "aiosp_description_format"=>'%description%',
  1191. "aiosp_404_title_format"=>'Nothing found for %request_words%',
  1192. "aiosp_paged_format"=>' - Part %page%',
  1193. "aiosp_use_categories"=>0,
  1194. "aiosp_dynamic_postspage_keywords"=>1,
  1195. "aiosp_category_noindex"=>1,
  1196. "aiosp_archive_noindex"=>1,
  1197. "aiosp_tags_noindex"=>0,
  1198. "aiosp_cap_cats"=>1,
  1199. "aiosp_generate_descriptions"=>1,
  1200. "aiosp_debug_info"=>null,
  1201. "aiosp_post_meta_tags"=>'',
  1202. "aiosp_enablecpost"=>'0',
  1203. "aiosp_page_meta_tags"=>'',
  1204. "aiosp_home_meta_tags"=>'',
  1205. "aiosp_enabled" =>0,
  1206. "aiosp_use_tags_as_keywords" =>1,
  1207. "aiosp_do_log"=>null);
  1208. update_option('aioseop_options', $res_aioseop_options);
  1209. }
  1210. // update options
  1211. if(isset($_POST['action'])){
  1212. if ($_POST['action'] && $_POST['action'] == 'aiosp_update' && $_POST['Submit']!='') {
  1213. $nonce = $_POST['nonce-aioseop'];
  1214. if (!wp_verify_nonce($nonce, 'aioseop-nonce')) die ( 'Security Check - If you receive this in error, log out and back in to WordPress');
  1215. $message = __("All in One SEO Options Updated.", 'all_in_one_seo_pack');
  1216. $aioseop_options['aiosp_can'] = $_POST['aiosp_can'];
  1217. $aioseop_options['aiosp_donate'] = $_POST['aiosp_donate'];
  1218. $aioseop_options['aiosp_home_title'] = esc_attr($_POST['aiosp_home_title']);
  1219. $aioseop_options['aiosp_home_description'] = esc_attr($_POST['aiosp_home_description']);
  1220. $aioseop_options['aiosp_home_keywords'] = $_POST['aiosp_home_keywords'];
  1221. $aioseop_options['aiosp_max_words_excerpt'] = $_POST['aiosp_max_words_excerpt'];
  1222. $aioseop_options['aiosp_rewrite_titles'] = $_POST['aiosp_rewrite_titles'];
  1223. $aioseop_options['aiosp_post_title_format'] = $_POST['aiosp_post_title_format'];
  1224. $aioseop_options['aiosp_page_title_format'] = $_POST['aiosp_page_title_format'];
  1225. $aioseop_options['aiosp_category_title_format'] = $_POST['aiosp_category_title_format'];
  1226. $aioseop_options['aiosp_archive_title_format'] = $_POST['aiosp_archive_title_format'];
  1227. $aioseop_options['aiosp_tag_title_format'] = $_POST['aiosp_tag_title_format'];
  1228. $aioseop_options['aiosp_search_title_format'] = $_POST['aiosp_search_title_format'];
  1229. $aioseop_options['aiosp_description_format'] = $_POST['aiosp_description_format'];
  1230. $aioseop_options['aiosp_404_title_format'] = $_POST['aiosp_404_title_format'];
  1231. $aioseop_options['aiosp_paged_format'] = $_POST['aiosp_paged_format'];
  1232. $aioseop_options['aiosp_use_categories'] = $_POST['aiosp_use_categories'];
  1233. $aioseop_options['aiosp_dynamic_postspage_keywords'] = $_POST['aiosp_dynamic_postspage_keywords'];
  1234. $aioseop_options['aiosp_category_noindex'] = $_POST['aiosp_category_noindex'];
  1235. $aioseop_options['aiosp_archive_noindex'] = $_POST['aiosp_archive_noindex'];
  1236. $aioseop_options['aiosp_tags_noindex'] = $_POST['aiosp_tags_noindex'];
  1237. $aioseop_options['aiosp_generate_descriptions'] = $_POST['aiosp_generate_descriptions'];
  1238. $aioseop_options['aiosp_cap_cats'] = $_POST['aiosp_cap_cats'];
  1239. $aioseop_options['aiosp_enablecpost'] = $_POST['aiosp_enablecpost'];
  1240. $aioseop_options['aiosp_debug_info'] = $_POST['aiosp_debug_info'];
  1241. $aioseop_options['aiosp_post_meta_tags'] = $_POST['aiosp_post_meta_tags'];
  1242. $aioseop_options['aiosp_page_meta_tags'] = $_POST['aiosp_page_meta_tags'];
  1243. $aioseop_options['aiosp_home_meta_tags'] = $_POST['aiosp_home_meta_tags'];
  1244. $aioseop_options['aiosp_ex_pages'] = $_POST['aiosp_ex_pages'];
  1245. $aioseop_options['aiosp_do_log'] = $_POST['aiosp_do_log'];
  1246. $aioseop_options['aiosp_enabled'] = $_POST['aiosp_enabled'];
  1247. $aioseop_options['aiosp_use_tags_as_keywords'] = $_POST['aiosp_use_tags_as_keywords'];
  1248. update_option('aioseop_options', $aioseop_options);
  1249. if (function_exists('wp_cache_flush')) {
  1250. wp_cache_flush();
  1251. }
  1252. }
  1253. } /*elseif ($_POST['aiosp_upgrade']) {
  1254. $message = __("Upgraded to newest version. Please revisit the options page to make sure you see the newest version.", 'all_in_one_seo_pack');
  1255. $success = $this->install_newest_version();
  1256. if (!$success) {
  1257. $message = __("Upgrade failed", 'all_in_one_seo_pack');
  1258. if (isset($this->upgrade_error) && !empty($this->upgrade_error)) {
  1259. $message .= ": " . $this->upgrade_error;
  1260. } else {
  1261. $message .= ".";
  1262. }
  1263. }
  1264. }*/
  1265. if ($message){
  1266. echo "<div id=\"message\" class=\"updated fade\"><p>$message</p></div>";
  1267. }
  1268. ?>
  1269. <div id="dropmessage" class="updated" style="display:none;"></div>
  1270. <div class="wrap">
  1271. <h2><?php _e('All in One SEO Plugin Options', 'all_in_one_seo_pack'); ?></h2>
  1272. by <strong>Michael Torbert</strong> of <strong>Semper Fi Web Design</strong>
  1273. <p>
  1274. <?php //_e("This is version ", 'all_in_one_seo_pack') ?><?php //_e("$this->version ", 'all_in_one_seo_pack') ?>
  1275. &nbsp;<a target="_blank" title="<?php _e('All in One SEO Plugin Release History', 'all_in_one_seo_pack')?>"
  1276. href="http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/all-in-one-seo-pack-release-history/"><?php _e("Changelog", 'all_in_one_seo_pack')?>
  1277. </a>
  1278. | <a target="_blank" title="<?php _e('FAQ', 'all_in_one_seo_pack') ?>"
  1279. href="http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/all-in-one-seo-faq/"><?php _e('FAQ', 'all_in_one_seo_pack') ?></a>
  1280. | <a target="_blank" title="<?php _e('All in One SEO Plugin Support Forum', 'all_in_one_seo_pack') ?>"
  1281. href="http://semperfiwebdesign.com/portfolio/wordpress/wordpress-plugins/forum/"><?php _e('Support', 'all_in_one_seo_pack') ?></a>
  1282. | <a target="_blank" title="<?php _e('All in One SEO Plugin Translations', 'all_in_one_seo_pack') ?>"
  1283. href="http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/translations-for-all-in-one-seo-pack/"><?php _e('Translations', 'all_in_one_seo_pack') ?></a>
  1284. | <strong><a target="_blank" title="<?php _e('Pro Version', 'all_in_one_seo_pack') ?>"
  1285. href="http://wpplugins.com/plugin/50/all-in-one-seo-pack-pro-version"><?php _e('UPGRADE TO PRO VERSION', 'all_in_one_seo_pack') ?></a></strong>
  1286. <br />
  1287. <!--<div style="width:75%;background-color:yellow;">
  1288. <em>Thank you for using <strong>All in One SEO Pack</strong> by <strong>Michael Torbert</strong> of <strong>Semper Fi Web Design</strong>. If you like this plugin and find it useful, feel free to click the <strong>donate</strong> button or send me a gift from my <strong>Amazon wishlist</strong>. Also, don't forget to follow me on <strong>Twitter</strong>.</em>
  1289. </div>
  1290. -->
  1291. <!--
  1292. <a target="_blank" title="<?php //echo 'Donate' ?>"
  1293. href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8"><img src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" width="" alt="Donate" /><?php //echo 'Donate' ?></a>
  1294. | <a target="_blank" title="Amazon Wish List" href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web"><img src="https://images-na.ssl-images-amazon.com/images/G/01/gifts/registries/wishlist/v2/web/wl-btn-74-b._V46774601_.gif" width="74" alt="My Amazon.com Wish List" height="42" border="0" /></a>
  1295. | <a target="_blank" title="<?php //_e('Follow us on Twitter', 'all_in_one_seo_pack') ?>"
  1296. href="http://twitter.com/michaeltorbert/"><img src="<?php //echo WP_PLUGIN_URL; ?>/all-in-one-seo-pack/images/twitter.png" alt="<?php //_e('Follow Us on Twitter', 'all_in_one_seo_pack') ?>" height="47px" /></a>
  1297. -->
  1298. </p>
  1299. <div style="width:832px;">
  1300. <div style="float:left;background-color:white;padding: 10px 10px 10px 10px;margin-right:15px;border: 1px solid #ddd;">
  1301. <div style="width:350px;height:130px;">
  1302. <h3>Donate</h3>
  1303. <em>If you like this plugin and find it useful, help keep this plugin free and actively developed by clicking the <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8" target="_blank"><strong>donate</strong></a> button or send me a gift from my <a href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank"><strong>Amazon wishlist</strong></a>. Also, don't forget to follow me on <a href="http://twitter.com/michaeltorbert/" target="_blank"><strong>Twitter</strong></a>.</em>
  1304. </div>
  1305. <a target="_blank" title="<?php echo 'Donate' ?>"
  1306. href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8">
  1307. <img src="<?php echo WP_PLUGIN_URL; ?>/all-in-one-seo-pack/images/donate.jpg" alt="<?php _e('Donate with Paypal', 'all_in_one_seo_pack') ?>" /> </a>
  1308. <a target="_blank" title="Amazon Wish List" href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web">
  1309. <img src="<?php echo WP_PLUGIN_URL; ?>/all-in-one-seo-pack/images/amazon.jpg" alt="<?php _e('My Amazon Wish List', 'all_in_one_seo_pack') ?>" /> </a>
  1310. <a target="_blank" title="<?php _e('Follow us on Twitter', 'all_in_one_seo_pack') ?>" href="http://twitter.com/michaeltorbert/">
  1311. <img src="<?php echo WP_PLUGIN_URL; ?>/all-in-one-seo-pack/images/twitter.jpg" alt="<?php _e('Follow Us on Twitter', 'all_in_one_seo_pack') ?>" /> </a>
  1312. </div>
  1313. <div style="float:left;background-color:white;padding: 10px 10px 10px 10px;border: 1px solid #ddd;">
  1314. <div style="width:423px;height:130px;">
  1315. <h3>PageLines Themes</h3>
  1316. We would also like to recommend <a href="http://www.pagelines.com/wpthemes/" target="_blank">PageLines</a> for Professional WordPress Themes. They are attractive, affordable, performance optimized CMS themes that integrate perfectly with All in One SEO Pack to put your professional website at the top of the rankings.
  1317. </div>
  1318. <a target="_blank" title="iBlogPro" href="http://www.pagelines.com/wpthemes/"><img src="<?php echo WP_PLUGIN_URL; ?>/all-in-one-seo-pack/images/iblogpro.jpg" alt="<?php _e('iBlogPro theme', 'all_in_one_seo_pack') ?>" /></a>
  1319. <a target="_blank" title="PageLines Themes" href="http://www.pagelines.com/wpthemes/"><img src="<?php echo WP_PLUGIN_URL; ?>/all-in-one-seo-pack/images/pagelines.jpg" alt="<?php _e('Pagelines Themes', 'all_in_one_seo_pack') ?>" /></a>
  1320. <a target="_blank" title="WhiteHouse" href="http://www.pagelines.com/wpthemes/"><img src="<?php echo WP_PLUGIN_URL; ?>/all-in-one-seo-pack/images/whitehouse.jpg" alt="<?php _e('WhiteHouse theme', 'all_in_one_seo_pack') ?>" /></a>
  1321. </div>
  1322. </div>
  1323. <div style="clear:both";></div>
  1324. <!--
  1325. <p>
  1326. <?php
  1327. //$canwrite = $this->is_upgrade_directory_writable();
  1328. //$canwrite = false;
  1329. ?>
  1330. <form class="form-table" name="dofollow" action="" method="post">
  1331. <p class="submit">
  1332. <input type="submit" <?php //if (!$canwrite) echo(' disabled="disabled" ');?> name="aiosp_upgrade" value="<?php //_e('One Click Upgrade', 'all_in_one_seo_pack')?> &raquo;" />
  1333. <strong><?php //_e("(Remember: Backup early, backup often!)", 'all_in_one_seo_pack') ?></strong>
  1334. </form>
  1335. </p>
  1336. <p></p>
  1337. <?php //if (!$canwrite) {
  1338. //echo("<p><strong>"); echo(sprintf(__("Please make sure that %s is writable.", 'all_in_one_seo_pack'), $this->upgrade_folder)); echo("</p></strong>");
  1339. // } ?>
  1340. </p>
  1341. -->
  1342. <script type="text/javascript">
  1343. <!--
  1344. function toggleVisibility(id) {
  1345. var e = document.getElementById(id);
  1346. if(e.style.display == 'block')
  1347. e.style.display = 'none';
  1348. else
  1349. e.style.display = 'block';
  1350. }
  1351. //-->
  1352. </script>
  1353. <h3><?php _e('Click on option titles to get help!', 'all_in_one_seo_pack') ?></h3>
  1354. <?php
  1355. function aioseop_mrt_df(){
  1356. if(function_exists('fetch_feed')){
  1357. // start new feed
  1358. echo "Highest Donations";
  1359. // Get RSS Feed(s)
  1360. include_once(ABSPATH . WPINC . '/feed.php');
  1361. // Get a SimplePie feed object from the specified feed source.
  1362. $rss = fetch_feed('feed://donations.semperfiwebdesign.com/category/highest-donations/feed/');
  1363. // Figure out how many total items there are, but limit it to 5.
  1364. $maxitems = $rss->get_item_quantity(3);
  1365. // Build an array of all the items, starting with element 0 (first element).
  1366. $rss_items = $rss->get_items(0, $maxitems);
  1367. ?>
  1368. <ul>
  1369. <?php if ($maxitems == 0) echo '<li>No items.</li>';
  1370. else
  1371. // Loop through each feed item and display each item as a hyperlink.
  1372. foreach ( $rss_items as $item ) : ?>
  1373. <li>
  1374. <a href='<?php echo $item->get_permalink(); ?>'
  1375. title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
  1376. <?php echo $item->get_title(); ?></a>
  1377. </li>
  1378. <?php endforeach; ?>
  1379. </ul>
  1380. <?php echo "Latest Donations"; ?>
  1381. <?php // Get RSS Feed(s)
  1382. include_once(ABSPATH . WPINC . '/feed.php');
  1383. // Get a SimplePie feed object from the specified feed source.
  1384. $rss = fetch_feed('feed://donations.semperfiwebdesign.com/category/all-in-one-seo-pack/feed/');
  1385. // Figure out how many total items there are, but limit it to 5.
  1386. $maxitems = $rss->get_item_quantity(3);
  1387. // Build an array of all the items, starting with element 0 (first element).
  1388. $rss_items = $rss->get_items(0, $maxitems);
  1389. ?>
  1390. <ul>
  1391. <?php if ($maxitems == 0) echo '<li>No items.</li>';
  1392. else
  1393. // Loop through each feed item and display each item as a hyperlink.
  1394. foreach ( $rss_items as $item ) : ?>
  1395. <li>
  1396. <a href='<?php echo $item->get_permalink(); ?>'
  1397. title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
  1398. <?php echo $item->get_title(); ?></a>
  1399. </li>
  1400. <?php endforeach; ?>
  1401. </ul>
  1402. <?php // end new feed
  1403. }else{
  1404. $uri = "feed://donations.semperfiwebdesign.com/category/highest-donations/feed/";
  1405. include_once(ABSPATH . WPINC . '/rss.php');
  1406. $rss = fetch_rss($uri);
  1407. if($rss){
  1408. echo "Highest Donations";
  1409. $maxitems = 5;
  1410. if(is_array($rss->items)){
  1411. $items = array_slice($rss->items, 0, $maxitems);
  1412. ?>
  1413. <ul>
  1414. <?php if (empty($items)) echo '<li>No items</li>';
  1415. else
  1416. foreach ( $items as $item ) : ?>
  1417. <li><a href='<?php echo $item['description']; ?>'
  1418. title='<?php echo $item['title']; ?>'>
  1419. <?php echo $item['title']; ?>
  1420. </a></li>
  1421. <?php endforeach; ?>
  1422. </ul>
  1423. <?php } }else{
  1424. //do something else for feed here
  1425. }
  1426. ?>
  1427. <?php
  1428. $uri = "feed://donations.semperfiwebdesign.com/category/all-in-one-seo-pack/feed/";
  1429. include_once(ABSPATH . WPINC . '/rss.php');
  1430. $rss = fetch_rss($uri);
  1431. if($rss){
  1432. echo "Latest Donations";
  1433. $maxitems = 5;
  1434. if(is_array($rss->items)){
  1435. $items = array_slice($rss->items, 0, $maxitems);
  1436. ?>
  1437. <ul>
  1438. <?php if (empty($items)) echo '<li>No items</li>';
  1439. else
  1440. foreach ( $items as $item ) : ?>
  1441. <li><a href='<?php echo $item['link']; ?>'
  1442. title='<?php echo $item['title']; ?>'>
  1443. <?php echo $item['title']; ?>
  1444. </a></li>
  1445. <?php endforeach; ?>
  1446. </ul>
  1447. <?php } }else{
  1448. //fall back on something else for feed here
  1449. }
  1450. }
  1451. }
  1452. //aioseop_mrt_df();
  1453. ?>
  1454. <?php
  1455. global $wpdb;
  1456. $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'keywords'");
  1457. $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'title'") + $somecount;
  1458. $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'description'") + $somecount;
  1459. $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'aiosp_meta'") + $somecount;
  1460. $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'aiosp_disable'") + $somecount;
  1461. if($somecount > 0){
  1462. echo "<div class='error' style='text-align:center;'><p><strong>Your database meta needs to be updated. " . $somecount . " old fields remaining</strong> <em>(Back up your database before updating.)</em>
  1463. <FORM action='' method='post' name='aioseop-migrate'>
  1464. <input type='hidden' name='nonce-aioseop-migrate' value='" . wp_create_nonce('aioseop-migrate-nonce') . "' />
  1465. <input type='submit' name='aioseop_migrate' class='button-primary' value='Update Database'>
  1466. </FORM>
  1467. </p></div>";
  1468. }
  1469. if(!get_option('aioseop_options')){
  1470. echo "<div class='error' style='text-align:center;'><p><strong>Your database options need to be updated.</strong><em>(Back up your database before updating.)</em>
  1471. <FORM action='' method='post' name='aioseop-migrate-options'>
  1472. <input type='hidden' name='nonce-aioseop-migrate-options' value='" . wp_create_nonce('aioseop-migrate-nonce-options') . "' />
  1473. <input type='submit' name='aioseop_migrate_options' class='button-primary' value='Update Database Options'>
  1474. </FORM>
  1475. </p></div>";
  1476. }
  1477. ?>
  1478. <form name="dofollow" action="" method="post">
  1479. <table class="form-table">
  1480. <?php $aioseop_options = get_option('aioseop_options'); ?>
  1481. <?php if (!$aioseop_options['aiosp_donate']){?>
  1482. <tr>
  1483. <th scope="row" style="text-align:right; vertical-align:top;">
  1484. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_donate_tip');">
  1485. <?php _e('I enjoy this plugin and have made a donation:', 'all_in_one_seo_pack')?>
  1486. </a>
  1487. </td>
  1488. <td>
  1489. <input type="checkbox" name="aiosp_donate" <?php if ($aioseop_options['aiosp_donate']) echo "checked=\"1\""; ?>/>
  1490. <div style="max-width:500px; text-align:left; display:none" id="aiosp_donate_tip">
  1491. <?php
  1492. _e('All donations support continued development of this free software.', 'all_in_one_seo_pack');
  1493. ?>
  1494. </div>
  1495. </td>
  1496. </tr>
  1497. <?php } ?>
  1498. <tr>
  1499. <th scope="row" style="text-align:right; vertical-align:top;">
  1500. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_enabled_tip');">
  1501. <?php _e('Plugin Status:', 'all_in_one_seo_pack')?>
  1502. </a>
  1503. </td>
  1504. <td>
  1505. <input type="radio" name="aiosp_enabled" value="1" <?php if($aioseop_options['aiosp_enabled']) echo "checked"?> > Enabled<br>
  1506. <input type="radio" name="aiosp_enabled" value="0" <?php if(!$aioseop_options['aiosp_enabled']) echo "checked"?>> Disabled
  1507. <div style="max-width:500px; text-align:left; display:none" id="aiosp_enabled_tip">
  1508. <?php
  1509. _e('All in One SEO Pack must be enabled for use.', 'all_in_one_seo_pack');
  1510. ?>
  1511. </div>
  1512. </td>
  1513. </tr>
  1514. <tr>
  1515. <th scope="row" style="text-align:right; vertical-align:top;">
  1516. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_title_tip');">
  1517. <?php _e('Home Title:', 'all_in_one_seo_pack')?>
  1518. </a>
  1519. </td>
  1520. <td>
  1521. <textarea cols="57" rows="2" name="aiosp_home_title"><?php echo stripcslashes($aioseop_options['aiosp_home_title']); ?></textarea>
  1522. <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_title_tip">
  1523. <?php
  1524. _e('As the name implies, this will be the title of your homepage. This is independent of any other option. If not set, the default blog title will get used.', 'all_in_one_seo_pack');
  1525. ?>
  1526. </div>
  1527. </td>
  1528. </tr>
  1529. <tr>
  1530. <th scope="row" style="text-align:right; vertical-align:top;">
  1531. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_description_tip');">
  1532. <?php _e('Home Description:', 'all_in_one_seo_pack')?>
  1533. </a>
  1534. </td>
  1535. <td>
  1536. <textarea cols="57" rows="2" name="aiosp_home_description"><?php echo stripcslashes($aioseop_options['aiosp_home_description']); ?></textarea>
  1537. <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_description_tip">
  1538. <?php
  1539. _e('The META description for your homepage. Independent of any other options, the default is no META description at all if this is not set.', 'all_in_one_seo_pack');
  1540. ?>
  1541. </div>
  1542. </td>
  1543. </tr>
  1544. <tr>
  1545. <th scope="row" style="text-align:right; vertical-align:top;">
  1546. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_keywords_tip');">
  1547. <?php _e('Home Keywords (comma separated):', 'all_in_one_seo_pack')?>
  1548. </a>
  1549. </td>
  1550. <td>
  1551. <textarea cols="57" rows="2" name="aiosp_home_keywords"><?php echo stripcslashes($aioseop_options['aiosp_home_keywords']); ?></textarea>
  1552. <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_keywords_tip">
  1553. <?php
  1554. _e("A comma separated list of your most important keywords for your site that will be written as META keywords on your homepage. Don't stuff everything in here.", 'all_in_one_seo_pack');
  1555. ?>
  1556. </div>
  1557. </td>
  1558. </tr>
  1559. <tr>
  1560. <th scope="row" style="text-align:right; vertical-align:top;">
  1561. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_can_tip');">
  1562. <?php _e('Canonical URLs:', 'all_in_one_seo_pack')?>
  1563. </a>
  1564. </td>
  1565. <td>
  1566. <input type="checkbox" name="aiosp_can" <?php if ($aioseop_options['aiosp_can']) echo "checked=\"1\""; ?>/>
  1567. <div style="max-width:500px; text-align:left; display:none" id="aiosp_can_tip">
  1568. <?php
  1569. _e("This option will automatically generate Canonical URLS for your entire WordPress installation. This will help to prevent duplicate content penalties by <a href='http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html' target='_blank'>Google</a>.", 'all_in_one_seo_pack');
  1570. ?>
  1571. </div>
  1572. </td>
  1573. </tr>
  1574. <tr>
  1575. <th scope="row" style="text-align:right; vertical-align:top;">
  1576. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_rewrite_titles_tip');">
  1577. <?php _e('Rewrite Titles:', 'all_in_one_seo_pack')?>
  1578. </a>
  1579. </td>
  1580. <td>
  1581. <input type="checkbox" name="aiosp_rewrite_titles" <?php if ($aioseop_options['aiosp_rewrite_titles']) echo "checked=\"1\""; ?>/>
  1582. <div style="max-width:500px; text-align:left; display:none" id="aiosp_rewrite_titles_tip">
  1583. <?php
  1584. _e("Note that this is all about the title tag. This is what you see in your browser's window title bar. This is NOT visible on a page, only in the window title bar and of course in the source. If set, all page, post, category, search and archive page titles get rewritten. You can specify the format for most of them. For example: The default templates puts the title tag of posts like this: “Blog Archive >> Blog Name >> Post Title” (maybe I've overdone slightly). This is far from optimal. With the default post title format, Rewrite Title rewrites this to “Post Title | Blog Name”. If you have manually defined a title (in one of the text fields for All in One SEO Plugin input) this will become the title of your post in the format string.", 'all_in_one_seo_pack');
  1585. ?>
  1586. </div>
  1587. </td>
  1588. </tr>
  1589. <tr>
  1590. <th scope="row" style="text-align:right; vertical-align:top;">
  1591. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_post_title_format_tip');">
  1592. <?php _e('Post Title Format:', 'all_in_one_seo_pack')?>
  1593. </a>
  1594. </td>
  1595. <td>
  1596. <input size="59" name="aiosp_post_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_post_title_format']); ?>"/>
  1597. <div style="max-width:500px; text-align:left; display:none" id="aiosp_post_title_format_tip">
  1598. <?php
  1599. _e('The following macros are supported:', 'all_in_one_seo_pack');
  1600. echo('<ul>');
  1601. echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
  1602. echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
  1603. echo('<li>'); _e('%post_title% - The original title of the post', 'all_in_one_seo_pack'); echo('</li>');
  1604. echo('<li>'); _e('%category_title% - The (main) category of the post', 'all_in_one_seo_pack'); echo('</li>');
  1605. echo('<li>'); _e('%category% - Alias for %category_title%', 'all_in_one_seo_pack'); echo('</li>');
  1606. echo('<li>'); _e("%post_author_login% - This post's author' login", 'all_in_one_seo_pack'); echo('</li>');
  1607. echo('<li>'); _e("%post_author_nicename% - This post's author' nicename", 'all_in_one_seo_pack'); echo('</li>');
  1608. echo('<li>'); _e("%post_author_firstname% - This post's author' first name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
  1609. echo('<li>'); _e("%post_author_lastname% - This post's author' last name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
  1610. echo('</ul>');
  1611. ?>
  1612. </div>
  1613. </td>
  1614. </tr>
  1615. <tr>
  1616. <th scope="row" style="text-align:right; vertical-align:top;">
  1617. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_page_title_format_tip');">
  1618. <?php _e('Page Title Format:', 'all_in_one_seo_pack')?>
  1619. </a>
  1620. </td>
  1621. <td>
  1622. <input size="59" name="aiosp_page_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_page_title_format']); ?>"/>
  1623. <div style="max-width:500px; text-align:left; display:none" id="aiosp_page_title_format_tip">
  1624. <?php
  1625. _e('The following macros are supported:', 'all_in_one_seo_pack');
  1626. echo('<ul>');
  1627. echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
  1628. echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
  1629. echo('<li>'); _e('%page_title% - The original title of the page', 'all_in_one_seo_pack'); echo('</li>');
  1630. echo('<li>'); _e("%page_author_login% - This page's author' login", 'all_in_one_seo_pack'); echo('</li>');
  1631. echo('<li>'); _e("%page_author_nicename% - This page's author' nicename", 'all_in_one_seo_pack'); echo('</li>');
  1632. echo('<li>'); _e("%page_author_firstname% - This page's author' first name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
  1633. echo('<li>'); _e("%page_author_lastname% - This page's author' last name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
  1634. echo('</ul>');
  1635. ?>
  1636. </div>
  1637. </td>
  1638. </tr>
  1639. <tr>
  1640. <th scope="row" style="text-align:right; vertical-align:top;">
  1641. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_category_title_format_tip');">
  1642. <?php _e('Category Title Format:', 'all_in_one_seo_pack')?>
  1643. </a>
  1644. </td>
  1645. <td>
  1646. <input size="59" name="aiosp_category_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_category_title_format']); ?>"/>
  1647. <div style="max-width:500px; text-align:left; display:none" id="aiosp_category_title_format_tip">
  1648. <?php
  1649. _e('The following macros are supported:', 'all_in_one_seo_pack');
  1650. echo('<ul>');
  1651. echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
  1652. echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
  1653. echo('<li>'); _e('%category_title% - The original title of the category', 'all_in_one_seo_pack'); echo('</li>');
  1654. echo('<li>'); _e('%category_description% - The description of the category', 'all_in_one_seo_pack'); echo('</li>');
  1655. echo('</ul>');
  1656. ?>
  1657. </div>
  1658. </td>
  1659. </tr>
  1660. <tr>
  1661. <th scope="row" style="text-align:right; vertical-align:top;">
  1662. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_archive_title_format_tip');">
  1663. <?php _e('Archive Title Format:', 'all_in_one_seo_pack')?>
  1664. </a>
  1665. </td>
  1666. <td>
  1667. <input size="59" name="aiosp_archive_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_archive_title_format']); ?>"/>
  1668. <div style="max-width:500px; text-align:left; display:none" id="aiosp_archive_title_format_tip">
  1669. <?php
  1670. _e('The following macros are supported:', 'all_in_one_seo_pack');
  1671. echo('<ul>');
  1672. echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
  1673. echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
  1674. echo('<li>'); _e('%date% - The original archive title given by wordpress, e.g. "2007" or "2007 August"', 'all_in_one_seo_pack'); echo('</li>');
  1675. echo('</ul>');
  1676. ?>
  1677. </div>
  1678. </td>
  1679. </tr>
  1680. <tr>
  1681. <th scope="row" style="text-align:right; vertical-align:top;">
  1682. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_tag_title_format_tip');">
  1683. <?php _e('Tag Title Format:', 'all_in_one_seo_pack')?>
  1684. </a>
  1685. </td>
  1686. <td>
  1687. <input size="59" name="aiosp_tag_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_tag_title_format']); ?>"/>
  1688. <div style="max-width:500px; text-align:left; display:none" id="aiosp_tag_title_format_tip">
  1689. <?php
  1690. _e('The following macros are supported:', 'all_in_one_seo_pack');
  1691. echo('<ul>');
  1692. echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
  1693. echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
  1694. echo('<li>'); _e('%tag% - The name of the tag', 'all_in_one_seo_pack'); echo('</li>');
  1695. echo('</ul>');
  1696. ?>
  1697. </div>
  1698. </td>
  1699. </tr>
  1700. <tr>
  1701. <th scope="row" style="text-align:right; vertical-align:top;">
  1702. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_search_title_format_tip');">
  1703. <?php _e('Search Title Format:', 'all_in_one_seo_pack')?>
  1704. </a>
  1705. </td>
  1706. <td>
  1707. <input size="59" name="aiosp_search_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_search_title_format']); ?>"/>
  1708. <div style="max-width:500px; text-align:left; display:none" id="aiosp_search_title_format_tip">
  1709. <?php
  1710. _e('The following macros are supported:', 'all_in_one_seo_pack');
  1711. echo('<ul>');
  1712. echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
  1713. echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
  1714. echo('<li>'); _e('%search% - What was searched for', 'all_in_one_seo_pack'); echo('</li>');
  1715. echo('</ul>');
  1716. ?>
  1717. </div>
  1718. </td>
  1719. </tr>
  1720. <tr>
  1721. <th scope="row" style="text-align:right; vertical-align:top;">
  1722. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_description_format_tip');">
  1723. <?php _e('Description Format:', 'all_in_one_seo_pack')?>
  1724. </a>
  1725. </td>
  1726. <td>
  1727. <input size="59" name="aiosp_description_format" value="<?php echo stripcslashes($aioseop_options['aiosp_description_format']); ?>"/>
  1728. <div style="max-width:500px; text-align:left; display:none" id="aiosp_description_format_tip">
  1729. <?php
  1730. _e('The following macros are supported:', 'all_in_one_seo_pack');
  1731. echo('<ul>');
  1732. echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
  1733. echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
  1734. echo('<li>'); _e('%description% - The original description as determined by the plugin, e.g. the excerpt if one is set or an auto-generated one if that option is set', 'all_in_one_seo_pack'); echo('</li>');
  1735. echo('<li>'); _e('%wp_title% - The original wordpress title, e.g. post_title for posts', 'all_in_one_seo_pack'); echo('</li>');
  1736. echo('</ul>');
  1737. ?>
  1738. </div>
  1739. </td>
  1740. </tr>
  1741. <tr>
  1742. <th scope="row" style="text-align:right; vertical-align:top;">
  1743. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_404_title_format_tip');">
  1744. <?php _e('404 Title Format:', 'all_in_one_seo_pack')?>
  1745. </a>
  1746. </td>
  1747. <td>
  1748. <input size="59" name="aiosp_404_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_404_title_format']); ?>"/>
  1749. <div style="max-width:500px; text-align:left; display:none" id="aiosp_404_title_format_tip">
  1750. <?php
  1751. _e('The following macros are supported:', 'all_in_one_seo_pack');
  1752. echo('<ul>');
  1753. echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
  1754. echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
  1755. echo('<li>'); _e('%request_url% - The original URL path, like "/url-that-does-not-exist/"', 'all_in_one_seo_pack'); echo('</li>');
  1756. echo('<li>'); _e('%request_words% - The URL path in human readable form, like "Url That Does Not Exist"', 'all_in_one_seo_pack'); echo('</li>');
  1757. echo('<li>'); _e('%404_title% - Additional 404 title input"', 'all_in_one_seo_pack'); echo('</li>');
  1758. echo('</ul>');
  1759. ?>
  1760. </div>
  1761. </td>
  1762. </tr>
  1763. <tr>
  1764. <th scope="row" style="text-align:right; vertical-align:top;">
  1765. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_paged_format_tip');">
  1766. <?php _e('Paged Format:', 'all_in_one_seo_pack')?>
  1767. </a>
  1768. </td>
  1769. <td>
  1770. <input size="59" name="aiosp_paged_format" value="<?php echo stripcslashes($aioseop_options['aiosp_paged_format']); ?>"/>
  1771. <div style="max-width:500px; text-align:left; display:none" id="aiosp_paged_format_tip">
  1772. <?php
  1773. _e('This string gets appended/prepended to titles when they are for paged index pages (like home or archive pages).', 'all_in_one_seo_pack');
  1774. _e('The following macros are supported:', 'all_in_one_seo_pack');
  1775. echo('<ul>');
  1776. echo('<li>'); _e('%page% - The page number', 'all_in_one_seo_pack'); echo('</li>');
  1777. echo('</ul>');
  1778. ?>
  1779. </div>
  1780. </td>
  1781. </tr>
  1782. <tr>
  1783. <th scope="row" style="text-align:right; vertical-align:top;">
  1784. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_enablecpost_tip');">
  1785. <?php _e('SEO for Custom Post Types:', 'all_in_one_seo_pack')?>
  1786. </td>
  1787. <td>
  1788. <input type="checkbox" name="aiosp_enablecpost" <?php if ($aioseop_options['aiosp_enablecpost']) echo "checked=\"1\""; ?>/>
  1789. <div style="max-width:500px; text-align:left; display:none" id="aiosp_enablecpost_tip">
  1790. <?php
  1791. _e('Check this if you want your enable AIOSEOP support for Custom Post Types on this site.', 'all_in_one_seo_pack');
  1792. ?>
  1793. </div>
  1794. </td>
  1795. </tr>
  1796. <tr>
  1797. <th scope="row" style="text-align:right; vertical-align:top;">
  1798. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_use_categories_tip');">
  1799. <?php _e('Use Categories for META keywords:', 'all_in_one_seo_pack')?>
  1800. </td>
  1801. <td>
  1802. <input type="checkbox" name="aiosp_use_categories" <?php if ($aioseop_options['aiosp_use_categories']) echo "checked=\"1\""; ?>/>
  1803. <div style="max-width:500px; text-align:left; display:none" id="aiosp_use_categories_tip">
  1804. <?php
  1805. _e('Check this if you want your categories for a given post used as the META keywords for this post (in addition to any keywords and tags you specify on the post edit page).', 'all_in_one_seo_pack');
  1806. ?>
  1807. </div>
  1808. </td>
  1809. </tr>
  1810. <tr>
  1811. <th scope="row" style="text-align:right; vertical-align:top;">
  1812. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_use_tags_as_keywords_tip');">
  1813. <?php _e('Use Tags for META keywords:', 'all_in_one_seo_pack')?>
  1814. </td>
  1815. <td>
  1816. <input type="checkbox" name="aiosp_use_tags_as_keywords" <?php if ($aioseop_options['aiosp_use_tags_as_keywords']) echo "checked=\"1\""; ?>/>
  1817. <div style="max-width:500px; text-align:left; display:none" id="aiosp_use_tags_as_keywords_tip">
  1818. <?php
  1819. _e('Check this if you want your tags for a given post used as the META keywords for this post (in addition to any keywords you specify on the post edit page).', 'all_in_one_seo_pack');
  1820. ?>
  1821. </div>
  1822. </td>
  1823. </tr>
  1824. <tr>
  1825. <th scope="row" style="text-align:right; vertical-align:top;">
  1826. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_dynamic_postspage_keywords_tip');">
  1827. <?php _e('Dynamically Generate Keywords for Posts Page:', 'all_in_one_seo_pack')?>
  1828. </td>
  1829. <td>
  1830. <input type="checkbox" name="aiosp_dynamic_postspage_keywords" <?php if ($aioseop_options['aiosp_dynamic_postspage_keywords']) echo "checked=\"1\""; ?>/>
  1831. <div style="max-width:500px; text-align:left; display:none" id="aiosp_dynamic_postspage_keywords_tip">
  1832. <?php
  1833. _e('Check this if you want your keywords on a custom posts page (set it in options->reading) to be dynamically generated from the keywords of the posts showing on that page. If unchecked, it will use the keywords set in the edit page screen for the posts page.', 'all_in_one_seo_pack');
  1834. ?>
  1835. </div>
  1836. </td>
  1837. </tr>
  1838. <tr>
  1839. <th scope="row" style="text-align:right; vertical-align:top;">
  1840. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_category_noindex_tip');">
  1841. <?php _e('Use noindex for Categories:', 'all_in_one_seo_pack')?>
  1842. </a>
  1843. </td>
  1844. <td>
  1845. <input type="checkbox" name="aiosp_category_noindex" <?php if ($aioseop_options['aiosp_category_noindex']) echo "checked=\"1\""; ?>/>
  1846. <div style="max-width:500px; text-align:left; display:none" id="aiosp_category_noindex_tip">
  1847. <?php
  1848. _e('Check this for excluding category pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack');
  1849. ?>
  1850. </div>
  1851. </td>
  1852. </tr>
  1853. <tr>
  1854. <th scope="row" style="text-align:right; vertical-align:top;">
  1855. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_archive_noindex_tip');">
  1856. <?php _e('Use noindex for Archives:', 'all_in_one_seo_pack')?>
  1857. </a>
  1858. </td>
  1859. <td>
  1860. <input type="checkbox" name="aiosp_archive_noindex" <?php if ($aioseop_options['aiosp_archive_noindex']) echo "checked=\"1\""; ?>/>
  1861. <div style="max-width:500px; text-align:left; display:none" id="aiosp_archive_noindex_tip">
  1862. <?php
  1863. _e('Check this for excluding archive pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack');
  1864. ?>
  1865. </div>
  1866. </td>
  1867. </tr>
  1868. <tr>
  1869. <th scope="row" style="text-align:right; vertical-align:top;">
  1870. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_tags_noindex_tip');">
  1871. <?php _e('Use noindex for Tag Archives:', 'all_in_one_seo_pack')?>
  1872. </a>
  1873. </td>
  1874. <td>
  1875. <input type="checkbox" name="aiosp_tags_noindex" <?php if ($aioseop_options['aiosp_tags_noindex']) echo "checked=\"1\""; ?>/>
  1876. <div style="max-width:500px; text-align:left; display:none" id="aiosp_tags_noindex_tip">
  1877. <?php
  1878. _e('Check this for excluding tag pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack');
  1879. ?>
  1880. </div>
  1881. </td>
  1882. </tr>
  1883. <tr>
  1884. <th scope="row" style="text-align:right; vertical-align:top;">
  1885. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_generate_descriptions_tip');">
  1886. <?php _e('Autogenerate Descriptions:', 'all_in_one_seo_pack')?>
  1887. </a>
  1888. </td>
  1889. <td>
  1890. <input type="checkbox" name="aiosp_generate_descriptions" <?php if ($aioseop_options['aiosp_generate_descriptions']) echo "checked=\"1\""; ?>/>
  1891. <div style="max-width:500px; text-align:left; display:none" id="aiosp_generate_descriptions_tip">
  1892. <?php
  1893. _e("Check this and your META descriptions will get autogenerated if there's no excerpt.", 'all_in_one_seo_pack');
  1894. ?>
  1895. </div>
  1896. </td>
  1897. </tr>
  1898. <tr>
  1899. <th scope="row" style="text-align:right; vertical-align:top;">
  1900. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_cap_cats_tip');">
  1901. <?php _e('Capitalize Category Titles:', 'all_in_one_seo_pack')?>
  1902. </a>
  1903. </td>
  1904. <td>
  1905. <input type="checkbox" name="aiosp_cap_cats" <?php if ($aioseop_options['aiosp_cap_cats']) echo "checked=\"1\""; ?>/>
  1906. <div style="max-width:500px; text-align:left; display:none" id="aiosp_cap_cats_tip">
  1907. <?php
  1908. _e("Check this and Category Titles will have the first letter of each word capitalized.", 'all_in_one_seo_pack');
  1909. ?>
  1910. </div>
  1911. </td>
  1912. </tr>
  1913. <!-- new crap start -->
  1914. <tr>
  1915. <th scope="row" style="text-align:right; vertical-align:top;">
  1916. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_ex_pages_tip');">
  1917. <?php _e('Exclude Pages:', 'all_in_one_seo_pack')?>
  1918. </a>
  1919. </td>
  1920. <td>
  1921. <textarea cols="57" rows="2" name="aiosp_ex_pages"><?php echo stripcslashes($aioseop_options['aiosp_ex_pages']); ?></textarea>
  1922. <div style="max-width:500px; text-align:left; display:none" id="aiosp_ex_pages_tip">
  1923. <?php
  1924. _e("Enter any comma separated pages here to be excluded by All in One SEO Pack. This is helpful when using plugins which generate their own non-WordPress dynamic pages. Ex: <em>/forum/,/contact/</em> For instance, if you want to exclude the virtual pages generated by a forum plugin, all you have to do is give forum or /forum or /forum/ or and any URL with the word \"forum\" in it, such as http://mysite.com/forum or http://mysite.com/forum/someforumpage will be excluded from All in One SEO Pack.", 'all_in_one_seo_pack');
  1925. ?>
  1926. </div>
  1927. </td>
  1928. </tr>
  1929. <!-- new crap end -->
  1930. <tr>
  1931. <th scope="row" style="text-align:right; vertical-align:top;">
  1932. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_post_meta_tags_tip');">
  1933. <?php _e('Additional Post Headers:', 'all_in_one_seo_pack')?>
  1934. </a>
  1935. </td>
  1936. <td>
  1937. <textarea cols="57" rows="2" name="aiosp_post_meta_tags"><?php echo stripcslashes($aioseop_options['aiosp_post_meta_tags']); ?></textarea>
  1938. <div style="max-width:500px; text-align:left; display:none" id="aiosp_post_meta_tags_tip">
  1939. <?php
  1940. _e('What you enter here will be copied verbatim to your header on post pages. You can enter whatever additional headers you want here, even references to stylesheets.', 'all_in_one_seo_pack');
  1941. ?>
  1942. </div>
  1943. </td>
  1944. </tr>
  1945. <tr>
  1946. <th scope="row" style="text-align:right; vertical-align:top;">
  1947. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_page_meta_tags_tip');">
  1948. <?php _e('Additional Page Headers:', 'all_in_one_seo_pack')?>
  1949. </a>
  1950. </td>
  1951. <td>
  1952. <textarea cols="57" rows="2" name="aiosp_page_meta_tags"><?php echo stripcslashes($aioseop_options['aiosp_page_meta_tags']); ?></textarea>
  1953. <div style="max-width:500px; text-align:left; display:none" id="aiosp_page_meta_tags_tip">
  1954. <?php
  1955. _e('What you enter here will be copied verbatim to your header on pages. You can enter whatever additional headers you want here, even references to stylesheets.', 'all_in_one_seo_pack');
  1956. ?>
  1957. </div>
  1958. </td>
  1959. </tr>
  1960. <tr>
  1961. <th scope="row" style="text-align:right; vertical-align:top;">
  1962. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_meta_tags_tip');">
  1963. <?php _e('Additional Home Headers:', 'all_in_one_seo_pack')?>
  1964. </a>
  1965. </td>
  1966. <td>
  1967. <textarea cols="57" rows="2" name="aiosp_home_meta_tags"><?php echo stripcslashes($aioseop_options['aiosp_home_meta_tags']); ?></textarea>
  1968. <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_meta_tags_tip">
  1969. <?php
  1970. _e('What you enter here will be copied verbatim to your header on the home page. You can enter whatever additional headers you want here, even references to stylesheets.', 'all_in_one_seo_pack');
  1971. ?>
  1972. </div>
  1973. </td>
  1974. </tr>
  1975. <tr>
  1976. <th scope="row" style="text-align:right; vertical-align:top;">
  1977. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'auto_social')?>" onclick="toggleVisibility('aiosp_do_log_tip');">
  1978. <?php _e('Log important events:', 'all_in_one_seo_pack')?>
  1979. </a>
  1980. </td>
  1981. <td>
  1982. <input type="checkbox" name="aiosp_do_log" <?php if ($aioseop_options['aiosp_do_log']) echo "checked=\"1\""; ?>/>
  1983. <div style="max-width:500px; text-align:left; display:none" id="aiosp_do_log_tip">
  1984. <?php
  1985. _e('Check this and SEO pack will create a log of important events (all_in_one_seo_pack.log) in its plugin directory which might help debugging it. Make sure this directory is writable.', 'all_in_one_seo_pack');
  1986. ?>
  1987. </div>
  1988. </td>
  1989. </tr>
  1990. <?php if ($aioseop_options['aiosp_donate']){?>
  1991. <tr>
  1992. <th scope="row" style="text-align:right; vertical-align:top;">
  1993. <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_donate_tip');">
  1994. <?php _e('Thank you for your donation:', 'all_in_one_seo_pack')?>
  1995. </a>
  1996. </td>
  1997. <td>
  1998. <input type="checkbox" name="aiosp_donate" <?php if ($aioseop_options['aiosp_donate']) echo "checked=\"1\""; ?>/>
  1999. <div style="max-width:500px; text-align:left; display:none" id="aiosp_donate_tip">
  2000. <?php
  2001. _e('All donations support continued development of this free software.', 'all_in_one_seo_pack');
  2002. ?>
  2003. </div>
  2004. </td>
  2005. </tr>
  2006. <?php } ?>
  2007. </table>
  2008. <p class="submit">
  2009. <?php if($aioseop_options) { ?>
  2010. <input type="hidden" name="action" value="aiosp_update" />
  2011. <input type="hidden" name="nonce-aioseop" value="<?php echo wp_create_nonce('aioseop-nonce'); ?>" />
  2012. <input type="hidden" name="page_options" value="aiosp_home_description" />
  2013. <input type="submit" class='button-primary' name="Submit" value="<?php _e('Update Options', 'all_in_one_seo_pack')?> &raquo;" />
  2014. <input type="submit" class='button-primary' name="Submit_Default" value="<?php _e('Reset Settings to Defaults', 'all_in_one_seo_pack')?> &raquo;" />
  2015. </p>
  2016. <?php } ?>
  2017. <p><br />
  2018. <strong>Check out these other great plugins!</strong><br />
  2019. <a href="http://semperfiwebdesign.com/custom-applications/sms-text-message/" title="SMS Text Message WordPress plugin">SMS Text Message</a> - sends SMS updates to your readers<br />
  2020. <a href="http://semperfiwebdesign.com/custom-applications/wp-security-scan/" title="WordPress Security">WordPress Security Scan</a> - provides vital security for your WordPress site
  2021. </p>
  2022. </form>
  2023. </div>
  2024. <?php
  2025. } // options_panel
  2026. }
  2027. ?>