false ]); $ogdesc = trim(html2plain($ogdesc, 0, true)); $ogdesc = html_entity_decode($ogdesc, ENT_QUOTES, 'UTF-8'); // remove all URLs $ogdesc = preg_replace("/https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,\@]+/", "", $ogdesc); // shorten description $ogdesc = substr($ogdesc, 0, 300); $ogdesc = str_replace("\n", " ", $ogdesc); while (strpos($ogdesc, " ") !== false) $ogdesc = str_replace(" ", " ", $ogdesc); $ogdesc = (strlen($ogdesc) < 298 ? $ogdesc : rtrim(substr($ogdesc, 0, strrpos($ogdesc, " ")), "?.,:;!-") . "..."); $ogtype = "article"; } if(! isset($ogdesc)) { if(App::$profile['about'] && perm_is_allowed($channel['channel_id'],get_observer_hash(),'view_profile')) { $ogdesc = App::$profile['about']; } else { $ogdesc = sprintf( t('This is the home page of %s.'), $channel['channel_name']); } } if(! isset($ogimage)) { $ogimage = $channel['xchan_photo_l']; $ogimagetype = $channel['xchan_photo_mimetype']; } if (! isset(App::$page['htmlhead'])) App::$page['htmlhead'] = ''; App::$page['htmlhead'] .= '' . "\r\n"; App::$page['htmlhead'] .= '' . "\r\n"; App::$page['htmlhead'] .= '' . "\r\n"; App::$page['htmlhead'] .= '' . "\r\n"; App::$page['htmlhead'] .= '' . "\r\n"; return true; }