aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorroyalterra <royalterra@users.noreply.github.com>2015-12-11 09:39:01 +0000
committerroyalterra <royalterra@users.noreply.github.com>2015-12-11 09:39:01 +0000
commit4ff31d0a4140d923cbb8ddbe18ccf578a367375f (patch)
tree1f63d4b042c3dbf7bfe2c3e74f0a24ef2e5f94ec /include/items.php
parentb92cc852d142940f0f8dd78ddf7be835dc8b9e07 (diff)
parentf73c82632f213ac7971b54220b4a0c87d354ca1e (diff)
downloadvolse-hubzilla-4ff31d0a4140d923cbb8ddbe18ccf578a367375f.tar.gz
volse-hubzilla-4ff31d0a4140d923cbb8ddbe18ccf578a367375f.tar.bz2
volse-hubzilla-4ff31d0a4140d923cbb8ddbe18ccf578a367375f.zip
Merge pull request #1 from redmatrix/master
merge branches
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php
index 7d349c631..ef1867c14 100755
--- a/include/items.php
+++ b/include/items.php
@@ -550,6 +550,7 @@ function get_public_feed($channel, $params) {
$params['direction'] = ((x($params,'direction')) ? $params['direction'] : 'desc');
$params['pages'] = ((x($params,'pages')) ? intval($params['pages']) : 0);
$params['top'] = ((x($params,'top')) ? intval($params['top']) : 0);
+ $params['cat'] = ((x($params,'cat')) ? $params['cat'] : '');
switch($params['type']) {
case 'json':
@@ -593,7 +594,8 @@ function get_feed_for($channel, $observer_hash, $params) {
'direction' => $params['direction'], // FIXME
'pages' => $params['pages'],
'order' => 'post',
- 'top' => $params['top']
+ 'top' => $params['top'],
+ 'cat' => $params['cat']
), $channel, $observer_hash, CLIENT_MODE_NORMAL, get_app()->module);
@@ -3472,7 +3474,7 @@ function post_is_importable($item,$abook) {
unobscure($item);
$text = prepare_text($item['body'],$item['mimetype']);
- $text = html2plain($text);
+ $text = html2plain(($item['title']) ? $item['title'] . ' ' . $text : $text);
$lang = null;
@@ -4817,6 +4819,9 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
if($arr['since_id'])
$sql_extra .= " and item.id > " . $since_id . " ";
+ if($arr['cat'])
+ $sql_extra .= protect_sprintf(term_query('item', $arr['cat'], TERM_CATEGORY));
+
if($arr['gid'] && $uid) {
$r = q("SELECT * FROM `groups` WHERE id = %d AND uid = %d LIMIT 1",
intval($arr['group']),