Example #1
0
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
$pmid = empty($_GET['pmid']) ? 0 : floatval($_GET['pmid']);
$uid = empty($_GET['uid']) ? 0 : intval($_GET['uid']);
if ($uid) {
    $touid = $uid;
} else {
    $touid = empty($_GET['touid']) ? 0 : intval($_GET['touid']);
}
$daterange = empty($_GET['daterange']) ? 1 : intval($_GET['daterange']);
loaducenter();
if ($_GET['op'] == 'checknewpm') {
    if ($_G['uid']) {
        $ucnewpm = uc_pm_checknew($_G['uid']);
        if ($_G['member']['newpm'] != $ucnewpm) {
            DB::query("UPDATE " . DB::table('common_member') . " SET newpm='{$ucnewpm}' WHERE uid='{$_G['uid']}'");
        }
    }
    dsetcookie('checkpm', 1, 30);
    exit;
} elseif ($_GET['op'] == 'getpmuser') {
    $otherpm = $json = array();
    $result = uc_pm_list($_G['uid'], 1, 30, 'inbox', 'privatepm');
    foreach ($result['data'] as $key => $value) {
        $value['msgfrom'] = daddslashes($value['msgfrom']);
        $value['avatar'] = avatar($value['msgfromid'], 'small', true);
        if ($value['new']) {
            $json[$value['msgfromid']] = "{$value['msgfromid']}:{'uid':{$value['msgfromid']}, 'username':'******'msgfrom']}', 'avatar':'{$value['avatar']}', 'pmid':{$value['pmid']}, 'new':{$value['new']}, 'daterange':{$value['daterange']}}";
        } else {
Example #2
0
<?php

!function_exists('html') && exit('ERR');
if ($lfjid) {
    @(include ROOT_PATH . "data/level.php");
    if (ereg("^pwbbs", $webdb[passport_type]) && !is_array($db_modes)) {
        @extract($db->get_one("SELECT COUNT(*) AS pmNUM FROM {$TB_pre}msg WHERE `touid`='{$lfjuid}' AND type='rebox' AND ifnew=1"));
    } elseif (ereg("^dzbbs", $webdb[passport_type])) {
        if ($webdb[passport_type] == 'dzbbs7') {
            $pmNUM = uc_pm_checknew($lfjuid);
        } else {
            @extract($db->get_one("SELECT COUNT(*) AS pmNUM FROM {$TB_pre}pms WHERE `msgtoid`='{$lfjuid}' AND folder='inbox' AND new=1"));
        }
    } else {
        @extract($db->get_one("SELECT COUNT(*) AS pmNUM FROM `{$pre}pm` WHERE `touid`='{$lfjuid}' AND type='rebox' AND ifnew='1'"));
    }
    if (!$pmNUM) {
        $MSG = "<A target=\"_blank\" HREF=\"{$webdb['www_url']}/member/index.php?main=pm.php?job=list\">站内消息</A>";
    } else {
        $MSG = "<A target=\"_blank\" HREF=\"{$webdb['www_url']}/member/index.php?main=pm.php?job=list\" style=\"color:blue;\">你有新消息({$pmNUM})</a>";
    }
    $lfjdb[_lastvist] = date("Y-m-d H:i", $lfjdb[lastvist]);
    $lfjdb[_regdate] = date("Y-m-d H:i", $lfjdb[regdate]);
}
if ($styletype && !eregi("^[-_0-9a-z]+\$", $styletype)) {
    showerr("风格样式有误", 1);
} elseif (!$styletype) {
    $styletype = 0;
}
require_once html("login_tpl/{$styletype}");
$show = ob_get_contents();
Example #3
0
if (!defined('IN_UCHOME')) {
    exit('Access Denied');
}
$pmid = empty($_GET['pmid']) ? 0 : floatval($_GET['pmid']);
$uid = empty($_GET['uid']) ? 0 : intval($_GET['uid']);
if ($uid) {
    $touid = $uid;
} else {
    $touid = empty($_GET['touid']) ? 0 : intval($_GET['touid']);
}
$daterange = empty($_GET['daterange']) ? 1 : intval($_GET['daterange']);
include_once S_ROOT . './uc_client/client.php';
if ($_GET['op'] == 'checknewpm') {
    //检查当前用户
    if ($_SGLOBAL['supe_uid']) {
        $ucnewpm = uc_pm_checknew($_SGLOBAL['supe_uid']);
        if ($_SGLOBAL['member']['newpm'] != $ucnewpm) {
            updatetable('space', array('newpm' => $ucnewpm), array('uid' => $_SGLOBAL['supe_uid']));
        }
    }
    ssetcookie('checkpm', 1, 30);
    exit;
} elseif ($_GET['op'] == 'delete') {
    $pmid = empty($_GET['pmid']) ? 0 : floatval($_GET['pmid']);
    $folder = $_GET['folder'] == 'inbox' ? 'inbox' : 'outbox';
    if (submitcheck('deletesubmit')) {
        $retrun = uc_pm_delete($_SGLOBAL['supe_uid'], $folder, array($pmid));
        if ($retrun > 0) {
            showmessage('do_success', $_POST['refer'], 0);
        } else {
            showmessage('this_message_could_not_be_deleted');
Example #4
0
function API_NewMsg($more = 0)
{
    global $userid;
    include_once ONEZ_ROOT . './uc_client/client.php';
    return uc_pm_checknew($userid, $more);
}
Example #5
0
 */
include './config.inc.php';
include './uc_client/client.php';
/**
 * Get the current user UID and user name
 * Cookie decryption directly by uc_authcode function, users use their own functions
 */
if (!empty($_COOKIE['Example_auth'])) {
    list($Example_uid, $Example_username) = explode("\t", uc_authcode($_COOKIE['Example_auth'], 'DECODE'));
} else {
    $Example_uid = $Example_username = '';
}
/**
 * Get the latest PMs
 */
$newpm = uc_pm_checknew($Example_uid);
/**
 * Example code for each function
 */
switch (@$_GET['example']) {
    case 'login':
        //Example code UCenter User login
        include 'code/login_nodb.php';
        break;
    case 'logout':
        //Example code UCenter user Logout
        include 'code/logout.php';
        break;
    case 'register':
        //Example code UCenter user registration
        include 'code/register_nodb.php';
Example #6
0
<?php

defined('M_COM') && $enable_uc || exit('No Permission');
/*
只能发送单个信息,发送多个失败,可能用用户名不能发多个,而只能用id
*/
$page = isset($page) ? $page : 1;
$page = max(1, intval($page));
require_once M_ROOT . './include/ucenter/config.inc.php';
require_once M_ROOT . './uc_client/client.php';
list($uid, $username) = uc_get_user($curuser->info['mname']);
$boxs = array('newpm', 'privatepm', 'systempm', 'announcepm');
$boxl = array('noreadpm', 'memberpm', 'syspm', 'ucpm');
//添加缓存机会
$new = uc_pm_checknew($uid, 4);
$new['privatepm'] = $new['newprivatepm'];
$new['systempm'] = $new['newpm'] - $new['privatepm'];
$action == 'pmbox' && ($box = !empty($box) && in_array($box, $boxs) ? $box : ($new['newpm'] ? 'newpm' : 'privatepm'));
$l = count($boxs);
$urlsarr = array('pmsend' => array(lang('sendpm'), '?action=pmsend'));
for ($i = 0; $i < $l; $i++) {
    $urlsarr[$boxs[$i]] = array(lang($boxl[$i]) . ($new[$boxs[$i]] ? '(' . $new[$boxs[$i]] . ')' : ''), "?action=pmbox&box={$boxs[$i]}&page={$page}");
}
murl_nav($urlsarr, 'pmbox' == $action ? $box : 'pmsend', 6);
if ($action == 'pmsend') {
    if (!submitcheck('bpmsend')) {
        //发送框
        tabheader(lang('sendpm'), 'pmsend', "?action=pmsend&box={$box}&page={$page}", 2, 0, 1);
        trbasic(lang('pmtitle'), 'pmnew[title]', '', 'btext');
        trbasic(lang('pmtonames'), 'pmnew[tonames]', empty($tonames) ? '' : $tonames, 'btext');
        trbasic(lang('pmcontent'), 'pmnew[content]', '', 'btextarea');
Example #7
0
        }
        if ($gpmids) {
            $query = DB::query("SELECT * FROM " . DB::table("common_grouppm") . " WHERE id IN (" . dimplode($gpmids) . ") ORDER BY id DESC");
            while ($grouppm = DB::fetch($query)) {
                $grouppm['message'] = cutstr(strip_tags($grouppm['message']), 100, '');
                $grouppms[] = $grouppm;
            }
        }
    }
    if ($filter == 'privatepm' || $filter == 'newpm') {
        $result = uc_pm_list($_G['uid'], $page, $perpage, 'inbox', $filter, 200);
        $count = $result['count'];
        $list = $result['data'];
    }
    if ($filter == 'privatepm' && $page == 1) {
        $newpmarr = uc_pm_checknew($_G['uid'], 1);
        $newpm = $newpmarr['newpm'];
    }
    if ($_G['member']['newpm']) {
        DB::update('common_member', array('newpm' => 0), array('uid' => $_G['uid']));
        uc_pm_ignore($_G['uid']);
    }
    $multi = multi($count, $perpage, $page, "home.php?mod=space&do=pm&filter={$filter}");
    $actives = array($filter => ' class="a"');
}
if (!empty($list)) {
    $today = $_G['timestamp'] - ($_G['timestamp'] + $_G['setting']['timeoffset'] * 3600) % 86400;
    foreach ($list as $key => $value) {
        /*vot*/
        $value['lastsummary'] = stripslashes($value['lastsummary']);
        $value['lastsummary'] = str_replace('&amp;', '&', $value['lastsummary']);
Example #8
0
}
$pmid = empty($_GET['pmid']) ? 0 : floatval($_GET['pmid']);
$uid = empty($_GET['uid']) ? 0 : intval($_GET['uid']);
$plid = empty($_GET['plid']) ? 0 : intval($_GET['plid']);
$opactives['pm'] = 'class="a"';
if ($uid) {
    $touid = $uid;
} else {
    $touid = empty($_GET['touid']) ? 0 : intval($_GET['touid']);
}
$daterange = empty($_GET['daterange']) ? 1 : intval($_GET['daterange']);
loaducenter();
if ($_GET['op'] == 'checknewpm') {
    header('Content-Type: text/javascript');
    if ($_G['uid'] && !getstatus($_G['member']['newpm'], 1)) {
        $ucnewpm = intval(uc_pm_checknew($_G['uid']));
        $newpm = setstatus(1, $ucnewpm ? 1 : 0, $_G['member']['newpm']);
        if ($_G['member']['newpm'] != $newpm) {
            C::t('common_member')->update($_G['uid'], array('newpm' => $newpm));
        }
    }
    dsetcookie('checkpm', 1, 30);
    exit;
} elseif ($_GET['op'] == 'getpmuser') {
    $otherpm = $json = array();
    $result = uc_pm_list($_G['uid'], 1, 30, 'inbox', 'privatepm');
    foreach ($result['data'] as $key => $value) {
        $value['lastauthor'] = daddslashes($value['lastauthor']);
        $value['avatar'] = avatar($value['lastauthorid'], 'small', true);
        if ($value['isnew']) {
            $json[$value['lastauthorid']] = "{$value['lastauthorid']}:{'uid':{$value['lastauthorid']}, 'username':'******'lastauthor']}', 'avatar':'{$value['avatar']}', 'plid':{$value['plid']}, 'isnew':{$value['isnew']}, 'daterange':{$value['daterange']}}";
Example #9
0
    foreach ($ucdata['data'] as $pm) {
        $pm['msgfromurl'] = $pm['fromappid'] && $ucapp[$pm['fromappid']]['viewprourl'] ? sprintf($ucapp[$pm['fromappid']]['viewprourl'], $pm['msgfromid']) : 'space.php?uid=' . $pm['msgfromid'];
        $pm['daterange'] = 5;
        if ($pm['dateline'] >= $today) {
            $pm['daterange'] = 1;
        } elseif ($pm['dateline'] >= $today - 86400) {
            $pm['daterange'] = 2;
        } elseif ($pm['dateline'] >= $today - 172800) {
            $pm['daterange'] = 3;
        }
        $pm['date'] = gmdate($dateformat, $pm['dateline'] + $timeoffset * 3600);
        $pm['time'] = gmdate($timeformat, $pm['dateline'] + $timeoffset * 3600);
        $pmlist[] = $pm;
    }
} elseif ($action == 'viewnew') {
    $newpmnum = uc_pm_checknew($discuz_uid);
    $pmlist = array();
    if ($newpmnum) {
        $num = min(5, $newpmnum);
        $morenum = max(0, $newpmnum - 5);
        $ucdata = uc_pm_list($discuz_uid, 1, $num, 'inbox', 'newpm', 0);
        $today = $timestamp - ($timestamp + $timeoffset * 3600) % 86400;
        foreach ($ucdata['data'] as $pm) {
            $pm['daterange'] = 5;
            if ($pm['dateline'] >= $today) {
                $pm['daterange'] = 1;
            } elseif ($pm['dateline'] >= $today - 86400) {
                $pm['daterange'] = 2;
            } elseif ($pm['dateline'] >= $today - 172800) {
                $pm['daterange'] = 3;
            }
        $gzflag = true;
        break;
    }
}
//私信
$filter = in_array($_GET['filter'], array('newpm', 'privatepm', 'announcepm')) ? $_GET['filter'] : 'privatepm';
$newpm = $newpmcount = 0;
if ($filter == 'privatepm' || $filter == 'announcepm' || $filter == 'newpm') {
    $announcepm = 0;
    foreach (C::t('common_member_grouppm')->fetch_all_by_uid($_G['uid'], $filter == 'announcepm' ? 1 : 0) as $gpmid => $gpuser) {
        $gpmstatus[$gpmid] = $gpuser['status'];
        if ($gpuser['status'] == 0) {
            $announcepm++;
        }
    }
    $gpmids = array_keys($gpmstatus);
    if ($gpmids) {
        foreach (C::t('common_grouppm')->fetch_all_by_id_authorid($gpmids) as $grouppm) {
            $grouppm['message'] = cutstr(strip_tags($grouppm['message']), 100, '');
            $grouppms[] = $grouppm;
        }
    }
}
loaducenter();
if ($filter == 'privatepm' || $filter == 'newpm') {
    $newpmarr = uc_pm_checknew($uid, 1);
    $newpm = $newpmarr['newpm'];
}
$newpmcount = $newpm + $announcepm;
//end add
require_once libfile('space/' . $do, 'include');
Example #11
0
<?php

/**
* @file checknewpm.php
* @Brief check whether there are new pms
* @author youzu
* @version 1.0.0
* @date 2015-07-07
*/
if (!defined('IN_MOBILE_API')) {
    exit('Access Denied');
}
define('APPTYPEID', 0);
define('CURSCRIPT', 'member');
require './source/class/class_core.php';
$discuz = C::app();
$discuz->init();
loaducenter();
$newpm['newpm'] = intval(uc_pm_checknew($_G['uid']));
require_once dirname(dirname(dirname(__FILE__))) . '/bigappjson.class.php';
echo BIGAPPJSON::encode($newpm);
die(0);
Example #12
0
		$_DCACHE['settings']['announcepm'] = $ucnewpm['announcepm'];
		require_once DISCUZ_ROOT.'./include/cache.func.php';
		updatesettings();
		$s .= updateprompt('announcepm', $discuz_uid, $ucnewpm['announcepm'], 0);
	}
	dsetcookie('checkpm', 1, 30, 0);
	include_once template('pm_checknew');
	exit;
}

$page = max($page, 1);
$action = !empty($action) ? $action : (isset($uid) || !empty($pmid) ? 'view' : '');

if(!$action) {

	$pmstatus = uc_pm_checknew($discuz_uid, 4);
	$filter = !empty($filter) && in_array($filter, array('newpm', 'privatepm', 'announcepm')) ? $filter : ($pmstatus['newpm'] ? 'newpm' : 'privatepm');
	$ucdata = uc_pm_list($discuz_uid, $page, $ppp, !isset($search) ? 'inbox' : 'searchbox', !isset($search) ? $filter : $srchtxt, 200);
	if(!empty($search) && $srchtxt !== '') {
		$filter = '';
		$srchtxtinput = htmlspecialchars(stripslashes($srchtxt));
		$srchtxtenc = rawurlencode($srchtxt);
	} else {
		$multipage = multi($ucdata['count'], $ppp, $page, 'pm.php?filter='.$filter);
	}
	$_COOKIE['checkpm'] && setcookie('checkpm', '', -86400 * 365);

	$pmlist = array();
	$today = $timestamp - ($timestamp + $timeoffset * 3600) % 86400;
	foreach($ucdata['data'] as $pm) {
		$pm['msgfromurl'] = $pm['fromappid'] && $ucapp[$pm['fromappid']]['viewprourl'] ? sprintf($ucapp[$pm['fromappid']]['viewprourl'], $pm['msgfromid']) : 'space.php?uid='.$pm['msgfromid'];
Example #13
0
<?php

include_once 'common.php';
include_once S_ROOT . './uc_client/client.php';
$page = max($page, 1);
$action = !empty($action) ? $action : (isset($uid) || !empty($pmid) ? 'view' : '');
$ppp = 10;
$pmstatus = uc_pm_checknew($_SGLOBAL['supe_uid'], 4);
$systemnewpm = $pmstatus['newpm'] - $pmstatus['newprivatepm'];
$filter = 'newpm';
$ucdata = uc_pm_list($_SGLOBAL['supe_uid'], $page, $ppp, !isset($search) ? 'inbox' : 'searchbox', !isset($search) ? $filter : $srchtxt, 200);
if (!empty($search) && $srchtxt !== '') {
    $filter = '';
    $srchtxtinput = htmlspecialchars(stripslashes($srchtxt));
    $srchtxtenc = rawurlencode($srchtxt);
} else {
    $multipage = multi($ucdata['count'], $ppp, $page, 'pm.php?filter=' . $filter);
}
$_COOKIE['checkpm'] && setcookie('checkpm', '', -86400 * 365);
$pmlist = array();
$today = $timestamp - ($timestamp + $timeoffset * 3600) % 86400;
foreach ($ucdata['data'] as $pm) {
    $pm['msgfromurl'] = $pm['fromappid'] && $ucapp[$pm['fromappid']]['viewprourl'] ? sprintf($ucapp[$pm['fromappid']]['viewprourl'], $pm['msgfromid']) : 'space.php?uid=' . $pm['msgfromid'];
    $pm['daterange'] = 5;
    if ($pm['dateline'] >= $today) {
        $pm['daterange'] = 1;
    } elseif ($pm['dateline'] >= $today - 86400) {
        $pm['daterange'] = 2;
    } elseif ($pm['dateline'] >= $today - 172800) {
        $pm['daterange'] = 3;
    }
Example #14
0
<?php

/*
	[CYASK] (C)2007 Cyask.com QQ: 240508015
	Revision: 3.0.0 for Discuz
	Date: 2007/4/23
*/
define('CURSCRIPT', 'msgcheck');
require_once './include/common.inc.php';
if ($cyask_uid) {
    exit(uc_pm_checknew($cyask_uid));
} else {
    exit;
}