Beispiel #1
0
		}
		
		if(empty($_GET['pmid'])) {
			$output .= "
				<a href=\"$phpself&action=delete&uid=$_GET[touid]\">删除</a>
				<form method=\"post\" action=\"$phpself&action=send\">
				<input name=\"touid\" type=\"hidden\" value=\"$_GET[touid]\">
				<input name=\"subject\" value=\"\"><br>
				<textarea name=\"message\" cols=\"30\" rows=\"5\"></textarea>
				<input type=\"submit\">
				</form>
				";
		}
		break;
	case 'delete':
		if(uc_pm_deleteuser($Example_uid, array($_GET['uid']))) {
			$output .= "短消息已删除。";
		}
		break;
	case 'addblackls':
		$user = !empty($_GET['user']) ? $_GET['user'] : (!empty($_POST['user']) ? $_POST['user'] : '');
		if(uc_pm_blackls_add($Example_uid, $user)) {
			$output .= $_GET['user']." 已加入黑名单。";
		}
		break;
	case 'deleteblackls':
		if(uc_pm_blackls_delete($Example_uid, $_GET['user'])) {
			$output .= $_GET['user']." 已从黑名单中移除。";
		}
		break;
	case 'viewblackls':
Beispiel #2
0
            $comment['comment'] = str_replace(array('[b]', '[/b]', '[/color]'), array(''), preg_replace("/\\[color=([#\\w]+?)\\]/i", '', strip_tags($comment['comment'])));
            $messageappend = htmlspecialchars('[url=' . $_G['siteurl'] . 'forum.php?mod=redirect&goto=findpost&pid=' . $comment['pid'] . '&ptid=' . $comment['tid'] . '][b]' . lang('spacecp', 'pm_comment') . '[/b][/url][quote]' . $comment['comment'] . '[/quote]');
        }
    } elseif (!empty($_G['gp_pid'])) {
        $thread = DB::fetch_first("SELECT t.tid, t.subject, p.pid FROM " . DB::table('forum_post') . " p\n\t\t\tLEFT JOIN " . DB::table('forum_thread') . " t ON t.tid=p.tid WHERE p.pid='{$_G['gp_pid']}'");
        if ($thread) {
            $messageappend = htmlspecialchars('[url=' . $_G['siteurl'] . 'forum.php?mod=redirect&goto=findpost&pid=' . $thread['pid'] . '&ptid=' . $thread['tid'] . '][b]' . lang('spacecp', 'pm_thread_about', array('subject' => $thread['subject'])) . '[/b][/url]');
        }
    }
} elseif ($_GET['op'] == 'delete') {
    $pmid = empty($_G['gp_pmid']) ? 0 : floatval($_G['gp_pmid']);
    $deluid = empty($_G['gp_deluid']) ? 0 : floatval($_G['gp_deluid']);
    $folder = $_G['gp_folder'] == 'inbox' ? 'inbox' : 'outbox';
    if (submitcheck('deletesubmit')) {
        if ($deluid) {
            $retrun = uc_pm_deleteuser($_G['uid'], array($deluid));
            $pmid = $deluid;
        } else {
            $retrun = uc_pm_delete($_G['uid'], $folder, array($pmid));
        }
        if ($retrun > 0) {
            showmessage('do_success', dreferer(), array('pmid' => $pmid), array('showdialog' => 1, 'showmsg' => true, 'closetime' => 1));
        } else {
            showmessage('this_message_could_not_be_deleted');
        }
    }
} elseif ($_GET['op'] == 'send') {
    $waittime = interval_check('post');
    if ($waittime > 0) {
        showmessage('operating_too_fast', '', 1, array($waittime));
    }
Beispiel #3
0
 function submenu_mail_box()
 {
     echo '<div class=wrap>';
     echo '<h2>' . __('Mail Box', 'ucenter') . '</h2>';
     global $current_user;
     wp_get_current_user();
     list($uid, $_, $_) = uc_get_user($current_user->user_login);
     $timeoffset = get_option('gmt_offset');
     $pm_per_page = 10;
     $max_msg_length = 100;
     $handler = $_SERVER['PHP_SELF'] . '?page=' . $_GET['page'];
     $current_handler = $handler . '&tab=' . $_GET['tab'];
     $action = !empty($_GET['action']) ? $_GET['action'] : '';
     $_GET['tab'] = !empty($_GET['tab']) ? $_GET['tab'] : 'inbox';
     $menu = array(array('inbox', '', __('Inbox', 'ucenter')), array('uread', 'filter=newpm', __('Unread Mail', 'ucenter')), array('announcepm', 'filter=announcepm', __('Public Message', 'ucenter')), array('systempm', 'filter=systempm', __('System Message', 'ucenter')), array('send', 'action=send', __('Send Message', 'ucenter')), array('blacklist', 'action=blacklist', __('Black List', 'ucenter')));
     echo '<ul class="ucenter-ul">';
     foreach ($menu as $item) {
         printf("<li><a href='{$handler}&tab={$item['0']}&{$item['1']}' %s>{$item['2']}</a></li>", $_GET['tab'] == $item[0] ? 'class="current"' : '');
     }
     echo '</ul><br /><hr />';
     switch ($action) {
         case '':
             $_GET['pageid'] = max(1, intval($_GET['pageid']));
             $_GET['filter'] = !empty($_GET['filter']) ? $_GET['filter'] : '';
             $data = uc_pm_list($uid, $_GET['pageid'], $pm_per_page, $_GET['folder'], $_GET['filter'], $max_msg_length);
             foreach ($data['data'] as $pm) {
                 if ($_GET['filter'] == 'announcepm' || $_GET['filter'] == 'systempm') {
                     $output .= "<li><a href='{$current_handler}&action=view&subtab=within3days&daterange=3&pmid={$pm['pmid']}'>{$pm['subject']}</a>";
                     $output .= '<br /> ' . __('Content:', 'ucenter') . $pm[message] . '</li>';
                 } else {
                     $output .= "<li><a href='{$current_handler}&action=view&subtab=within3days&daterange=3&touid={$pm['touid']}'>[{$pm['msgfrom']}]</a> (" . gmdate('Y-m-d H:i:s', $pm['dateline'] + $timeoffset * 3600) . ')';
                     $pm['new'] && ($output .= " New! ");
                     $output .= '<br /> ' . __('Content: ', 'ucenter') . $pm[message] . '</li>';
                 }
             }
             $page_n = $data['count'] / $pm_per_page;
             if ($page_n > 1) {
                 $output .= '<hr / ><br />';
                 $output .= __('Page ', 'ucenter');
                 for ($i = 1; $i <= $page_n; $i++) {
                     $output .= " <a href='{$current_handler}&pageid={$i}'>{$i}</a> ";
                 }
             }
             break;
         case 'view':
             $pmid = !empty($_GET['pmid']) ? $_GET['pmid'] : '';
             $daterange = !empty($_GET['daterange']) ? $_GET['daterange'] : '1';
             $data = uc_pm_view($uid, $pmid, $_GET['touid'], $daterange);
             $dateranges = array(array('within3days', '3', __('Within 3 Days', 'ucenter')), array('within1week', '4', __('Within This Week', 'ucenter')), array('all', '5', __('All', 'ucenter')));
             echo '<ul class="ucenter-ul">';
             foreach ($dateranges as $item) {
                 printf("<li><a href='{$current_handler}&action=view&touid={$_GET['touid']}&pmid={$pmid}&subtab={$item['0']}&daterange={$item['1']}' %s>{$item['2']}</a></li>", $_GET['subtab'] == $item[0] ? 'class="current"' : '');
             }
             echo '</ul><br /><hr />';
             foreach ($data as $pm) {
                 $output .= "<b>{$pm['msgfrom']}</b>";
                 if ($_GET['touid'] == $pm['msgfromid']) {
                     $output .= "<a href='{$current_handler}&action=addblacklist&user={$pm['msgfrom']}'>" . __(' [ Ban This User ] ', 'ucenter') . "</a>";
                 }
                 $output .= ' ( ' . gmdate('Y-m-d H:i:s', $pm['dateline'] + $timeoffset * 3600) . ' ) ';
                 $output .= "<br />{$pm['message']}<br /><br />";
             }
             if (empty($_GET['pmid'])) {
                 $output .= "\n\t\t\t\t\t\t<a href='{$current_handler}&action=delete&uid={$_GET['touid']}'>" . __('Delete All Message From This user', 'ucenter') . "</a><br />\n\t\t\t\t\t\tReply:\n\t\t\t\t\t\t<form method='post' action='{$current_handler}&action=send'>\n\t\t\t\t\t\t<input name='touid' type='hidden' value='{$_GET['touid']}'>\n\t\t\t\t\t\t<textarea name='message' cols='30' rows='5'></textarea><br />\n\t\t\t\t\t\t<input type='submit'>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t\t";
             }
             break;
         case 'delete':
             if (uc_pm_deleteuser($uid, array($_GET['uid']))) {
                 $output .= __('Deleted', 'ucenter');
             }
             break;
         case 'addblacklist':
             $user = !empty($_GET['user']) ? $_GET['user'] : (!empty($_POST['user']) ? $_POST['user'] : '');
             if (uc_pm_blackls_add($uid, $user)) {
                 $output .= $_GET['user'] . __('has been added to your black list', 'ucenter');
             }
             break;
         case 'deleteblacklist':
             if (uc_pm_blackls_delete($uid, $_GET['user'])) {
                 $output .= $_GET['user'] . __('has been removed from your black list', 'ucenter');
             }
             break;
         case 'blacklist':
             $data = explode(',', uc_pm_blackls_get($uid));
             foreach ($data as $ls) {
                 $ls && ($output .= "{$ls} <a href='{$current_handler}&action=deleteblacklist&user={$ls}'>" . __('Remove', 'ucenter') . "</a>");
             }
             $output .= "\n\t\t\t\t\t<form method='post' action='{$current_handler}&action=addblacklist'>\n\t\t\t\t\t<input type='input' name='user' value=''>\n\t\t\t\t\t<input type='submit'>\n\t\t\t\t\t</form>\n\t\t\t\t\t";
             break;
         case 'send':
             if (!empty($_POST)) {
                 if (!empty($_POST['touser'])) {
                     $msgto = $_POST['touser'];
                     $isusername = 1;
                 } else {
                     $msgto = $_POST['touid'];
                     $isusername = 0;
                 }
                 if (uc_pm_send($uid, $msgto, $_POST['subject'], $_POST['message'], 1, 0, $isusername)) {
                     $output .= __('Sended', 'ucenter');
                 } else {
                     $output .= __('Failed', 'ucenter');
                 }
             } else {
                 $output .= "\n\t\t\t\t\t\t<form method='post' action='{$current_handler}&action=send'>\n\t\t\t\t\t\t<table>\n\t\t\t\t\t\t<tr><td>" . __('to', 'ucenter') . ":</td><td><input name='touser' value='{$_GET['touser']}'></td></tr>\n\t\t\t\t\t\t<tr><td>" . __('subject', 'ucenter') . ":</td><td><input name='subject' value=''><br></td></tr>\n\t\t\t\t\t\t<tr><td>" . __('content', 'ucenter') . ":</td><td><textarea name='message' cols='30' rows='5'></textarea></td></tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<input type='submit'>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t\t";
             }
             break;
     }
     echo $output;
     echo '</div>';
 }
Beispiel #4
0
        if ($ucpm['data']) {
            foreach ($ucpm['data'] as $pm) {
                echo "<tr title=\"" . mhtmlspecialchars($pm['message']) . "\">\n<td align=\"left\" width=\"40\">" . ($box == 'announcepm' ? '' : "<input class=\"checkbox\" type=\"checkbox\" name=\"" . ($pm['msgformid'] ? "fids[{$pm['msgformid']}]\" value=\"{$pm['msgform']}" : "pmids[{$pm['pmid']}]\" value=\"{$pm['pmid']}") . '">') . "</td>\n" . "<td class=\"item2\">" . mhtmlspecialchars($pm['subject']) . "</td>\n" . "<td align=\"center\" width=\"120\">" . ($pm['msgfromid'] ? $pm['msgfrom'] : lang('syspm')) . "</td>\n" . "<td align=\"center\" width=\"40\">" . ($box == 'announcepm' ? '-' : lang($pm['new'] ? 'noread' : 'read')) . "</td>\n" . "<td align=\"center\" width=\"80\">" . date($dateformat, $pm['dateline']) . "</td>\n" . "<td align=\"center\" width=\"40\"><a href=\"?action=pmbox&box={$box}&page={$page}&" . ($pm['msgfromid'] ? "fid={$pm['msgfromid']}" : "pmid={$pm['pmid']}") . "\">" . lang('look') . "</a></td></tr>\n";
            }
        } else {
            echo '<tr class="item2" height="50"><td align="center" colspan="6">' . lang('nonepm') . '</td></tr>';
        }
        echo multi($ucpm['count'], $mrowpp, $page, "?action=pmbox");
        $box == 'announcepm' ? tabfooter() : tabfooter('bpmbox', lang('delete'));
    } else {
        //删除
        empty($fids) && empty($pmids) && mcmessage(lang('choosedeltem'), "?action=pmbox&box={$box}&page={$page}");
        is_array($fids) || ($fids = array($fids));
        is_array($pmids) || ($pmids = array($pmids));
        if ($fids) {
            uc_pm_deleteuser($uid, $fids);
        }
        if ($pmids) {
            uc_pm_delete($uid, 'inbox', $pmids);
        }
        mcmessage(lang('pm delete operate finish'), "?action=pmbox&box={$box}&page={$page}");
    }
} else {
    //阅读短信
    $days = array(1 => lang('today'), 3 => lang('near3days'), 4 => lang('thisweek'), 5 => lang('all'));
    $day = isset($day) && array_key_exists($day, $days) ? $day : 3;
    $ucpm = empty($fid) ? uc_pm_view($uid, $pmid, 0, $day) : uc_pm_view($uid, '', $fid, $day);
    //$ucpm=uc_pm_view($uid, $pmid, 0, 3);
    //	exit(var_export($ucpm));
    empty($ucpm) && mcmessage(lang('nonenewpm'));
    $fuser = '';
 case 'view':
     $pmid = !empty($_GET['pmid']) ? $_GET['pmid'] : '';
     $data = uc_pm_view($Cta_uid, $pmid, $_GET['touid']);
     foreach ($data as $pm) {
         $output .= "<b>{$pm['msgfrom']} (" . gmdate('Y-m-d H:i:s', $pm['dateline'] + $timeoffset * 3600) . "):</b>";
         if ($_GET['touid'] == $pm['msgfromid']) {
             $output .= "<a href=\"{$phpself}&action=addblackls&user={$pm['msgfrom']}\">[屏蔽]</a>";
         }
         $output .= "<br>{$pm['message']}<br><br>";
     }
     if (empty($_GET['pmid'])) {
         $output .= "\r\n\t\t\t\t<a href=\"{$phpself}&action=delete&uid={$_GET['touid']}\">删除</a>\r\n\t\t\t\t<form method=\"post\" action=\"{$phpself}&action=send\">\r\n\t\t\t\t<input name=\"touid\" type=\"hidden\" value=\"{$_GET['touid']}\">\r\n\t\t\t\t<input name=\"subject\" value=\"\"><br>\r\n\t\t\t\t<textarea name=\"message\" cols=\"30\" rows=\"5\"></textarea>\r\n\t\t\t\t<input type=\"submit\">\r\n\t\t\t\t</form>\r\n\t\t\t\t";
     }
     break;
 case 'delete':
     if (uc_pm_deleteuser($Cta_uid, array($_GET['uid']))) {
         $output .= "短消息已删除。";
     }
     break;
 case 'addblackls':
     $user = !empty($_GET['user']) ? $_GET['user'] : (!empty($_POST['user']) ? $_POST['user'] : '');
     if (uc_pm_blackls_add($Cta_uid, $user)) {
         $output .= $_GET['user'] . " 已加入黑名单。";
     }
     break;
 case 'deleteblackls':
     if (uc_pm_blackls_delete($Cta_uid, $_GET['user'])) {
         $output .= $_GET['user'] . " 已从黑名单中移除。";
     }
     break;
 case 'viewblackls':
Beispiel #6
0
    } elseif ($pmid == -2) {
        showmessage('pm_send_floodctrl_error');
    } elseif ($pmid == -3) {
        showmessage('pm_send_batnotfriend_error');
    } elseif ($pmid == -4) {
        showmessage('pm_send_pmsendregdays_error');
    } else {
        showmessage('pm_send_invalid');
    }
} elseif ($action == 'del') {
    $uid = !empty($uid) ? !is_array($uid) ? array($uid) : $uid : array();
    $pmid = !empty($pmid) ? !is_array($pmid) ? array($pmid) : $pmid : array();
    if ($uid || $pmid) {
        if (!$readopt) {
            if ($uid) {
                uc_pm_deleteuser($discuz_uid, $uid);
            }
            if ($pmid) {
                uc_pm_delete($discuz_uid, 'inbox', $pmid);
            }
            showmessage('pm_delete_succeed', "pm.php?filter={$filter}&page={$page}");
        } else {
            uc_pm_readstatus($discuz_uid, $uid, $pmid, $readopt == 1 ? 0 : 1);
            showmessage($readopt == 1 ? 'pm_mark_read_succeed' : 'pm_mark_unread_succeed', "pm.php?filter={$filter}&page={$page}");
        }
    } else {
        showmessage('pm_nonexistence', "pm.php?filter={$filter}&page={$page}");
    }
} elseif ($action == 'addblack') {
    if ($formhash != FORMHASH) {
        showmessage('undefined_action', NULL, 'HALTED');
Beispiel #7
0
 $delplid = is_array($_GET['deletepm_delplid']) ? $_GET['deletepm_delplid'] : 0;
 $quitplid = is_array($_GET['deletepm_quitplid']) ? $_GET['deletepm_quitplid'] : 0;
 if (empty($gpmid) && empty($deluid) && empty($delpmid) && empty($delplid) && empty($quitplid)) {
     showmessage('delete_pm_error_option');
 }
 if (submitcheck('deletesubmit', 1)) {
     $flag = true;
     if (!empty($gpmid)) {
         $return = C::t('common_member_grouppm')->update($_G['uid'], $gpmid, array('status' => -1));
         $returnurl = 'home.php?mod=space&do=pm&filter=announcepm';
         if (!$return) {
             $flag = false;
         }
     }
     if (!empty($deluid)) {
         $return = uc_pm_deleteuser($_G['uid'], $deluid);
         $returnurl = 'home.php?mod=space&do=pm&filter=privatepm';
         if ($return <= 0) {
             $flag = false;
         }
     }
     if (!empty($delpmid)) {
         $return = uc_pm_delete($_G['uid'], 'inbox', $delpmid[0]);
         $returnurl = 'home.php?mod=space&do=pm&subop=view&touid=' . $touid;
         if ($return <= 0) {
             $flag = false;
         }
     }
     if (!empty($delplid)) {
         $return = uc_pm_deletechat($_G['uid'], $delplid, 1);
         $returnurl = 'home.php?mod=space&do=pm&filter=privatepm';