diff -r 2f6f6f7551ca -r 32102edaa81b web/wp-content/plugins/all-in-one-seo-pack/aioseop_functions.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/wp-content/plugins/all-in-one-seo-pack/aioseop_functions.php Mon Nov 19 18:26:13 2012 +0100 @@ -0,0 +1,416 @@ +getFileName(); + } + $aioseop_class_error .= ", preventing All in One SEO Pack from loading."; + echo "
$aioseop_class_error
"; + } +} + +if (!function_exists('aioseop_mrt_fix_meta')) { + function aioseop_mrt_fix_meta(){ + global $wpdb, $aiosp_activation; + $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '_aioseop_keywords' WHERE meta_key = 'keywords'"); + $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '_aioseop_title' WHERE meta_key = 'title'"); + $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '_aioseop_description' WHERE meta_key = 'description'"); + $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '_aioseop_meta' WHERE meta_key = 'aiosp_meta'"); + $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '_aioseop_disable' WHERE meta_key = 'aiosp_disable'"); + if ( !$aiosp_activation ) // don't echo on initial plugin activation + echo "

" . __( "Updating SEO post meta in database.", 'all_in_one_seo_pack' ) . "

"; + } +} + +if (!function_exists('aioseop_mrt_mkarry')) { + function aioseop_mrt_mkarry() { + global $aiosp; + $naioseop_options = array( + "aiosp_can"=>1, + "aiosp_donate"=>0, + "aiosp_home_title"=>null, + "aiosp_home_description"=>'', + "aiosp_home_keywords"=>null, + "aiosp_max_words_excerpt"=>'something', + "aiosp_rewrite_titles"=>1, + "aiosp_post_title_format"=>'%post_title% | %blog_title%', + "aiosp_page_title_format"=>'%page_title% | %blog_title%', + "aiosp_category_title_format"=>'%category_title% | %blog_title%', + "aiosp_archive_title_format"=>'%date% | %blog_title%', + "aiosp_tag_title_format"=>'%tag% | %blog_title%', + "aiosp_search_title_format"=>'%search% | %blog_title%', + "aiosp_description_format"=>'%description%', + "aiosp_404_title_format"=>'Nothing found for %request_words%', + "aiosp_paged_format"=>' - Part %page%', + "aiosp_google_analytics_id"=>null, + "aiosp_ga_track_outbound_links"=>0, + "aiosp_use_categories"=>0, + "aiosp_dynamic_postspage_keywords"=>1, + "aiosp_category_noindex"=>0, + "aiosp_archive_noindex"=>0, + "aiosp_tags_noindex"=>0, + "aiosp_cap_cats"=>1, + "aiosp_generate_descriptions"=>0, + "aiosp_debug_info"=>null, + "aiosp_post_meta_tags"=>'', + "aiosp_page_meta_tags"=>'', + "aiosp_home_meta_tags"=>'', + "aiosp_enabled" =>0, + "aiosp_enablecpost" => 0, + "aiosp_use_tags_as_keywords" =>1, + "aiosp_seopostcol" =>1, + "aiosp_seocustptcol" => 0, + "aiosp_posttypecolumns" => array('post','page'), + "aiosp_do_log"=>null); + + if(get_option('aiosp_post_title_format')){ + foreach( $naioseop_options as $aioseop_opt_name => $value ) { + if( $aioseop_oldval = get_option($aioseop_opt_name) ) { + $naioseop_options[$aioseop_opt_name] = $aioseop_oldval; + } + if( $aioseop_oldval == '') { + $naioseop_options[$aioseop_opt_name] = ''; + } + delete_option($aioseop_opt_name); + } + } + + add_option('aioseop_options',$naioseop_options); + } +} + +if (!function_exists('aioseop_activation_notice')) { + function aioseop_activation_notice() { + global $aioseop_options; + echo '

' . __('All in One SEO Pack must be configured.', 'all_in_one_seo_pack' ) + . ' ' . sprintf( __('Go to %s to enable and configure the plugin.', 'all_in_one_seo_pack' ), '' + . __('the admin page', 'all_in_one_seo_pack') . '' ) . '
' + . __( 'All in One SEO Pack now supports Custom Post Types and Google Analytics.', 'all_in_one_seo_pack' ) . '

'; + } +} + +if (!function_exists('aioseop_activate_pl')) { + function aioseop_activate_pl(){ + if(get_option('aioseop_options')){ + $aioseop_options = get_option('aioseop_options'); + $aioseop_options['aiosp_enabled'] = "0"; + + if(!$aioseop_options['aiosp_posttypecolumns']){ + $aioseop_options['aiosp_posttypecolumns'] = array('post','page'); + } + + update_option('aioseop_options',$aioseop_options); + } + } +} + +if (!function_exists('aioseop_get_version')) { + function aioseop_get_version(){ + return AIOSEOP_VERSION; + } +} + +if (!function_exists('aioseop_add_plugin_row')) { + function aioseop_add_plugin_row($links, $file) { + echo ''; + echo wp_remote_fopen('http://aioseoppro.semperfiwebdesign.com/'); + echo ''; + } +} + +if (!function_exists('aioseop_option_isset')) { + function aioseop_option_isset( $option ) { + global $aioseop_options; + return ( ( isset( $aioseop_options[$option] ) ) && $aioseop_options[$option] ); + } +} + +if (!function_exists('aioseop_addmycolumns')) { + function aioseop_addmycolumns(){ + $aioseop_options = get_option('aioseop_options'); + $aiosp_posttypecolumns = $aioseop_options['aiosp_posttypecolumns']; + + if ( !isset($_GET['post_type']) ) + $post_type = 'post'; + else $post_type = $_GET['post_type']; + add_action( 'admin_head', 'aioseop_admin_head'); + + if(is_array($aiosp_posttypecolumns) && in_array($post_type,$aiosp_posttypecolumns)) { + if($post_type == 'page'){ + add_action('manage_pages_custom_column', 'aioseop_mrt_pccolumn', 10, 2); + add_filter('manage_pages_columns', 'aioseop_mrt_pcolumns'); + } else { + add_action('manage_posts_custom_column', 'aioseop_mrt_pccolumn', 10, 2); + add_filter('manage_posts_columns', 'aioseop_mrt_pcolumns'); + } + } + } +} + +if (!function_exists('aioseop_mrt_pcolumns')) { + function aioseop_mrt_pcolumns($aioseopc) { + global $aioseop_options; + $aioseopc['seotitle'] = __('SEO Title'); + $aioseopc['seokeywords'] = __('SEO Keywords'); + $aioseopc['seodesc'] = __('SEO Description'); + return $aioseopc; + } +} + +if (!function_exists('aioseop_admin_head')) { + function aioseop_admin_head() { +// echo ''; + ?> + + No ' . $target . '' ; endif; + $output = $result . ''; + $output .= ''; + die( "jQuery('div#aioseop_" . $target . "_" . $post_id . "').fadeOut('fast', function() { + jQuery('div#aioseop_" . $target . "_" . $post_id . "').html('" . addslashes_gpc($output) . "').fadeIn('fast'); + });" ); + } +} + +if (!function_exists('aioseop_mrt_pccolumn')) { + function aioseop_mrt_pccolumn($aioseopcn, $aioseoppi) { + if( $aioseopcn == 'seotitle' ) { + echo htmlspecialchars(stripcslashes(get_post_meta($aioseoppi,'_aioseop_title',TRUE))); + } + if( $aioseopcn == 'seokeywords' ) { + echo htmlspecialchars(stripcslashes(get_post_meta($aioseoppi,'_aioseop_keywords',TRUE))); + } + if( $aioseopcn == 'seodesc' ) { + echo htmlspecialchars(stripcslashes(get_post_meta($aioseoppi,'_aioseop_description',TRUE))); + } + } +} + +if ( !function_exists( 'aioseop_unprotect_meta' ) ) { + function aioseop_unprotect_meta( $protected, $meta_key, $meta_type ) { + if ( isset( $meta_key ) && ( substr( $meta_key, 0, 9 ) === '_aioseop_' ) ) return false; + return $protected; + } +} + +if (!function_exists('aioseop_get_pages_start')) { + function aioseop_get_pages_start($excludes) { + global $aioseop_get_pages_start; + $aioseop_get_pages_start = 1; + return $excludes; + } +} + +if (!function_exists('aioseop_get_pages')) { + function aioseop_get_pages($pages) { + global $aioseop_get_pages_start; + if (!$aioseop_get_pages_start) return $pages; + foreach ($pages as $k => $v) { + $postID = $v->ID; + $menulabel = stripslashes(get_post_meta($postID, '_aioseop_menulabel', true)); + if ($menulabel) $pages[$k]->post_title = $menulabel; + } + $aioseop_get_pages_start = 0; + return $pages; + } +} + +// The following two functions are GPLed from Sarah G's Page Menu Editor, http://wordpress.org/extend/plugins/page-menu-editor/. +if (!function_exists('aioseop_list_pages')) { + function aioseop_list_pages( $content ) { + global $wp_version; + $matches = array(); + if ( preg_match_all( '/
  • @is'; + } else { + $pattern = '@
  • @is'; + } + return preg_replace_callback( $pattern, "aioseop_filter_callback", $content ); + } + return $content; + } +} + +if (!function_exists('aioseop_filter_callback')) { + function aioseop_filter_callback( $matches ) { + global $wpdb; + if ( $matches[1] && !empty( $matches[1] ) ) $postID = $matches[1]; + if ( empty( $postID ) ) $postID = get_option( "page_on_front" ); + $title_attrib = stripslashes( get_post_meta($postID, '_aioseop_titleatr', true ) ); + if ( empty( $title_attrib ) && !empty( $matches[4] ) ) $title_attrib = $matches[4]; + if ( !empty( $title_attrib ) ) $title_attrib = ' title="' . strip_tags( $title_attrib ) . '"'; + return '
  • '; + } +} + +if ( !function_exists('aioseop_add_contactmethods' ) ) { + function aioseop_add_contactmethods( $contactmethods ) { + $contactmethods['googleplus'] = 'Google+'; + return $contactmethods; + } +} + +if (!function_exists('aioseop_meta_box_add')) { + function aioseop_meta_box_add() { + $mrt_aioseop_pts=get_post_types('','names'); + $aioseop_options = get_option('aioseop_options'); + $aioseop_mrt_cpt = $aioseop_options['aiosp_enablecpost']; + foreach ($mrt_aioseop_pts as $mrt_aioseop_pt) { + if($mrt_aioseop_pt == 'post' || $mrt_aioseop_pt == 'page' || $aioseop_mrt_cpt){ + add_meta_box('aiosp',__('All in One SEO Pack', 'all_in_one_seo_pack'),'aiosp_meta',$mrt_aioseop_pt); + } + } + } +} + +if (!function_exists('aiosp_meta')) { + function aiosp_meta() { + global $post; + $post_id = $post; + if (is_object($post_id)) $post_id = $post_id->ID; + $keywords = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_keywords', true))); + $title = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_title', true))); + $description = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_description', true))); + $aiosp_meta = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aiosp_meta', true))); + $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_disable', true))); + $aiosp_titleatr = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_titleatr', true))); + $aiosp_menulabel = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_menulabel', true))); + ?> + + + + + + + + + + + + + + + + + + + + + + + + + post_type=='page'){ ?> + + + + + + + + + + + + + + +
    +

    + + +

    + + +
    + + + /> +
    +