• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP setstatus函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: lang

                    // 用户未开通微博
                    $message = lang('plugin/qqconnect', 'connect_weibo_account_not_signup');
                } else {
                    $code = 100;
                    $message = lang('plugin/qqconnect', 'connect_server_busy');
                    $connectService->connectErrlog($code, lang('plugin/qqconnect', 'connect_errlog_server_no_response'));
                }
            }
        } else {
            $thread = C::t('forum_thread')->fetch($tid);
            if ($response['data']['id'] && $_G['setting']['connect']['t']['reply'] && $thread['tid'] && !$thread['closed'] && !getstatus($thread['status'], 3) && empty($_G['forum']['replyperm'])) {
                //DB::insert('connect_tthreadlog', array(
                C::t('#qqconnect#connect_tthreadlog')->insert(array('twid' => $response['data']['id'], 'tid' => $tid, 'conopenid' => $_G['member']['conopenid'], 'pagetime' => 0, 'lasttwid' => '0', 'nexttime' => $_G['timestamp'] + 30 * 60, 'updatetime' => 0, 'dateline' => $_G['timestamp']));
            }
            if (!getstatus($thread['status'], 8)) {
                C::t('forum_thread')->update($tid, array('status' => setstatus(8, 1, $thread['status'])));
                //note 分享也增加推送微博标志
            }
            $code = $response['ret'];
            $message = lang('plugin/qqconnect', 'connect_broadcast_success');
        }
    }
} elseif ($pluginop == 'sync_tthread') {
    // hash 验证
    if (trim($_GET['formhash']) != formhash()) {
        showmessage('submit_invalid');
    }
    if (!$_G['setting']['connect']['t']['reply']) {
        exit;
        //note 未开启
    }
开发者ID:dalinhuang,项目名称:healthshop,代码行数:31,代码来源:spacecp.inc.php


示例17: _post_feedlog_message

 function _post_feedlog_message($param)
 {
     if (!$this->allow) {
         return;
     }
     global $_G;
     $condition1 = substr($param['param'][0], -8) != '_succeed';
     $condition2 = $_GET['action'] == 'edit' && !$GLOBALS['isfirstpost'];
     $condition3 = !$this->_allowconnectfeed() && !$this->_allowconnectt();
     $condition4 = empty($_GET['connect_publish_feed']) && empty($_GET['connect_publish_t']);
     if (empty($_GET['connect_publish_feed']) && $_GET['action'] != 'reply') {
         dsetcookie('connect_not_sync_feed', 1);
     } else {
         dsetcookie('connect_not_sync_feed', 0);
     }
     if (empty($_GET['connect_publish_t'])) {
         dsetcookie('connect_not_sync_t', 1);
     } else {
         dsetcookie('connect_not_sync_t', 0);
     }
     if ($condition1 || $condition2 || $condition3 || $condition4) {
         return false;
     }
     if ($_GET['action'] == 'reply') {
         $tid = $param['param'][2]['tid'];
         $pid = $param['param'][2]['pid'];
         if ($_GET['connect_publish_t']) {
             dsetcookie('connect_sync_post', $tid . '|' . $pid);
             $data = array('pid' => $pid, 'uid' => $_G['uid'], 'lastpublished' => 0, 'dateline' => $_G['timestamp'], 'status' => 0);
             C::t('#qqconnect#connect_postfeedlog')->insert($data, 0, 1);
         }
     } else {
         $tid = $param['param'][2]['tid'];
         $thread = C::t('forum_thread')->fetch($tid);
         if ($_GET['connect_publish_feed']) {
             $thread['status'] = setstatus(7, 1, $thread['status']);
         }
         if ($_GET['connect_publish_t']) {
             $thread['status'] = setstatus(8, 1, $thread['status']);
         }
         C::t('forum_thread')->update($tid, array('status' => $thread['status']));
         $data = array('tid' => $tid, 'uid' => $_G['uid'], 'lastpublished' => 0, 'dateline' => $_G['timestamp'], 'status' => 0);
         C::t('#qqconnect#connect_feedlog')->insert($data, 0, 1);
     }
 }
开发者ID:samyex6,项目名称:discuz3.2-lite,代码行数:45,代码来源:connect.class.php


示例18: _viewthread_share_method_output

 function _viewthread_share_method_output()
 {
     global $_G;
     require_once libfile('function/connect');
     if ($GLOBALS['page'] == 1 && $_G['forum_firstpid'] && $GLOBALS['postlist'][$_G['forum_firstpid']]['invisible'] == 0) {
         $_G['connect']['feed_js'] = $_G['connect']['t_js'] = false;
         if (!getstatus($_G['forum_thread']['status'], 7) && $_G['forum_thread']['displayorder'] >= 0) {
             $feedlogstatus = false;
             $_G['connect']['feed_log'] = DB::fetch_first("SELECT * FROM " . DB::table('connect_feedlog') . " WHERE tid='{$_G['tid']}'");
             if ($_G['connect']['feed_log']) {
                 $_G['connect']['feed_interval'] = 300;
                 $_G['connect']['feed_publish_max'] = 1000;
                 if ($_G['connect']['feed_log'] && $_G['member']['conisbind'] && $_G['uid'] == $_G['forum_thread']['authorid']) {
                     if ($_G['connect']['feed_log']['status'] == 1 || $_G['connect']['feed_log']['status'] == 2 && TIMESTAMP - $_G['connect']['feed_log']['lastpublished'] > $_G['connect']['feed_interval'] && $_G['connect']['feed_log']['publishtimes'] < $_G['connect']['feed_publish_max']) {
                         DB::query("UPDATE " . DB::table('connect_feedlog') . " SET status='2', lastpublished='{$_G['timestamp']}', publishtimes=publishtimes+1 WHERE tid='{$_G['tid']}' AND status!=4");
                         $_G['connect']['feed_js'] = $feedlogstatus = true;
                     }
                 }
             } else {
                 $feedlogstatus = true;
             }
         }
         if (!getstatus($_G['forum_thread']['status'], 8) && $_G['forum_thread']['displayorder'] >= 0) {
             $_G['connect']['t_log'] = DB::fetch_first("SELECT * FROM " . DB::table('connect_tlog') . " WHERE tid='{$_G['tid']}'");
             if ($_G['connect']['t_log']) {
                 $_G['connect']['t_interval'] = 300;
                 $_G['connect']['t_publish_max'] = 1000;
                 if ($_G['connect']['t_log'] && $_G['member']['conisbind'] && $_G['uid'] == $_G['forum_thread']['authorid']) {
                     if ($_G['connect']['t_log']['status'] == 1 || $_G['connect']['t_log']['status'] == 2 && TIMESTAMP - $_G['connect']['t_log']['lastpublished'] > $_G['connect']['t_interval'] && $_G['connect']['t_log']['publishtimes'] < $_G['connect']['t_publish_max']) {
                         DB::query("UPDATE " . DB::table('connect_tlog') . " SET status='2', lastpublished='{$_G['timestamp']}', publishtimes=publishtimes+1 WHERE tid='{$_G['tid']}' AND status!=4");
                         $_G['connect']['t_js'] = $tlogstatus = true;
                     }
                 }
             } else {
                 $tlogstatus = true;
             }
         }
         if ($feedlogstatus || $tlogstatus) {
             $newstatus = $_G['forum_thread']['status'];
             $newstatus = $feedlogstatus ? setstatus(7, 1, $newstatus) : $newstatus;
             $newstatus = $tlogstatus ? setstatus(8, 1, $newstatus) : $newstatus;
             DB::query("UPDATE " . DB::table('forum_thread') . " SET status='{$newstatus}' WHERE tid='{$_G['tid']}'");
         }
         $_G['connect']['thread_url'] = $_G['siteurl'] . $GLOBALS['canonical'];
         $_G['connect']['qzone_share_url'] = $_G['siteurl'] . 'home.php?mod=spacecp&ac=plugin&id=qqconnect:spacecp&pluginop=share&sh_type=1&thread_id=' . $_G['tid'];
         $_G['connect']['weibo_share_url'] = $_G['siteurl'] . 'home.php?mod=spacecp&ac=plugin&id=qqconnect:spacecp&pluginop=share&sh_type=2&thread_id=' . $_G['tid'];
         $_G['connect']['pengyou_share_url'] = $_G['siteurl'] . 'home.php?mod=spacecp&ac=plugin&id=qqconnect:spacecp&pluginop=share&sh_type=3&thread_id=' . $_G['tid'];
         $_G['connect']['qzone_share_api'] = $_G['connect']['qzone_public_share_url'] . '?url=' . urlencode($_G['connect']['thread_url']);
         $_G['connect']['pengyou_share_api'] = $_G['connect']['qzone_public_share_url'] . '?to=pengyou&url=' . urlencode($_G['connect']['thread_url']);
         $params = array('oauth_consumer_key' => $_G['setting']['connectappid'], 'title' => $GLOBALS['postlist'][$_G['forum_firstpid']]['subject'], 'url' => $_G['connect']['thread_url']);
         $params['sig'] = connect_get_sig($params, connect_get_sig_key());
         $_G['connect']['t_share_api'] = $_G['connect']['url'] . '/mblog/redirect?' . cloud_http_build_query($params, '', '&');
         $_G['connect']['first_post'] = daddslashes($GLOBALS['postlist'][$_G['forum_firstpid']]);
         $_G['gp_connect_autoshare'] = !empty($_G['gp_connect_autoshare']) ? 1 : 0;
         $_G['connect']['weibo_appkey'] = $_G['connect']['weibo_public_appkey'];
         if ($this->allow && $_G['setting']['connect']['mblog_app_key']) {
             $_G['connect']['weibo_appkey'] = $_G['setting']['connect']['mblog_app_key'];
         }
         $extrajs = '';
         if ($_G['connect']['feed_js'] || $_G['connect']['t_js']) {
             $params = array();
             $params['thread_id'] = $_G['tid'];
             $params['ts'] = TIMESTAMP;
             $params['type'] = bindec(($_G['connect']['t_js'] ? '1' : '0') . ($_G['connect']['feed_js'] ? '1' : '0'));
             $params['sig'] = connect_get_sig($params, connect_get_sig_key());
             $jsurl = $_G['connect']['discuz_new_feed_url'] . '&' . cloud_http_build_query($params, '', '&');
             $extrajs = connect_output_javascript($jsurl);
         }
         if (!$_G['member']['conisbind'] && $_G['group']['allowgetimage'] && $_G['thread']['price'] == 0) {
             if ($_G['connect']['first_post']['message']) {
                 require_once libfile('function/connect');
                 $post['html_content'] = connect_parse_bbcode($_G['connect']['first_post']['message'], $_G['connect']['first_post']['fid'], $_G['connect']['first_post']['pid'], $_G['connect']['first_post']['htmlon'], $attach_images);
                 if ($attach_images && is_array($attach_images)) {
                     $attach_images = array_slice($attach_images, 0, 3);
                     $share_images = array();
                     foreach ($attach_images as $attach_image) {
                         $share_images[] = urlencode($attach_image['big']);
                     }
                     $_G['connect']['share_images'] = implode('|', $share_images);
                     unset($share_images);
                 }
             }
         }
         connect_merge_member();
         return tpl_viewthread_share_method() . $extrajs;
     }
 }
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:87,代码来源:connect.class.php


示例19: foreach

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP setthreadcover函数代码示例发布时间:2022-05-15
下一篇:
PHP setsmsdeliverystatus函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap