use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Group;
// desired.
$sql_post_table = '';
- $sql_options = (($star) ? " AND `thread`.`starred` " : '');
- $sql_options .= (($bmark) ? " AND `thread`.`bookmark` " : '');
+ $sql_options = ($star ? " AND `thread`.`starred` " : '');
+ $sql_options .= ($bmark ? sprintf(" AND `thread`.`post-type` = %d ", Item::PT_PAGE) : '');
$sql_extra = $sql_options;
$sql_extra2 = '';
$sql_extra3 = '';
$sql_table = '`thread`';
$sql_parent = '`iid`';
+ $sql_order = '';
if ($update) {
$sql_table = '`item`';
$order_mode = 'commented';
}
- if ($sql_order == '') {
- $sql_order = "$sql_table.$ordering";
- }
+ $sql_order = "$sql_table.$ordering";
if (x($_GET, 'offset')) {
$sql_range = sprintf(" AND $sql_order <= '%s'", dbesc($_GET['offset']));
$top_limit = DateTimeFormat::utcNow();
}
- $items = dba::p("SELECT `item`.`parent-uri` AS `uri`, 0 AS `item_id`, `item`.$ordering AS `order_date` FROM `item`
+ $items = dba::p("SELECT `item`.`parent-uri` AS `uri`, 0 AS `item_id`, `item`.$ordering AS `order_date`, `author`.`url` AS `author-link` FROM `item`
STRAIGHT_JOIN (SELECT `oid` FROM `term` WHERE `term` IN
(SELECT SUBSTR(`term`, 2) FROM `search` WHERE `uid` = ? AND `term` LIKE '#%') AND `otype` = ? AND `type` = ? AND `uid` = 0) AS `term`
ON `item`.`id` = `term`.`oid`