3 // See update_profile.php for documentation
5 require_once 'mod/community.php';
7 function update_community_content(&$a)
9 header('Content-type: text/html');
10 echo "<!DOCTYPE html><html><body>\r\n";
13 $text = community_content($a, true);
14 $pattern = '/<img([^>]*) src="([^"]*)"/';
15 $replace = '<img${1} dst="${2}"';
16 $text = preg_replace($pattern, $replace, $text);
18 if (get_pconfig(local_user(), 'system', 'bandwith_saver')) {
19 $replace = '<br />'.t('[Embedded content - reload page to view]').'<br />';
20 $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
21 $text = preg_replace($pattern, $replace, $text);
22 $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
23 $text = preg_replace($pattern, $replace, $text);
24 $pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
25 $text = preg_replace($pattern, $replace, $text);
26 $pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
27 $text = preg_replace($pattern, $replace, $text);
30 // reportedly some versions of MSIE don't handle tabs in XMLHttpRequest documents very well
31 echo str_replace("\t", ' ', $text);
33 echo "</body></html>\r\n";