本文整理汇总了PHP中jsg_member_info函数的典型用法代码示例。如果您正苦于以下问题:PHP jsg_member_info函数的具体用法?PHP jsg_member_info怎么用?PHP jsg_member_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了jsg_member_info函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: ShowReminded
function ShowReminded()
{
if ((int) $this->Config['ajax_topic_time'] < 1) {
exit;
}
$uid = max(0, (int) $this->Post['uid']);
if ($uid < 1) {
exit;
}
$fcode = jpost('fcode');
$all_topic_notice = 'topicnew' == $fcode;
$__my = jsg_member_info($uid);
if (!$__my) {
exit;
}
$time = TIMESTAMP;
$is_uptime = $this->Post['is_uptime'];
if ($is_uptime == 1) {
DB::query("update `" . TABLE_PREFIX . "members` set `lastactivity`='{$time}' where `uid`='{$uid}'");
cache_db('rm', "{$uid}-topic-%", 1);
echo '<success></success>';
echo "<script language='Javascript'>";
echo "listTopic(0,0);";
echo "</script>";
exit;
}
$total_record = jlogic('buddy')->check_new_topic($uid, 0, 0, $all_topic_notice);
jsg_setcookie('topnotice', 'block');
include template('ajax_reminded');
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:30,代码来源:reminded.mod.php
示例2: add
function add($tag, $uid = MEMBER_ID)
{
$tag = jfilter($tag, 'txt');
$uid = jfilter($uid, 'int');
$info = $this->info($tag, $uid);
if ($info) {
return $info;
}
if ($uid < 1) {
return jerror('请指定一个正确的UID');
}
$uinfo = jsg_member_info($uid);
if (!$uinfo) {
return jerror('指定的UID已经不存在了');
}
if (!$tag) {
return jerror('请指定一个正确的话题');
}
$tinfo = jtable('tag')->info(array('name' => $tag));
if (!$tinfo) {
return jerror('指定的话题已经不存在了');
}
$data = array('tag' => $tag, 'uid' => $uid, 'dateline' => TIMESTAMP);
$id = $this->db->insert($data, 1, 1, 1);
if ($id > 0) {
$this->_rm_my_cache($uid);
jtable('members')->update_count($uid, 'tag_favorite_count', '+1');
jtable('tag')->update_count(array('name' => $tag), 'tag_count', '+1');
$info = $this->info($tag, $uid);
}
return $info;
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:32,代码来源:tag_favorite.logic.php
示例3: Main
function Main()
{
$uid = MEMBER_ID;
if ($uid < 1) {
$this->Messager("请先<a href='index.php?mod=login'>点此登录</a>或者<a href='index.php?mod=member'>点此注册</a>一个帐号", 'index.php?mod=login');
}
$member = jsg_member_info($uid);
$sql = "select * from `" . TABLE_PREFIX . "blacklist` where `uid` = '" . MEMBER_ID . "' ";
$query = $this->DatabaseHandler->Query($sql);
$uids = array();
while (false != ($row = $query->GetRow())) {
$uids[$row['touid']] = $row['touid'];
}
if ($uids) {
$where = "where `uid` in (" . jimplode($uids) . ")";
$member_list = $this->_MemberList($where);
if ($uids && MEMBER_ID > 0) {
$sql = "select `uid`,`tid`,`content`,`dateline` from `" . TABLE_PREFIX . "topic` where `uid` in (" . jimplode($uids) . ") group by `uid` order by `dateline` desc";
$query = $this->DatabaseHandler->Query($sql);
$topic_list = array();
while (false != ($row = $query->GetRow())) {
$row['content'] = cut_str($row['content'], 100);
$row['dateline'] = my_date_format2($row['dateline']);
$topic_list[] = $row;
}
}
}
$group_list = jlogic('buddy_follow_group')->get_my_group(MEMBER_ID);
$this->Title = '黑名单';
include template('social/blacklist');
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:31,代码来源:blacklist.mod.php
示例4: Modify
function Modify()
{
$member = jsg_member_info(MEMBER_ID);
$theme_id = $this->Member['theme_id'];
$theme_bg_image = $this->Member['theme_bg_image'];
$theme_bg_color = $this->Member['theme_bg_color'];
$theme_text_color = $this->Member['theme_text_color'];
$theme_link_color = $this->Member['theme_link_color'];
$theme_bg_image_type = $this->Member['theme_bg_image_type'];
$theme_bg_repeat = $this->Member['theme_bg_repeat'];
$theme_bg_fixed = $this->Member['theme_bg_fixed'];
$open_theme_list = jconf::get('theme');
$themelist = $open_theme_list['theme_list'];
$count = 0;
foreach ($themelist as $k => $v) {
$v['element'] = "{$v[theme_bg_color]},{$v[theme_text_color]},{$v[theme_link_color]},{$v[theme_id]},{$v[theme_bg_image_type]}";
$themelist[$k] = $v;
$count = $count + 1;
}
$prepage = 8;
$page_count = ceil($count / $prepage);
$page = 1;
if ($count > $perpage) {
$multi .= '<a href=\'javascript:;\' onclick=\'pre("pre");\'>上一页</a>';
$multi .= ' <a href=\'javascript:;\' onclick=\'pre("next");\'>下一页</a>';
}
$my_bg_image = RELATIVE_ROOT_PATH . 'images/theme/' . face_path(MEMBER_ID) . MEMBER_ID . '_o.jpg';
if (is_file($my_bg_image)) {
$my_bg_image = $this->Config['site_url'] . "/" . $my_bg_image;
} else {
$my_bg_image = '';
}
$this->Title = "个人模板设置";
include template('topic_theme');
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:35,代码来源:skin.mod.php
示例5: ModuleObject
function ModuleObject($config)
{
$this->MasterObject($config);
$qun_setting = $this->Config['qun_setting'];
if (MEMBER_ROLE_TYPE != 'admin') {
if (!$qun_setting['qun_open']) {
$this->Messager('站点暂时不开放' . $this->Config[changeword][weiqun] . '功能', 'index.php');
}
}
$this->TopicLogic = jlogic('topic');
$this->my = array();
if (MEMBER_ID < 1 && $this->Code) {
$this->Messager("请先<a href='index.php?mod=login'>点此登录</a>或者<a href='index.php?mod=member'>点此注册</a>一个帐号", 'index.php?mod=login');
}
$this->my = jsg_member_info(MEMBER_ID);
$this->ShowConfig = jconf::get('show');
Load::logic('qun');
$this->QunLogic = new QunLogic();
ob_start();
$code = $this->Code;
if (!empty($this->Get['qid']) && empty($code)) {
$code = 'view';
$this->Code = $code;
}
if (method_exists('ModuleObject', $code)) {
$this->{$code}();
} else {
$this->Code = 'index';
$this->index();
}
$body = ob_get_clean();
$this->ShowBody($body);
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:33,代码来源:qun.mod.php
示例6: get_at_my_topic
public function get_at_my_topic($p)
{
$rets = array();
$uid = isset($p['uid']) ? (int) $p['uid'] : MEMBER_ID;
$member = jsg_member_info($uid);
if ($member) {
if ($member['at_new'] > 0) {
jlogic('member')->clean_new_remind('at_new', $member['uid']);
}
$rets = $this->get_at_my_tid($p, 1);
if ($rets && is_array($rets)) {
if (!$rets['error']) {
$rets['member'] = $member;
$rets['list'] = $rets['count'] > 0 && $rets['ids'] ? jlogic('topic')->Get($rets['ids']) : array();
if ($rets['list']) {
if ($GLOBALS['_J']['config']['is_topic_user_follow'] && !$GLOBALS['_J']['disable_user_follow']) {
if (true === IN_JISHIGOU_WAP) {
$rets['list'] = buddy_follow_html($rets['list'], 'uid', 'wap_follow_html');
} else {
$rets['list'] = jlogic('buddy')->follow_html2($rets['list']);
}
}
$rets['parent_list'] = jlogic('topic')->get_parent_list($rets['list']);
}
if (true === IN_JISHIGOU_WAP) {
$rets = wap_iconv($rets);
}
}
}
} else {
return jerror('您无权查看该信息,请先登录', -1);
}
return $rets;
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:34,代码来源:topic_mention.logic.php
示例7: reminded
function reminded()
{
$my = jsg_member_info(MEMBER_ID);
if (!$my) {
Mobile::error("No User", 300);
}
$ret = array('at_count' => $my['at_new'], 'comment_count' => $my['comment_new'], 'pm_count' => $my['newpm'], 'total' => (string) ($my['at_new'] + $my['comment_new'] + $my['newpm']));
Mobile::output($ret);
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:9,代码来源:misc.mod.php
示例8: new_tc
public function new_tc($p)
{
$member = jsg_member_info(MEMBER_ID);
$province_id = max(0, (int) $p['province_id']);
$city_id = max(0, (int) $p['city_id']);
$area_id = max(0, (int) $p['area_id']);
if ($province_id < 1) {
if ($province = $member['province']) {
$province_id = jlogic('common_district')->get_id_by_name($province);
if ($province_id > 0 && ($city = $member['city'])) {
$city_id = jlogic('common_district')->get_id_by_name($city);
if ($city_id > 0) {
$area = $member['area'];
}
}
}
} else {
$province = jlogic('common_district')->get_name_by_id($province_id);
if ($province && $city_id > 0) {
$city = jlogic('common_district')->get_name_by_id($city_id);
if ($city && $area_id > 0) {
$area = jlogic('common_district')->get_name_by_id($area_id);
}
}
}
$ps = array('cache_time' => max(0, (int) $p['cache_time']), 'cache_key' => 'topic-new_tc-' . "{$province}-{$city}-{$area}", 'page_url' => $p['page_url'], 'province' => $province, 'city' => $city, 'area' => $area, 'type' => get_topic_type(), 'vip' => $GLOBALS['_J']['config']['only_show_vip_topic']);
if (isset($p['perpage'])) {
$ps['perpage'] = (int) $p['perpage'];
if ($ps['perpage'] < 1) {
$ps['perpage'] = 20;
}
}
$rets = jlogic('topic_list')->get_tc_data($ps);
if (is_array($rets)) {
$rets['province'] = $province;
$rets['city'] = $city;
$rets['area'] = $area;
$rets['province_id'] = $province_id;
$rets['city_id'] = $city_id;
$rets['area_id'] = $area_id;
if ($member) {
$rets['member'] = $member;
}
if ($rets['list']) {
$rets['parent_list'] = jlogic('topic')->get_parent_list($rets['list']);
$rets['relate_list'] = jlogic('topic')->get_relate_list($rets['list']);
if ($GLOBALS['_J']['plugins']['func']['printtopic']) {
foreach ($rets['list'] as $row) {
jlogic('plugin')->hookscript('printtopic', 'funcs', $row, 'printtopic');
}
}
}
}
return $rets;
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:55,代码来源:plaza.logic.php
示例9: get
function get($p = array())
{
$uid = (int) $p['uid'];
$uid = $uid > 0 ? $uid : MEMBER_ID;
if ($uid < 1) {
return jerror('获取用户粉丝列表数据时,UID不能为空或您没有登录系统', -1);
}
$member = jsg_member_info($uid);
if (empty($member)) {
return jerror('您要查看的用户已经不存在了,UID错误', -2);
}
$count = (int) $member['fans_count'];
if ($count < 1) {
return array();
}
$page_num = 10;
if (isset($p['page_num'])) {
$page_num = (int) $p['page_num'];
if ($page_num < 1 || $page_num > 100) {
return jerror('请设置每页显示的数量在 1 ~ 100 之间', -3);
}
}
$ps = array('result_count' => $count, 'page_num' => $page_num, 'page_url' => $p['page_url'], 'sql_field' => ' M.* ', 'sql_table' => ' `' . DB::table($this->db->table_name($uid)) . '` AS BF LEFT JOIN `' . DB::table('members') . '` AS M ON M.`uid`=BF.`touid` ', 'sql_where' => " BF.`uid`='{$uid}' AND M.`uid` IS NOT NULL ", 'sql_order' => ' BF.`dateline` DESC ', 'result_list_row_make_func' => 'jsg_member_make', 'result_list_make_func' => 'buddy_follow_html');
if (true === IN_JISHIGOU_WAP) {
unset($ps['result_list_make_func']);
}
if (jallow($uid)) {
if ($member['fans_new'] > 0) {
jlogic('member')->clean_new_remind('fans_new', $uid);
}
if ($p['nickname']) {
$nickname = jfilter($p['nickname'], 'txt');
if (strlen($nickname) < 3 || strlen($nickname) > 15) {
return jerror('搜索用户昵称时,字数请控制在 3 ~ 15 个字符之间', -4);
}
unset($ps['result_count']);
$ps['cache_time'] = 600;
$ps['sql_where'] .= ' AND ' . build_like_query(' M.`nickname` ', $nickname);
}
if ($p['order'] && in_array($p['order'], array('lastpost', 'fans_count'))) {
$p['sql_order'] = ' M.`' . $p['order'] . '` DESC ';
}
}
$rets = $this->db->get($ps);
if (is_array($rets)) {
$rets['member'] = $member;
}
if (true === IN_JISHIGOU_WAP) {
if ($rets['list']) {
$rets['list'] = buddy_follow_html($rets['list'], 'uid', 'wap_follow_html');
}
$rets = wap_iconv($rets);
}
return $rets;
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:55,代码来源:buddy_fans.logic.php
示例10: get_goods_list
public function get_goods_list($exp = '', $order = "`order` desc,id desc", $limit = 12)
{
if ('all' == $exp) {
return jtable("mall_goods")->get(array("sql_where" => 'expire > ' . TIMESTAMP, "sql_order" => $order, "page_num" => $limit));
} elseif ('exp' == $exp) {
$member = jsg_member_info(MEMBER_ID);
$config = jconf::get('mall');
$sql_where = "expire > " . TIMESTAMP . " AND credit <= " . $member['credits'] . " AND price <= " . $member[$config['credits']];
return jtable("mall_goods")->get(array("sql_where" => $sql_where, "sql_order" => $order, "page_num" => $limit));
} else {
return jtable("mall_goods")->get(array("sql_order" => "id desc", "page_num" => $limit));
}
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:13,代码来源:mall.logic.php
示例11: show_user
function show_user($member = array())
{
if (MEMBER_ID < 0) {
$this->other_login();
return FALSE;
}
if (empty($member)) {
$uid = MEMBER_ID;
$member = jsg_member_info($uid);
}
include template('login/login_index_other');
exit;
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:13,代码来源:index.mod.php
示例12: get_my_tag_topic
public function get_my_tag_topic($p)
{
$uid = isset($p['uid']) ? (int) $p['uid'] : MEMBER_ID;
if (jdisallow($uid)) {
return jerror('您无权查看');
}
$member = jsg_member_info($uid);
if ($member['topic_new']) {
jlogic('member')->clean_new_remind('topic_new', $uid);
}
$rets = $this->get_my_tag_tid($p, 1);
if (is_array($rets)) {
$rets['member'] = $member;
}
return jlogic('topic')->get_by_ids($rets);
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:16,代码来源:topic_tag.logic.php
示例13: main
function main()
{
$option = array();
$option['page_url'] = 'admin.php?mod=reward';
$id = (int) get_param('id');
if ($id) {
$option['id'] = $id;
$option['page_url'] .= "&id={$id}";
} else {
unset($id);
}
$title = trim(get_param('title'));
if (isset($title)) {
$option['title'] = $title;
$option['page_url'] .= "&title={$title}";
}
$timefrom = get_param('timefrom');
$fromt = strtotime($timefrom);
if ($fromt) {
$option['fromt'] = $fromt;
$option['page_url'] .= "&timefrom={$timefrom}";
}
$timeto = get_param('timeto');
$tot = strtotime($timeto);
if ($tot) {
$option['tot'] = $tot;
$option['page_url'] .= "&timeto={$timeto}";
}
$nickname1 = trim(get_param('nickname'));
$uid = DB::result_first(" select `uid` from `" . TABLE_PREFIX . "members` where `nickname` = '{$nickname1}'");
if ($uid > 0) {
$option['uid'] = $uid;
$option['page_url'] .= "&nickname={$nickname1}";
$nickname = $nickname1;
}
$option['page'] = true;
$option['per_page_num'] = min(500, max((int) $_GET['per_page_num'], (int) $_GET['pn'], 20));
$option['_config'] = array('return' => 'array');
$option['page_set'] = '20 30 40 50 100 200';
extract(jlogic('reward')->getRewardList($option));
$count = $count ? $count : 0;
$member = jsg_member_info(MEMBER_ID);
$this->Title = '有奖转发';
include template('admin/reward_mian');
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:45,代码来源:reward.mod.php
示例14: qun_announcement_index
function qun_announcement_index()
{
$this->Title = $this->Config['changeword']['weiqun'] . '公告';
$qid = jget('qid', 'int');
$id = jget('id', 'int');
if ($id < 1) {
$id = jget('ids', 'int');
if ($id < 1) {
$id = jget('code', 'int');
}
}
if ($id > 0) {
$qun_announcement_info = jtable('qun_announcement')->info($id);
$author_member = jsg_member_info($qun_announcement_info['author_id']);
$this->Title .= ' - ' . cutstr(trim(strip_tags($qun_announcement_info['message'])), 30);
}
include template('qun/qun_announcement_index');
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:18,代码来源:qun_announcement.mod.php
示例15: goodsinfo
function goodsinfo()
{
$id = jget('id');
$info = jlogic('mall')->get_info($id);
if ($info) {
$config = jconf::get('mall');
$member = jsg_member_info(MEMBER_ID);
if ($info['expire'] < TIMESTAMP) {
$info['exp'] = '商品已过期';
} elseif ($info['price'] > $member[$config['credits']]) {
$info['exp'] = '您的' . $config['credits_name'] . '不够';
} elseif ($info['credit'] > $member['credits']) {
$info['exp'] = '您的总积分不够';
} else {
$info['exp'] = '';
}
$info['expire'] = my_date_format($info['expire']);
$info['desc'] = nl2br($info['desc']);
$this->Title = '商品详情 —— ' . $info['name'];
$this->MetaKeywords = '积分兑换,商品详情';
$this->MetaDescription = $info['name'];
$top_credit_members = jlogic('mall')->get_top_member_credits();
$feeds = jlogic('feed')->get_feed(5, "`action`='兑换了'");
$css['mall'] = ' class="current"';
$this->item = 'mall';
$this->item_id = $id;
$h_key = 'mall';
$gets = array('mod' => 'mall', 'code' => 'goodsinfo', 'id' => $id);
$page_url = 'index.php?' . url_implode($gets);
$tids = jlogic('mall')->get_topic_by_goodsid($id);
$options = array('tid' => $tids, 'perpage' => 5, 'page_url' => $page_url);
$topic_info = jlogic('topic_list')->get_data($options);
$topic_list = array();
if (!empty($topic_info)) {
$topic_list = $topic_info['list'];
$page_arr['html'] = $topic_info['page']['html'];
}
$albums = jlogic('image')->getalbum();
include template('mall_info');
} else {
header('Location: ' . jurl('index.php?mod=mall'));
}
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:43,代码来源:mall.mod.php
示例16: outbox
public function outbox($p)
{
$uid = isset($p['uid']) ? (int) $p['uid'] : MEMBER_ID;
if (jdisallow($uid)) {
return jerror('您没有权限进行此操作', -1);
}
$member = jsg_member_info($uid);
$pn = (int) $p['page_num'];
if ($pn < 1) {
$pn = 10;
}
$ps = array('type' => array('both', 'reply'), 'page_num' => $pn);
if (isset($p['page_url'])) {
$ps['page_url'] = $p['page_url'];
}
$rets = jtable('member_topic')->get_tids($uid, $ps, 1);
if (is_array($rets)) {
$rets['member'] = $member;
}
return jlogic('topic')->get_by_ids($rets);
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:21,代码来源:comment.logic.php
示例17: Main
function Main()
{
$this->Title = "我的标签";
$this->Code = 'user_tag';
$uids = (int) MEMBER_ID;
$member = jsg_member_info($uids);
if ($member['validate'] && $member['validate_extra']) {
$act_list['validate_extra'] = '专题设置';
}
$sql = "Select * From `" . TABLE_PREFIX . "user_tag` Where id >= (Select floor(RAND() * (Select MAX(id) From `" . TABLE_PREFIX . "user_tag`))) Order By id Limit 20;";
$query = $this->DatabaseHandler->Query($sql);
$user_tag = array();
while (false != ($row = $query->GetRow())) {
$user_tag[] = $row;
}
$sql = "select * from `" . TABLE_PREFIX . "user_tag_fields` where `uid` = '" . MEMBER_ID . "'";
$query = $this->DatabaseHandler->Query($sql);
$user_tag_fields = array();
while (false != ($row = $query->GetRow())) {
$user_tag_fields[] = $row;
}
include template('topic_user_tag');
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:23,代码来源:user_tag.mod.php
示例18: admin_check_allow
function admin_check_allow($uid, $is_role_id = 0)
{
global $_J;
if (MEMBER_ID < 1) {
return false;
}
if (true === JISHIGOU_FOUNDER) {
return true;
}
$uid = is_numeric($uid) ? $uid : 0;
if ($uid > 0) {
if (!$is_role_id) {
if ($uid == MEMBER_ID) {
return true;
}
if (true === jsg_member_is_founder($uid)) {
return false;
}
$info = jsg_member_info($uid);
$role_id = $info['role_id'];
} else {
$role_id = $uid;
}
if ('normal' == $_J['member']['role_type']) {
return false;
}
if ($role_id == $_J['member']['role_id']) {
return false;
}
$role_info = jsg_role_info($role_id);
if ('admin' == $role_info['type']) {
return false;
}
}
return true;
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:36,代码来源:admincp.func.php
示例19: Send
function Send()
{
$member = jsg_member_info(MEMBER_ID);
$TopicLogic = jlogic('topic');
if ($member['medal_id']) {
$medal_list = $TopicLogic->GetMedal($member['medal_id'], $member['uid']);
}
$topic_selected = 'pm';
$this->Title = '发送新消息';
$action = "index.php?mod=pm&code=dosend";
$to_user = jget('to_user', 'txt');
if (empty($to_user)) {
$to_user = jget('nickname', 'txt');
if (empty($to_user)) {
$to_user = jget('to', 'txt');
}
}
$message = jget('message');
$subject = $this->Get['subject'] ? $this->Get['subject'] : $this->Post['subject'];
$to_admin = jget('to_admin', 'int');
$to_admin_id = jget('to_admin_id', 'int');
if ($this->ID != 1) {
$sql = "select msgtoid,msgfrom,subject,message from " . TABLE_PREFIX . 'pms' . " where pmid = '{$this->ID}'";
$query = $this->DatabaseHandler->Query($sql);
$pm = $query->GetRow();
if ($pm != false) {
$to_user = $pm['msgfrom'];
$subject = "回复:" . $pm['subject'];
$pm['message'] = $pm['message'];
}
}
$left_menu = $this->LeftMenu();
$my_grouplist = jlogic('buddy_follow_group')->get_my_group(MEMBER_ID);
include template('pm/pm_write');
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:35,代码来源:pm.mod.php
示例20: check_new_topic
function check_new_topic($uid = MEMBER_ID, $update_lastactivity = 0, $return_tids = 0, $all_topic_notice = 0)
{
$uid = (int) ($uid ? $uid : MEMBER_ID);
if ($uid < 1) {
return 0;
}
$info = jsg_member_info($uid);
if (!$info) {
return 0;
}
$t = $info['lastactivity'];
$count = 0;
$tids = array();
if ($t > 0 && $t + 29 < TIMESTAMP) {
if ($all_topic_notice) {
$sql = TABLE_PREFIX . "topic` WHERE `type`!='reply' AND `dateline`>'{$t}'";
$count = DB::result_first("SELECT COUNT(1) AS `count` FROM `" . $sql);
if ($return_tids) {
$query = DB::query("SELECT tid FROM `" . $sql);
while (false != ($row = DB::fetch($query))) {
$tids[] = $row['tid'];
}
}
} else {
$p = array('uid' => $uid, 'count' => 100, 'buddy_lastuptime' => $t);
$buddy_uids = $this->get_buddyids($p);
if ($buddy_uids) {
$sql = TABLE_PREFIX . "topic` WHERE `uid` IN ('" . implode("','", $buddy_uids) . "') AND `type`!='reply' AND `dateline`>'{$t}'";
$count = DB::result_first("SELECT COUNT(1) AS `count` FROM `" . $sql);
if ($return_tids) {
$query = DB::query("SELECT tid FROM `" . $sql);
while (false != ($row = DB::fetch($query))) {
$tids[] = $row['tid'];
}
}
}
}
}
if ($update_lastactivity) {
jtable('members')->update_count($uid, 'lastactivity', TIMESTAMP);
}
if ($return_tids) {
return array('count' => $count, 'tids' => $tids);
} else {
return $count;
}
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:47,代码来源:buddy.logic.php
注:本文中的jsg_member_info函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论