Skip to:
Content

Changeset 2431


Ignore:
Timestamp:
05/19/10 17:27:49 (4 years ago)
Author:
chrishajer
Message:

Link author's name to their profile page in topic.php. Fixes #1227. Props grassrootspa for the report, Nightgunner5 for the first path, GautamGupta for the final patch

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-admin/options-reading.php

    r2184 r2431  
    11<?php 
    22 
    3 require_once('admin.php'); 
     3require_once( 'admin.php' ); 
    44 
    55if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && $_POST['action'] == 'update') { 
     
    2525} 
    2626 
    27 if ( !empty($_GET['updated']) ) { 
    28     bb_admin_notice( __( '<strong>Settings saved.</strong>' ) ); 
    29 } 
     27if ( !empty( $_GET['updated'] ) ) 
     28    bb_admin_notice( '<strong>' . __( 'Settings saved.' ) . '</strong>' ); 
    3029 
    3130$reading_options = array( 
     
    3332        'title' => __( 'Items per page' ), 
    3433        '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.' ) 
    3644    ) 
    3745); 
     
    4553<div class="wrap"> 
    4654 
    47 <h2><?php _e('Reading Settings'); ?></h2> 
     55<h2><?php _e( 'Reading Settings' ); ?></h2> 
    4856<?php do_action( 'bb_admin_notices' ); ?> 
    4957 
    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 ); ?>"> 
    5159    <fieldset> 
    5260<?php 
     
    5967        <?php bb_nonce_field( 'options-reading-update' ); ?> 
    6068        <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' ) ?>" /> 
    6270    </fieldset> 
    6371</form> 
  • trunk/bb-includes/functions.bb-meta.php

    r2390 r2431  
    477477        'wp_roles_map', 
    478478        'gmt_offset', 
    479         'timezone_string' 
     479        'timezone_string', 
     480        'name_link_profile' 
    480481    ); 
    481482 
  • trunk/bb-includes/functions.bb-template.php

    r2430 r2431  
    17551755 
    17561756function 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 ) ) ) ) { 
    17581758        echo '<a href="' . esc_attr( $link ) . '">' . get_post_author( $post_id ) . '</a>'; 
    17591759    } elseif ( $link = bb_get_post_meta( 'pingback_uri' )) { 
     
    21412141        else 
    21422142            $r = __('Unregistered'); // This should never happen 
    2143     } else 
    2144         $r = '<a href="' . esc_attr( get_user_profile_link( get_post_author_id( $post_id ) ) ) . '">' . $title . '</a>'; 
     2143    } else { 
     2144        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 ) ) ) 
     2145            $r = '<a href="' . esc_attr( $link ) . '">' . $title . '</a>'; 
     2146        else 
     2147            $r = $title; 
     2148    } 
    21452149 
    21462150    return apply_filters( 'get_post_author_title_link', $r, get_post_id( $post_id ) ); 
Note: See TracChangeset for help on using the changeset viewer.