]> git.mxchange.org Git - friendica.git/blob - mod/update_profile.php
more robust feed error handling, at the expense of performance.
[friendica.git] / mod / update_profile.php
1 <?php
2
3 // This page is fetched via ajax to update the profile page with
4 // new content while you are viewing it.
5
6 require_once('mod/profile.php');
7
8 function update_profile_content(&$a) {
9
10         $profile_uid = intval($_GET['p']);
11
12         header("Content-type: text/html");
13         echo "<!DOCTYPE html><html><body>\r\n";
14         echo (($_GET['msie'] == 1) ? '<div>' : '<section>');
15
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.
20
21         $text = profile_content($a,$profile_uid);
22         $pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
23         $replace = "<img\${1} dst=\"\${2}\"";
24         $text = preg_replace($pattern, $replace, $text);
25
26         echo str_replace("\t",'       ',$text);
27         echo (($_GET['msie'] == 1) ? '</div>' : '</section>');
28         echo "</body></html>\r\n";
29         killme();
30
31 }