diff options
author | Fabio Comuni <fabrix.xm@gmail.com> | 2011-01-31 11:00:35 +0100 |
---|---|---|
committer | Fabio Comuni <fabrix.xm@gmail.com> | 2011-01-31 11:00:35 +0100 |
commit | 6ea87223d3ba5d9ecc1fa57453207e1645819fe5 (patch) | |
tree | 060e1e095fc28757cc4c45258805ebc9b9ad2ebb /include/oembed.php | |
parent | 23d1b994ccff17567391eb9b1572321b1731189c (diff) | |
download | volse-hubzilla-6ea87223d3ba5d9ecc1fa57453207e1645819fe5.tar.gz volse-hubzilla-6ea87223d3ba5d9ecc1fa57453207e1645819fe5.tar.bz2 volse-hubzilla-6ea87223d3ba5d9ecc1fa57453207e1645819fe5.zip |
Add 'system''no_oembed' config option
Diffstat (limited to 'include/oembed.php')
-rw-r--r-- | include/oembed.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/oembed.php b/include/oembed.php index d9bf9f67c..cec9cf75a 100644 --- a/include/oembed.php +++ b/include/oembed.php @@ -10,7 +10,7 @@ function oembed_replacecb($matches){ if (isset($j->thumbnail_url)) { $tw = (isset($j->thumbnail_width)) ? $j->thumbnail_width:200; $th = (isset($j->thumbnail_height)) ? $j->thumbnail_height:180; - $ret = "<a href='#' onclick='this.innerHTML=unescape(\"".urlencode($j->html)."\").replace(/\+/g,\" \"); return false;' >"; + $ret = "<a href='".$embedurl."' onclick='this.innerHTML=unescape(\"".urlencode($j->html)."\").replace(/\+/g,\" \"); return false;' >"; $ret.= "<img width='$tw' height='$th' src='".$j->thumbnail_url."'>"; $ret.= "</a>"; } else { @@ -41,8 +41,9 @@ function oembed_replacecb($matches){ function oembed_bbcode($text){ $stopoembed = get_config("system","no_oembed"); - if ($stopoembed == True): - return preg_replace_callback("/\[embed\](.+?)\[\/embed\]/is", "$1" ,$text); + if ($stopoembed == true){ + return preg_replace("/\[embed\](.+?)\[\/embed\]/is", "<!-- oembed $1 --><i>". t('Embedding disabled') ." : $1</i><!-- /oembed $1 -->" ,$text); + } return preg_replace_callback("/\[embed\](.+?)\[\/embed\]/is", oembed_replacecb ,$text); } ?>
\ No newline at end of file |