diff options
author | friendica <info@friendica.com> | 2015-04-23 19:49:41 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-04-23 19:49:41 -0700 |
commit | 6679734135fb04f4a7beccb81663bf1e9574f062 (patch) | |
tree | 887488543d98b5dd297d917718bdd99844e83ba5 /include/oembed.php | |
parent | 08b757a22cd2804bfec8ecf682b6987b8c06ca49 (diff) | |
parent | c696860cc53bc25558d83de5eda65d9b583da382 (diff) | |
download | volse-hubzilla-6679734135fb04f4a7beccb81663bf1e9574f062.tar.gz volse-hubzilla-6679734135fb04f4a7beccb81663bf1e9574f062.tar.bz2 volse-hubzilla-6679734135fb04f4a7beccb81663bf1e9574f062.zip |
Merge branch 'master' into tres
Conflicts:
include/Contact.php
include/ItemObject.php
include/api.php
include/attach.php
include/diaspora.php
include/dir_fns.php
include/enotify.php
include/event.php
include/expire.php
include/items.php
include/notifier.php
include/notify.php
include/photos.php
include/taxonomy.php
include/text.php
include/widgets.php
include/zot.php
mod/admin.php
mod/channel.php
mod/dirsearch.php
mod/display.php
mod/editwebpage.php
mod/events.php
mod/home.php
mod/item.php
mod/manage.php
mod/mood.php
mod/network.php
mod/page.php
mod/photos.php
mod/ping.php
mod/post.php
mod/thing.php
mod/viewsrc.php
view/css/mod_events.css
Diffstat (limited to 'include/oembed.php')
-rwxr-xr-x | include/oembed.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/include/oembed.php b/include/oembed.php index 38c433e99..0628afaa9 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -8,13 +8,25 @@ function oembed_replacecb($matches){ } +// if the url is embeddable with oembed, return the bbcode link. + +function oembed_process($url) { + $j = oembed_fetch_url($url); + logger('oembed_process: ' . print_r($j,true)); + if($j && $j->type !== 'error') + return '[embed]' . $url . '[/embed]'; + return false; +} + + + function oembed_fetch_url($embedurl){ $a = get_app(); $txt = Cache::get($a->videowidth . $embedurl); - if(strstr($txt,'youtu')) { + if(strstr($txt,'youtu') && strstr(z_root(),'https:')) { $txt = str_replace('http:','https:',$txt); } @@ -105,7 +117,7 @@ function oembed_format_object($j){ $th=120; $tw = $th*$tr; $tpl=get_markup_template('oembed_video.tpl'); - if(strstr($embedurl,'youtu')) { + if(strstr($embedurl,'youtu') && strstr(z_root(),'https:')) { $embedurl = str_replace('http:','https:',$embedurl); $j->thumbnail_url = str_replace('http:','https:', $j->thumbnail_url); $jhtml = str_replace('http:','https:', $jhtml); @@ -142,7 +154,7 @@ function oembed_format_object($j){ // add link to source if not present in "rich" type if ( $j->type!='rich' || !strpos($j->html,$embedurl) ){ $embedlink = (isset($j->title))?$j->title:$embedurl; - $ret .= "<a href='$embedurl' rel='oembed'>$embedlink</a>"; + $ret .= '<span class="bookmark-identifier">#^</span>' . "<a href='$embedurl' rel='oembed'>$embedlink</a>"; $ret .= "<br>"; if (isset($j->author_name)) $ret.=" by ".$j->author_name; if (isset($j->provider_name)) $ret.=" on ".$j->provider_name; |