Changeset 45279

Show
Ignore:
Timestamp:
05/11/08 18:35:59 (2 months ago)
Author:
Aaron Harun
Message:

Titles now change.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ajaxd-wordpress/trunk/modules/ajaxnav/ajaxnav.php

    r45271 r45279  
    170170      function AJAX(){ 
    171171      global $id, $post, $awpall; 
    172       global $hemingway; //for themes that arn't quite sure how to place nice with others. 
    173                                           // There are these things called filters and hooks, USE THEM. 
     172      global $hemingway; //for themes that aren't quite sure how to place nice with others. 
     173                                    // There are these things called filters and hooks, USE THEM. 
     174 
     175      global $user_login,$userdata;; 
     176            get_currentuserinfo(); 
     177 
    174178            ob_start(); 
    175179 
     
    190194                                    include(TEMPLATEPATH . '/index.php'); 
    191195                              } 
     196 
    192197 
    193198                        }elseif($_REQUEST['nav'] == "page"){ 
     
    206211                              } 
    207212                        } 
     213                        $title = wp_title('',false); 
    208214 
    209215                  }else{ 
     
    220226                        $url .= '?awp=ajax'; 
    221227                  } 
    222                   echo file_get_contents($url); 
    223  
     228                  $content = file_get_contents($url); 
     229                  echo $content; 
     230                  preg_match('/<title>([^<]*)<\/title>/',$content,$matches); 
     231                  $title = $matches[1]; 
    224232            }else{ 
    225233                  global $paged; 
     
    243251            if($awpall[ajax_nav_all] != '') 
    244252                  $actions[] = 'setTimeout("awp_nav_links();",500);'; 
     253 
     254            if($title != '') 
     255                  $actions[] = 'try{document.title = "'.$title.'"}catch(e){}'; 
    245256 
    246257            AWP::make_response($response, $vars,$actions);