don't include deleted channels in number of channels service class checks

This commit is contained in:
friendica 2014-02-16 14:48:07 -08:00
parent 663dd39015
commit 16cd9e2a7e
2 changed files with 11 additions and 6 deletions

View file

@ -22,8 +22,9 @@ require_once('include/crypto.php');
function identity_check_service_class($account_id) { function identity_check_service_class($account_id) {
$ret = array('success' => false, $message => ''); $ret = array('success' => false, $message => '');
$r = q("select count(channel_id) as total from channel where channel_account_id = %d ", $r = q("select count(channel_id) as total from channel where channel_account_id = %d and not ( channel_pageflags & %d ) ",
intval($account_id) intval($account_id),
intval(PAGE_REMOVED)
); );
if(! ($r && count($r))) { if(! ($r && count($r))) {
$ret['message'] = t('Unable to obtain identity information from database'); $ret['message'] = t('Unable to obtain identity information from database');
@ -101,7 +102,7 @@ function get_sys_channel() {
/** /**
* @channel_total() * @channel_total()
* Return the total number of channels on this site. No filtering is performed. * Return the total number of channels on this site. No filtering is performed except to check PAGE_REMOVED
* *
* @returns int * @returns int
* on error returns boolean false * on error returns boolean false
@ -109,7 +110,10 @@ function get_sys_channel() {
*/ */
function channel_total() { function channel_total() {
$r = q("select channel_id from channel where true"); $r = q("select channel_id from channel where not ( channel_pageflags & %d )",
intval(PAGE_REMOVED)
);
if(is_array($r)) if(is_array($r))
return count($r); return count($r);
return false; return false;

View file

@ -55,8 +55,9 @@ function manage_content(&$a) {
} }
} }
$r = q("select count(channel_id) as total from channel where channel_account_id = %d ", $r = q("select count(channel_id) as total from channel where channel_account_id = %d and not ( channel_pageflags & %d )",
intval(get_account_id()) intval(get_account_id()),
intval(PAGE_REMOVED)
); );
$limit = service_class_fetch(local_user(),'total_identities'); $limit = service_class_fetch(local_user(),'total_identities');
if($limit !== false) { if($limit !== false) {