Changeset 983255
- Timestamp:
- 09/06/2014 08:24:58 PM (12 years ago)
- Location:
- tessa-authorship
- Files:
-
- 132 added
- 5 edited
-
tags/0.7.5 (added)
-
tags/0.7.5/assets (added)
-
tags/0.7.5/assets/css (added)
-
tags/0.7.5/assets/css/admin.css (added)
-
tags/0.7.5/assets/css/social_font.css (added)
-
tags/0.7.5/assets/css/social_icons.css (added)
-
tags/0.7.5/assets/images (added)
-
tags/0.7.5/assets/images/authorship-icon.png (added)
-
tags/0.7.5/assets/images/authorship-icon@x2.png (added)
-
tags/0.7.5/assets/images/loading.gif (added)
-
tags/0.7.5/assets/images/social (added)
-
tags/0.7.5/assets/images/social/aim.png (added)
-
tags/0.7.5/assets/images/social/blogger.png (added)
-
tags/0.7.5/assets/images/social/digg.png (added)
-
tags/0.7.5/assets/images/social/email.png (added)
-
tags/0.7.5/assets/images/social/facebook.png (added)
-
tags/0.7.5/assets/images/social/googleplus.png (added)
-
tags/0.7.5/assets/images/social/icompositions.png (added)
-
tags/0.7.5/assets/images/social/icq.png (added)
-
tags/0.7.5/assets/images/social/linkedin.png (added)
-
tags/0.7.5/assets/images/social/msn.png (added)
-
tags/0.7.5/assets/images/social/myspace.png (added)
-
tags/0.7.5/assets/images/social/pinterest.png (added)
-
tags/0.7.5/assets/images/social/reverbnation.png (added)
-
tags/0.7.5/assets/images/social/skype.png (added)
-
tags/0.7.5/assets/images/social/slashdot.png (added)
-
tags/0.7.5/assets/images/social/soundcloud.png (added)
-
tags/0.7.5/assets/images/social/technorati.png (added)
-
tags/0.7.5/assets/images/social/twitter.png (added)
-
tags/0.7.5/assets/images/social/vimeo.png (added)
-
tags/0.7.5/assets/images/social/website.png (added)
-
tags/0.7.5/assets/images/social/wordpress.png (added)
-
tags/0.7.5/assets/images/social/yahoo.png (added)
-
tags/0.7.5/assets/images/social/yahoo_im.png (added)
-
tags/0.7.5/assets/images/social/youtube.png (added)
-
tags/0.7.5/assets/js (added)
-
tags/0.7.5/assets/js/media-modal.js (added)
-
tags/0.7.5/assets/js/multi-post-thumbnails-admin.js (added)
-
tags/0.7.5/assets/js/saprsat.js (added)
-
tags/0.7.5/assets/js/tasrpas.js (added)
-
tags/0.7.5/assets/js/tasrpas_email.js (added)
-
tags/0.7.5/classes (added)
-
tags/0.7.5/classes/multi-post-thumbnails.php (added)
-
tags/0.7.5/classes/multi-post-thumbnails.readme.txt (added)
-
tags/0.7.5/classes/tessa-authorship-tasrpas.php (added)
-
tags/0.7.5/classes/tessa-authorship-taxonomy.php (added)
-
tags/0.7.5/classes/tessa-authorship-widget.php (added)
-
tags/0.7.5/classes/tessa-authorship.php (added)
-
tags/0.7.5/lang (added)
-
tags/0.7.5/lang/multiple-post-thumbnails-de_DE.mo (added)
-
tags/0.7.5/lang/multiple-post-thumbnails-de_DE.po (added)
-
tags/0.7.5/lang/multiple-post-thumbnails-xx_XX.pot (added)
-
tags/0.7.5/lang/tessa-authorship-de_DE.mo (added)
-
tags/0.7.5/lang/tessa-authorship-de_DE.po (added)
-
tags/0.7.5/lang/tessa-authorship-en_US.mo (added)
-
tags/0.7.5/lang/tessa-authorship-en_US.po (added)
-
tags/0.7.5/lang/tessa-authorship-es_ES.mo (added)
-
tags/0.7.5/lang/tessa-authorship-es_ES.po (added)
-
tags/0.7.5/lang/tessa-authorship-xx_XX.pot (added)
-
tags/0.7.5/lang/tessa-authorshipes-es_ES.mo (added)
-
tags/0.7.5/lang/tessa-authorshipes-es_ES.po (added)
-
tags/0.7.5/readme.txt (added)
-
tags/0.7.5/recaptchalib.php (added)
-
tags/0.7.5/tessa-authorship-template.php (added)
-
tags/0.7.5/tessa-authorship.php (added)
-
tags/0.7.5/wpml-config.xml (added)
-
tags/0.7.6 (added)
-
tags/0.7.6/assets (added)
-
tags/0.7.6/assets/css (added)
-
tags/0.7.6/assets/css/admin.css (added)
-
tags/0.7.6/assets/css/social_font.css (added)
-
tags/0.7.6/assets/css/social_icons.css (added)
-
tags/0.7.6/assets/images (added)
-
tags/0.7.6/assets/images/authorship-icon.png (added)
-
tags/0.7.6/assets/images/authorship-icon@x2.png (added)
-
tags/0.7.6/assets/images/loading.gif (added)
-
tags/0.7.6/assets/images/social (added)
-
tags/0.7.6/assets/images/social/aim.png (added)
-
tags/0.7.6/assets/images/social/blogger.png (added)
-
tags/0.7.6/assets/images/social/digg.png (added)
-
tags/0.7.6/assets/images/social/email.png (added)
-
tags/0.7.6/assets/images/social/facebook.png (added)
-
tags/0.7.6/assets/images/social/googleplus.png (added)
-
tags/0.7.6/assets/images/social/icompositions.png (added)
-
tags/0.7.6/assets/images/social/icq.png (added)
-
tags/0.7.6/assets/images/social/linkedin.png (added)
-
tags/0.7.6/assets/images/social/msn.png (added)
-
tags/0.7.6/assets/images/social/myspace.png (added)
-
tags/0.7.6/assets/images/social/pinterest.png (added)
-
tags/0.7.6/assets/images/social/reverbnation.png (added)
-
tags/0.7.6/assets/images/social/skype.png (added)
-
tags/0.7.6/assets/images/social/slashdot.png (added)
-
tags/0.7.6/assets/images/social/soundcloud.png (added)
-
tags/0.7.6/assets/images/social/technorati.png (added)
-
tags/0.7.6/assets/images/social/twitter.png (added)
-
tags/0.7.6/assets/images/social/vimeo.png (added)
-
tags/0.7.6/assets/images/social/website.png (added)
-
tags/0.7.6/assets/images/social/wordpress.png (added)
-
tags/0.7.6/assets/images/social/yahoo.png (added)
-
tags/0.7.6/assets/images/social/yahoo_im.png (added)
-
tags/0.7.6/assets/images/social/youtube.png (added)
-
tags/0.7.6/assets/js (added)
-
tags/0.7.6/assets/js/media-modal.js (added)
-
tags/0.7.6/assets/js/multi-post-thumbnails-admin.js (added)
-
tags/0.7.6/assets/js/saprsat.js (added)
-
tags/0.7.6/assets/js/tasrpas.js (added)
-
tags/0.7.6/assets/js/tasrpas_email.js (added)
-
tags/0.7.6/classes (added)
-
tags/0.7.6/classes/multi-post-thumbnails.php (added)
-
tags/0.7.6/classes/multi-post-thumbnails.readme.txt (added)
-
tags/0.7.6/classes/tessa-authorship-tasrpas.php (added)
-
tags/0.7.6/classes/tessa-authorship-taxonomy.php (added)
-
tags/0.7.6/classes/tessa-authorship-widget.php (added)
-
tags/0.7.6/classes/tessa-authorship.php (added)
-
tags/0.7.6/lang (added)
-
tags/0.7.6/lang/multiple-post-thumbnails-de_DE.mo (added)
-
tags/0.7.6/lang/multiple-post-thumbnails-de_DE.po (added)
-
tags/0.7.6/lang/multiple-post-thumbnails-xx_XX.pot (added)
-
tags/0.7.6/lang/tessa-authorship-de_DE.mo (added)
-
tags/0.7.6/lang/tessa-authorship-de_DE.po (added)
-
tags/0.7.6/lang/tessa-authorship-en_US.mo (added)
-
tags/0.7.6/lang/tessa-authorship-en_US.po (added)
-
tags/0.7.6/lang/tessa-authorship-es_ES.mo (added)
-
tags/0.7.6/lang/tessa-authorship-es_ES.po (added)
-
tags/0.7.6/lang/tessa-authorship-xx_XX.pot (added)
-
tags/0.7.6/lang/tessa-authorshipes-es_ES.mo (added)
-
tags/0.7.6/lang/tessa-authorshipes-es_ES.po (added)
-
tags/0.7.6/readme.txt (added)
-
tags/0.7.6/recaptchalib.php (added)
-
tags/0.7.6/tessa-authorship-template.php (added)
-
tags/0.7.6/tessa-authorship.php (added)
-
tags/0.7.6/wpml-config.xml (added)
-
trunk/assets/css/admin.css (modified) (2 diffs)
-
trunk/classes/tessa-authorship-tasrpas.php (modified) (15 diffs)
-
trunk/classes/tessa-authorship.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/tessa-authorship.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tessa-authorship/trunk/assets/css/admin.css
r812655 r983255 1 /* 1 2 #menu-posts-authorship .wp-menu-image { 2 3 background: none; … … 22 23 } 23 24 } 25 */ 26 #menu-posts-authorship div.wp-menu-image:before { 27 /*font-family: WooCommerce !important;*/ 28 content: "\f488" !important; 29 font-size: 1.3em !important; 30 } -
tessa-authorship/trunk/classes/tessa-authorship-tasrpas.php
r903699 r983255 783 783 return trim( $t, "\"'\n\r " ); 784 784 } 785 785 786 /** 786 787 * Ajax callback function to find authors. … … 788 789 * @access public 789 790 * @since 0.1.0 791 * @changed 0.7.7 790 792 * @return Object 791 793 * @modified 0.4.0 WPML Support … … 793 795 public function tasrpas_ajax_find_authors() 794 796 { 795 global $tessa_authorship, $tasrpas_options, $wpdb ;797 global $tessa_authorship, $tasrpas_options, $wpdb, $sitepress; 796 798 check_ajax_referer( 'find-authors' ); 797 799 … … 811 813 $searchand = $search = ''; 812 814 foreach ( (array)$search_terms as $term ) { 813 $term = esc_sql( like_escape( $term ) );815 $term = esc_sql( $this->tasrpas_like_escape( $term ) );//like_escape( $term ) ); 814 816 $search .= "{$searchand}(($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%'))"; 815 817 $searchand = ' AND '; 816 818 } 817 $term = esc_sql( like_escape( $s ) );819 $term = esc_sql( $this->tasrpas_like_escape( $s ) ); //like_escape( $s ) ); 818 820 if ( count($search_terms) > 1 && $search_terms[0] != $s ) { 819 821 $search .= " OR ($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%')"; … … 823 825 //get the lang code for the post as we are currently in default language 824 826 $post_lang = $this->tasrpas_get_language_for_element($_POST['pid'], 'post_' . $_POST['ppt']); 827 //$def_lang = $sitepress->get_default_language(); 825 828 if ( isset($post_lang) && $post_lang ) : 826 829 $lang_code = $post_lang; … … 828 831 $db_icltable = $wpdb->base_prefix . 'icl_translations'; 829 832 $query_str = " 830 SELECT $wpdb->posts.ID, $wpdb->posts.post_title, $wpdb->posts.post_status, $wpdb->posts.post_date, $wpdb->posts.post_type, {$db_icltable}.language_code831 FROM $wpdb->posts, $db_icltable832 WHERE $wpdb->posts.post_type = 'authorship' AND $wpdb->posts.post_status != 'revision' AND $wpdb->posts.ID = {$db_icltable}.element_id AND {$db_icltable}.language_code = '$lang_code'AND ($search)833 SELECT DISTINCT $wpdb->posts.ID, $wpdb->posts.post_title, $wpdb->posts.post_status, $wpdb->posts.post_date, $wpdb->posts.post_type, b.language_code 834 FROM $wpdb->posts, (SELECT DISTINCT $db_icltable.element_id AS id, $db_icltable.language_code FROM $db_icltable WHERE $db_icltable.language_code = '$lang_code' AND $db_icltable.element_type = 'post_authorship') AS b 835 WHERE $wpdb->posts.post_type = 'authorship' AND $wpdb->posts.post_status != 'revision' AND $wpdb->posts.ID = b.id AND ($search) 833 836 ORDER BY $wpdb->posts.post_date_gmt DESC LIMIT 50 834 837 "; 835 838 else : 836 839 $query_str = " 837 SELECT $wpdb->posts.ID, $wpdb->posts.post_title, $wpdb->posts.post_status, $wpdb->posts.post_date, $wpdb->posts.post_type840 SELECT DISTINCT $wpdb->posts.ID, $wpdb->posts.post_title, $wpdb->posts.post_status, $wpdb->posts.post_date, $wpdb->posts.post_type 838 841 FROM $wpdb->posts 839 842 WHERE $wpdb->posts.post_type = 'authorship' AND $wpdb->posts.post_status != 'revision' AND ($search) … … 842 845 endif; 843 846 $posts = $wpdb->get_results( $query_str ); 844 845 847 //try to get results if wpml is not enabled on our post-type 846 848 if ( !$posts && $wpml ) : 847 849 $wpml = false; 848 850 $query_str = " 849 SELECT $wpdb->posts.ID, $wpdb->posts.post_title, $wpdb->posts.post_status, $wpdb->posts.post_date, $wpdb->posts.post_type851 SELECT DISTINCT $wpdb->posts.ID, $wpdb->posts.post_title, $wpdb->posts.post_status, $wpdb->posts.post_date, $wpdb->posts.post_type 850 852 FROM $wpdb->posts 851 853 WHERE $wpdb->posts.post_type = 'authorship' AND $wpdb->posts.post_status != 'revision' AND ($search) … … 897 899 */ 898 900 $html .= '<tr class="authors-found"><td class="found-radio"><input type="checkbox" id="found-author-'.$post->ID.'" name="found_author_id[]" value="' . esc_attr($post->ID) . '"></td>'; 899 $html .= '<td><label for="found-'.$post->ID.'">'. esc_html( $post->post_title ).'</label></td><td>'.esc_html( $lang_code ).'</td><td>'.esc_html( $time ).'</td><td>'.esc_html( $stat ).'</td></tr>'."\n\n";901 $html .= '<td><label for="found-'.$post->ID.'">'. $post->ID . ': ' .esc_html( $post->post_title ).'</label></td><td>'.esc_html( $lang_code ).'</td><td>'.esc_html( $time ).'</td><td>'.esc_html( $stat ).'</td></tr>'."\n\n"; 900 902 else : 901 903 $html .= '<tr class="authors-found"><td class="found-radio"><input type="checkbox" id="found-author-'.$post->ID.'" name="found_author_id[]" value="' . esc_attr($post->ID) . '"></td>'; … … 905 907 } 906 908 $html .= '</tbody></table>'; 907 908 909 $x = new WP_Ajax_Response(); 909 910 $x->add( array( … … 920 921 * @access public 921 922 * @since 0.4.0 923 * @changed 0.7.7 922 924 * @return Object 923 925 */ … … 944 946 $in_array = array_intersect( $pt, $tasrpas_options['post_types'] ); 945 947 if ( !empty($_POST['post_type'] ) && !empty( $in_array ) ) : 946 $what = "'" . implode( "','", $in_array ) . "'"; 948 //make compatible with php < 5.3 949 $what = implode( ",", array_map( create_function( '$at', 'return "\'" . $at . "\'";'), $in_array ) ); 947 950 else : 948 951 $what = 'post'; … … 954 957 $searchand = $search = ''; 955 958 foreach ( (array)$search_terms as $term ) { 956 $term = esc_sql( like_escape( $term ) );959 $term = esc_sql( $this->tasrpas_like_escape( $term ) );//like_escape( $term ) ); 957 960 $search .= "{$searchand}(($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%'))"; 958 961 $searchand = ' AND '; 959 962 } 960 $term = esc_sql( like_escape( $s ) );963 $term = esc_sql( $this->tasrpas_like_escape( $s ) );//like_escape( $s ) ); 961 964 if ( count($search_terms) > 1 && $search_terms[0] != $s ) { 962 965 $search .= " OR ($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%')"; … … 971 974 972 975 $db_icltable = $wpdb->base_prefix . 'icl_translations'; 976 $pt_icl = explode( ",", $what ); 977 //make compatible with php < 5.3 978 $what_icl = implode( ",", array_map( create_function( '$at', 'return "\'post_" . str_replace( "\'", "", $at ) . "\'";'), $pt_icl ) ); 979 973 980 $query_str = " 974 SELECT $wpdb->posts.ID, $wpdb->posts.post_title, $wpdb->posts.post_status, $wpdb->posts.post_date, $wpdb->posts.post_type, {$db_icltable}.language_code975 FROM $wpdb->posts, $db_icltable976 WHERE $wpdb->posts.post_type IN ($what) AND $wpdb->posts.post_status != 'revision' AND $wpdb->posts.ID = {$db_icltable}.element_id AND {$db_icltable}.language_code = '$lang_code'AND ($search)981 SELECT DISTINCT $wpdb->posts.ID, $wpdb->posts.post_title, $wpdb->posts.post_status, $wpdb->posts.post_date, $wpdb->posts.post_type, b.language_code 982 FROM $wpdb->posts, (SELECT DISTINCT $db_icltable.element_id AS id, $db_icltable.language_code FROM $db_icltable WHERE $db_icltable.language_code = '$lang_code' AND $db_icltable.element_type IN ($what_icl) ) AS b 983 WHERE $wpdb->posts.post_type IN ($what) AND $wpdb->posts.post_status != 'revision' AND $wpdb->posts.ID = b.id AND ($search) 977 984 ORDER BY $wpdb->posts.post_date_gmt DESC LIMIT 50 978 "; 985 "; 979 986 else : 980 987 $query_str = " … … 986 993 endif; 987 994 $posts = $wpdb->get_results( $query_str ); 988 989 995 //try to get results if wpml is not enabled on post-types 990 996 if ( !$posts && $wpml ) : … … 1103 1109 <?php 1104 1110 } 1111 1112 /* 1113 * Avoid deprecated for like_escape for WP 4.0+ 1114 * @since 0.7.7 1115 * @param string $term 1116 * @return string $term 1117 */ 1118 public function tasrpas_like_escape( $term ) { 1119 global $wpdb, $wp_version; 1120 if ( version_compare( $wp_version, '4.0', '>=' ) ) : 1121 return $wpdb->esc_like( $term ); 1122 else : 1123 return like_escape( $term ); 1124 endif; 1125 } 1126 1105 1127 } -
tessa-authorship/trunk/classes/tessa-authorship.php
r878948 r983255 53 53 add_action( 'save_post', array( $this, 'meta_box_save' ) ); 54 54 add_filter( 'enter_title_here', array( $this, 'enter_title_here' ) ); 55 add_action( 'admin_ print_styles', array( $this, 'enqueue_admin_styles' ), 10 );55 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ), 10 ); 56 56 add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) ); 57 57 … … 528 528 * @return void 529 529 */ 530 public function enqueue_admin_styles () { 531 wp_register_style( 'tessa-authorship-admin', $this->assets_url . '/css/admin.css', array(), '1.0.1' ); 532 wp_enqueue_style( 'tessa-authorship-admin' ); 530 public function enqueue_admin_styles ($hook_suffix) { 531 if ( $hook_suffix == 'edit.php' || $hook_suffix == 'authorship_page_tessa-authorship' ) : 532 wp_register_style( 'tessa-authorship-admin', $this->assets_url . '/css/admin.css', array(), '1.0.1' ); 533 wp_enqueue_style( 'tessa-authorship-admin' ); 534 endif; 533 535 } // End enqueue_admin_styles() 534 536 -
tessa-authorship/trunk/readme.txt
r914017 r983255 4 4 Tags: tessa authorship, authorship, biography, bio, bio box, related, related post, related author, link post, link author, relation, relationship, biography box, twitter, facebook, linkedin, googleplus, google+, delicious, flickr, picasa, vimeo, youtube, reddit, website, about, author, user, about author, user box, author box, contributors, author bio, author biography, user biography, avatar, gravatar, guest post, guest author, publisher, copyright, gallery, exposition, third-party content, widget, shortcode, template-tag, social, fusion, collaboration, custom post-type, post-type, custom post type, post type 5 5 Requires at least: 3.4.2 6 Tested up to: 3.9.07 Stable tag: 0.7. 66 Tested up to: 4.0 7 Stable tag: 0.7.7 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 95 95 96 96 = Related Authors References / Related Content References = 97 Lists for related authors o r related posts on the authors page can be shown or automatically activating the content filter in the settings or you have to use for example:97 Lists for related authors on content pages and related posts on author pages can be shown automatically by activating the content filter in the settings page. If you don't want to add this automaticaly you can add related posts or authors manually using the following code: 98 98 99 99 `<?php do_action( 'tessa_authorship' ); ?>` … … 277 277 == Changelog == 278 278 279 = 0.7.7 = 280 281 * Fix and improve content or author selection in WPML context 282 * Fix for WP 4.0 deprecated like_escape-function used in the plugin 283 * Get rid off pixelated menu icon, use WP 3.8 dashicon font icon instead 284 279 285 = 0.7.6 = 280 286 -
tessa-authorship/trunk/tessa-authorship.php
r914017 r983255 5 5 * Description: Add wordpress independent authorship information on posts, pages, create lists of authors, reflect related content on author's page 6 6 * Author: Uli Hake 7 * Version: 0.7. 67 * Version: 0.7.7 8 8 * Author URI: http://takebarcelona.com/authorship/uli-hake/ 9 9 * @author Uli Hake … … 51 51 //load into global 52 52 $tessa_authorship = new Tessa_Authorship( __FILE__ ); 53 $tessa_authorship->version = '0.7. 3';53 $tessa_authorship->version = '0.7.7'; 54 54 55 55 register_uninstall_hook( __FILE__, 'tasrpas_uninstaller' );
Note: See TracChangeset
for help on using the changeset viewer.