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 $profile_uid = intval($_GET['p']);
12 header("Content-type: text/html");
13 echo "<!DOCTYPE html><html><body>\r\n";
14 echo (($_GET['msie'] == 1) ? '<div>' : '<section>');
16 // Grab the page inner contents, but move any image src attributes to another attribute name.
17 // Some browsers will prefetch all the images for the page even if we don't need them.
18 // The only ones we need to fetch are those for new page additions, which we'll discover
19 // on the client side and then swap the image back.
21 $text = profile_content($a,$profile_uid);
22 $pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
23 $replace = "<img\${1} dst=\"\${2}\"";
24 $text = preg_replace($pattern, $replace, $text);
26 echo str_replace("\t",' ',$text);
27 echo (($_GET['msie'] == 1) ? '</div>' : '</section>');
28 echo "</body></html>\r\n";