aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rwxr-xr-xinclude/diaspora.php100
1 files changed, 97 insertions, 3 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index e3bfc2806..1e0e48a86 100755
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -845,8 +845,9 @@ function diaspora_post($importer,$xml,$msg) {
// Look for tags and linkify them
$results = linkify_tags(get_app(), $body, $importer['channel_id']);
+ $datarray['term'] = array();
+
if($results) {
- $datarray['term'] = array();
foreach($results as $result) {
$success = $result['success'];
if($success['replaced']) {
@@ -861,6 +862,37 @@ function diaspora_post($importer,$xml,$msg) {
}
}
+ $cnt = preg_match_all('/@\[url=(.*?)\](.*?)\[\/url\]/ism',$body,$matches,PREG_SET_ORDER);
+ if($cnt) {
+ foreach($matches as $mtch) {
+ $datarray['term'][] = array(
+ 'uid' => $importer['channel_id'],
+ 'type' => TERM_MENTION,
+ 'otype' => TERM_OBJ_POST,
+ 'term' => $mtch[2],
+ 'url' => $mtch[1]
+ );
+ }
+ }
+
+ $cnt = preg_match_all('/@\[zrl=(.*?)\](.*?)\[\/zrl\]/ism',$body,$matches,PREG_SET_ORDER);
+ if($cnt) {
+ foreach($matches as $mtch) {
+ // don't include plustags in the term
+ $term = ((substr($mtch[2],-1,1) === '+') ? substr($mtch[2],0,-1) : $mtch[2]);
+ $datarray['term'][] = array(
+ 'uid' => $importer['channel_id'],
+ 'type' => TERM_MENTION,
+ 'otype' => TERM_OBJ_POST,
+ 'term' => $term,
+ 'url' => $mtch[1]
+ );
+ }
+ }
+
+
+
+
$plink = service_plink($contact,$guid);
@@ -1032,8 +1064,9 @@ function diaspora_reshare($importer,$xml,$msg) {
// Look for tags and linkify them
$results = linkify_tags(get_app(), $body, $importer['channel_id']);
+ $datarray['term'] = array();
+
if($results) {
- $datarray['term'] = array();
foreach($results as $result) {
$success = $result['success'];
if($success['replaced']) {
@@ -1048,6 +1081,38 @@ function diaspora_reshare($importer,$xml,$msg) {
}
}
+ $cnt = preg_match_all('/@\[url=(.*?)\](.*?)\[\/url\]/ism',$body,$matches,PREG_SET_ORDER);
+ if($cnt) {
+ foreach($matches as $mtch) {
+ $datarray['term'][] = array(
+ 'uid' => $importer['channel_id'],
+ 'type' => TERM_MENTION,
+ 'otype' => TERM_OBJ_POST,
+ 'term' => $mtch[2],
+ 'url' => $mtch[1]
+ );
+ }
+ }
+
+ $cnt = preg_match_all('/@\[zrl=(.*?)\](.*?)\[\/zrl\]/ism',$body,$matches,PREG_SET_ORDER);
+ if($cnt) {
+ foreach($matches as $mtch) {
+ // don't include plustags in the term
+ $term = ((substr($mtch[2],-1,1) === '+') ? substr($mtch[2],0,-1) : $mtch[2]);
+ $datarray['term'][] = array(
+ 'uid' => $importer['channel_id'],
+ 'type' => TERM_MENTION,
+ 'otype' => TERM_OBJ_POST,
+ 'term' => $term,
+ 'url' => $mtch[1]
+ );
+ }
+ }
+
+
+
+
+
$newbody = "[share author='" . urlencode($orig_author_name)
. "' profile='" . $orig_author_link
. "' avatar='" . $orig_author_photo
@@ -1334,8 +1399,9 @@ function diaspora_comment($importer,$xml,$msg) {
// Look for tags and linkify them
$results = linkify_tags(get_app(), $body, $importer['channel_id']);
+ $datarray['term'] = array();
+
if($results) {
- $datarray['term'] = array();
foreach($results as $result) {
$success = $result['success'];
if($success['replaced']) {
@@ -1350,6 +1416,34 @@ function diaspora_comment($importer,$xml,$msg) {
}
}
+ $cnt = preg_match_all('/@\[url=(.*?)\](.*?)\[\/url\]/ism',$body,$matches,PREG_SET_ORDER);
+ if($cnt) {
+ foreach($matches as $mtch) {
+ $datarray['term'][] = array(
+ 'uid' => $importer['channel_id'],
+ 'type' => TERM_MENTION,
+ 'otype' => TERM_OBJ_POST,
+ 'term' => $mtch[2],
+ 'url' => $mtch[1]
+ );
+ }
+ }
+
+ $cnt = preg_match_all('/@\[zrl=(.*?)\](.*?)\[\/zrl\]/ism',$body,$matches,PREG_SET_ORDER);
+ if($cnt) {
+ foreach($matches as $mtch) {
+ // don't include plustags in the term
+ $term = ((substr($mtch[2],-1,1) === '+') ? substr($mtch[2],0,-1) : $mtch[2]);
+ $datarray['term'][] = array(
+ 'uid' => $importer['channel_id'],
+ 'type' => TERM_MENTION,
+ 'otype' => TERM_OBJ_POST,
+ 'term' => $term,
+ 'url' => $mtch[1]
+ );
+ }
+ }
+
$datarray['uid'] = $importer['channel_id'];
$datarray['verb'] = ACTIVITY_POST;
$datarray['mid'] = $guid;