aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-09-04 19:58:03 -0700
committerFriendika <info@friendika.com>2011-09-04 19:58:03 -0700
commit82f7f33cf58774ac6b07acd64fe0b49cd5b0aa30 (patch)
tree54400fab49c5f64b917db32c60cc201f2ac6e626 /mod/item.php
parent481853d2cc44a4bf6c540e72c741ff453305a925 (diff)
downloadvolse-hubzilla-82f7f33cf58774ac6b07acd64fe0b49cd5b0aa30.tar.gz
volse-hubzilla-82f7f33cf58774ac6b07acd64fe0b49cd5b0aa30.tar.bz2
volse-hubzilla-82f7f33cf58774ac6b07acd64fe0b49cd5b0aa30.zip
bookmarks + bug #140
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/mod/item.php b/mod/item.php
index 6ecca8f4a..b4ec7666f 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -332,6 +332,15 @@ function item_post(&$a) {
}
}
+ // embedded bookmark in post? convert to regular url and set bookmark flag
+
+ $bookmark = 0;
+ if(preg_match_all("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/m",$body,$match)) {
+ $bookmark = 1;
+ $body = preg_replace("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/m",'[url=$1]$2[/url]',$body);
+ }
+
+
/**
* Fold multi-line [code] sequences
*/
@@ -509,6 +518,7 @@ function item_post(&$a) {
$datarray['private'] = $private;
$datarray['pubmail'] = $pubmail_enable;
$datarray['attach'] = $attachments;
+ $datarray['bookmark'] = intval($bookmark);
$datarray['thr-parent'] = $thr_parent;
/**
@@ -551,8 +561,8 @@ function item_post(&$a) {
$r = q("INSERT INTO `item` (`guid`, `uid`,`type`,`wall`,`gravity`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`,
`author-name`, `author-link`, `author-avatar`, `created`, `edited`, `received`, `changed`, `uri`, `thr-parent`, `title`, `body`, `app`, `location`, `coord`,
- `tag`, `inform`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `private`, `pubmail`, `attach` )
- VALUES( '%s', %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s' )",
+ `tag`, `inform`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `private`, `pubmail`, `attach`, `bookmark` )
+ VALUES( '%s', %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d )",
dbesc($datarray['guid']),
intval($datarray['uid']),
dbesc($datarray['type']),
@@ -585,7 +595,8 @@ function item_post(&$a) {
dbesc($datarray['deny_gid']),
intval($datarray['private']),
intval($datarray['pubmail']),
- dbesc($datarray['attach'])
+ dbesc($datarray['attach']),
+ intval($datarray['bookmark'])
);
$r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' LIMIT 1",