当前位置: 首页>>代码示例>>PHP>>正文


PHP setstatus函数代码示例

本文整理汇总了PHP中setstatus函数的典型用法代码示例。如果您正苦于以下问题:PHP setstatus函数的具体用法?PHP setstatus怎么用?PHP setstatus使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setstatus函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _update_member_allowadmincp

 /**
  * 更新用户表中allowadmincp的状态
  */
 function _update_member_allowadmincp($uids)
 {
     if (!empty($uids)) {
         $userperms = C::t('common_block_permission')->fetch_permission_by_uid($uids);
         foreach (C::t('common_member')->fetch_all($uids, false, 0) as $uid => $v) {
             $v['allowadmincp'] = setstatus(4, empty($userperms[$uid]['allowmanage']) ? 0 : 1, $v['allowadmincp']);
             if ($userperms[$uid]['allowrecommend'] > 0) {
                 if ($userperms[$uid]['allowrecommend'] == $userperms[$uid]['needverify']) {
                     $v['allowadmincp'] = setstatus(5, 1, $v['allowadmincp']);
                     //推送数据到模块且需要审核的权限
                     $v['allowadmincp'] = setstatus(6, 0, $v['allowadmincp']);
                     //取消 推送数据到模块不需要审核的权限(既管理模块数据权限)
                 } else {
                     $v['allowadmincp'] = setstatus(5, 0, $v['allowadmincp']);
                     //取消 推送数据到模块且需要审核的权限
                     $v['allowadmincp'] = setstatus(6, 1, $v['allowadmincp']);
                     //推送数据到模块不需要审核的权限(既管理模块数据权限)
                 }
             } else {
                 $v['allowadmincp'] = setstatus(5, 0, $v['allowadmincp']);
                 //取消 推送数据到模块且需要审核的权限
                 $v['allowadmincp'] = setstatus(6, 0, $v['allowadmincp']);
                 //取消 推送数据到模块不需要审核的权限(既管理模块数据权限)
             }
             C::t('common_member')->update($uid, array('allowadmincp' => $v['allowadmincp']));
         }
     }
 }
开发者ID:vanloswang,项目名称:discuzx-1,代码行数:31,代码来源:class_blockpermission.php

示例2: _update_member_allowadmincp

 function _update_member_allowadmincp($uids)
 {
     if (!empty($uids)) {
         $userperms = array();
         $query = DB::query('SELECT uid, sum(allowmanage) as mn, sum(allowrecommend) as rc, sum(needverify) as nv FROM ' . DB::table('common_block_permission') . " WHERE uid IN (" . dimplode($uids) . ") GROUP BY uid");
         while ($v = DB::fetch($query)) {
             $userperms[$v['uid']] = array('allowmanage' => $v['mn'], 'allowrecommend' => $v['rc'], 'needverify' => $v['nv']);
         }
         $query = DB::query('SELECT uid,allowadmincp FROM ' . DB::table('common_member') . " WHERE uid IN (" . dimplode($uids) . ")");
         while ($v = DB::fetch($query)) {
             $v['allowadmincp'] = setstatus(4, empty($userperms[$v['uid']]['allowmanage']) ? 0 : 1, $v['allowadmincp']);
             if ($userperms[$v['uid']]['allowrecommend'] > 0) {
                 if ($userperms[$v['uid']]['allowrecommend'] == $userperms[$v['uid']]['needverify']) {
                     $v['allowadmincp'] = setstatus(5, 1, $v['allowadmincp']);
                     $v['allowadmincp'] = setstatus(6, 0, $v['allowadmincp']);
                 } else {
                     $v['allowadmincp'] = setstatus(5, 0, $v['allowadmincp']);
                     $v['allowadmincp'] = setstatus(6, 1, $v['allowadmincp']);
                 }
             } else {
                 $v['allowadmincp'] = setstatus(5, 0, $v['allowadmincp']);
                 $v['allowadmincp'] = setstatus(6, 0, $v['allowadmincp']);
             }
             DB::update('common_member', array('allowadmincp' => $v['allowadmincp']), "uid='{$v['uid']}'");
         }
     }
 }
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:27,代码来源:class_blockpermission.php

示例3: before_newthread

 public function before_newthread($parameters)
 {
     if ($this->group['allowpostrushreply']) {
         $_GET['rushreplyfrom'] = strtotime($_GET['rushreplyfrom']);
         $_GET['rushreplyto'] = strtotime($_GET['rushreplyto']);
         $_GET['rewardfloor'] = trim($_GET['rewardfloor']);
         $_GET['stopfloor'] = intval($_GET['stopfloor']);
         $_GET['replylimit'] = intval($_GET['replylimit']);
         $_GET['creditlimit'] = $_GET['creditlimit'] == '' ? '-996' : intval($_GET['creditlimit']);
         if ($_GET['rushreplyfrom'] > $_GET['rushreplyto'] && !empty($_GET['rushreplyto'])) {
             showmessage('post_rushreply_timewrong');
         }
         if ($_GET['rushreplyfrom'] > TIMESTAMP || !empty($_GET['rushreplyto']) && $_GET['rushreplyto'] < TIMESTAMP || $_GET['stopfloor'] == 1) {
             $this->param['closed'] = true;
         }
         if (!empty($_GET['rewardfloor']) && !empty($_GET['stopfloor'])) {
             $floors = explode(',', $_GET['rewardfloor']);
             if (!empty($floors) && is_array($floors)) {
                 foreach ($floors as $key => $floor) {
                     if (strpos($floor, '*') === false) {
                         if (intval($floor) == 0) {
                             unset($floors[$key]);
                         } elseif ($floor > $_GET['stopfloor']) {
                             unset($floors[$key]);
                         }
                     }
                 }
                 $_GET['rewardfloor'] = implode(',', $floors);
             }
         }
         $parameters['tstatus'] = setstatus(3, 1, $parameters['tstatus']);
         $parameters['tstatus'] = setstatus(1, 1, $parameters['tstatus']);
         $this->param['tstatus'] = $parameters['tstatus'];
     }
 }
开发者ID:wait121000,项目名称:discuz3.0forsae,代码行数:35,代码来源:extend_thread_rushreply.php

示例4: setTopicPostData

 function setTopicPostData($postdata)
 {
     if (empty($this->info['classid']) || empty($this->info['iftopicshowinforum'])) {
         $postdata['ifcheck'] = 2;
     }
     setstatus($postdata['tpcstatus'], 1);
     return $postdata;
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:8,代码来源:colonypost.class.php

示例5: post_mobile_message

 function post_mobile_message($message, $url_forward, $values, $extraparam, $custom)
 {
     if ($message == 'comment_add_succeed') {
         showmessage($message);
     }
     if ($values['tid'] && $values['pid']) {
         global $_G;
         $threadstatus = DB::result_first("SELECT status FROM " . DB::table('forum_thread') . " WHERE tid='{$values['tid']}'");
         $setstatusold = base_convert(getstatus($threadstatus, 13) . getstatus($threadstatus, 12) . getstatus($threadstatus, 11), 2, 10);
         $updatestatus = false;
         if (!empty($_POST['allowsound'])) {
             $setstatus = array(1, 0, 0);
             $updatestatus = $setstatusold < 4;
         } elseif (!empty($_POST['allowphoto'])) {
             $setstatus = array(0, 1, 1);
             $updatestatus = $setstatusold < 3;
         } elseif (!empty($_POST['allowlocal'])) {
             $setstatus = array(0, 1, 0);
             $updatestatus = $setstatusold < 2;
         } else {
             $setstatus = array(0, 0, 1);
         }
         if ($updatestatus) {
             foreach ($setstatus as $i => $bit) {
                 $threadstatus = setstatus(13 - $i, $bit, $threadstatus);
             }
             //note DB::update('forum_thread', array('status' => $threadstatus), "tid='$values[tid]'");
             C::t('forum_thread')->update($values['tid'], array('status' => $threadstatus));
         }
         $posttable = getposttablebytid($values['tid']);
         $poststatus = DB::result_first("SELECT status FROM " . DB::table($posttable) . " WHERE pid='{$values['pid']}'");
         $poststatus = setstatus(4, 1, $poststatus);
         if (!empty($_POST['allowlocal'])) {
             $poststatus = setstatus(6, 1, $poststatus);
         }
         if (!empty($_POST['allowsound'])) {
             $poststatus = setstatus(7, 1, $poststatus);
         }
         if (!empty($_POST['mobiletype']) && $_POST['mobiletype'] < 8) {
             $mobiletype = base_convert($_POST['mobiletype'], 10, 2);
             $mobiletype = sprintf('%03d', $mobiletype);
             for ($i = 0; $i < 3; $i++) {
                 $poststatus = setstatus(10 - $i, $mobiletype[$i], $poststatus);
             }
         }
         //note DB::update($posttable, array('status' => $poststatus), "pid='$values[pid]'");
         C::t('forum_post')->update('tid:' . $values['tid'], $values['pid'], array('status' => $poststatus));
         if ($_POST['location']) {
             list($mapx, $mapy, $location) = explode('|', dhtmlspecialchars($_POST['location']));
             C::t('forum_post_location')->insert(array('pid' => $values['pid'], 'tid' => $values['tid'], 'uid' => $_G['uid'], 'mapx' => $mapx, 'mapy' => $mapy, 'location' => $location));
         }
     }
 }
开发者ID:sayhanabi,项目名称:sayhanabi_forum,代码行数:53,代码来源:sendreply.php

示例6: _update_member_allowadmincp

 function _update_member_allowadmincp($uids)
 {
     if (!empty($uids)) {
         $userperms = array();
         $userperms = C::t('portal_category_permission')->fetch_permission_by_uid($uids);
         foreach (C::t('common_member')->fetch_all($uids, false, 0) as $uid => $v) {
             $v['allowadmincp'] = setstatus(3, empty($userperms[$v['uid']]['allowpublish']) ? 0 : 1, $v['allowadmincp']);
             $v['allowadmincp'] = setstatus(2, empty($userperms[$v['uid']]['allowmanage']) ? 0 : 1, $v['allowadmincp']);
             C::t('common_member')->update($uid, array('allowadmincp' => $v['allowadmincp']));
         }
     }
 }
开发者ID:softhui,项目名称:discuz,代码行数:12,代码来源:class_portalcategory.php

示例7: post_mobile_message

	function post_mobile_message($message, $url_forward, $values, $extraparam, $custom) {
		if($values['tid'] && $values['pid']) {
			global $_G;

			$threadstatus = DB::result_first("SELECT status FROM ".DB::table('forum_thread')." WHERE tid='$values[tid]'");
			if(!empty($_POST['allowsound'])) {
				$setstatus = array(1, 0, 0);
			} elseif(!empty($_POST['allowphoto'])) {
				$setstatus = array(0, 1, 1);
			} elseif(!empty($_POST['allowlocal'])) {
				$setstatus = array(0, 1, 0);
			} else {
				$setstatus = array(0, 0, 1);
			}
			foreach($setstatus as $i => $bit) {
				$threadstatus = setstatus(13 - $i, $bit, $threadstatus);
			}
			//note DB::update('forum_thread', array('status' => $threadstatus), "tid='$values[tid]'");
			C::t('forum_thread')->update($values['tid'], array('status' => $threadstatus));

			$poststatus = DB::result_first("SELECT status FROM ".DB::table('forum_post')." WHERE pid='$values[pid]'");
			$poststatus = setstatus(4, 1, $poststatus);
			if(!empty($_POST['allowlocal'])) {
				$poststatus = setstatus(6, 1, $poststatus);
			}
			if(!empty($_POST['allowsound'])) {
				$poststatus = setstatus(7, 1, $poststatus);
			}
			if(!empty($_POST['mobiletype'])) {
				$mobiletype = base_convert($_POST['mobiletype'], 10, 2);
				$mobiletype = sprintf('%03d', $mobiletype);
				for($i = 0;$i < 3;$i++) {
					$poststatus = setstatus(10 - $i, $mobiletype{$i}, $poststatus);
				}
			}
			//note DB::update('forum_post', array('status' => $poststatus), "pid='$values[pid]'");
			C::t('forum_post')->update(0, $values['pid'], array('status' => $poststatus));

			if($_POST['location']) {
				list($mapx, $mapy, $location) = explode('|', dhtmlspecialchars($_POST['location']));
				C::t('forum_post_location')->insert(array(
					'pid' => $values['pid'],
					'tid' => $values['tid'],
					'uid' => $_G['uid'],
					'mapx' => $mapx,
					'mapy' => $mapy,
					'location' => $location,
				));
			}
		}
	}
开发者ID:noikiy,项目名称:ejia,代码行数:51,代码来源:newthread.php

示例8: _update_member_allowadmincp

 function _update_member_allowadmincp($uids)
 {
     if (!empty($uids)) {
         $userperms = array();
         $query = DB::query('SELECT uid, sum(allowpublish) as pb, sum(allowmanage) as mn FROM ' . DB::table('portal_category_permission') . " WHERE uid IN (" . dimplode($uids) . ") GROUP BY uid");
         while ($v = DB::fetch($query)) {
             $userperms[$v['uid']] = array('allowpublish' => $v['pb'], 'allowmanage' => $v['mn']);
         }
         $query = DB::query('SELECT uid,allowadmincp FROM ' . DB::table('common_member') . " WHERE uid IN (" . dimplode($uids) . ")");
         while ($v = DB::fetch($query)) {
             $v['allowadmincp'] = setstatus(3, empty($userperms[$v['uid']]['allowpublish']) ? 0 : 1, $v['allowadmincp']);
             $v['allowadmincp'] = setstatus(2, empty($userperms[$v['uid']]['allowmanage']) ? 0 : 1, $v['allowadmincp']);
             DB::update('common_member', array('allowadmincp' => $v['allowadmincp']), "uid='{$v['uid']}'");
         }
     }
 }
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:16,代码来源:class_portalcategory.php

示例9: setTpcStatusByThreadId

 /**
  * 
  * 更新tpc状态
  * @param int $threadId
  * @param int $b 位
  * @param int $v 0|1
  */
 function setTpcStatusByThreadId($threadId, $b, $v = '1')
 {
     $b = intval($b);
     $threadId = intval($threadId);
     if (!$threadId) {
         return false;
     }
     $v != 1 && ($v = '0');
     $threadInfo = $this->getByThreadId($threadId);
     if (!S::isArray($threadInfo)) {
         return false;
     }
     $tpcstatus = $threadInfo['tpcstatus'];
     setstatus($tpcstatus, $b, $v);
     $_dbService = L::loadDB('threads', 'forum');
     $_dbService->update(array('tpcstatus' => $tpcstatus), $threadId);
     return true;
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:25,代码来源:threads.class.php

示例10: notifymembers


//.........这里部分代码省略.........
    if (!function_exists('sendmail')) {
        include libfile('function/mail');
    }
    if ($_GET['notifymember'] && in_array($_GET['notifymembers'], array('pm', 'notice', 'email', 'mobile'))) {
        $uids = searchmembers($search_condition, $pertask, $current);
        require_once libfile('function/discuzcode');
        $message = in_array($_GET['notifymembers'], array('email', 'notice')) && $_GET['posttype'] ? discuzcode($message, 1, 0, 1, '', '', '', 1) : discuzcode($message, 1, 0);
        $pmuids = array();
        if ($_GET['notifymembers'] == 'pm') {
            $membernum = countmembers($search_condition, $urladd);
            $gpmid = $_GET['gpmid'];
            if (!$gpmid) {
                $pmdata = array('authorid' => $_G['uid'], 'author' => !$_GET['system'] ? $_G['member']['username'] : '', 'dateline' => TIMESTAMP, 'message' => ($subject ? '<b>' . $subject . '</b><br /> &nbsp; ' : '') . $message . $addmsg, 'numbers' => $membernum);
                $gpmid = C::t('common_grouppm')->insert($pmdata, true);
            }
            $urladd .= '&gpmid=' . $gpmid;
        }
        $members = C::t('common_member')->fetch_all($uids);
        if ($_GET['notifymembers'] == 'mobile') {
            $toUids = array_keys($members);
            if ($_G['setting']['cloud_status'] && !empty($toUids)) {
                try {
                    $noticeService = Cloud::loadClass('Service_Client_Notification');
                    $fromType = $_GET['system'] ? 1 : 2;
                    $noticeService->addSiteMasterUserNotify($toUids, $subject, $message, $_G['uid'], $_G['username'], $fromType, TIMESTAMP);
                } catch (Cloud_Service_Client_RestfulException $e) {
                    cpmsg('[' . $e->getCode() . ']' . $e->getMessage(), '', 'error');
                }
            }
        } else {
            foreach ($members as $member) {
                if ($_GET['notifymembers'] == 'pm') {
                    C::t('common_member_grouppm')->insert(array('uid' => $member['uid'], 'gpmid' => $gpmid, 'status' => 0), false, true);
                    $newpm = setstatus(2, 1, $member['newpm']);
                    C::t('common_member')->update($member['uid'], array('newpm' => $newpm));
                } elseif ($_GET['notifymembers'] == 'notice') {
                    notification_add($member['uid'], 'system', 'system_notice', array('subject' => $subject, 'message' => $message . $addmsg, 'from_id' => 0, 'from_idtype' => 'sendnotice'), 1);
                } elseif ($_GET['notifymembers'] == 'email') {
                    if (!sendmail("{$member['username']} <{$member['email']}>", $subject, $message . $addmsg)) {
                        runlog('sendmail', "{$member['email']} sendmail failed.");
                    }
                }
                $log = array();
                if ($_GET['updatecredittype'] == 0) {
                    foreach ($setarr as $key => $val) {
                        if (empty($val)) {
                            continue;
                        }
                        $val = intval($val);
                        $id = intval($key);
                        $id = !$id && substr($key, 0, -1) == 'extcredits' ? intval(substr($key, -1, 1)) : $id;
                        if (0 < $id && $id < 9) {
                            $log['extcredits' . $id] = $val;
                        }
                    }
                    $logtype = 'RPR';
                } else {
                    foreach ($setarr as $val) {
                        if (empty($val)) {
                            continue;
                        }
                        $id = intval($val);
                        $id = !$id && substr($val, 0, -1) == 'extcredits' ? intval(substr($val, -1, 1)) : $id;
                        if (0 < $id && $id < 9) {
                            $log['extcredits' . $id] = '-1';
                        }
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:67,代码来源:admincp_members.php

示例11: setStatus

 function setStatus($pos, $value = '1')
 {
     setstatus($this->data['tpcstatus'], $pos, $value);
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:4,代码来源:post.class.php

示例12: catch

        try {
            if ($t_params['pic']) {
                $method = 'connectAddPicT';
            } else {
                $method = 'connectAddT';
            }
            $response = $connectOAuthClient->{$method}($_G['member']['conopenid'], $_G['member']['conuin'], $_G['member']['conuinsecret'], $t_params);
            if ($response['ret'] == 0) {
                $weibo_succ = true;
            }
        } catch (Exception $e) {
            if ($e->getCode()) {
                $weiboErrorCode = $e->getCode();
            }
            $weibo_succ = false;
        }
        if ($weibo_succ) {
            $feedlog_status = $feedlog['status'];
            $feedlog_status = setstatus(4, 1, $feedlog_status);
            $feedlog_status = setstatus(3, 0, $feedlog_status);
            C::t('#qqconnect#connect_postfeedlog')->update_by_pid($pid, array('status' => $feedlog_status, 'lastpublished' => $_G['timestamp'], 'publishtimes' => $feedlog['publishtimes'] + 1));
        }
        if (!$weiboErrorCode) {
            dsetcookie('connect_sync_post');
            $connectService->connectJsOutputMessage(lang('plugin/qqconnect', 'connect_feed_sync_success'), '', 0);
        } else {
            C::t('#qqconnect#connect_postfeedlog')->update_by_pid($pid, array('lastpublished' => $_G['timestamp'], 'publishtimes' => $feedlog['publishtimes'] + 1));
            $connectService->connectJsOutputMessage('', '', $weiboErrorCode);
        }
    }
}
开发者ID:tang86,项目名称:discuz-utf8,代码行数:31,代码来源:connect_feed.php

示例13: buildbitsql

function buildbitsql($fieldname, $position, $value)
{
    $t = " `{$fieldname}`=`{$fieldname}`";
    if ($value) {
        $t .= ' | ' . setstatus($position, 1);
    } else {
        $t .= ' & ' . setstatus($position, 0);
    }
    return $t . ' ';
}
开发者ID:samyex6,项目名称:discuz3.2-lite,代码行数:10,代码来源:function_forum.php

示例14: getdate

    $t = getdate($timestamp + 8 * 3600);
    $tdtime = (floor($timestamp / 3600) - $t['hours']) * 3600;
    $lang['db_bbsurl'] = $bbsurl;
    $lang['db_manager'] = $manager[0];
    $content = str_replace(array("\r", "\n\n", ";\n"), array('', "\n", ";<wind>\n"), trim(readover(R_P . 'lang/install_wind.sql'), " \n"));
    $db_floorname = array($lang['db_floorname_1'], $lang['db_floorname_2'], $lang['db_floorname_3'], $lang['db_floorname_4']);
    $db_sitemsg = array("reg" => array($lang['db_sitemsg_1'], $lang['db_sitemsg_2']), "login" => array($lang['db_sitemsg_3']), "post" => array($lang['db_sitemsg_4'], $lang['db_sitemsg_5'], $lang['db_sitemsg_6']), "reply" => array($lang['db_sitemsg_4'], $lang['db_sitemsg_5'], $lang['db_sitemsg_6']));
    $lang['db_floorname'] = addslashes(serialize($db_floorname));
    $lang['db_sitemsg'] = addslashes(serialize($db_sitemsg));
    $content = preg_replace("/{#(.+?)}/eis", '$lang[\'\\1\']', $content) . '<wind>';
    $content = explode("\n", $content);
    $writearray = array($lang['success_3']);
    $writearray = SQLCreate($content);
    $userstatus = 0;
    setstatus($userstatus, 7);
    setstatus($userstatus, 8);
    $db->update("REPLACE INTO pw_members (username,password,icon,email,groupid,memberid,regdate,userstatus,shortcut) VALUES ('{$manager['0']}','{$manager_pwd['0']}','none.gif|1|||','{$manager_email}','3','8','{$timestamp}','{$userstatus}',',article,write,diary,share,groups,photos,')");
    $uid = $db->insert_id();
    $db->update("REPLACE INTO pw_memberdata (uid,lastvisit,thisvisit) VALUES ('{$uid}','{$timestamp}','{$timestamp}')");
    $db->update("REPLACE INTO pw_bbsinfo (id,newmember,totalmember,tdtcontrol) VALUES ('1','{$manager['0']}','1','{$tdtime}')");
    $db->update("REPLACE INTO pw_administrators(uid,username,groupid,groups) VALUES('{$uid}','{$manager['0']}','3','')");
    writeover(D_P . "data/install.log", implode("\n", $writearray) . "\n{$lang['success_3_2']}", 'ab+');
    list($prev, $next) = getStepto($action);
    pwHeader("{$basename}?action={$next}");
    exit;
}
/**
 * 初始化数据库数据
 */
if ($action == 'initdata') {
    if ($step != 2) {
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:31,代码来源:install.php

示例15: notifymembers


//.........这里部分代码省略.........
                            $data = array('uid' => $medalnew['uid'], 'medalid' => $medalnewarray['medalid'], 'type' => 0, 'dateline' => $_G['timestamp'], 'expiration' => $medalnewarray['expiration'], 'status' => $medalnewarray['status']);
                            DB::insert('forum_medallog', $data);
                        }
                    }
                }
            }
            if (!$_G['gp_notifymembers']) {
                cpmsg('members_confermedal_succeed', '', 'succeed');
            }
        } elseif ($operation == 'confermagic') {
            $magics = $_G['gp_magic'];
            $magicnum = $_G['gp_magicnum'];
            if ($magics) {
                require_once libfile('function/magic');
                $limit = 200;
                set_time_limit(0);
                for ($i = 0; $i > -1; $i++) {
                    $uids = searchmembers($search_condition, $limit, $i * $limit);
                    $conditions = $uids ? 'uid IN (' . dimplode($uids) . ')' : '0';
                    foreach ($magics as $magicid) {
                        $uparray = $insarray = array();
                        if (empty($magicnum[$magicid])) {
                            continue;
                        }
                        $query = DB::query("SELECT uid, magicid FROM " . DB::table('common_member_magic') . " WHERE {$conditions} AND magicid='{$magicid}'");
                        while ($row = DB::fetch($query)) {
                            $uparray[] = $row['uid'];
                        }
                        if ($uparray) {
                            DB::query("UPDATE " . DB::table('common_member_magic') . " SET num=num+{$magicnum[$magicid]} WHERE uid IN (" . dimplode($uparray) . ") AND magicid='{$magicid}'");
                        }
                        $insarray = array_diff($uids, $uparray);
                        if ($insarray) {
                            $sqls = array();
                            $sql = "INSERT INTO " . DB::table('common_member_magic') . " (uid, magicid, num) VALUES ";
                            foreach ($insarray as $uid) {
                                $sqls[] = "('{$uid}', '{$magicid}', '{$magicnum[$magicid]}')";
                            }
                            $sql .= implode(',', $sqls);
                            DB::query($sql);
                        }
                        foreach ($uids as $uid) {
                            updatemagiclog($magicid, '3', $magicnum[$magicid], '', $uid);
                        }
                    }
                    if (count($uids) < $limit) {
                        break;
                    }
                }
            }
        }
        DB::query("REPLACE INTO " . DB::table('common_setting') . " (skey, svalue) VALUES ('{$variable}', '" . addslashes(serialize(array('subject' => $subject, 'message' => $message))) . "')");
    }
    $pertask = intval($_G['gp_pertask']);
    $current = $_G['gp_current'] ? intval($_G['gp_current']) : 0;
    $continue = FALSE;
    if (!function_exists('sendmail')) {
        include libfile('function/mail');
    }
    if ($_G['gp_notifymember'] && in_array($_G['gp_notifymembers'], array('pm', 'notice', 'email'))) {
        $uids = searchmembers($search_condition, $pertask, $current);
        $conditions = $uids ? 'uid IN (' . dimplode($uids) . ')' : '0';
        require_once libfile('function/discuzcode');
        $message = $_G['gp_notifymembers'] == 'email' && $_G['gp_posttype'] ? discuzcode($message, 1, 0, 1, '', '', '', 1) : discuzcode($message, 1, 0);
        $pmuids = array();
        if ($_G['gp_notifymembers'] == 'pm') {
            $membernum = countmembers($search_condition, $urladd);
            $gpmid = empty($_G['gp_gpmid']) ? DB::insert('common_grouppm', array('authorid' => $_G['uid'], 'author' => !$_G['gp_system'] ? $_G['member']['username'] : '', 'dateline' => TIMESTAMP, 'message' => ($subject ? '<b>' . $subject . '</b><br /> &nbsp; ' : '') . addslashes($message) . $addmsg, 'numbers' => $membernum), true) : $_G['gp_gpmid'];
            $urladd .= '&gpmid=' . $gpmid;
        }
        $query = DB::query("SELECT uid, username, groupid, email, newpm FROM " . DB::table('common_member') . " m WHERE {$conditions}");
        while ($member = DB::fetch($query)) {
            if ($_G['gp_notifymembers'] == 'pm') {
                DB::insert('common_member_grouppm', array('uid' => $member['uid'], 'gpmid' => $gpmid, 'status' => 0), false, true);
                $newpm = setstatus(2, 1, $member['newpm']);
                DB::query("UPDATE " . DB::table('common_member') . " SET newpm='{$newpm}' WHERE uid='{$member['uid']}'");
            } elseif ($_G['gp_notifymembers'] == 'notice') {
                notification_add($member['uid'], 'system', 'system_notice', array('subject' => $subject, 'message' => $message . $addmsg), 1);
            } elseif ($_G['gp_notifymembers'] == 'email') {
                sendmail("{$member['username']} <{$member['email']}>", $subject, $message . $addmsg);
            }
            $continue = TRUE;
        }
    }
    $newsletter_detail = array();
    if ($continue) {
        $next = $current + $pertask;
        $newsletter_detail = array('uid' => $_G['uid'], 'current' => $current, 'next' => $next, 'search_condition' => serialize($search_condition), 'action' => "action=members&operation={$operation}&{$operation}submit=yes&current={$next}&pertask={$pertask}&notifymember={$_G['gp_notifymember']}&notifymembers=" . rawurlencode($_G['gp_notifymembers']) . $urladd);
        save_newsletter('newsletter_detail', $newsletter_detail);
        cpmsg("{$lang['members_newsletter_send']}: " . cplang('members_newsletter_processing', array('current' => $current, 'next' => $next, 'search_condition' => serialize($search_condition))), "action=members&operation={$operation}&{$operation}submit=yes&current={$next}&pertask={$pertask}&notifymember={$_G['gp_notifymember']}&notifymembers=" . rawurlencode($_G['gp_notifymembers']) . $urladd, 'loadingform');
    } else {
        del_newsletter('newsletter_detail');
        if ($operation == 'reward' && $_G['gp_notifymembers'] == 'pm') {
            $message = '';
        } else {
            $message = '_notify';
        }
        cpmsg('members' . ($operation ? '_' . $operation : '') . $message . '_succeed', '', 'succeed');
    }
}
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:101,代码来源:admincp_members.php


注:本文中的setstatus函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。