3 // This page is fetched via ajax to update the profile page with
4 // new content while you are viewing it.
6 require_once('mod/profile.php');
8 function update_profile_content(&$a) {
10 header("Content-type: text/html");
11 echo "<!DOCTYPE html><html><body>\r\n";
12 echo (($_GET['msie'] == 1) ? '<div>' : '<section>');
14 // Grab the page inner contents, but move any image src attributes to another attribute name.
15 // Some browsers will prefetch all the images for the page even if we don't need them.
16 // The only ones we need to fetch are those for new page additions, which we'll discover
17 // on the client side and then swap the image back.
20 $text = profile_content($a,true);
21 $pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
22 $replace = "<img\${1} dst=\"\${2}\"";
23 $text = preg_replace($pattern, $replace, $text);
25 echo str_replace("\t",' ',$text);
26 echo (($_GET['msie'] == 1) ? '</div>' : '</section>');
27 echo "</body></html>\r\n";