aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-03-11 19:35:23 -0700
committerfriendica <info@friendica.com>2015-03-11 19:35:23 -0700
commit64ae17aa6a1bdbc3933422272a391d4e3662f59b (patch)
treeb87f4c0866d9ecfa832d43b7e622e3100386a408 /mod
parenta40c19d19d31bba3fe037a9778c521461e2b0290 (diff)
parentb3a9a6c802170a15cc58fd3af966b35f81c50818 (diff)
downloadvolse-hubzilla-64ae17aa6a1bdbc3933422272a391d4e3662f59b.tar.gz
volse-hubzilla-64ae17aa6a1bdbc3933422272a391d4e3662f59b.tar.bz2
volse-hubzilla-64ae17aa6a1bdbc3933422272a391d4e3662f59b.zip
Merge branch 'master' into openid
Diffstat (limited to 'mod')
-rw-r--r--mod/editblock.php5
-rw-r--r--mod/editlayout.php5
-rw-r--r--mod/editpost.php5
-rw-r--r--mod/editwebpage.php5
-rw-r--r--mod/parse_url.php30
5 files changed, 42 insertions, 8 deletions
diff --git a/mod/editblock.php b/mod/editblock.php
index 46126f94e..cacb5c27d 100644
--- a/mod/editblock.php
+++ b/mod/editblock.php
@@ -141,6 +141,11 @@ function editblock_content(&$a) {
'$action' => 'item',
'$webpage' => ITEM_BUILDBLOCK,
'$share' => t('Edit'),
+ '$bold' => t('Bold'),
+ '$italic' => t('Italic'),
+ '$underline' => t('Underline'),
+ '$quote' => t('Quote'),
+ '$code' => t('Code'),
'$upload' => t('Upload photo'),
'$attach' => t('Attach file'),
'$weblink' => t('Insert web link'),
diff --git a/mod/editlayout.php b/mod/editlayout.php
index 847a64320..21607de8c 100644
--- a/mod/editlayout.php
+++ b/mod/editlayout.php
@@ -137,6 +137,11 @@ function editlayout_content(&$a) {
'$action' => 'item',
'$webpage' => ITEM_PDL,
'$share' => t('Edit'),
+ '$bold' => t('Bold'),
+ '$italic' => t('Italic'),
+ '$underline' => t('Underline'),
+ '$quote' => t('Quote'),
+ '$code' => t('Code'),
'$upload' => t('Upload photo'),
'$attach' => t('Attach file'),
'$weblink' => t('Insert web link'),
diff --git a/mod/editpost.php b/mod/editpost.php
index bdd3be450..edc5fa1b7 100644
--- a/mod/editpost.php
+++ b/mod/editpost.php
@@ -111,6 +111,11 @@ function editpost_content(&$a) {
'$return_path' => $_SESSION['return_url'],
'$action' => 'item',
'$share' => t('Edit'),
+ '$bold' => t('Bold'),
+ '$italic' => t('Italic'),
+ '$underline' => t('Underline'),
+ '$quote' => t('Quote'),
+ '$code' => t('Code'),
'$upload' => t('Upload photo'),
'$attach' => t('Attach file'),
'$weblink' => t('Insert web link'),
diff --git a/mod/editwebpage.php b/mod/editwebpage.php
index c07efc7ee..3e0bd9ff4 100644
--- a/mod/editwebpage.php
+++ b/mod/editwebpage.php
@@ -172,6 +172,11 @@ function editwebpage_content(&$a) {
'$action' => 'item',
'$share' => t('Edit'),
+ '$bold' => t('Bold'),
+ '$italic' => t('Italic'),
+ '$underline' => t('Underline'),
+ '$quote' => t('Quote'),
+ '$code' => t('Code'),
'$upload' => t('Upload photo'),
'$attach' => t('Attach file'),
'$weblink' => t('Insert web link'),
diff --git a/mod/parse_url.php b/mod/parse_url.php
index 49d5cae76..b6c0559f9 100644
--- a/mod/parse_url.php
+++ b/mod/parse_url.php
@@ -1,5 +1,6 @@
<?php
+require_once('include/oembed.php');
/* To-Do
https://developers.google.com/+/plugins/snippet/
@@ -250,6 +251,8 @@ function parse_url_content(&$a) {
}
}
+ logger('parse_url: ' . $url);
+
$result = z_fetch_url($url,false,0,array('novalidate' => true, 'nobody' => true));
if($result['success']) {
$hdrs=array();
@@ -261,25 +264,31 @@ function parse_url_content(&$a) {
if (array_key_exists('Content-Type', $hdrs))
$type = $hdrs['Content-Type'];
if($type) {
- if(in_array($type,array('image/jpeg','image/gif','image/png'))) {
- $s = $br . '[img]' . $url . '[/img]' . $br;
- $s = preg_replace_callback('/\[img(.*?)\](.*?)\[\/img\]/ism','red_zrlify_img_callback',$s);
- echo $s;
+ $zrl = is_matrix_url($url);
+ if(stripos($type,'image/') !== false) {
+ if($zrl)
+ echo $br . '[zmg]' . $url . '[/zmg]' . $br;
+ else
+ echo $br . '[img]' . $url . '[/img]' . $br;
killme();
}
if(stripos($type,'video/') !== false) {
- echo $br . '[video]' . $url . '[/video]' . $br;
+ if($zrl)
+ echo $br . '[zvideo]' . $url . '[/zvideo]' . $br;
+ else
+ echo $br . '[video]' . $url . '[/video]' . $br;
killme();
}
if(stripos($type,'audio/') !== false) {
- echo $br . '[audio]' . $url . '[/audio]' . $br;
+ if($zrl)
+ echo $br . '[zaudio]' . $url . '[/zaudio]' . $br;
+ else
+ echo $br . '[audio]' . $url . '[/audio]' . $br;
killme();
}
}
}
- logger('parse_url: ' . $url);
-
$template = $br . '#^[url=%s]%s[/url]%s' . $br;
$arr = array('url' => $url, 'text' => '');
@@ -291,6 +300,11 @@ function parse_url_content(&$a) {
killme();
}
+ $x = oembed_process($url);
+ if($x) {
+ echo $x;
+ killme();
+ }
if($url && $title && $text) {