3 // See update_profile.php for documentation
7 require_once("mod/community.php");
9 function update_community_content(App $a) {
11 header("Content-type: text/html");
12 echo "<!DOCTYPE html><html><body>\r\n";
15 $text = community_content($a, true);
16 $pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
17 $replace = "<img\${1} dst=\"\${2}\"";
18 $text = preg_replace($pattern, $replace, $text);
20 if (get_pconfig(local_user(), "system", "bandwith_saver")) {
21 $replace = "<br />".t("[Embedded content - reload page to view]")."<br />";
22 $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
23 $text = preg_replace($pattern, $replace, $text);
24 $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
25 $text = preg_replace($pattern, $replace, $text);
26 $pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
27 $text = preg_replace($pattern, $replace, $text);
28 $pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
29 $text = preg_replace($pattern, $replace, $text);
32 echo str_replace("\t", " ", $text);
34 echo "</body></html>\r\n";