diff options
author | zotlabs <mike@macgirvin.com> | 2017-12-12 11:54:26 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-12-12 11:54:26 -0800 |
commit | 215d615fc3bb9e168e21a78a6319a7971c4d1e9e (patch) | |
tree | ff0af309ef283c48a6f3df5d590068c103d6bf7a /Zotlabs/Module/Item.php | |
parent | 979c05b24da0497be582aacaa8b744f692b56ccf (diff) | |
parent | d0956eb39d7a361639f5cd73fb1c3c8463fb1e99 (diff) | |
download | volse-hubzilla-215d615fc3bb9e168e21a78a6319a7971c4d1e9e.tar.gz volse-hubzilla-215d615fc3bb9e168e21a78a6319a7971c4d1e9e.tar.bz2 volse-hubzilla-215d615fc3bb9e168e21a78a6319a7971c4d1e9e.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'Zotlabs/Module/Item.php')
-rw-r--r-- | Zotlabs/Module/Item.php | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 2528645f3..37a3a3a85 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -1139,7 +1139,29 @@ class Item extends \Zotlabs\Web\Controller { $ret['message'] = t('Unable to obtain post information from database.'); return $ret; } - + + // auto-upgrade beginner (techlevel 0) accounts - if they have at least two friends and ten posts + // and have uploaded something (like a profile photo), promote them to level 1. + + $a = q("select account_id, account_level from account where account_id = (select channel_account_id from channel where channel_id = %d limit 1)", + intval($channel_id) + ); + if((! intval($a[0]['account_level'])) && intval($r[0]['total']) > 10) { + $x = q("select count(abook_id) as total from abook where abook_channel = %d", + intval($channel_id) + ); + if($x && intval($x[0]['total']) > 2) { + $y = q("select count(id) as total from attach where uid = %d", + intval($channel_id) + ); + if($y && intval($y[0]['total']) > 1) { + q("update account set account_level = 1 where account_id = %d limit 1", + intval($a[0]['account_id']) + ); + } + } + } + if (!$iswebpage) { $max = engr_units_to_bytes(service_class_fetch($channel_id,'total_items')); if(! service_class_allows($channel_id,'total_items',$r[0]['total'])) { |