diff options
author | friendica <info@friendica.com> | 2013-04-25 01:55:35 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-04-25 01:55:35 -0700 |
commit | d3b5e678908864d889b916ad2f976c1af16ca360 (patch) | |
tree | a5992a78ff9d9683da25f8fbdf895ecd5fc0a20d /mod | |
parent | 9d564913f6ea913a39fe2e4937dc4703452c769d (diff) | |
download | volse-hubzilla-d3b5e678908864d889b916ad2f976c1af16ca360.tar.gz volse-hubzilla-d3b5e678908864d889b916ad2f976c1af16ca360.tar.bz2 volse-hubzilla-d3b5e678908864d889b916ad2f976c1af16ca360.zip |
odds and ends in prepearation for photo abstraction, plus red-to-friendica addon
Diffstat (limited to 'mod')
-rw-r--r-- | mod/display.php | 15 | ||||
-rw-r--r-- | mod/oexchange.php | 9 | ||||
-rw-r--r-- | mod/starred.php | 8 |
3 files changed, 21 insertions, 11 deletions
diff --git a/mod/display.php b/mod/display.php index 170f800ac..b1ae54df3 100644 --- a/mod/display.php +++ b/mod/display.php @@ -94,6 +94,8 @@ function display_content(&$a, $update = 0, $load = false) { if($update && $load) { + $updateable = false; + $pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage'])); if($load) { @@ -107,6 +109,8 @@ function display_content(&$a, $update = 0, $load = false) { intval(local_user()), dbesc($target_item['parent_mid']) ); + if($r) + $updateable = true; } if($r === null) { $r = q("SELECT * from item @@ -149,6 +153,17 @@ function display_content(&$a, $update = 0, $load = false) { $o .= conversation($a,$items,'display', $update, 'client'); + + if($updateable) { + $x = q("UPDATE item SET item_flags = ( item_flags ^ %d ) + WHERE (item_flags & %d) AND uid = %d and parent = %d ", + intval(ITEM_UNSEEN), + intval(ITEM_UNSEEN), + intval(local_user()), + intval($r[0]['parent']) + ); + } + return $o; diff --git a/mod/oexchange.php b/mod/oexchange.php index 791a493ff..63b48751c 100644 --- a/mod/oexchange.php +++ b/mod/oexchange.php @@ -32,18 +32,19 @@ function oexchange_content(&$a) { $tags = (((x($_REQUEST,'tags')) && strlen($_REQUEST['tags'])) ? '&tags=' . urlencode(notags(trim($_REQUEST['tags']))) : ''); - $s = fetch_url($a->get_baseurl() . '/parse_url?f=&url=' . $url . $title . $description . $tags); + $ret = z_fetch_url($a->get_baseurl() . '/parse_url?f=&url=' . $url . $title . $description . $tags); + + if($ret['success']) + $s = $ret['body']; if(! strlen($s)) return; - require_once('include/html2bbcode.php'); - $post = array(); $post['profile_uid'] = local_user(); $post['return'] = '/oexchange/done' ; - $post['body'] = html2bbcode($s); + $post['body'] = $s; $post['type'] = 'wall'; $_REQUEST = $post; diff --git a/mod/starred.php b/mod/starred.php index 530c5c7e0..ca7621b0f 100644 --- a/mod/starred.php +++ b/mod/starred.php @@ -19,13 +19,7 @@ function starred_init(&$a) { if(! count($r)) killme(); - $item_flags = $r[0]['item_flags']; - - if($item_flags & ITEM_STARRED) - $item_flags -= ITEM_STARRED; - else - $item_flags += ITEM_STARRED; - + $item_flags = ( $r[0]['item_flags'] ^ ITEM_STARRED ); $r = q("UPDATE item SET item_flags = %d WHERE uid = %d and id = %d LIMIT 1", intval($item_flags), |