清除 userapp相关
This commit is contained in:
parent
ae176a903f
commit
e342b75ab0
|
@ -15,7 +15,7 @@ $root = '<a href="'.ADMINSCRIPT.'?action=adv">'.cplang('adv_admin').'</a>';
|
|||
|
||||
$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']];
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -1,100 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: table_home_userapp.php 27820 2012-02-15 05:15:59Z zhangguosheng $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
class table_home_userapp extends discuz_table
|
||||
{
|
||||
public function __construct() {
|
||||
|
||||
$this->_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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,22 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: table_home_userapp_plying.php 27449 2012-02-01 05:32:35Z zhangguosheng $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
class table_home_userapp_plying extends discuz_table {
|
||||
public function __construct() {
|
||||
|
||||
$this->_table = 'home_userapp_plying';
|
||||
$this->_pk = 'uid';
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,46 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: table_home_userappfield.php 27449 2012-02-01 05:32:35Z zhangguosheng $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
class table_home_userappfield extends discuz_table
|
||||
{
|
||||
public function __construct() {
|
||||
|
||||
$this->_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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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'])) {
|
||||
|
|
|
@ -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'])) {
|
||||
|
|
|
@ -1,101 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: spacecp_space.php 25510 2011-11-14 02:22:26Z yexinhao $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if(submitcheck('delappsubmit')) {
|
||||
|
||||
$setarr = array();
|
||||
if($_POST['type'] == 'profilelink') {
|
||||
$setarr = array('allowprofilelink' => 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;
|
||||
|
||||
}
|
||||
|
||||
?>
|
|
@ -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', '');
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -1,26 +1,8 @@
|
|||
<!--{hook/global_userabout_top $_G['basescript'].'::'.CURMODULE}-->
|
||||
<ul>
|
||||
<!--{loop $_G['setting']['spacenavs'] $nav}-->
|
||||
<!--{if $nav['available'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1))}-->
|
||||
<!--{if in_array($nav['code'], array('userpanelarea1', 'userpanelarea2'))}-->
|
||||
<!--{if !empty($_G[my_panelapp]) && $_G['setting']['my_app_status']}-->
|
||||
<!--{if $nav['code']=='userpanelarea1' && !empty($_G[my_panelapp][1])}-->
|
||||
<!--{loop $_G[my_panelapp][1] $appid $app}-->
|
||||
<li>
|
||||
<a href="userapp.php?mod=app&id=$app[appid]" title="$app[appname]"><img {if $app[icon]}src="$app[icon]" onerror="this.onerror=null;this.src='http://appicon.manyou.com/icons/$app[appid]'"{else} src="http://appicon.manyou.com/icons/$app[appid]"{/if} name="$appid" alt="$app[appname]" />$app[appname]</a>
|
||||
</li>
|
||||
<!--{/loop}-->
|
||||
<!--{elseif $nav['code']=='userpanelarea2' && !empty($_G[my_panelapp][2])}-->
|
||||
<!--{loop $_G[my_panelapp][2] $appid $app}-->
|
||||
<li>
|
||||
<a href="userapp.php?mod=app&id=$app[appid]" title="$app[appname]"><img {if $app[icon]}src="$app[icon]" onerror="this.onerror=null;this.src='http://appicon.manyou.com/icons/$app[appid]'"{else} src="http://appicon.manyou.com/icons/$app[appid]"{/if} name="$appid" alt="$app[appname]" />$app[appname]</a>
|
||||
</li>
|
||||
<!--{/loop}-->
|
||||
<!--{/if}-->
|
||||
<!--{/if}-->
|
||||
<!--{else}-->
|
||||
<!--{if $nav['available'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1))}-->
|
||||
$nav[code]
|
||||
<!--{/if}-->
|
||||
<!--{/if}-->
|
||||
<!--{/loop}-->
|
||||
</ul>
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
<!--{template common/header}-->
|
||||
<!--{if $_GET['op'] == 'delete'}-->
|
||||
<h1>{lang hide_app}</h1>
|
||||
<a href="javascript:hideMenu();" class="float_del" title="{lang close}">{lang close}</a>
|
||||
<div class="popupmenu_inner" id="__userappform_{$_GET[appid]}">
|
||||
<form method="post" autocomplete="off" id="userappform_{$_GET[appid]}" name="userappform_{$_GET[appid]}" action="home.php?mod=spacecp&ac=space&op=">
|
||||
<p>{lang hide_app_message}</p>
|
||||
<p class="btn_line">
|
||||
<input type="hidden" name="referer" value="{echo dreferer()}">
|
||||
<input type="hidden" name="appid" value="$_GET[appid]" />
|
||||
<input type="hidden" name="type" value="$_GET[type]" />
|
||||
<!--{if $_G[inajax]}-->
|
||||
<input type="hidden" name="delappsubmit" value="true" />
|
||||
<button name="delappsubmit_btn" type="button" class="submit" value="true" onclick="ajaxpost('userappform_{$_GET[appid]}', 'userapp_delete', 2000)">{lang determine}</button>
|
||||
<!--{else}-->
|
||||
<button name="delappsubmit" type="submit" class="submit" value="true">{lang determine}</button>
|
||||
<!--{/if}-->
|
||||
</p>
|
||||
<input type="hidden" name="formhash" value="{FORMHASH}" />
|
||||
</form>
|
||||
</div>
|
||||
<!--{/if}-->
|
||||
<!--{template common/footer}-->
|
Loading…
Reference in New Issue