// Currently security is based on the logged in user
- if(! local_user()) {
+ if (! local_user()) {
return;
}
);
$str = '';
- if(count($r))
+ if (dbm::is_result($r))
foreach($r as $rr)
$str .= '<' . $rr['id'] . '>';
if(strlen($str))
intval($group),
intval($_SESSION['uid'])
);
- if(! count($r)) {
+ if (! dbm::is_result($r)) {
if($update)
killme();
notice( t('No such group') . EOL );
- goaway($a->get_baseurl(true) . '/network');
+ goaway(App::get_baseurl(true) . '/network');
// NOTREACHED
}
AND `blocked` = 0 AND `pending` = 0 LIMIT 1",
intval($cid)
);
- if(count($r)) {
+ if (dbm::is_result($r)) {
$sql_extra = " AND `item`.`parent` IN ( SELECT DISTINCT(`parent`) FROM `item` WHERE 1 $sql_options AND `contact-id` = " . intval($cid) . " and deleted = 0 ) ";
}
}
if($conv) {
- $myurl = $a->get_baseurl() . '/profile/'. $a->user['nickname'];
+ $myurl = App::get_baseurl() . '/profile/'. $a->user['nickname'];
$myurl = substr($myurl,strpos($myurl,'://')+3);
$myurl = str_replace('www.','',$myurl);
$diasp_url = str_replace('/profile/','/u/',$myurl);
$items = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`writable`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
- `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
+ `contact`.`id` AS `cid`
FROM $sql_table INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1
AND `item`.`deleted` = 0 and `item`.`moderated` = 0
$simple_update
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$sql_extra $sql_nets
- ORDER BY `item`.`received` DESC $pager_sql ",
+ ORDER BY `item`.`id` DESC $pager_sql ",
intval($_SESSION['uid'])
);
$parents_arr = array();
$parents_str = '';
- if(count($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr)
if(! in_array($rr['item_id'],$parents_arr))
$parents_arr[] = $rr['item_id'];
$items = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`, `contact`.`writable`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
- `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
+ `contact`.`id` AS `cid`
FROM $sql_table INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
AND `item`.`moderated` = 0
'like' => '',
'dislike' => '',
'comment' => '',
- //'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl($ssl_state) . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))),
- 'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl($ssl_state).'/display/'.$item['guid'], 'title'=> t('View in context'))),
+ //'conv' => (($preview) ? '' : array('href'=> App::get_baseurl($ssl_state) . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))),
+ 'conv' => (($preview) ? '' : array('href'=> App::get_baseurl($ssl_state).'/display/'.$item['guid'], 'title'=> t('View in context'))),
'previewing' => $previewing,
'wait' => t('Please wait'),
);
}
}
- if(local_user() && link_compare($a->contact['url'],$item['author-link']))
- $edpost = array($a->get_baseurl($ssl_state)."/editpost/".$item['id'], t("Edit"));
- else
+ if (local_user() && link_compare($a->contact['url'],$item['author-link'])) {
+ $edpost = array(App::get_baseurl($ssl_state)."/editpost/".$item['id'], t("Edit"));
+ } else {
$edpost = false;
+ }
$drop = '';
$dropping = false;
$isstarred = "unstarred";
if ($profile_owner == local_user()) {
- if($toplevelpost) {
+ if ($toplevelpost) {
$isstarred = (($item['starred']) ? "starred" : "unstarred");
$star = array(
intval($item['uid']),
intval($item['id'])
);
- if (count($r)) {
+
+ if (dbm::is_result($r)) {
$ignore = array(
'do' => t("ignore thread"),
'undo' => t("unignore thread"),
);
}
$tagger = '';
- if(feature_enabled($profile_owner,'commtag')) {
+ if (feature_enabled($profile_owner,'commtag')) {
$tagger = array(
'add' => t("add tag"),
'class' => "",
$sp = false;
$profile_link = best_link_url($item,$sp);
- if($profile_link === 'mailbox')
+ if ($profile_link === 'mailbox') {
$profile_link = '';
- if($sp)
+ }
+ if ($sp) {
$sparkle = ' sparkle';
- else
+ } else {
$profile_link = zrl($profile_link);
+ }
// Don't rely on the author-avatar. It is better to use the data from the contact table
$author_contact = get_contact_details_by_url($item['author-link'], $profile_owner);
- if ($author_contact["thumb"])
+ if ($author_contact["thumb"]) {
$profile_avatar = $author_contact["thumb"];
- else
+ } else {
$profile_avatar = $item['author-avatar'];
+ }
$like = ((x($conv_responses['like'],$item['uri'])) ? format_like($conv_responses['like'][$item['uri']],$conv_responses['like'][$item['uri'] . '-l'],'like',$item['uri']) : '');
$dislike = ((x($conv_responses['dislike'],$item['uri'])) ? format_like($conv_responses['dislike'][$item['uri']],$conv_responses['dislike'][$item['uri'] . '-l'],'dislike',$item['uri']) : '');