Ticket #1227: 1277.diff
| File 1277.diff, 3.9 KB (added by GautamGupta, 2 years ago) |
|---|
-
bb-admin/options-reading.php
1 1 <?php 2 2 3 require_once( 'admin.php');3 require_once( 'admin.php' ); 4 4 5 5 if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && $_POST['action'] == 'update') { 6 6 … … 24 24 exit; 25 25 } 26 26 27 if ( !empty($_GET['updated']) ) { 28 bb_admin_notice( __( '<strong>Settings saved.</strong>' ) ); 29 } 27 if ( !empty( $_GET['updated'] ) ) 28 bb_admin_notice( '<strong>' . __( 'Settings saved.' ) . '</strong>' ); 30 29 31 30 $reading_options = array( 32 31 'page_topics' => array( 33 32 'title' => __( 'Items per page' ), 34 33 'class' => 'short', 35 'note' => __( 'Number of topics, posts or tags to show per page.' ), 34 'note' => __( 'Number of topics, posts or tags to show per page.' ) 35 ), 36 'name_link_profile' => array( 37 'title' => __( 'Link name to' ), 38 'type' => 'radio', 39 'options' => array( 40 0 => __( 'Website' ), 41 1 => __( 'Profile' ) 42 ), 43 'note' => __( 'What should the user\'s name link to on the topic page? The user\'s title would automatically get linked to the option you don\'t choose. By default, the user\'s name is linked to his/her website.' ) 36 44 ) 37 45 ); 38 46 … … 44 52 45 53 <div class="wrap"> 46 54 47 <h2><?php _e( 'Reading Settings'); ?></h2>55 <h2><?php _e( 'Reading Settings' ); ?></h2> 48 56 <?php do_action( 'bb_admin_notices' ); ?> 49 57 50 <form class="settings" method="post" action="<?php bb_uri( 'bb-admin/options-reading.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN); ?>">58 <form class="settings" method="post" action="<?php bb_uri( 'bb-admin/options-reading.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN ); ?>"> 51 59 <fieldset> 52 60 <?php 53 61 foreach ( $reading_options as $option => $args ) { … … 58 66 <fieldset class="submit"> 59 67 <?php bb_nonce_field( 'options-reading-update' ); ?> 60 68 <input type="hidden" name="action" value="update" /> 61 <input class="submit" type="submit" name="submit" value="<?php _e( 'Save Changes') ?>" />69 <input class="submit" type="submit" name="submit" value="<?php _e( 'Save Changes' ) ?>" /> 62 70 </fieldset> 63 71 </form> 64 72 -
bb-includes/functions.bb-meta.php
476 476 'plugin_cookie_paths', 477 477 'wp_roles_map', 478 478 'gmt_offset', 479 'timezone_string' 479 'timezone_string', 480 'name_link_profile' 480 481 ); 481 482 482 483 // Check that these aren't already in the cache -
bb-includes/functions.bb-template.php
1754 1754 } 1755 1755 1756 1756 function post_author_link( $post_id = 0 ) { 1757 if ( $link = get_user_link( get_post_author_id( $post_id) ) ) {1757 if ( $link = ( bb_get_option( 'name_link_profile' ) ? get_user_profile_link( get_post_author_id( $post_id ) ) : get_user_link( get_post_author_id( $post_id ) ) ) ) { 1758 1758 echo '<a href="' . esc_attr( $link ) . '">' . get_post_author( $post_id ) . '</a>'; 1759 1759 } elseif ( $link = bb_get_post_meta( 'pingback_uri' )) { 1760 1760 echo '<a href="' . esc_attr( $link ) . '">' . get_post_author( $post_id ) . '</a>'; … … 2144 2144 $r = __('PingBack'); 2145 2145 else 2146 2146 $r = __('Unregistered'); // This should never happen 2147 } else 2148 $r = '<a href="' . esc_attr( get_user_profile_link( get_post_author_id( $post_id ) ) ) . '">' . $title . '</a>'; 2147 } else { 2148 if ( $link = bb_get_option( 'name_link_profile' ) ? get_user_link( get_post_author_id( $post_id ) ) : get_user_profile_link( get_post_author_id( $post_id ) ) ) 2149 $r = '<a href="' . esc_attr( $link ) . '">' . $title . '</a>'; 2150 else 2151 $r = $title; 2152 } 2149 2153 2150 2154 return apply_filters( 'get_post_author_title_link', $r, get_post_id( $post_id ) ); 2151 2155 }