找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 164|回复: 0

阿达撒打算

[复制链接]

4

主题

2

回帖

143

积分

校长

积分
143
发表于 3 天前 | 显示全部楼层 |阅读模式

复制代码
阿达撒打算
  1. 阿达是的
复制代码

  1. <?php
  2. /**
  3. *      [Discuz!] (C)2001-2099 Comsenz Inc.
  4. *      This is NOT a freeware, use is subject to license terms
  5. *
  6. *      $Id: admincp_usertag.php 29214 2012-03-29 07:22:01Z monkey $
  7. */

  8. if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
  9.         exit('Access Denied');
  10. }
  11. cpheader();
  12. shownav('user', 'usertag');
  13. $lpp = empty($_GET['lpp']) ? 20 : $_GET['lpp'];
  14. $start = ($page - 1) * $lpp;
  15. if($operation == '') {
  16.         if($_GET['srchname']) {
  17.                 $addurl = '&srchname='.$_GET['srchname'];
  18.         }
  19.         if(submitcheck('submit') && $_GET['tagids']) {
  20.                 $class_tag = new tag();
  21.                 if($_GET['operate_type'] == 'delete') {
  22.                         $class_tag->delete_tag($_GET['tagids'], 'uid');
  23.                         cpmsg('usertag_delete_succeed', 'action=usertag'.$addurl, 'succeed');
  24.                 } elseif($_GET['operate_type'] == 'merge' && $_GET['newtag']) {
  25.                         $data = $class_tag->merge_tag($_GET['tagids'], $_GET['newtag'], 'uid');
  26.                         if($data != 'succeed') {
  27.                                 cpmsg($data);
  28.                         }
  29.                         cpmsg('usertag_merge_succeed', 'action=usertag'.$addurl, 'succeed');
  30.                 }
  31.         }
  32.         showsubmenu('usertag', array(
  33.                 array('usertag_list', 'usertag', 1),
  34.                 array('usertag_add', 'usertag&operation=add', 0),
  35.         ));
  36.         showboxheader();
  37.         echo '<form method="post">'. $lang['keywords'].': <input type="text" name="srchname" value="'.$_GET['srchname'].'" /> &nbsp;<input type="submit" name="usertag_search" value="'.$lang['search'].'" class="btn" /> </form>';
  38.         showboxfooter();
  39.         showformheader('usertag'.$addurl);
  40.         $tagcount = C::t('common_tag')->fetch_all_by_status(3, $_GET['srchname'], 0, 0, 1);
  41.         showtableheader(cplang('usertag_count', array('tagcount' => $tagcount)));
  42.         if($tagcount) {
  43.                 showsubtitle(array('', 'tagname', 'usernum', 'operation'));
  44.                 $query = C::t('common_tag')->fetch_all_by_status(3, $_GET['srchname'], $start, $lpp);
  45.                 foreach($query as $row) {
  46.                         showtablerow('', array('class="td25"', 'width=100', ''), array(
  47.                                         '<input type="checkbox" class="checkbox" name="tagids[]" value="'.$row['tagid'].'" />',
  48.                                         $row['tagname'],
  49.                                         '<span id="tag_'.$row['tagid'].'"><a href="javascript:;" onclick="ajaxget(\'misc.php?mod=tag&type=countitem&id='.$row['tagid'].'\', \'tag_'.$row['tagid'].'\');return false;">'.$lang['view'].'</a></span>',
  50.                                         '<a href="'.ADMINSCRIPT.'?action=members&operation=search&submit=1&tagid='.$row['tagid'].'" target="_blank">'.cplang('view').$lang['usertag_user'].'</a>&nbsp;|&nbsp;<a href="'.ADMINSCRIPT.'?action=members&operation=newsletter&tagid='.$row['tagid'].'&submit=1" target="_blank">'.$lang['usertag_send_notice'].'</a>'
  51.                                 ));
  52.                 }
  53.                 $multipage = multi($tagcount, $lpp, $page, ADMINSCRIPT."?action=usertag$addurl&lpp=$lpp", 0, 3);
  54.                 showtablerow('', array('class="td25" colspan="3"'), array('<input name="chkall" id="chkall" type="checkbox" class="checkbox" onclick="checkAll(\'prefix\', this.form, \'tagids\', \'chkall\')" /><label for="chkall">'.cplang('select_all').'</label>'));
  55.                 showtablerow('', array('class="td25"', 'colspan="2"'), array(
  56.                 cplang('operation'),'<input class="radio" type="radio" name="operate_type" value="delete"> '.cplang('delete').' &nbsp; &nbsp;<input class="radio" type="radio" name="operate_type" value="merge"> '.cplang('mergeto').' <input name="newtag" value="" class="txt" type="text">'
  57.                                 ));
  58.                 showsubmit('submit', 'submit', '', '', $multipage);
  59.         }

  60.         showtablefooter();
  61.         showformfooter();
  62. } elseif($operation == 'add') {
  63.         if(submitcheck('submit')) {
  64.                 $uids = $tagarray = array();
  65.                 if($_GET['usernames']) {
  66.                         $_GET['usernames'] = trim(preg_replace("/\s*(\r\n|\n\r|\n|\r)\s*/", "\r\n", $_GET['usernames']));
  67.                         $_GET['usernames'] = explode("\r\n", $_GET['usernames']);
  68.                         $uids = C::t('common_member')->fetch_all_uid_by_username($_GET['usernames']);
  69.                 }
  70.                 if(empty($_GET['usernames']) || $uids) {
  71.                         $class_tag = new tag();
  72.                         $tagarray = $class_tag->add_tag($_GET['tags'], 0, 'uid', 1);
  73.                 }

  74.                 if($uids && $tagarray) {
  75.                         foreach($uids as $uid) {
  76.                                 if(empty($uid)) continue;
  77.                                 foreach($tagarray as $tagid => $tagname) {
  78.                                         C::t('common_tagitem')->insert(array('tagid' => $tagid, 'itemid' => $uid, 'idtype' => 'uid'), 0, 1);
  79.                                 }
  80.                         }
  81.                         cpmsg('usertag_add_succeed', 'action=usertag&operation=add', 'succeed');
  82.                 } else {
  83.                         if($tagarray && empty($_GET['usernames'])) {
  84.                                 cpmsg('usertag_add_tag_succeed', 'action=usertag&operation=add', 'succeed');
  85.                         } else {
  86.                                 cpmsg('usertag_add_error', 'action=usertag&operation=add', 'error');
  87.                         }
  88.                 }

  89.         }
  90.         showsubmenu('usertag', array(
  91.                 array('usertag_list', 'usertag', 0),
  92.                 array('usertag_add', 'usertag&operation=add', 1),
  93.         ));
  94.         showtips('usertag_add_tips');
  95.         showformheader('usertag&operation=add');
  96.         showtableheader();
  97.         showsetting('usertag_add_tags', 'tags', '', 'text');
  98.         showsetting('usertag_add_usernames', 'usernames', '', 'textarea');
  99.         showsubmit('submit', 'submit');
  100.         showtablefooter();
  101.         showformfooter();
  102. }
  103. ?>
复制代码

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表