XPressME Integration Kit

Trac

Changeset 33


Ignore:
Timestamp:
Dec 18, 2008, 12:45:54 PM (15 years ago)
Author:
toemon
Message:

ポストナビリンクで表示内容を指定(「前の投稿」「次の投稿へ」等)したとき、オンマウスで投稿のタイトルを表示するようにした。

File:
1 edited

Legend:

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

    r32 r33  
    3535{ 
    3636        $config = new XPressME_Class(); 
    37         $ret = '';               
    38          
     37        $ret = ''; 
     38                 
    3939        if($config->is_left_postnavi_old){ 
    4040                $link_title = $config->old_post_link_text; 
     
    5656                ob_end_clean(); 
    5757        } 
    58         $ret = str_replace('">','" title="'.$link_title . '">' , $ret); 
     58         
     59        if ($config->is_postnavi_title_disp){ 
     60                $on_mouse_show = $link_title; 
     61        } else  { 
     62                if($config->is_left_postnavi_old){ 
     63                        ob_start(); 
     64                                previous_post_link('%link'); 
     65                                $on_mouse_show = ob_get_contents(); 
     66                        ob_end_clean(); 
     67                } else { 
     68                        ob_start(); 
     69                                next_post_link('%link'); 
     70                                $on_mouse_show = ob_get_contents(); 
     71                        ob_end_clean(); 
     72                } 
     73                $pattern = "<a[^>]*?>(.*)<\/a>"; 
     74                preg_match("/".$pattern."/s",  $on_mouse_show, $body_matches); 
     75                $on_mouse_show = $body_matches[1]; 
     76        } 
     77        $ret = str_replace('">','" title="'.$on_mouse_show . '">' , $ret); 
    5978 
    6079        if (empty($show)) 
     
    88107                ob_end_clean(); 
    89108        } 
    90         $ret = str_replace('">','" title="'.$link_title . '">' , $ret); 
     109         
     110        if ($config->is_postnavi_title_disp){ 
     111                $on_mouse_show = $link_title; 
     112        } else  { 
     113                if($config->is_left_postnavi_old){ 
     114                        ob_start(); 
     115                                next_post_link('%link'); 
     116                                $on_mouse_show = ob_get_contents(); 
     117                        ob_end_clean(); 
     118                } else { 
     119                        ob_start(); 
     120                                previous_post_link('%link'); 
     121                                $on_mouse_show = ob_get_contents(); 
     122                        ob_end_clean(); 
     123                } 
     124                $pattern = "<a[^>]*?>(.*)<\/a>"; 
     125                preg_match("/".$pattern."/s",  $on_mouse_show, $body_matches); 
     126                $on_mouse_show = $body_matches[1]; 
     127        } 
     128        $ret = str_replace('">','" title="'.$on_mouse_show . '">' , $ret); 
    91129 
    92130        if (empty($show)) 
Note: See TracChangeset for help on using the changeset viewer.