XPressME Integration Kit

Trac


Ignore:
Timestamp:
Apr 4, 2009, 6:47:22 PM (15 years ago)
Author:
toemon
Message:

#14 マルチユーザーモードの実装

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/plugins/xpressme/include/custom_functions.php

    r154 r155  
    11<?php 
     2function xpress_selected_author($show=true ) { 
     3        $output = ''; 
     4        $author_cookie = get_xpress_dir_name() . "_select_author" ; 
     5        if (!empty($_COOKIE[$author_cookie])){ 
     6                $uid = intval($_COOKIE[$author_cookie]); 
     7                $user_info = get_userdata($uid); 
     8                $output = $user_info->display_name; 
     9        } 
     10        if (empty($show)) 
     11                return $output; 
     12        else 
     13                echo $output; 
     14                 
     15} 
    216         
    317function xpress_list_pings($trackback, $args, $depth) { 
     
    199213} 
    200214 
     215function xpress_is_multi_user(){ 
     216        global $xpress_config; 
     217        return $xpress_config->is_multi_user; 
     218} 
     219 
     220 
    201221function xpress_substr($str, $start, $length, $trimmarker = '...') 
    202222{ 
     
    352372function xpress_conditional_title($display = true) 
    353373{ 
     374        $selected_author = xpress_selected_author(false); 
     375         
    354376        $output = __('Main', 'xpressme'); 
    355377        if (is_category()) 
     
    363385        if (is_year()) 
    364386                $output = sprintf(__('Archive for %s|Yearly archive page', 'xpressme'), get_the_time(__('Y', 'xpressme'))); 
    365         if (is_author()) 
    366                 $output = sprintf(__('Archive for the &#8216;%s&#8217; Author', 'xpressme'), get_author_name( get_query_var('author'))); 
     387        if (is_author()){ 
     388                if (empty($selected_author)) 
     389                        $output = sprintf(__('Archive for the &#8216;%s&#8217; Author', 'xpressme'), get_author_name( get_query_var('author'))); 
     390        } 
    367391        if (is_search()) 
    368392                $output = sprintf(__('Search Results of word &#8216;%s&#8217;', 'xpressme'), get_search_query()); 
     393         
     394        if (!empty($selected_author)) 
     395        $output = sprintf(__('Article of %s', 'xpressme'), $selected_author) . ' - ' . $output; 
    369396                 
    370397        if ($display)  
Note: See TracChangeset for help on using the changeset viewer.