Merge remote-tracking branch 'friendica/develop' into bug/fix-diaspora-people-links
# Conflicts: # include/follow.php
This commit is contained in:
commit
e8e1f9253d
148 changed files with 12178 additions and 11976 deletions
|
@ -1121,7 +1121,7 @@ function admin_page_dbsync(&$a) {
|
|||
|
||||
$failed = array();
|
||||
$r = q("SELECT `k`, `v` FROM `config` WHERE `cat` = 'database' ");
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
foreach($r as $rr) {
|
||||
$upd = intval(substr($rr['k'],7));
|
||||
if($upd < 1139 || $rr['v'] === 'success')
|
||||
|
|
|
@ -39,7 +39,7 @@ function allfriends_content(&$a) {
|
|||
|
||||
$r = all_friends(local_user(), $cid, $a->pager['start'], $a->pager['itemspage']);
|
||||
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
$o .= t('No friends to display.');
|
||||
return $o;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ function oauth_get_client($request){
|
|||
AND `tokens`.`id`='%s' AND `tokens`.`scope`='request'",
|
||||
dbesc($token));
|
||||
|
||||
if (!count($r))
|
||||
if (!dbm::is_result($r))
|
||||
return null;
|
||||
|
||||
return $r[0];
|
||||
|
|
|
@ -16,7 +16,7 @@ function attach_init(&$a) {
|
|||
$r = q("SELECT * FROM `attach` WHERE `id` = %d LIMIT 1",
|
||||
intval($item_id)
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
notice( t('Item was not found.'). EOL);
|
||||
return;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ function attach_init(&$a) {
|
|||
dbesc($item_id)
|
||||
);
|
||||
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ function cal_content(&$a) {
|
|||
intval($contact_id),
|
||||
intval($a->profile['profile_uid'])
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$contact = $r[0];
|
||||
$remote_contact = true;
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ function cal_content(&$a) {
|
|||
|
||||
$links = array();
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$r = sort_by_date($r);
|
||||
foreach($r as $rr) {
|
||||
$j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'j') : datetime_convert('UTC','UTC',$rr['start'],'j'));
|
||||
|
@ -240,7 +240,7 @@ function cal_content(&$a) {
|
|||
$events=array();
|
||||
|
||||
// transform the event in a usable array
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$r = sort_by_date($r);
|
||||
$events = process_events($r);
|
||||
|
||||
|
|
|
@ -57,13 +57,13 @@ function common_content(&$a) {
|
|||
dbesc(normalise_link(get_my_url())),
|
||||
intval($profile_uid)
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$cid = $r[0]['id'];
|
||||
else {
|
||||
$r = q("SELECT `id` FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1",
|
||||
dbesc(normalise_link(get_my_url()))
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$zcid = $r[0]['id'];
|
||||
}
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ function common_content(&$a) {
|
|||
$r = common_friends_zcid($uid, $zcid, $a->pager['start'], $a->pager['itemspage']);
|
||||
|
||||
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
return $o;
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ function community_content(&$a, $update = 0) {
|
|||
AND `item`.`private` = 0 AND `item`.`wall` = 1"
|
||||
);
|
||||
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$a->set_pager_total($r[0]['total']);
|
||||
|
||||
if(! $r[0]['total']) {
|
||||
|
@ -71,7 +71,7 @@ function community_content(&$a, $update = 0) {
|
|||
|
||||
$r = community_getitems($a->pager['start'], $a->pager['itemspage']);
|
||||
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
info( t('No results.') . EOL);
|
||||
return $o;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ function contactgroup_content(&$a) {
|
|||
intval($a->argv[2]),
|
||||
intval(local_user())
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$change = intval($a->argv[2]);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ function contactgroup_content(&$a) {
|
|||
intval($a->argv[1]),
|
||||
intval(local_user())
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
killme();
|
||||
}
|
||||
|
||||
|
@ -47,4 +47,4 @@ function contactgroup_content(&$a) {
|
|||
}
|
||||
|
||||
killme();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ function contacts_init(&$a) {
|
|||
intval(local_user()),
|
||||
intval($contact_id)
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
$contact_id = 0;
|
||||
}
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ function contacts_post(&$a) {
|
|||
intval($profile_id),
|
||||
intval(local_user())
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
notice( t('Could not locate selected profile.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ function contacts_post(&$a) {
|
|||
intval($contact_id),
|
||||
intval(local_user())
|
||||
);
|
||||
if($r && count($r))
|
||||
if($r && dbm::is_result($r))
|
||||
$a->data['contact'] = $r[0];
|
||||
|
||||
return;
|
||||
|
@ -765,7 +765,7 @@ function contacts_content(&$a) {
|
|||
$r = q("SELECT COUNT(*) AS `total` FROM `contact`
|
||||
WHERE `uid` = %d AND `self` = 0 AND `pending` = 0 $sql_extra $sql_extra2 ",
|
||||
intval($_SESSION['uid']));
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$a->set_pager_total($r[0]['total']);
|
||||
$total = $r[0]['total'];
|
||||
}
|
||||
|
@ -780,8 +780,8 @@ function contacts_content(&$a) {
|
|||
|
||||
$contacts = array();
|
||||
|
||||
if(count($r)) {
|
||||
foreach($r as $rr) {
|
||||
if (dbm::is_result($r)) {
|
||||
foreach ($r as $rr) {
|
||||
$contacts[] = _contact_detail_for_template($rr);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ function content_content(&$a, $update = 0) {
|
|||
);
|
||||
|
||||
$str = '';
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
foreach($r as $rr)
|
||||
$str .= '<' . $rr['id'] . '>';
|
||||
if(strlen($str))
|
||||
|
@ -113,7 +113,7 @@ function content_content(&$a, $update = 0) {
|
|||
intval($group),
|
||||
intval($_SESSION['uid'])
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
if($update)
|
||||
killme();
|
||||
notice( t('No such group') . EOL );
|
||||
|
@ -141,7 +141,7 @@ function content_content(&$a, $update = 0) {
|
|||
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 ) ";
|
||||
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ function content_content(&$a, $update = 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);
|
||||
|
@ -259,7 +259,7 @@ function content_content(&$a, $update = 0) {
|
|||
$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'];
|
||||
|
@ -782,7 +782,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
|
|||
intval($item['uid']),
|
||||
intval($item['id'])
|
||||
);
|
||||
if (count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$ignore = array(
|
||||
'do' => t("ignore thread"),
|
||||
'undo' => t("unignore thread"),
|
||||
|
|
|
@ -14,7 +14,7 @@ function crepair_init(&$a) {
|
|||
intval(local_user()),
|
||||
intval($contact_id)
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
$contact_id = 0;
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ function crepair_post(&$a) {
|
|||
);
|
||||
}
|
||||
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
return;
|
||||
|
||||
$contact = $r[0];
|
||||
|
@ -110,7 +110,7 @@ function crepair_content(&$a) {
|
|||
);
|
||||
}
|
||||
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
notice( t('Contact not found.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -26,12 +26,12 @@ function delegate_content(&$a) {
|
|||
$r = q("select `nickname` from user where uid = %d limit 1",
|
||||
intval($id)
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$r = q("select id from contact where uid = %d and nurl = '%s' limit 1",
|
||||
intval(local_user()),
|
||||
dbesc(normalise_link($a->get_baseurl() . '/profile/' . $r[0]['nickname']))
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
q("insert into manage ( uid, mid ) values ( %d , %d ) ",
|
||||
intval($a->argv[2]),
|
||||
intval(local_user())
|
||||
|
@ -64,7 +64,7 @@ function delegate_content(&$a) {
|
|||
dbesc($a->user['email']),
|
||||
dbesc($a->user['password'])
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$full_managers = $r;
|
||||
|
||||
$delegates = array();
|
||||
|
@ -75,7 +75,7 @@ function delegate_content(&$a) {
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$delegates = $r;
|
||||
|
||||
$uids = array();
|
||||
|
@ -97,14 +97,14 @@ function delegate_content(&$a) {
|
|||
dbesc(NETWORK_DFRN)
|
||||
);
|
||||
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
notice( t('No potential page delegates located.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
$nicknames = array();
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
foreach($r as $rr) {
|
||||
$nicknames[] = "'" . dbesc(basename($rr['nurl'])) . "'";
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ function delegate_content(&$a) {
|
|||
|
||||
$r = q("select `uid`, `username`, `nickname` from user where nickname in ( $nicks )");
|
||||
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
foreach($r as $rr)
|
||||
if(! in_array($rr['uid'],$uids))
|
||||
$potentials[] = $rr;
|
||||
|
|
|
@ -121,7 +121,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
|
|||
intval($uid)
|
||||
);
|
||||
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
logger('Contact not found in DB.');
|
||||
notice( t('Contact not found.') . EOL );
|
||||
notice( t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL );
|
||||
|
@ -423,7 +423,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
|
|||
$r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
|
||||
intval($contact_id)
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$contact = $r[0];
|
||||
else
|
||||
$contact = null;
|
||||
|
@ -443,7 +443,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
|
|||
intval($uid)
|
||||
);
|
||||
|
||||
if((count($r)) && ($r[0]['hide-friends'] == 0) && ($activity) && (! $hidden)) {
|
||||
if((dbm::is_result($r)) && ($r[0]['hide-friends'] == 0) && ($activity) && (! $hidden)) {
|
||||
|
||||
require_once('include/items.php');
|
||||
|
||||
|
@ -553,7 +553,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
|
|||
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1",
|
||||
dbesc($node));
|
||||
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
$message = sprintf(t('No user record found for \'%s\' '), $node);
|
||||
xml_status(3,$message); // failure
|
||||
// NOTREACHED
|
||||
|
@ -629,7 +629,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
|
|||
$r = q("SELECT * FROM `contact` WHERE `dfrn-id` = '%s' LIMIT 1",
|
||||
dbesc($decrypted_dfrn_id)
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$message = t('The ID provided by your system is a duplicate on our system. It should work if you try again.');
|
||||
xml_status(1,$message); // Birthday paradox - duplicate dfrn-id
|
||||
// NOTREACHED
|
||||
|
@ -640,7 +640,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
|
|||
dbesc($dfrn_pubkey),
|
||||
intval($dfrn_record)
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
$message = t('Unable to set your contact credentials on our system.');
|
||||
xml_status(3,$message);
|
||||
}
|
||||
|
@ -661,7 +661,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
|
|||
$r = q("SELECT `photo` FROM `contact` WHERE `id` = %d LIMIT 1",
|
||||
intval($dfrn_record));
|
||||
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$photo = $r[0]['photo'];
|
||||
else
|
||||
$photo = $a->get_baseurl() . '/images/person-175.jpg';
|
||||
|
@ -714,10 +714,10 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
|
|||
intval($dfrn_record)
|
||||
);
|
||||
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$combined = $r[0];
|
||||
|
||||
if((count($r)) && ($r[0]['notify-flags'] & NOTIFY_CONFIRM)) {
|
||||
if((dbm::is_result($r)) && ($r[0]['notify-flags'] & NOTIFY_CONFIRM)) {
|
||||
$mutual = ($new_relation == CONTACT_IS_FRIEND);
|
||||
notification(array(
|
||||
'type' => NOTIFY_CONFIRM,
|
||||
|
@ -742,7 +742,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
|
|||
intval($local_uid)
|
||||
);
|
||||
|
||||
if((count($r)) && ($r[0]['hide-friends'] == 0)) {
|
||||
if((dbm::is_result($r)) && ($r[0]['hide-friends'] == 0)) {
|
||||
|
||||
require_once('include/items.php');
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ function dfrn_notify_post(&$a) {
|
|||
dbesc($dfrn_id),
|
||||
dbesc($challenge)
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
logger('dfrn_notify: could not match challenge to dfrn_id ' . $dfrn_id . ' challenge=' . $challenge);
|
||||
xml_status(3);
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ function dfrn_notify_post(&$a) {
|
|||
dbesc($a->argv[1])
|
||||
);
|
||||
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
logger('dfrn_notify: contact not found for dfrn_id ' . $dfrn_id);
|
||||
xml_status(3);
|
||||
//NOTREACHED
|
||||
|
@ -284,7 +284,7 @@ function dfrn_notify_content(&$a) {
|
|||
dbesc($a->argv[1])
|
||||
);
|
||||
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
$status = 1;
|
||||
|
||||
logger("Remote rino version: ".$rino_remote." for ".$r[0]["url"], LOGGER_DEBUG);
|
||||
|
|
|
@ -79,7 +79,7 @@ function dfrn_poll_init(&$a) {
|
|||
dbesc($a->argv[1])
|
||||
);
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
|
||||
$s = fetch_url($r[0]['poll'] . '?dfrn_id=' . $my_id . '&type=profile-check');
|
||||
|
||||
|
@ -126,7 +126,7 @@ function dfrn_poll_init(&$a) {
|
|||
$r = q("SELECT * FROM `profile_check` WHERE `sec` = '%s' ORDER BY `expire` DESC LIMIT 1",
|
||||
dbesc($sec)
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
xml_status(3, 'No ticket');
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ function dfrn_poll_init(&$a) {
|
|||
q("DELETE FROM `profile_check` WHERE `expire` < " . intval(time()));
|
||||
$r = q("SELECT * FROM `profile_check` WHERE `dfrn_id` = '%s' ORDER BY `expire` DESC",
|
||||
dbesc($dfrn_id));
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
xml_status(1);
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ function dfrn_poll_post(&$a) {
|
|||
$r = q("SELECT * FROM `profile_check` WHERE `sec` = '%s' ORDER BY `expire` DESC LIMIT 1",
|
||||
dbesc($sec)
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
xml_status(3, 'No ticket');
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -284,7 +284,7 @@ function dfrn_poll_post(&$a) {
|
|||
dbesc($challenge)
|
||||
);
|
||||
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
killme();
|
||||
|
||||
$type = $r[0]['type'];
|
||||
|
@ -319,7 +319,7 @@ function dfrn_poll_post(&$a) {
|
|||
$r = q("SELECT * FROM `contact` WHERE `blocked` = 0 AND `pending` = 0 $sql_extra LIMIT 1");
|
||||
|
||||
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
killme();
|
||||
|
||||
$contact = $r[0];
|
||||
|
@ -335,7 +335,7 @@ function dfrn_poll_post(&$a) {
|
|||
$reputation = 0;
|
||||
$text = '';
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$reputation = $r[0]['rating'];
|
||||
$text = $r[0]['reason'];
|
||||
|
||||
|
@ -448,7 +448,7 @@ function dfrn_poll_content(&$a) {
|
|||
dbesc($nickname)
|
||||
);
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
|
||||
$challenge = '';
|
||||
$encrypted_id = '';
|
||||
|
@ -495,7 +495,7 @@ function dfrn_poll_content(&$a) {
|
|||
));
|
||||
}
|
||||
|
||||
$profile = ((count($r) && $r[0]['nickname']) ? $r[0]['nickname'] : $nickname);
|
||||
$profile = ((dbm::is_result($r) && $r[0]['nickname']) ? $r[0]['nickname'] : $nickname);
|
||||
|
||||
switch($destination_url) {
|
||||
case 'profile':
|
||||
|
|
|
@ -91,7 +91,7 @@ function dfrn_request_post(&$a) {
|
|||
dbesc(normalise_link($dfrn_url))
|
||||
);
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
if(strlen($r[0]['dfrn-id'])) {
|
||||
|
||||
/*
|
||||
|
@ -185,7 +185,7 @@ function dfrn_request_post(&$a) {
|
|||
dbesc($dfrn_url),
|
||||
$parms['key'] // this was already escaped
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$def_gid = get_default_group(local_user(), $r[0]["network"]);
|
||||
if(intval($def_gid))
|
||||
group_add_member(local_user(), '', $r[0]['id'], $def_gid);
|
||||
|
@ -273,7 +273,7 @@ function dfrn_request_post(&$a) {
|
|||
dbesc(datetime_convert('UTC','UTC','now - 24 hours')),
|
||||
intval($uid)
|
||||
);
|
||||
if(count($r) > $maxreq) {
|
||||
if (dbm::is_result($r) && count($r) > $maxreq) {
|
||||
notice( sprintf( t('%s has received too many connection requests today.'), $a->profile['name']) . EOL);
|
||||
notice( t('Spam protection measures have been invoked.') . EOL);
|
||||
notice( t('Friends are advised to please try again in 24 hours.') . EOL);
|
||||
|
@ -295,7 +295,7 @@ function dfrn_request_post(&$a) {
|
|||
AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 30 MINUTE ",
|
||||
dbesc(NETWORK_MAIL2)
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
foreach($r as $rr) {
|
||||
if(! $rr['rel']) {
|
||||
q("DELETE FROM `contact` WHERE `id` = %d",
|
||||
|
@ -320,7 +320,7 @@ function dfrn_request_post(&$a) {
|
|||
AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 3 DAY ",
|
||||
dbesc(NETWORK_MAIL2)
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
foreach($r as $rr) {
|
||||
if(! $rr['rel']) {
|
||||
q("DELETE FROM `contact` WHERE `id` = %d",
|
||||
|
@ -370,8 +370,8 @@ function dfrn_request_post(&$a) {
|
|||
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
|
||||
intval($uid)
|
||||
);
|
||||
if(! count($r)) {
|
||||
|
||||
if(! dbm::is_result($r)) {
|
||||
notice( t('This account has not been configured for email. Request failed.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
@ -398,7 +398,7 @@ function dfrn_request_post(&$a) {
|
|||
dbesc($poll),
|
||||
intval($uid)
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$contact_id = $r[0]['id'];
|
||||
|
||||
$def_gid = get_default_group($uid, $r[0]["network"]);
|
||||
|
@ -431,8 +431,8 @@ function dfrn_request_post(&$a) {
|
|||
|
||||
$hash = random_string();
|
||||
|
||||
$r = q("insert into intro ( uid, `contact-id`, knowyou, note, hash, datetime, blocked )
|
||||
values( %d , %d, %d, '%s', '%s', '%s', %d ) ",
|
||||
$r = q("INSERT INTO `intro` ( `uid`, `contact-id`, knowyou, note, hash, datetime, blocked )
|
||||
VALUES( %d , %d, %d, '%s', '%s', '%s', %d ) ",
|
||||
intval($uid),
|
||||
intval($contact_id),
|
||||
((x($_POST,'knowyou') && ($_POST['knowyou'] == 1)) ? 1 : 0),
|
||||
|
@ -473,7 +473,7 @@ function dfrn_request_post(&$a) {
|
|||
dbesc($url)
|
||||
);
|
||||
|
||||
if(count($ret)) {
|
||||
if (dbm::is_result($ret)) {
|
||||
if(strlen($ret[0]['issued-id'])) {
|
||||
notice( t('You have already introduced yourself here.') . EOL );
|
||||
return;
|
||||
|
@ -572,7 +572,7 @@ function dfrn_request_post(&$a) {
|
|||
$parms['url'],
|
||||
$parms['issued-id']
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$contact_record = $r[0];
|
||||
update_contact_avatar($photo, $uid, $contact_record["id"], true);
|
||||
}
|
||||
|
@ -720,7 +720,7 @@ function dfrn_request_content(&$a) {
|
|||
dbesc($_GET['confirm_key'])
|
||||
);
|
||||
|
||||
if(count($intro)) {
|
||||
if (dbm::is_result($intro)) {
|
||||
|
||||
$r = q("SELECT `contact`.*, `user`.* FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
|
||||
WHERE `contact`.`id` = %d LIMIT 1",
|
||||
|
@ -729,7 +729,7 @@ function dfrn_request_content(&$a) {
|
|||
|
||||
$auto_confirm = false;
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
if(($r[0]['page-flags'] != PAGE_NORMAL) && ($r[0]['page-flags'] != PAGE_PRVGROUP))
|
||||
$auto_confirm = true;
|
||||
|
||||
|
@ -742,7 +742,7 @@ function dfrn_request_content(&$a) {
|
|||
'to_name' => $r[0]['username'],
|
||||
'to_email' => $r[0]['email'],
|
||||
'uid' => $r[0]['uid'],
|
||||
'link' => $a->get_baseurl() . '/notifications/intros',
|
||||
'link' => $a->get_baseurl() . '/notifications/intros',
|
||||
'source_name' => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : t('[Name Withheld]')),
|
||||
'source_link' => $r[0]['url'],
|
||||
'source_photo' => $r[0]['photo'],
|
||||
|
@ -754,11 +754,11 @@ function dfrn_request_content(&$a) {
|
|||
if($auto_confirm) {
|
||||
require_once('mod/dfrn_confirm.php');
|
||||
$handsfree = array(
|
||||
'uid' => $r[0]['uid'],
|
||||
'node' => $r[0]['nickname'],
|
||||
'dfrn_id' => $r[0]['issued-id'],
|
||||
'uid' => $r[0]['uid'],
|
||||
'node' => $r[0]['nickname'],
|
||||
'dfrn_id' => $r[0]['issued-id'],
|
||||
'intro_id' => $intro[0]['id'],
|
||||
'duplex' => (($r[0]['page-flags'] == PAGE_FREELOVE) ? 1 : 0),
|
||||
'duplex' => (($r[0]['page-flags'] == PAGE_FREELOVE) ? 1 : 0),
|
||||
'activity' => intval(get_pconfig($r[0]['uid'],'system','post_newfriend'))
|
||||
);
|
||||
dfrn_confirm_post($a,$handsfree);
|
||||
|
@ -842,7 +842,7 @@ function dfrn_request_content(&$a) {
|
|||
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
|
||||
intval($a->profile['uid'])
|
||||
);
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
$mail_disabled = 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ function directory_content(&$a) {
|
|||
$r = $db->q("SELECT COUNT(*) AS `total` FROM `profile`
|
||||
LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
|
||||
WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra ");
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$a->set_pager_total($r[0]['total']);
|
||||
|
||||
$order = " ORDER BY `name` ASC ";
|
||||
|
@ -90,7 +90,7 @@ function directory_content(&$a) {
|
|||
LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
|
||||
LEFT JOIN `contact` ON `contact`.`uid` = `user`.`uid`
|
||||
WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 AND `contact`.`self` $sql_extra $order LIMIT ".$limit);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
|
||||
if(in_array('small', $a->argv))
|
||||
$photo = 'thumb';
|
||||
|
|
|
@ -78,7 +78,7 @@ function editpost_content(&$a) {
|
|||
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
|
||||
intval(local_user())
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$mail_enabled = true;
|
||||
if(intval($r[0]['pubmail']))
|
||||
$pubmail_enabled = true;
|
||||
|
|
|
@ -332,7 +332,7 @@ function events_content(&$a) {
|
|||
|
||||
$links = array();
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$r = sort_by_date($r);
|
||||
foreach($r as $rr) {
|
||||
$j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'j') : datetime_convert('UTC','UTC',$rr['start'],'j'));
|
||||
|
@ -344,9 +344,10 @@ function events_content(&$a) {
|
|||
$events=array();
|
||||
|
||||
// transform the event in a usable array
|
||||
if(count($r))
|
||||
if (dbm::is_result($r)) {
|
||||
$r = sort_by_date($r);
|
||||
$events = process_events($r);
|
||||
}
|
||||
|
||||
if ($a->argv[1] === 'json'){
|
||||
echo json_encode($events); killme();
|
||||
|
@ -403,7 +404,7 @@ function events_content(&$a) {
|
|||
intval($event_id),
|
||||
intval(local_user())
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$orig_event = $r[0];
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ function fbrowser_content($a){
|
|||
);
|
||||
|
||||
function _map_files1($rr){
|
||||
global $a;
|
||||
$a = get_app();
|
||||
$types = Photo::supportedTypes();
|
||||
$ext = $types[$rr['type']];
|
||||
|
||||
|
@ -110,7 +110,8 @@ function fbrowser_content($a){
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
function _map_files2($rr){ global $a;
|
||||
function _map_files2($rr){
|
||||
$a = get_app();
|
||||
list($m1,$m2) = explode("/",$rr['filetype']);
|
||||
$filetype = ( (file_exists("images/icons/$m1.png"))?$m1:"zip");
|
||||
|
||||
|
|
|
@ -6,7 +6,9 @@ require_once("include/crypto.php");
|
|||
require_once("include/diaspora.php");
|
||||
require_once("include/xml.php");
|
||||
|
||||
function fetch_init($a){
|
||||
/// @TODO You always make it like this: function foo(&$a)
|
||||
/// @TODO This means that the value of $a can be changed in anything, remove & and use App as type-hint
|
||||
function fetch_init(&$a){
|
||||
|
||||
if (($a->argc != 3) OR (!in_array($a->argv[1], array("post", "status_message", "reshare")))) {
|
||||
header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
|
||||
|
|
|
@ -24,7 +24,7 @@ function friendica_init(&$a) {
|
|||
$visible_plugins = array();
|
||||
if(is_array($a->plugins) && count($a->plugins)) {
|
||||
$r = q("select * from addon where hidden = 0");
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
foreach($r as $rr)
|
||||
$visible_plugins[] = $rr['name'];
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ function friendica_content(&$a) {
|
|||
$visible_plugins = array();
|
||||
if(is_array($a->plugins) && count($a->plugins)) {
|
||||
$r = q("select * from addon where hidden = 0");
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
foreach($r as $rr)
|
||||
$visible_plugins[] = $rr['name'];
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ function fsuggest_post(&$a) {
|
|||
intval($contact_id),
|
||||
intval(local_user())
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
notice( t('Contact not found.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ function fsuggest_post(&$a) {
|
|||
intval($new_contact),
|
||||
intval(local_user())
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
|
||||
$x = q("INSERT INTO `fsuggest` ( `uid`,`cid`,`name`,`url`,`request`,`photo`,`note`,`created`)
|
||||
VALUES ( %d, %d, '%s','%s','%s','%s','%s','%s')",
|
||||
|
@ -50,7 +50,7 @@ function fsuggest_post(&$a) {
|
|||
dbesc($hash),
|
||||
intval(local_user())
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$fsuggest_id = $r[0]['id'];
|
||||
q("UPDATE `fsuggest` SET `note` = '%s' WHERE `id` = %d AND `uid` = %d",
|
||||
dbesc($note),
|
||||
|
@ -88,7 +88,7 @@ function fsuggest_content(&$a) {
|
|||
intval($contact_id),
|
||||
intval(local_user())
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
notice( t('Contact not found.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ function group_post(&$a) {
|
|||
intval($a->argv[1]),
|
||||
intval(local_user())
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
notice( t('Group not found.') . EOL );
|
||||
goaway($a->get_baseurl() . '/contacts');
|
||||
return; // NOTREACHED
|
||||
|
@ -107,7 +107,7 @@ function group_content(&$a) {
|
|||
intval($a->argv[2]),
|
||||
intval(local_user())
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$result = group_rmv(local_user(),$r[0]['name']);
|
||||
if($result)
|
||||
info( t('Group removed.') . EOL);
|
||||
|
@ -125,7 +125,7 @@ function group_content(&$a) {
|
|||
intval($a->argv[2]),
|
||||
intval(local_user())
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$change = intval($a->argv[2]);
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ function group_content(&$a) {
|
|||
intval($a->argv[1]),
|
||||
intval(local_user())
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
notice( t('Group not found.') . EOL );
|
||||
goaway($a->get_baseurl() . '/contacts');
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ function group_content(&$a) {
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false);
|
||||
foreach($r as $member) {
|
||||
if(! in_array($member['id'],$preselected)) {
|
||||
|
|
|
@ -16,7 +16,7 @@ function ignored_init(&$a) {
|
|||
intval(local_user()),
|
||||
intval($message_id)
|
||||
);
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
killme();
|
||||
|
||||
if(! intval($r[0]['ignored']))
|
||||
|
|
|
@ -165,7 +165,7 @@ function install_content(&$a) {
|
|||
|
||||
if($db && $db->connected) {
|
||||
$r = q("SELECT COUNT(*) as `total` FROM `user`");
|
||||
if($r && count($r) && $r[0]['total']) {
|
||||
if (dbm::is_result($r) && $r[0]['total']) {
|
||||
$tpl = get_markup_template('install.tpl');
|
||||
return replace_macros($tpl, array(
|
||||
'$title' => $install_title,
|
||||
|
@ -548,9 +548,14 @@ function check_imagik(&$checks) {
|
|||
$gif = true;
|
||||
}
|
||||
}
|
||||
check_add($checks, t('ImageMagick PHP extension is installed'), $imagick, false, "");
|
||||
if ($imagick) {
|
||||
check_add($checks, t('ImageMagick supports GIF'), $gif, false, "");
|
||||
if ($imagick == false) {
|
||||
check_add($checks, t('ImageMagick PHP extension is not installed'), $imagick, false, "");
|
||||
}
|
||||
else {
|
||||
check_add($checks, t('ImageMagick PHP extension is installed'), $imagick, false, "");
|
||||
if ($imagick) {
|
||||
check_add($checks, t('ImageMagick supports GIF'), $gif, false, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
10
mod/item.php
10
mod/item.php
|
@ -102,7 +102,7 @@ function item_post(&$a) {
|
|||
}
|
||||
|
||||
// if this isn't the real parent of the conversation, find it
|
||||
if($r !== false && count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$parid = $r[0]['parent'];
|
||||
$parent_uri = $r[0]['uri'];
|
||||
if($r[0]['id'] != $r[0]['parent']) {
|
||||
|
@ -112,7 +112,7 @@ function item_post(&$a) {
|
|||
}
|
||||
}
|
||||
|
||||
if(($r === false) || (! count($r))) {
|
||||
if(! dbm::is_result($r)) {
|
||||
notice( t('Unable to locate original post.') . EOL);
|
||||
if(x($_REQUEST,'return'))
|
||||
goaway($return_path);
|
||||
|
@ -141,7 +141,7 @@ function item_post(&$a) {
|
|||
|
||||
$r = q("SELECT * FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1",
|
||||
dbesc(normalise_link($thrparent[0]["author-link"])));
|
||||
if (count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$parent_contact = $r[0];
|
||||
$parent_contact["thumb"] = $parent_contact["photo"];
|
||||
$parent_contact["micro"] = $parent_contact["photo"];
|
||||
|
@ -330,7 +330,7 @@ function item_post(&$a) {
|
|||
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
|
||||
intval(local_user())
|
||||
);
|
||||
if(count($r) && intval($r[0]['pubmail']))
|
||||
if (dbm::is_result($r) && intval($r[0]['pubmail']))
|
||||
$pubmail_enabled = true;
|
||||
}
|
||||
}
|
||||
|
@ -464,7 +464,7 @@ function item_post(&$a) {
|
|||
intval($profile_uid)
|
||||
);
|
||||
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
continue;
|
||||
|
||||
$r = q("UPDATE `photo` SET `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s'
|
||||
|
|
|
@ -21,7 +21,7 @@ function lockview_content(&$a) {
|
|||
dbesc($type),
|
||||
intval($item_id)
|
||||
);
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
killme();
|
||||
$item = $r[0];
|
||||
|
||||
|
@ -52,7 +52,7 @@ function lockview_content(&$a) {
|
|||
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
|
||||
dbesc(implode(', ', $allowed_groups))
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
foreach($r as $rr)
|
||||
$l[] = '<b>' . $rr['name'] . '</b>';
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ function lockview_content(&$a) {
|
|||
$r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
|
||||
dbesc(implode(', ',$allowed_users))
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
foreach($r as $rr)
|
||||
$l[] = $rr['name'];
|
||||
|
||||
|
@ -70,7 +70,7 @@ function lockview_content(&$a) {
|
|||
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
|
||||
dbesc(implode(', ', $deny_groups))
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
foreach($r as $rr)
|
||||
$l[] = '<b><strike>' . $rr['name'] . '</strike></b>';
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ function lockview_content(&$a) {
|
|||
$r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
|
||||
dbesc(implode(', ',$deny_users))
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
foreach($r as $rr)
|
||||
$l[] = '<strike>' . $rr['name'] . '</strike>';
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ function lostpass_post(&$a) {
|
|||
dbesc($loginame)
|
||||
);
|
||||
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
notice( t('No valid account found.') . EOL);
|
||||
goaway(z_root());
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ function lostpass_content(&$a) {
|
|||
$r = q("SELECT * FROM `user` WHERE `pwdreset` = '%s' LIMIT 1",
|
||||
dbesc($hash)
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
$o = t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed.");
|
||||
return $o;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ function manage_post(&$a) {
|
|||
$r = q("select * from user where uid = %d limit 1",
|
||||
intval($_SESSION['submanage'])
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$uid = intval($r[0]['uid']);
|
||||
$orig_record = $r[0];
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ function manage_post(&$a) {
|
|||
);
|
||||
}
|
||||
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
return;
|
||||
|
||||
unset($_SESSION['authenticated']);
|
||||
|
|
|
@ -27,7 +27,7 @@ function match_content(&$a) {
|
|||
$r = q("SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
|
||||
intval(local_user())
|
||||
);
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
return;
|
||||
if(! $r[0]['pub_keywords'] && (! $r[0]['prv_keywords'])) {
|
||||
notice( t('No keywords to match. Please add keywords to your default profile.') . EOL);
|
||||
|
|
|
@ -242,7 +242,7 @@ function message_content(&$a) {
|
|||
intval($a->argv[2]),
|
||||
intval(local_user())
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$parent = $r[0]['parent-uri'];
|
||||
$convid = $r[0]['convid'];
|
||||
|
||||
|
@ -309,19 +309,21 @@ function message_content(&$a) {
|
|||
intval(local_user()),
|
||||
intval($a->argv[2])
|
||||
);
|
||||
if(!$r) {
|
||||
if (!dbm::is_result($r)) {
|
||||
$r = q("SELECT `name`, `url`, `id` FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' LIMIT 1",
|
||||
intval(local_user()),
|
||||
dbesc(normalise_link(base64_decode($a->argv[2])))
|
||||
);
|
||||
}
|
||||
if(!$r) {
|
||||
|
||||
if (!dbm::is_result($r)) {
|
||||
$r = q("SELECT `name`, `url`, `id` FROM `contact` WHERE `uid` = %d AND `addr` = '%s' LIMIT 1",
|
||||
intval(local_user()),
|
||||
dbesc(base64_decode($a->argv[2]))
|
||||
);
|
||||
}
|
||||
if(count($r)) {
|
||||
|
||||
if (dbm::is_result($r)) {
|
||||
$prename = $r[0]['name'];
|
||||
$preurl = $r[0]['url'];
|
||||
$preid = $r[0]['id'];
|
||||
|
@ -405,7 +407,7 @@ function message_content(&$a) {
|
|||
intval(local_user()),
|
||||
intval($a->argv[1])
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$contact_id = $r[0]['contact-id'];
|
||||
$convid = $r[0]['convid'];
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ function modexp_init(&$a) {
|
|||
dbesc($nick)
|
||||
);
|
||||
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
killme();
|
||||
|
||||
$lines = explode("\n",$r[0]['spubkey']);
|
||||
|
|
|
@ -36,7 +36,7 @@ function mood_init(&$a) {
|
|||
intval($parent),
|
||||
intval($uid)
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$parent_uri = $r[0]['uri'];
|
||||
$private = $r[0]['private'];
|
||||
$allow_cid = $r[0]['allow_cid'];
|
||||
|
|
|
@ -13,17 +13,19 @@ function msearch_post(&$a) {
|
|||
$r = q("SELECT COUNT(*) AS `total` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 AND `user`.`hidewall` = 0 AND MATCH `pub_keywords` AGAINST ('%s') ",
|
||||
dbesc($search)
|
||||
);
|
||||
if(count($r))
|
||||
|
||||
if (dbm::is_result($r))
|
||||
$total = $r[0]['total'];
|
||||
|
||||
$results = array();
|
||||
|
||||
$r = q("SELECT `pub_keywords`, `username`, `nickname`, `user`.`uid` FROM `user` LEFT JOIN `profile` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 AND `user`.`hidewall` = 0 AND MATCH `pub_keywords` AGAINST ('%s') LIMIT %d , %d ",
|
||||
dbesc($search),
|
||||
intval($startrec),
|
||||
intval($perpage)
|
||||
);
|
||||
|
||||
$results = array();
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
foreach($r as $rr)
|
||||
$results[] = array(
|
||||
'name' => $rr['name'],
|
||||
|
@ -39,4 +41,4 @@ function msearch_post(&$a) {
|
|||
|
||||
killme();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ function network_init(&$a) {
|
|||
intval(local_user()),
|
||||
dbesc($search)
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
q("INSERT INTO `search` ( `uid`,`term` ) VALUES ( %d, '%s') ",
|
||||
intval(local_user()),
|
||||
dbesc($search)
|
||||
|
@ -182,7 +182,7 @@ function saved_searches($search) {
|
|||
|
||||
$saved = array();
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
foreach($r as $rr) {
|
||||
$saved[] = array(
|
||||
'id' => $rr['id'],
|
||||
|
@ -381,7 +381,7 @@ function network_content(&$a, $update = 0) {
|
|||
);
|
||||
|
||||
$str = '';
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
foreach($r as $rr)
|
||||
$str .= '<' . $rr['id'] . '>';
|
||||
if(strlen($str))
|
||||
|
@ -463,7 +463,7 @@ function network_content(&$a, $update = 0) {
|
|||
intval($group),
|
||||
intval($_SESSION['uid'])
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
if($update)
|
||||
killme();
|
||||
notice( t('No such group') . EOL );
|
||||
|
@ -507,7 +507,7 @@ function network_content(&$a, $update = 0) {
|
|||
AND (NOT `blocked` OR `pending`) LIMIT 1",
|
||||
intval($cid)
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$sql_extra = " AND ".$sql_table.".`contact-id` = ".intval($cid);
|
||||
|
||||
$entries[0] = array(
|
||||
|
@ -609,7 +609,7 @@ function network_content(&$a, $update = 0) {
|
|||
intval($_SESSION['uid'])
|
||||
);
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$a->set_pager_total($r[0]['total']);
|
||||
}
|
||||
}
|
||||
|
@ -705,7 +705,7 @@ function network_content(&$a, $update = 0) {
|
|||
$parents_str = '';
|
||||
$date_offset = "";
|
||||
|
||||
if(dbm::is_result($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
foreach($r as $rr)
|
||||
if(! in_array($rr['item_id'],$parents_arr))
|
||||
$parents_arr[] = $rr['item_id'];
|
||||
|
@ -729,7 +729,9 @@ function network_content(&$a, $update = 0) {
|
|||
intval($parents),
|
||||
intval($max_comments + 1)
|
||||
);
|
||||
$items = array_merge($items, $thread_items);
|
||||
|
||||
if (dbm::is_result($thread_items))
|
||||
$items = array_merge($items, $thread_items);
|
||||
}
|
||||
$items = conv_sort($items,$ordering);
|
||||
} else {
|
||||
|
|
|
@ -28,11 +28,11 @@ function nogroup_content(&$a) {
|
|||
|
||||
require_once('include/Contact.php');
|
||||
$r = contacts_not_grouped(local_user());
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$a->set_pager_total($r[0]['total']);
|
||||
}
|
||||
$r = contacts_not_grouped(local_user(),$a->pager['start'],$a->pager['itemspage']);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
foreach($r as $rr) {
|
||||
|
||||
$contact_details = get_contact_details_by_url($rr['url'], local_user(), $rr);
|
||||
|
|
|
@ -43,7 +43,7 @@ function noscrape_init(&$a) {
|
|||
if(is_array($a->profile) AND !$a->profile['hide-friends']) {
|
||||
$r = q("SELECT `gcontact`.`updated` FROM `contact` INNER JOIN `gcontact` WHERE `gcontact`.`nurl` = `contact`.`nurl` AND `self` AND `uid` = %d LIMIT 1",
|
||||
intval($a->profile['uid']));
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$json_info["updated"] = date("c", strtotime($r[0]['updated']));
|
||||
|
||||
$r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0 AND `archive` = 0
|
||||
|
@ -53,7 +53,7 @@ function noscrape_init(&$a) {
|
|||
dbesc(NETWORK_DIASPORA),
|
||||
dbesc(NETWORK_OSTATUS)
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$json_info["contacts"] = intval($r[0]['total']);
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ function notes_content(&$a,$update = false) {
|
|||
|
||||
);
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$a->set_pager_total($r[0]['total']);
|
||||
$a->set_pager_itemspage(40);
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ function notes_content(&$a,$update = false) {
|
|||
$parents_arr = array();
|
||||
$parents_str = '';
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
foreach($r as $rr)
|
||||
$parents_arr[] = $rr['item_id'];
|
||||
$parents_str = implode(', ', $parents_arr);
|
||||
|
@ -116,7 +116,7 @@ function notes_content(&$a,$update = false) {
|
|||
dbesc($parents_str)
|
||||
);
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$items = conv_sort($r,"`commented`");
|
||||
|
||||
$o .= conversation($a,$items,'notes',$update);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
$r = q("SELECT user.nickname FROM user LEFT JOIN item ON item.uid=user.uid WHERE item.id=%d",
|
||||
intval($id)
|
||||
);
|
||||
if (count($r)){
|
||||
if (dbm::is_result($r)){
|
||||
$nick = $r[0]['nickname'];
|
||||
$url = $a->get_baseurl()."/display/$nick/$id";
|
||||
goaway($url);
|
||||
|
|
|
@ -27,7 +27,7 @@ function notifications_post(&$a) {
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$intro_id = $r[0]['id'];
|
||||
$contact_id = $r[0]['contact-id'];
|
||||
}
|
||||
|
@ -305,7 +305,6 @@ function notifications_content(&$a) {
|
|||
$notif_nocontent = sprintf( t('No more %s notifications.'), $notifs['ident']);
|
||||
}
|
||||
|
||||
|
||||
$o .= replace_macros($notif_tpl, array(
|
||||
'$notif_header' => $notif_header,
|
||||
'$tabs' => $tabs,
|
||||
|
|
|
@ -47,7 +47,7 @@ function notify_content(&$a) {
|
|||
require_once('include/bbcode.php');
|
||||
|
||||
$r = $nm->getAll(array('seen'=>0));
|
||||
if ($r!==false && count($r) > 0) {
|
||||
if (dbm::is_result($r) > 0) {
|
||||
foreach ($r as $it) {
|
||||
$notif_content .= replace_macros($not_tpl,array(
|
||||
'$item_link' => $a->get_baseurl(true).'/notify/view/'. $it['id'],
|
||||
|
|
|
@ -38,7 +38,7 @@ function openid_content(&$a) {
|
|||
dbesc($authid), dbesc(normalise_openid($authid))
|
||||
);
|
||||
|
||||
if($r && count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
|
||||
// successful OpenID login
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ function p_init($a){
|
|||
$r = q("SELECT `user`.`prvkey`, `contact`.`addr`, `user`.`nickname`, `contact`.`nick` FROM `user`
|
||||
INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid`
|
||||
WHERE `user`.`uid` = %d", intval($item[0]["uid"]));
|
||||
if (!$r) {
|
||||
if (!dbm::is_result($r)) {
|
||||
header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
|
||||
killme();
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ function photo_init(&$a) {
|
|||
intval($resolution),
|
||||
intval($uid)
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$data = $r[0]['data'];
|
||||
$mimetype = $r[0]['type'];
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ function photo_init(&$a) {
|
|||
dbesc($photo),
|
||||
intval($resolution)
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
|
||||
$sql_extra = permissions_sql($r[0]['uid']);
|
||||
|
||||
|
@ -117,9 +117,9 @@ function photo_init(&$a) {
|
|||
intval($resolution)
|
||||
);
|
||||
|
||||
$public = ($r[0]['allow_cid'] == '') AND ($r[0]['allow_gid'] == '') AND ($r[0]['deny_cid'] == '') AND ($r[0]['deny_gid'] == '');
|
||||
$public = (dbm::is_result($r)) AND ($r[0]['allow_cid'] == '') AND ($r[0]['allow_gid'] == '') AND ($r[0]['deny_cid'] == '') AND ($r[0]['deny_gid'] == '');
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$resolution = $r[0]['scale'];
|
||||
$data = $r[0]['data'];
|
||||
$mimetype = $r[0]['type'];
|
||||
|
|
|
@ -165,7 +165,7 @@ function photos_post(&$a) {
|
|||
intval($page_owner_uid)
|
||||
);
|
||||
|
||||
if (! count($r)) {
|
||||
if (! dbm::is_result($r)) {
|
||||
notice( t('Contact information unavailable') . EOL);
|
||||
logger('photos_post: unable to locate contact record for page owner. uid=' . $page_owner_uid);
|
||||
killme();
|
||||
|
@ -186,7 +186,7 @@ function photos_post(&$a) {
|
|||
dbesc($album),
|
||||
intval($page_owner_uid)
|
||||
);
|
||||
if (! count($r)) {
|
||||
if (! dbm::is_result($r)) {
|
||||
notice( t('Album not found.') . EOL);
|
||||
goaway($_SESSION['photo_return']);
|
||||
return; // NOTREACHED
|
||||
|
@ -255,7 +255,7 @@ function photos_post(&$a) {
|
|||
);
|
||||
}
|
||||
if (dbm::is_result($r)) {
|
||||
foreach ($r as $rr) {
|
||||
foreach($r as $rr) {
|
||||
$res[] = "'" . dbesc($rr['rid']) . "'" ;
|
||||
}
|
||||
} else {
|
||||
|
@ -277,7 +277,7 @@ function photos_post(&$a) {
|
|||
intval($page_owner_uid)
|
||||
);
|
||||
if (dbm::is_result($r)) {
|
||||
foreach ($r as $rr) {
|
||||
foreach($r as $rr) {
|
||||
q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
|
||||
dbesc(datetime_convert()),
|
||||
dbesc($rr['parent-uri']),
|
||||
|
@ -681,7 +681,7 @@ function photos_post(&$a) {
|
|||
$arr['visible'] = 1;
|
||||
$arr['verb'] = ACTIVITY_TAG;
|
||||
$arr['object-type'] = ACTIVITY_OBJ_PERSON;
|
||||
$arr['target-type'] = ACTIVITY_OBJ_PHOTO;
|
||||
$arr['target-type'] = ACTIVITY_OBJ_IMAGE;
|
||||
$arr['tag'] = $tagged[4];
|
||||
$arr['inform'] = $tagged[2];
|
||||
$arr['origin'] = 1;
|
||||
|
@ -694,7 +694,7 @@ function photos_post(&$a) {
|
|||
$arr['object'] .= xmlify('<link rel="photo" type="'.$p[0]['type'].'" href="' . $tagged[3]['photo'] . '" />' . "\n");
|
||||
$arr['object'] .= '</link></object>' . "\n";
|
||||
|
||||
$arr['target'] = '<target><type>' . ACTIVITY_OBJ_PHOTO . '</type><title>' . $p[0]['desc'] . '</title><id>'
|
||||
$arr['target'] = '<target><type>' . ACTIVITY_OBJ_IMAGE . '</type><title>' . $p[0]['desc'] . '</title><id>'
|
||||
. $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . '</id>';
|
||||
$arr['target'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . '" />' . "\n" . '<link rel="preview" type="'.$p[0]['type'].'" href="' . $a->get_baseurl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.' . $ext . '" />') . '</link></target>';
|
||||
|
||||
|
@ -748,7 +748,7 @@ function photos_post(&$a) {
|
|||
dbesc($album),
|
||||
intval($page_owner_uid)
|
||||
);
|
||||
if ((! count($r)) || ($album == t('Profile Photos')))
|
||||
if ((! dbm::is_result($r)) || ($album == t('Profile Photos')))
|
||||
$visible = 1;
|
||||
else
|
||||
$visible = 0;
|
||||
|
@ -1573,7 +1573,7 @@ function photos_content(&$a) {
|
|||
}
|
||||
|
||||
$comments = '';
|
||||
if (! count($r)) {
|
||||
if (! dbm::is_result($r)) {
|
||||
if ($can_post || can_write_wall($a,$owner_uid)) {
|
||||
if ($link_item['last-child']) {
|
||||
$comments .= replace_macros($cmnt_tpl,array(
|
||||
|
@ -1809,8 +1809,6 @@ function photos_content(&$a) {
|
|||
intval($a->pager['itemspage'])
|
||||
);
|
||||
|
||||
|
||||
|
||||
$photos = array();
|
||||
if (dbm::is_result($r)) {
|
||||
$twist = 'rotright';
|
||||
|
|
|
@ -175,7 +175,7 @@ function ping_init(App $a)
|
|||
);
|
||||
|
||||
$intro_count = count($intros1) + count($intros2);
|
||||
$intros = $intros1+$intros2;
|
||||
$intros = $intros1 + $intros2;
|
||||
|
||||
$myurl = $a->get_baseurl() . '/profile/' . $a->user['nickname'] ;
|
||||
$mails = qu("SELECT `id`, `from-name`, `from-url`, `from-photo`, `created` FROM `mail`
|
||||
|
@ -189,7 +189,8 @@ function ping_init(App $a)
|
|||
$regs = qu("SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created`, COUNT(*) AS `total`
|
||||
FROM `contact` RIGHT JOIN `register` ON `register`.`uid` = `contact`.`uid`
|
||||
WHERE `contact`.`self` = 1");
|
||||
if ($regs) {
|
||||
|
||||
if (dbm::is_result($regs)) {
|
||||
$register_count = $regs[0]['total'];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ function poco_init(&$a) {
|
|||
where `user`.`nickname` = '%s' and `profile`.`is-default` = 1 limit 1",
|
||||
dbesc($user)
|
||||
);
|
||||
if(! count($r) || $r[0]['hidewall'] || $r[0]['hide-friends'])
|
||||
if(! dbm::is_result($r) || $r[0]['hidewall'] || $r[0]['hide-friends'])
|
||||
http_status_exit(404);
|
||||
|
||||
$user = $r[0];
|
||||
|
@ -83,7 +83,7 @@ function poco_init(&$a) {
|
|||
dbesc(NETWORK_STATUSNET)
|
||||
);
|
||||
}
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$totalResults = intval($r[0]['total']);
|
||||
else
|
||||
$totalResults = 0;
|
||||
|
@ -173,7 +173,7 @@ function poco_init(&$a) {
|
|||
}
|
||||
|
||||
if(is_array($r)) {
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
foreach($r as $rr) {
|
||||
if (!isset($rr['generation'])) {
|
||||
if ($global)
|
||||
|
|
|
@ -52,7 +52,7 @@ function poke_init(&$a) {
|
|||
intval($uid)
|
||||
);
|
||||
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
logger('poke: no contact ' . $contact_id);
|
||||
return;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ function poke_init(&$a) {
|
|||
intval($parent),
|
||||
intval($uid)
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$parent_uri = $r[0]['uri'];
|
||||
$private = $r[0]['private'];
|
||||
$allow_cid = $r[0]['allow_cid'];
|
||||
|
@ -159,7 +159,7 @@ function poke_content(&$a) {
|
|||
intval($_GET['c']),
|
||||
intval(local_user())
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$name = $r[0]['name'];
|
||||
$id = $r[0]['id'];
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ function post_post(&$a) {
|
|||
AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
|
||||
dbesc($nickname)
|
||||
);
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
http_status_exit(500);
|
||||
|
||||
$importer = $r[0];
|
||||
|
|
|
@ -13,7 +13,7 @@ function profile_init(&$a) {
|
|||
$which = htmlspecialchars($a->argv[1]);
|
||||
else {
|
||||
$r = q("select nickname from user where blocked = 0 and account_expired = 0 and account_removed = 0 and verified = 1 order by rand() limit 1");
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
goaway($a->get_baseurl() . '/profile/' . $r[0]['nickname']);
|
||||
}
|
||||
else {
|
||||
|
@ -136,7 +136,7 @@ function profile_content(&$a, $update = 0) {
|
|||
intval($contact_id),
|
||||
intval($a->profile['profile_uid'])
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$contact = $r[0];
|
||||
$remote_contact = true;
|
||||
}
|
||||
|
@ -256,21 +256,21 @@ function profile_content(&$a, $update = 0) {
|
|||
AND `thread`.`wall` = 1
|
||||
$sql_extra $sql_extra2 ",
|
||||
intval($a->profile['profile_uid'])
|
||||
);
|
||||
);
|
||||
|
||||
if(count($r)) {
|
||||
$a->set_pager_total($r[0]['total']);
|
||||
if (dbm::is_result($r)) {
|
||||
$a->set_pager_total($r[0]['total']);
|
||||
}
|
||||
}
|
||||
|
||||
// check if we serve a mobile device and get the user settings
|
||||
// accordingly
|
||||
if ($a->is_mobile) {
|
||||
$itemspage_network = get_pconfig(local_user(),'system','itemspage_mobile_network');
|
||||
$itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 10);
|
||||
$itemspage_network = get_pconfig(local_user(),'system','itemspage_mobile_network');
|
||||
$itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 10);
|
||||
} else {
|
||||
$itemspage_network = get_pconfig(local_user(),'system','itemspage_network');
|
||||
$itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 20);
|
||||
$itemspage_network = get_pconfig(local_user(),'system','itemspage_network');
|
||||
$itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 20);
|
||||
}
|
||||
// now that we have the user settings, see if the theme forces
|
||||
// a maximum item number which is lower then the user choice
|
||||
|
|
|
@ -32,7 +32,7 @@ function profile_photo_post(&$a) {
|
|||
intval($_REQUEST['profile']),
|
||||
intval(local_user())
|
||||
);
|
||||
if(count($r) && (! intval($r[0]['is-default'])))
|
||||
if (dbm::is_result($r) && (! intval($r[0]['is-default'])))
|
||||
$is_default_profile = 0;
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ function profile_photo_post(&$a) {
|
|||
dbesc(local_user()),
|
||||
intval($scale));
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
|
||||
$base_image = $r[0];
|
||||
|
||||
|
@ -195,7 +195,7 @@ function profile_photo_content(&$a) {
|
|||
intval(local_user()),
|
||||
dbesc($resource_id)
|
||||
);
|
||||
if (!count($r)){
|
||||
if (!dbm::is_result($r)){
|
||||
notice( t('Permission denied.') . EOL );
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ function profiles_init(&$a) {
|
|||
intval($a->argv[2]),
|
||||
intval(local_user())
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
notice( t('Profile not found.') . EOL);
|
||||
goaway('profiles');
|
||||
return; // NOTREACHED
|
||||
|
@ -130,7 +130,7 @@ function profiles_init(&$a) {
|
|||
intval($a->argv[1]),
|
||||
intval(local_user())
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
notice( t('Profile not found.') . EOL);
|
||||
killme();
|
||||
return;
|
||||
|
@ -286,7 +286,7 @@ function profiles_post(&$a) {
|
|||
intval(local_user())
|
||||
);
|
||||
}
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$prf = $r[0]['url'];
|
||||
$newname = $r[0]['name'];
|
||||
}
|
||||
|
@ -613,7 +613,7 @@ function profiles_content(&$a) {
|
|||
intval($a->argv[1]),
|
||||
intval(local_user())
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
notice( t('Profile not found.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
@ -767,7 +767,7 @@ function profiles_content(&$a) {
|
|||
"SELECT * FROM `profile` WHERE `uid` = %d AND `is-default`=1",
|
||||
local_user()
|
||||
);
|
||||
if(count($r)){
|
||||
if (dbm::is_result($r)){
|
||||
//Go to the default profile.
|
||||
goaway('profiles/'.$r[0]['id']);
|
||||
}
|
||||
|
@ -775,7 +775,7 @@ function profiles_content(&$a) {
|
|||
|
||||
$r = q("SELECT * FROM `profile` WHERE `uid` = %d",
|
||||
local_user());
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
|
||||
$tpl = get_markup_template('profile_entry.tpl');
|
||||
foreach($r as $rr) {
|
||||
|
|
|
@ -42,7 +42,7 @@ function profperm_content(&$a) {
|
|||
intval($a->argv[2]),
|
||||
intval(local_user())
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$change = intval($a->argv[2]);
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ function profperm_content(&$a) {
|
|||
intval($a->argv[1]),
|
||||
intval(local_user())
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
notice( t('Invalid profile identifier.') . EOL );
|
||||
return;
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ function profperm_content(&$a) {
|
|||
);
|
||||
|
||||
$ingroup = array();
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
foreach($r as $member)
|
||||
$ingroup[] = $member['id'];
|
||||
|
||||
|
@ -94,7 +94,7 @@ function profperm_content(&$a) {
|
|||
$members = $r;
|
||||
|
||||
$ingroup = array();
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
foreach($r as $member)
|
||||
$ingroup[] = $member['id'];
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ function profperm_content(&$a) {
|
|||
dbesc(NETWORK_DFRN)
|
||||
);
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false);
|
||||
foreach($r as $member) {
|
||||
if(! in_array($member['id'],$ingroup)) {
|
||||
|
|
|
@ -136,7 +136,7 @@ function proxy_init() {
|
|||
|
||||
if (!$direct_cache AND ($cachefile == "")) {
|
||||
$r = qu("SELECT * FROM `photo` WHERE `resource-id` = '%s' LIMIT 1", $urlhash);
|
||||
if (count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$img_str = $r[0]['data'];
|
||||
$mime = $r[0]["desc"];
|
||||
if ($mime == "") $mime = "image/jpeg";
|
||||
|
@ -144,7 +144,7 @@ function proxy_init() {
|
|||
} else
|
||||
$r = array();
|
||||
|
||||
if (!count($r)) {
|
||||
if (!dbm::is_result($r)) {
|
||||
// It shouldn't happen but it does - spaces in URL
|
||||
$_REQUEST['url'] = str_replace(" ", "+", $_REQUEST['url']);
|
||||
$redirects = 0;
|
||||
|
@ -281,14 +281,14 @@ function proxy_url($url, $writemode = false, $size = '') {
|
|||
|
||||
$longpath .= '/' . strtr(base64_encode($url), '+/', '-_');
|
||||
|
||||
// Checking for valid extensions. Only add them if they are safe
|
||||
$pos = strrpos($url, '.');
|
||||
if ($pos) {
|
||||
$extension = strtolower(substr($url, $pos + 1));
|
||||
$pos = strpos($extension, '?');
|
||||
if ($pos) {
|
||||
$extension = substr($extension, 0, $pos);
|
||||
}
|
||||
// Extract the URL extension, disregarding GET parameters starting with ?
|
||||
$question_mark_pos = strpos($url, '?');
|
||||
if ($question_mark_pos === false) {
|
||||
$question_mark_pos = strlen($url);
|
||||
}
|
||||
$dot_pos = strrpos($url, '.', $question_mark_pos - strlen($url));
|
||||
if ($dot_pos !== false) {
|
||||
$extension = strtolower(substr($url, $dot_pos + 1, $question_mark_pos - ($dot_pos + 1)));
|
||||
}
|
||||
|
||||
$extensions = array('jpg', 'jpeg', 'gif', 'png');
|
||||
|
|
|
@ -47,7 +47,7 @@ function pubsub_init(&$a) {
|
|||
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
|
||||
dbesc($nick)
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
logger('pubsub: local account not found: ' . $nick);
|
||||
hub_return(false, '');
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ function pubsub_init(&$a) {
|
|||
intval($contact_id),
|
||||
intval($owner['uid'])
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
logger('pubsub: contact '.$contact_id.' not found.');
|
||||
hub_return(false, '');
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ function pubsub_post(&$a) {
|
|||
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
|
||||
dbesc($nick)
|
||||
);
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
hub_post_return();
|
||||
|
||||
$importer = $r[0];
|
||||
|
@ -131,7 +131,7 @@ function pubsub_post(&$a) {
|
|||
dbesc(NETWORK_FEED)
|
||||
);
|
||||
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
logger('pubsub: no contact record for "'.$nick.' ('.$contact_id.')" - ignored. '.$xml);
|
||||
hub_post_return();
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ function pubsubhubbub_init(&$a) {
|
|||
" AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
|
||||
dbesc($nick));
|
||||
|
||||
if(!count($r)) {
|
||||
if (!dbm::is_result($r)) {
|
||||
logger('pubsubhubbub: local account not found: ' . $nick);
|
||||
http_status_exit(404);
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ function pubsubhubbub_init(&$a) {
|
|||
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND NOT `blocked`".
|
||||
" AND NOT `pending` AND `self` LIMIT 1",
|
||||
intval($owner['uid']));
|
||||
if(!count($r)) {
|
||||
if (!dbm::is_result($r)) {
|
||||
logger('pubsubhubbub: contact not found.');
|
||||
http_status_exit(404);
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ function pubsubhubbub_init(&$a) {
|
|||
|
||||
// if we are just updating an old subscription, keep the
|
||||
// old values for push and last_update
|
||||
if (count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$last_update = $r[0]['last_update'];
|
||||
$push_flag = $r[0]['push'];
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ function qsearch_init(&$a) {
|
|||
intval($limit)
|
||||
);
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
|
||||
foreach($r as $rr)
|
||||
$results[] = array( 0, (int) $rr['id'], $rr['name'], '', '');
|
||||
|
@ -38,7 +38,7 @@ function qsearch_init(&$a) {
|
|||
);
|
||||
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
|
||||
foreach($r as $rr)
|
||||
$results[] = array( (int) $rr['id'], 0, $rr['name'],$rr['url'],$rr['photo']);
|
||||
|
|
|
@ -34,7 +34,7 @@ function receive_post(&$a) {
|
|||
$r = q("SELECT * FROM `user` WHERE `guid` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
|
||||
dbesc($guid)
|
||||
);
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
http_status_exit(500);
|
||||
|
||||
$importer = $r[0];
|
||||
|
|
|
@ -18,7 +18,7 @@ function redir_init(&$a) {
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
if((! count($r)) || ($r[0]['network'] !== NETWORK_DFRN))
|
||||
if((! dbm::is_result($r)) || ($r[0]['network'] !== NETWORK_DFRN))
|
||||
goaway(z_root());
|
||||
|
||||
$cid = $r[0]['id'];
|
||||
|
@ -31,7 +31,7 @@ function redir_init(&$a) {
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
if((! count($r)) || ($r[0]['network'] !== NETWORK_DFRN))
|
||||
if((! dbm::is_result($r)) || ($r[0]['network'] !== NETWORK_DFRN))
|
||||
goaway(z_root());
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ function user_allow($hash) {
|
|||
$r = q("SELECT * FROM `profile` WHERE `uid` = %d AND `is-default` = 1",
|
||||
intval($user[0]['uid'])
|
||||
);
|
||||
if(count($r) && $r[0]['net-publish']) {
|
||||
if (dbm::is_result($r) && $r[0]['net-publish']) {
|
||||
$url = $a->get_baseurl() . '/profile/' . $user[0]['nickname'];
|
||||
if($url && strlen(get_config('system','directory')))
|
||||
proc_run(PRIORITY_LOW, "include/directory.php", $url);
|
||||
|
|
|
@ -31,7 +31,7 @@ function salmon_post(&$a) {
|
|||
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
|
||||
dbesc($nick)
|
||||
);
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
http_status_exit(500);
|
||||
|
||||
$importer = $r[0];
|
||||
|
@ -150,7 +150,7 @@ function salmon_post(&$a) {
|
|||
dbesc(normalise_link($author_link)),
|
||||
intval($importer['uid'])
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
logger('mod-salmon: Author unknown to us.');
|
||||
if(get_pconfig($importer['uid'],'system','ostatus_autofriend')) {
|
||||
$result = new_contact($importer['uid'],$author_link);
|
||||
|
@ -169,8 +169,8 @@ function salmon_post(&$a) {
|
|||
// Have we ignored the person?
|
||||
// If so we can not accept this post.
|
||||
|
||||
//if((count($r)) && (($r[0]['readonly']) || ($r[0]['rel'] == CONTACT_IS_FOLLOWER) || ($r[0]['blocked']))) {
|
||||
if(count($r) && $r[0]['blocked']) {
|
||||
//if((dbm::is_result($r)) && (($r[0]['readonly']) || ($r[0]['rel'] == CONTACT_IS_FOLLOWER) || ($r[0]['blocked']))) {
|
||||
if (dbm::is_result($r) && $r[0]['blocked']) {
|
||||
logger('mod-salmon: Ignoring this author.');
|
||||
http_status_exit(202);
|
||||
// NOTREACHED
|
||||
|
@ -179,7 +179,7 @@ function salmon_post(&$a) {
|
|||
// Placeholder for hub discovery.
|
||||
$hub = '';
|
||||
|
||||
$contact_rec = ((count($r)) ? $r[0] : null);
|
||||
$contact_rec = ((dbm::is_result($r)) ? $r[0] : null);
|
||||
|
||||
ostatus::import($data,$importer,$contact_rec, $hub);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ function search_saved_searches() {
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$saved = array();
|
||||
foreach($r as $rr) {
|
||||
$saved[] = array(
|
||||
|
@ -53,7 +53,7 @@ function search_init(&$a) {
|
|||
intval(local_user()),
|
||||
dbesc($search)
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
q("INSERT INTO `search` (`uid`,`term`) VALUES ( %d, '%s')",
|
||||
intval(local_user()),
|
||||
dbesc($search)
|
||||
|
@ -209,7 +209,6 @@ function search_content(&$a) {
|
|||
$sql_extra = sprintf(" AND `item`.`body` REGEXP '%s' ", dbesc(protect_sprintf(preg_quote($search))));
|
||||
}
|
||||
|
||||
|
||||
$r = q("SELECT %s
|
||||
FROM `item` %s
|
||||
WHERE %s AND (`item`.`uid` = 0 OR (`item`.`uid` = %s AND NOT `item`.`global`))
|
||||
|
@ -220,7 +219,7 @@ function search_content(&$a) {
|
|||
intval($a->pager['start']), intval($a->pager['itemspage']));
|
||||
}
|
||||
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
info( t('No results.') . EOL);
|
||||
return $o;
|
||||
}
|
||||
|
|
|
@ -225,7 +225,7 @@ function settings_post(&$a) {
|
|||
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
|
||||
intval(local_user())
|
||||
);
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
q("INSERT INTO `mailacct` (`uid`) VALUES (%d)",
|
||||
intval(local_user())
|
||||
);
|
||||
|
@ -255,7 +255,7 @@ function settings_post(&$a) {
|
|||
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
|
||||
intval(local_user())
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$eacct = $r[0];
|
||||
require_once('include/email.php');
|
||||
$mb = construct_mailbox_name($eacct);
|
||||
|
@ -691,7 +691,7 @@ function settings_content(&$a) {
|
|||
dbesc($a->argv[3]),
|
||||
local_user());
|
||||
|
||||
if (!count($r)){
|
||||
if (!dbm::is_result($r)){
|
||||
notice(t("You can't edit this application."));
|
||||
return;
|
||||
}
|
||||
|
@ -752,7 +752,7 @@ function settings_content(&$a) {
|
|||
$settings_addons = "";
|
||||
|
||||
$r = q("SELECT * FROM `hook` WHERE `hook` = 'plugin_settings' ");
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
$settings_addons = t('No Plugin settings configured');
|
||||
|
||||
call_hooks('plugin_settings', $settings_addons);
|
||||
|
@ -859,15 +859,15 @@ function settings_content(&$a) {
|
|||
$r = null;
|
||||
}
|
||||
|
||||
$mail_server = ((count($r)) ? $r[0]['server'] : '');
|
||||
$mail_port = ((count($r) && intval($r[0]['port'])) ? intval($r[0]['port']) : '');
|
||||
$mail_ssl = ((count($r)) ? $r[0]['ssltype'] : '');
|
||||
$mail_user = ((count($r)) ? $r[0]['user'] : '');
|
||||
$mail_replyto = ((count($r)) ? $r[0]['reply_to'] : '');
|
||||
$mail_pubmail = ((count($r)) ? $r[0]['pubmail'] : 0);
|
||||
$mail_action = ((count($r)) ? $r[0]['action'] : 0);
|
||||
$mail_movetofolder = ((count($r)) ? $r[0]['movetofolder'] : '');
|
||||
$mail_chk = ((count($r)) ? $r[0]['last_check'] : '0000-00-00 00:00:00');
|
||||
$mail_server = ((dbm::is_result($r)) ? $r[0]['server'] : '');
|
||||
$mail_port = ((dbm::is_result($r) && intval($r[0]['port'])) ? intval($r[0]['port']) : '');
|
||||
$mail_ssl = ((dbm::is_result($r)) ? $r[0]['ssltype'] : '');
|
||||
$mail_user = ((dbm::is_result($r)) ? $r[0]['user'] : '');
|
||||
$mail_replyto = ((dbm::is_result($r)) ? $r[0]['reply_to'] : '');
|
||||
$mail_pubmail = ((dbm::is_result($r)) ? $r[0]['pubmail'] : 0);
|
||||
$mail_action = ((dbm::is_result($r)) ? $r[0]['action'] : 0);
|
||||
$mail_movetofolder = ((dbm::is_result($r)) ? $r[0]['movetofolder'] : '');
|
||||
$mail_chk = ((dbm::is_result($r)) ? $r[0]['last_check'] : '0000-00-00 00:00:00');
|
||||
|
||||
|
||||
$tpl = get_markup_template("settings_connectors.tpl");
|
||||
|
|
|
@ -12,7 +12,7 @@ function share_init(&$a) {
|
|||
intval($post_id),
|
||||
intval(local_user())
|
||||
);
|
||||
if(! count($r) || ($r[0]['private'] == 1))
|
||||
if(! dbm::is_result($r) || ($r[0]['private'] == 1))
|
||||
killme();
|
||||
|
||||
if (!intval(get_config('system','old_share'))) {
|
||||
|
|
|
@ -18,7 +18,7 @@ function starred_init(&$a) {
|
|||
intval(local_user()),
|
||||
intval($message_id)
|
||||
);
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
killme();
|
||||
|
||||
if(! intval($r[0]['starred']))
|
||||
|
|
|
@ -20,7 +20,7 @@ function subthread_content(&$a) {
|
|||
dbesc($item_id)
|
||||
);
|
||||
|
||||
if(! $item_id || (! count($r))) {
|
||||
if(! $item_id || (! dbm::is_result($r))) {
|
||||
logger('subthread: no item ' . $item_id);
|
||||
return;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ function subthread_content(&$a) {
|
|||
intval($item['contact-id']),
|
||||
intval($item['uid'])
|
||||
);
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
return;
|
||||
if(! $r[0]['self'])
|
||||
$remote_owner = $r[0];
|
||||
|
@ -53,7 +53,7 @@ function subthread_content(&$a) {
|
|||
WHERE `contact`.`self` = 1 AND `contact`.`uid` = %d LIMIT 1",
|
||||
intval($owner_uid)
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$owner = $r[0];
|
||||
|
||||
if(! $owner) {
|
||||
|
@ -75,7 +75,7 @@ function subthread_content(&$a) {
|
|||
intval($_SESSION['visitor_id']),
|
||||
intval($owner_uid)
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$contact = $r[0];
|
||||
}
|
||||
if(! $contact) {
|
||||
|
@ -85,7 +85,7 @@ function subthread_content(&$a) {
|
|||
$uri = item_new_uri($a->get_hostname(),$owner_uid);
|
||||
|
||||
$post_type = (($item['resource-id']) ? t('photo') : t('status'));
|
||||
$objtype = (($item['resource-id']) ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE );
|
||||
$objtype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
|
||||
$link = xmlify('<link rel="alternate" type="text/html" href="' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
|
||||
$body = $item['body'];
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ function suggest_content(&$a) {
|
|||
|
||||
$r = suggestion_query(local_user());
|
||||
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
$o .= t('No suggestions available. If this is a new site, please try again in 24 hours.');
|
||||
return $o;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ function tagger_content(&$a) {
|
|||
dbesc($item_id)
|
||||
);
|
||||
|
||||
if(! $item_id || (! count($r))) {
|
||||
if(! $item_id || (! dbm::is_result($r))) {
|
||||
logger('tagger: no item ' . $item_id);
|
||||
return;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ function tagger_content(&$a) {
|
|||
$r = q("select `nickname`,`blocktags` from user where uid = %d limit 1",
|
||||
intval($owner_uid)
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$owner_nick = $r[0]['nickname'];
|
||||
$blocktags = $r[0]['blocktags'];
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ function tagger_content(&$a) {
|
|||
$r = q("select * from contact where self = 1 and uid = %d limit 1",
|
||||
intval(local_user())
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$contact = $r[0];
|
||||
else {
|
||||
logger('tagger: no contact_id');
|
||||
|
@ -60,7 +60,7 @@ function tagger_content(&$a) {
|
|||
$uri = item_new_uri($a->get_hostname(),$owner_uid);
|
||||
$xterm = xmlify($term);
|
||||
$post_type = (($item['resource-id']) ? t('photo') : t('status'));
|
||||
$targettype = (($item['resource-id']) ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE );
|
||||
$targettype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
|
||||
|
||||
$link = xmlify('<link rel="alternate" type="text/html" href="'
|
||||
. $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
|
||||
|
@ -178,7 +178,7 @@ EOT;
|
|||
$r = q("select `tag`,`id`,`uid` from item where `origin` = 1 AND `uri` = '%s' LIMIT 1",
|
||||
dbesc($item['uri'])
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$x = q("SELECT `blocktags` FROM `user` WHERE `uid` = %d limit 1",
|
||||
intval($r[0]['uid'])
|
||||
);
|
||||
|
|
|
@ -19,7 +19,7 @@ function tagrm_post(&$a) {
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
|
||||
|
||||
$arr = explode(',', $r[0]['tag']);
|
||||
|
@ -68,7 +68,7 @@ function tagrm_content(&$a) {
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
|
||||
|
||||
$arr = explode(',', $r[0]['tag']);
|
||||
|
|
|
@ -44,7 +44,7 @@ function uexport_content(&$a){
|
|||
function _uexport_multirow($query) {
|
||||
$result = array();
|
||||
$r = q($query);
|
||||
// if(count($r)) {
|
||||
// if (dbm::is_result($r)) {
|
||||
if ($r){
|
||||
foreach($r as $rr){
|
||||
$p = array();
|
||||
|
@ -130,7 +130,7 @@ function uexport_all(&$a) {
|
|||
$r = q("SELECT count(*) as `total` FROM `item` WHERE `uid` = %d ",
|
||||
intval(local_user())
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$total = $r[0]['total'];
|
||||
|
||||
// chunk the output to avoid exhausting memory
|
||||
|
@ -142,7 +142,7 @@ function uexport_all(&$a) {
|
|||
intval($x),
|
||||
intval(500)
|
||||
);
|
||||
/*if(count($r)) {
|
||||
/*if (dbm::is_result($r)) {
|
||||
foreach($r as $rr)
|
||||
foreach($rr as $k => $v)
|
||||
$item[][$k] = $v;
|
||||
|
|
|
@ -140,7 +140,7 @@ function videos_post(&$a) {
|
|||
dbesc($video_id)
|
||||
);
|
||||
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
q("DELETE FROM `attach` WHERE `uid` = %d AND `id` = '%s'",
|
||||
intval(local_user()),
|
||||
dbesc($video_id)
|
||||
|
@ -259,7 +259,7 @@ function videos_content(&$a) {
|
|||
intval($contact_id),
|
||||
intval($owner_uid)
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$can_post = true;
|
||||
$contact = $r[0];
|
||||
$remote_contact = true;
|
||||
|
@ -287,7 +287,7 @@ function videos_content(&$a) {
|
|||
intval($contact_id),
|
||||
intval($owner_uid)
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$contact = $r[0];
|
||||
$remote_contact = true;
|
||||
}
|
||||
|
@ -347,7 +347,7 @@ function videos_content(&$a) {
|
|||
$sql_extra GROUP BY hash",
|
||||
intval($a->data['user']['uid'])
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$a->set_pager_total(count($r));
|
||||
$a->set_pager_itemspage(20);
|
||||
}
|
||||
|
@ -363,7 +363,7 @@ function videos_content(&$a) {
|
|||
|
||||
|
||||
$videos = array();
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
foreach($r as $rr) {
|
||||
if($a->theme['template_engine'] === 'internal') {
|
||||
$alt_e = template_escape($rr['filename']);
|
||||
|
|
|
@ -16,7 +16,7 @@ function viewcontacts_init(&$a) {
|
|||
dbesc($nick)
|
||||
);
|
||||
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
return;
|
||||
|
||||
$a->data['user'] = $r[0];
|
||||
|
@ -54,7 +54,7 @@ function viewcontacts_content(&$a) {
|
|||
dbesc(NETWORK_DIASPORA),
|
||||
dbesc(NETWORK_OSTATUS)
|
||||
);
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
$a->set_pager_total($r[0]['total']);
|
||||
|
||||
$r = q("SELECT * FROM `contact`
|
||||
|
@ -68,7 +68,7 @@ function viewcontacts_content(&$a) {
|
|||
intval($a->pager['start']),
|
||||
intval($a->pager['itemspage'])
|
||||
);
|
||||
if(!count($r)) {
|
||||
if (!dbm::is_result($r)) {
|
||||
info(t('No contacts.').EOL);
|
||||
return $o;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ function viewsrc_content(&$a) {
|
|||
dbesc($item_id)
|
||||
);
|
||||
|
||||
if(count($r))
|
||||
if (dbm::is_result($r))
|
||||
if(is_ajax()) {
|
||||
echo str_replace("\n",'<br />',$r[0]['body']);
|
||||
killme();
|
||||
|
|
|
@ -12,7 +12,7 @@ function wall_attach_post(&$a) {
|
|||
$r = q("SELECT `user`.*, `contact`.`id` FROM `user` LEFT JOIN `contact` on `user`.`uid` = `contact`.`uid` WHERE `user`.`nickname` = '%s' AND `user`.`blocked` = 0 and `contact`.`self` = 1 LIMIT 1",
|
||||
dbesc($nick)
|
||||
);
|
||||
if(! count($r)){
|
||||
if(! dbm::is_result($r)){
|
||||
if ($r_json) {
|
||||
echo json_encode(array('error'=>t('Invalid request.')));
|
||||
killme();
|
||||
|
@ -55,7 +55,7 @@ function wall_attach_post(&$a) {
|
|||
intval($contact_id),
|
||||
intval($page_owner_uid)
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$can_post = true;
|
||||
$visitor = $contact_id;
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ function wall_attach_post(&$a) {
|
|||
dbesc($hash)
|
||||
);
|
||||
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
$msg = t('File upload failed.');
|
||||
if ($r_json) {
|
||||
echo json_encode(array('error'=>$msg));
|
||||
|
|
|
@ -15,7 +15,7 @@ function wall_upload_post(&$a, $desktopmode = true) {
|
|||
dbesc($nick)
|
||||
);
|
||||
|
||||
if(! count($r)){
|
||||
if(! dbm::is_result($r)){
|
||||
if ($r_json) {
|
||||
echo json_encode(array('error'=>t('Invalid request.')));
|
||||
killme();
|
||||
|
@ -63,7 +63,7 @@ function wall_upload_post(&$a, $desktopmode = true) {
|
|||
intval($contact_id),
|
||||
intval($page_owner_uid)
|
||||
);
|
||||
if(count($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$can_post = true;
|
||||
$visitor = $contact_id;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ function wallmessage_post(&$a) {
|
|||
dbesc($recipient)
|
||||
);
|
||||
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
logger('wallmessage: no recipient');
|
||||
return;
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ function wallmessage_content(&$a) {
|
|||
dbesc($recipient)
|
||||
);
|
||||
|
||||
if(! count($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
notice( t('No recipient.') . EOL);
|
||||
logger('wallmessage: no recipient');
|
||||
return;
|
||||
|
|
|
@ -21,7 +21,7 @@ function xrd_init(&$a) {
|
|||
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1",
|
||||
dbesc($name)
|
||||
);
|
||||
if(! count($r))
|
||||
if(! dbm::is_result($r))
|
||||
killme();
|
||||
|
||||
$salmon_key = salmon_key($r[0]['spubkey']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue