From e342b75ab00c923d7a1acecf838435cd79b44aad Mon Sep 17 00:00:00 2001 From: Comsenz <10433182@qq.com> Date: Mon, 31 Jul 2017 15:07:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E9=99=A4=20userapp=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/source/admincp/admincp_adv.php | 2 +- upload/source/admincp/admincp_misc.php | 3 +- .../source/class/table/table_home_userapp.php | 100 ----------------- .../class/table/table_home_userapp_plying.php | 22 ---- .../class/table/table_home_userappfield.php | 46 -------- upload/source/function/function_delete.php | 2 +- upload/source/function/function_home.php | 16 --- upload/source/include/misc/misc_ajax.php | 12 +-- upload/source/include/space/space_notice.php | 30 ------ .../source/include/spacecp/spacecp_space.php | 101 ------------------ upload/source/module/home/home_invite.php | 7 +- upload/source/module/home/home_spacecp.php | 2 +- upload/template/default/common/userabout.htm | 20 +--- .../template/default/home/spacecp_space.htm | 23 ---- 14 files changed, 7 insertions(+), 379 deletions(-) delete mode 100644 upload/source/class/table/table_home_userapp.php delete mode 100644 upload/source/class/table/table_home_userapp_plying.php delete mode 100644 upload/source/class/table/table_home_userappfield.php delete mode 100644 upload/source/include/spacecp/spacecp_space.php delete mode 100644 upload/template/default/home/spacecp_space.htm diff --git a/upload/source/admincp/admincp_adv.php b/upload/source/admincp/admincp_adv.php index b6bb7b3..b759d88 100644 --- a/upload/source/admincp/admincp_adv.php +++ b/upload/source/admincp/admincp_adv.php @@ -15,7 +15,7 @@ $root = ''.cplang('adv_admin').''; $operation = $operation ? $operation : 'list'; -$defaulttargets = array('portal', 'home', 'member', 'forum', 'group', 'userapp', 'plugin'); +$defaulttargets = array('portal', 'home', 'member', 'forum', 'group', 'plugin'); if(!empty($_GET['preview'])) { $_GET['advnew'][$_GET['advnew']['style']]['url'] = $_GET['TMPadvnew'.$_GET['advnew']['style']] ? $_GET['TMPadvnew'.$_GET['advnew']['style']] : $_GET['advnew'.$_GET['advnew']['style']]; diff --git a/upload/source/admincp/admincp_misc.php b/upload/source/admincp/admincp_misc.php index 5ae46f1..2162859 100644 --- a/upload/source/admincp/admincp_misc.php +++ b/upload/source/admincp/admincp_misc.php @@ -1283,8 +1283,7 @@ var rowtypedata = [ array('member', cplang('misc_focus_position_member')), array('forum', cplang('misc_focus_position_forum')), array('group', cplang('misc_focus_position_group')), - array('search', cplang('misc_focus_position_search')), - array('userapp', cplang('misc_focus_position_userapp')), + array('search', cplang('misc_focus_position_search')), ); if(!$do) { diff --git a/upload/source/class/table/table_home_userapp.php b/upload/source/class/table/table_home_userapp.php deleted file mode 100644 index c1f01d6..0000000 --- a/upload/source/class/table/table_home_userapp.php +++ /dev/null @@ -1,100 +0,0 @@ -_table = 'home_userapp'; - $this->_pk = ''; - - parent::__construct(); - } - - public function fetch_by_uid_appid($uid, $appid) { - return DB::fetch_first('SELECT * FROM %t WHERE uid=%d AND appid=%d', array($this->_table, $uid, $appid)); - } - - public function fetch_max_menuorder_by_uid($uid) { - return DB::result_first('SELECT MAX(menuorder) FROM %t WHERE uid=%d', array($this->_table, $uid)); - } - - public function count_by_uid($uid) { - return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d', array($this->_table, $uid)); - } - - public function fetch_all_by_uid_appid($uid = 0, $appid = 0, $order = null, $sort = 'DESC' , $start = 0, $limit = 0) { - $parameter = array($this->_table); - $wherearr = array(); - if($uid) { - $uid = dintval((array)$uid, true); - $wherearr[] = 'uid IN(%n)'; - $parameter[] = $uid; - } - if($appid) { - $appid = dintval((array)$appid, true); - $wherearr[] = 'appid IN(%n)'; - $parameter[] = $appid; - } - $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; - $sort = in_array($sort, array('DESC', 'ASC')) ? $sort : 'DESC'; - $ordersql = $order !== null ? ' ORDER BY '.DB::order($order, $sort) : ''; - if(!$uid) { - $limit = $limit ? $limit : 100; - } - return DB::fetch_all("SELECT * FROM %t $wheresql $ordersql ".DB::limit($start, $limit), $parameter); - } - - public function update_by_uid_appid($uid = 0, $appid = 0, $data = array()) { - if($data && is_array($data)) { - $wherearr = array(); - if($uid) { - $uid = dintval((array)$uid, true); - $wherearr[] = DB::field('uid', $uid); - } - if($appid) { - $appid = dintval((array)$appid, true); - $wherearr[] = DB::field('appid', $appid); - } - $wheresql = !empty($wherearr) && is_array($wherearr) ? implode(' AND ', $wherearr) : ''; - return DB::update($this->_table, $data, $wheresql); - } - return 0; - } - - public function delete_by_uid_appid($uid = 0, $appid = 0) { - $parameter = array($this->_table); - $wherearr = array(); - if($uid) { - $uid = dintval((array)$uid, true); - $wherearr[] = 'uid IN(%n)'; - $parameter[] = $uid; - } - if($appid) { - $appid = dintval((array)$appid, true); - $wherearr[] = 'appid IN(%n)'; - $parameter[] = $appid; - } - $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; - return DB::query("DELETE FROM %t $wheresql", $parameter); - } - public function delete_by_uid($uids) { - if(($uids = dintval($uids, true))) { - return DB::delete($this->_table, DB::field('uid', $uids)); - } - return 0; - } - -} - -?> \ No newline at end of file diff --git a/upload/source/class/table/table_home_userapp_plying.php b/upload/source/class/table/table_home_userapp_plying.php deleted file mode 100644 index 3538c35..0000000 --- a/upload/source/class/table/table_home_userapp_plying.php +++ /dev/null @@ -1,22 +0,0 @@ -_table = 'home_userapp_plying'; - $this->_pk = 'uid'; - - parent::__construct(); - } -} - -?> \ No newline at end of file diff --git a/upload/source/class/table/table_home_userappfield.php b/upload/source/class/table/table_home_userappfield.php deleted file mode 100644 index 05124a8..0000000 --- a/upload/source/class/table/table_home_userappfield.php +++ /dev/null @@ -1,46 +0,0 @@ -_table = 'home_userappfield'; - $this->_pk = ''; - - parent::__construct(); - } - - public function delete_by_uid_appid($uid = 0, $appid = 0) { - $parameter = array($this->_table); - $wherearr = array(); - if($uid) { - $parameter[] = $uid; - $wherearr[] = is_array($uid) ? 'uid IN(%n)' : 'uid=%d'; - } - if($appid) { - $parameter[] = $appid; - $wherearr[] = is_array($appid) ? 'appid IN(%n)' : 'appid=%d'; - } - $wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : ''; - - return DB::query("DELETE FROM %t $wheresql", $parameter); - } - - public function delete_by_uid($uids) { - return DB::delete($this->_table, DB::field('uid', $uids)); - } - -} - -?> \ No newline at end of file diff --git a/upload/source/function/function_delete.php b/upload/source/function/function_delete.php index 5bc31af..233dab2 100644 --- a/upload/source/function/function_delete.php +++ b/upload/source/function/function_delete.php @@ -91,7 +91,7 @@ function deletemember($uids, $delpost = true) { foreach(array('home_doing', 'home_share', 'home_album', 'common_credit_rule_log', 'common_credit_rule_log_field', 'home_pic', 'home_blog', 'home_blogfield', 'home_class', 'home_clickuser', - 'home_userapp', 'home_userappfield', 'home_show', 'forum_collectioncomment', 'forum_collectionfollow', 'forum_collectionteamworker') as $table) { + 'home_show', 'forum_collectioncomment', 'forum_collectionfollow', 'forum_collectionteamworker') as $table) { C::t($table)->delete_by_uid($arruids); } C::t('common_member')->delete($arruids, 1, 1); diff --git a/upload/source/function/function_home.php b/upload/source/function/function_home.php index 3e80cae..6b9d589 100644 --- a/upload/source/function/function_home.php +++ b/upload/source/function/function_home.php @@ -92,25 +92,9 @@ function ckstart($start, $perpage) { function get_my_app() { - global $_G; - - if($_G['setting']['my_app_status']) { - foreach(C::t('common_myapp')->fetch_all_by_flag(1, '=', 'DESC') as $value) { - $_G['my_app'][$value['appid']] = $value; - } - } } function get_my_userapp() { - global $_G; - - if($_G['setting']['my_app_status'] && $_G['uid']) { - foreach(C::t('home_userapp')->fetch_all_by_uid_appid($_G['uid'], 0, 'displayorder') as $value) { - if(!empty($value['appname'])) { - $_G['my_userapp'][$value['appid']] = $value; - } - } - } } function getspace($uid) { diff --git a/upload/source/include/misc/misc_ajax.php b/upload/source/include/misc/misc_ajax.php index bd296ff..008a24f 100644 --- a/upload/source/include/misc/misc_ajax.php +++ b/upload/source/include/misc/misc_ajax.php @@ -135,17 +135,7 @@ if($op == 'comment') { } elseif($op == 'deluserapp') { - - if(empty($_G['uid'])) { - showmessage('no_privilege_guest'); - } - $hash = trim($_GET['hash']); - if(C::t('common_myinvite')->count_by_hash_touid($hash, $_G['uid'])) { - C::t('common_myinvite')->delete_by_hash_touid($hash, $_G['uid']); - showmessage('do_success'); - } else { - showmessage('no_privilege_deluserapp'); - } + } elseif($op == 'delnotice') { if(empty($_G['uid'])) { diff --git a/upload/source/include/space/space_notice.php b/upload/source/include/space/space_notice.php index 4858702..aab0068 100644 --- a/upload/source/include/space/space_notice.php +++ b/upload/source/include/space/space_notice.php @@ -33,36 +33,6 @@ $opactives[$view] = 'class="a"'; $categorynum = $newprompt = array(); if($view == 'userapp') { - space_merge($space, 'status'); - - if($_GET['op'] == 'del') { - $appid = intval($_GET['appid']); - C::t('common_myinvite')->delete_by_appid_touid($appid, $_G['uid']); - showmessage('do_success', "home.php?mod=space&do=notice&view=userapp&quickforward=1"); - } - - $filtrate = 0; - $count = 0; - $apparr = array(); - $type = intval($_GET['type']); - foreach(C::t('common_myinvite')->fetch_all_by_touid($_G['uid']) as $value) { - $count++; - $key = md5($value['typename'].$value['type']); - $apparr[$key][] = $value; - if($filtrate) { - $filtrate--; - } else { - if($count < $perpage) { - if($type && $value['appid'] == $type) { - $list[$key][] = $value; - } elseif(!$type) { - $list[$key][] = $value; - } - } - } - } - $mynotice = $count; - } else { if(!empty($_GET['ignore'])) { diff --git a/upload/source/include/spacecp/spacecp_space.php b/upload/source/include/spacecp/spacecp_space.php deleted file mode 100644 index 7d89d25..0000000 --- a/upload/source/include/spacecp/spacecp_space.php +++ /dev/null @@ -1,101 +0,0 @@ - 0); - } else { - $setarr = array('privacy' => 5); - } - $appid = intval($_POST['appid']); - C::t('home_userapp')->update_by_uid_appid($_G['uid'], $appid, $setarr); - my_userapp_update($_G['uid'], $appid, $setarr['privacy'], $setarr['allowprofilelink']); - showmessage('do_success', dreferer()); -} - -if($_GET['op'] == 'delete') { - $delid = $_GET['type'] == 'profilelink'? 'profilelink_'.$_GET['appid'] : $_GET['appid']; -} -$actives = array($ac => ' class="active"'); - -include_once template("home/spacecp_space"); - - -function my_userapp_update($uId, $appId, $privacy = null, $allowProfileLink = null) { - global $my_register_url, $_G; - - $mySiteId = $_G['setting']['my_siteid']; - $mySiteKey = $_G['setting']['my_sitekey']; - if (!$_G['setting']['my_app_status']) { - $res = array('errCode' => 121, - 'errMessage' => 'Manyou Service Disabled', - 'result' => '' - ); - return $res; - } - - $data = array(); - - if ($privacy !== null) { - switch($privacy) { - case 1: - $data['privacy'] = 'friends'; - break; - case 3: - $data['privacy'] = 'me'; - break; - case 5: - $data['privacy'] = 'none'; - break; - case 0: - default: - $data['privacy'] = 'public'; - } - } - - if ($allowProfileLink !== null) { - $data['allowProfileLink'] = $allowProfileLink ? true : false; - } - - if (!$data) { - return array('errCode' => 5, 'errMessage' => 'Post Data Cann\'t Be Empty!'); - } - - $data = serialize($data); - $key = "$mySiteId|$mySiteKey|$uId|$appId|$data"; - $key = md5($key); - $data = urlencode($data); - - $postString = sprintf('action=%s&key=%s&mySiteId=%d&uId=%d&appId=%d&data=%s', 'userappUpdate', $key, $mySiteId, $uId, $appId, $data); - - loaducenter(); - $url = 'http://api.manyou.com/uchome.php'; - $response = uc_fopen2($url, 0, $postString, '', false, $_G['setting']['my_ip']); - $res = unserialize($response); - if (!$response) { - $res['errCode'] = 111; - $res['errMessage'] = 'Empty Response'; - $res['result'] = $response; - } elseif(!$res) { - $res['errCode'] = 110; - $res['errMessage'] = 'Error Response'; - $res['result'] = $response; - } - - return $res; - -} - -?> \ No newline at end of file diff --git a/upload/source/module/home/home_invite.php b/upload/source/module/home/home_invite.php index fc4ba18..5a4829a 100644 --- a/upload/source/module/home/home_invite.php +++ b/upload/source/module/home/home_invite.php @@ -81,16 +81,11 @@ if($id) { showmessage('invite_code_error', '', array(), array('return' => true)); } -$userapp = array(); -if($appid) { - $userapp = C::t('common_myapp')->fetch($appid); -} - $space = getuserbyuid($uid); if(empty($space)) { showmessage('space_does_not_exist', '', array(), array('return' => true)); } -$jumpurl = $appid ? "userapp.php?mod=app&id=$appid&my_extra=invitedby_bi_{$uid}_$_GET[c]&my_suffix=Lw%3D%3D" : 'home.php?mod=space&uid='.$uid; +$jumpurl = 'home.php?mod=space&uid='.$uid; if($acceptconfirm) { dsetcookie('invite_auth', ''); diff --git a/upload/source/module/home/home_spacecp.php b/upload/source/module/home/home_spacecp.php index 9a31e87..a2608df 100644 --- a/upload/source/module/home/home_spacecp.php +++ b/upload/source/module/home/home_spacecp.php @@ -14,7 +14,7 @@ if(!defined('IN_DISCUZ')) { require_once libfile('function/spacecp'); require_once libfile('function/magic'); -$acs = array('space', 'doing', 'upload', 'comment', 'blog', 'album', 'relatekw', 'common', 'class', +$acs = array('doing', 'upload', 'comment', 'blog', 'album', 'relatekw', 'common', 'class', 'swfupload', 'poke', 'friend', 'eccredit', 'favorite', 'follow', 'avatar', 'profile', 'theme', 'feed', 'privacy', 'pm', 'share', 'invite','sendmail', 'credit', 'usergroup', 'domain', 'click','magic', 'top', 'videophoto', 'index', 'plugin', 'search', 'promotion'); diff --git a/upload/template/default/common/userabout.htm b/upload/template/default/common/userabout.htm index 05176fa..2f1ec3e 100644 --- a/upload/template/default/common/userabout.htm +++ b/upload/template/default/common/userabout.htm @@ -1,26 +1,8 @@ diff --git a/upload/template/default/home/spacecp_space.htm b/upload/template/default/home/spacecp_space.htm deleted file mode 100644 index 8c0fe31..0000000 --- a/upload/template/default/home/spacecp_space.htm +++ /dev/null @@ -1,23 +0,0 @@ - - -

{lang hide_app}

-{lang close} -
-
-

{lang hide_app_message}

-

- - - - - - - - - -

- -
-
- - \ No newline at end of file