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


PHP manage_addnotify函数代码示例

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


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

示例1: _adminUserInfo


//.........这里部分代码省略.........
             } elseif ($key == 'site') {
                 if (!in_array(strtolower(substr($value, 0, 6)), array('http:/', 'https:', 'ftp://', 'rtsp:/', 'mms://')) && !preg_match('/^static\\//', $value) && !preg_match('/^data\\//', $value)) {
                     $value = 'http://' . $value;
                 }
             }
             if ($field['formtype'] == 'file') {
                 if (!empty($_FILES[$key]) && $_FILES[$key]['error'] == 0 || !empty($space[$key]) && empty($_GET['deletefile'][$key])) {
                     $value = '1';
                 } else {
                     $value = '';
                 }
             }
             if (empty($field)) {
                 continue;
             } elseif (profile_check($key, $value, $space)) {
                 $setarr[$key] = dhtmlspecialchars(trim($value));
             } else {
                 if ($key == 'birthprovince') {
                     $key = 'birthcity';
                 } elseif ($key == 'resideprovince' || $key == 'residecommunity' || $key == 'residedist') {
                     $key = 'residecity';
                 } elseif ($key == 'birthyear' || $key == 'birthmonth') {
                     $key = 'birthday';
                 }
                 // profile_showerror($key);
                 $list = $this->makeErrorInfo($res, 'check_date_item');
                 $errcode = $list['errcode'] . $settings[$key]['title'];
                 $this->_exitWithHtmlAlert($errcode);
             }
             if ($field['formtype'] == 'file') {
                 unset($setarr[$key]);
             }
             if ($vid && $verifyconfig['available'] && isset($verifyconfig['field'][$key])) {
                 if (isset($verifyinfo['field'][$key]) && $setarr[$key] !== $space[$key]) {
                     $verifyarr[$key] = $setarr[$key];
                 }
                 unset($setarr[$key]);
             }
             if (isset($setarr[$key]) && $_G['cache']['profilesetting'][$key]['needverify']) {
                 if ($setarr[$key] !== $space[$key]) {
                     $verifyarr[$key] = $setarr[$key];
                 }
                 unset($setarr[$key]);
             }
         }
         if ($vid && !empty($verifyinfo['field']) && is_array($verifyinfo['field'])) {
             foreach ($verifyinfo['field'] as $key => $fvalue) {
                 if (!isset($verifyconfig['field'][$key])) {
                     unset($verifyinfo['field'][$key]);
                     continue;
                 }
                 if (empty($verifyarr[$key]) && !isset($verifyarr[$key]) && isset($verifyinfo['field'][$key])) {
                     $verifyarr[$key] = !empty($fvalue) && $key != $fvalue ? $fvalue : $space[$key];
                 }
             }
         }
         if ($forum) {
             if (!$_G['group']['maxsigsize']) {
                 $forum['sightml'] = '';
             }
             C::t('common_member_field_forum')->update($_G['uid'], $forum);
         }
         if (isset($_POST['birthmonth']) && ($space['birthmonth'] != $_POST['birthmonth'] || $space['birthday'] != $_POST['birthday'])) {
             $setarr['constellation'] = get_constellation($_POST['birthmonth'], $_POST['birthday']);
         }
         if (isset($_POST['birthyear']) && $space['birthyear'] != $_POST['birthyear']) {
             $setarr['zodiac'] = get_zodiac($_POST['birthyear']);
         }
         if ($setarr) {
             C::t('common_member_profile')->update($_G['uid'], $setarr);
         }
         if ($verifyarr) {
             C::t('common_member_verify_info')->delete_by_uid($_G['uid'], $vid);
             $setverify = array('uid' => $_G['uid'], 'username' => $_G['username'], 'verifytype' => $vid, 'field' => serialize($verifyarr), 'dateline' => $_G['timestamp']);
             C::t('common_member_verify_info')->insert($setverify);
             if (!C::t('common_member_verify')->count_by_uid($_G['uid'])) {
                 C::t('common_member_verify')->insert(array('uid' => $_G['uid']));
             }
             if ($_G['setting']['verify'][$vid]['available']) {
                 manage_addnotify('verify_' . $vid, 0, array('langkey' => 'manage_verify_field', 'verifyname' => $_G['setting']['verify'][$vid]['title'], 'doid' => $vid));
             }
         }
         if (isset($_POST['privacy'])) {
             foreach ($_POST['privacy'] as $key => $value) {
                 if (isset($_G['cache']['profilesetting'][$key])) {
                     $space['privacy']['profile'][$key] = intval($value);
                 }
             }
             C::t('common_member_field_home')->update($space['uid'], array('privacy' => serialize($space['privacy'])));
         }
         manyoulog('user', $_G['uid'], 'update');
         include_once libfile('function/feed');
         feed_add('profile', 'feed_profile_update_' . $operation, array('hash_data' => 'profile'));
         countprofileprogress();
         // $message = $vid ? lang('spacecp', 'profile_verify_verifying', array('verify' => $verifyconfig['title'])) : '';
         $list = $this->makeErrorInfo($res, 'update_date_success');
         $this->_exitWithHtmlAlert($list['errcode']);
     }
     $this->getController()->renderPartial('userInfoAdmin', array('formUrl' => WebUtils::createUrl_oldVersion('user/userinfoadminview', array('act' => $act)), 'errorMsg' => $errorMsg, 'action' => $act, '_G' => $_G, 'htmls' => $htmls, 'settings' => $settings));
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:101,代码来源:UserInfoAdminViewAction.php

示例2: libfile

     if (in_array($thread['displayorder'], array(2, 3))) {
         $stickmodify = 1;
     }
     if ($_G['forum']['status'] == 3 && $thread['closed'] > 1) {
         $deleteredirect[] = $thread['closed'];
     }
     if ($thread['isgroup'] == 1 && $thread['closed'] > 1) {
         $remarkclosed[] = $thread['closed'];
     }
 }
 $modaction = 'DEL';
 require_once libfile('function/delete');
 $tids = array_keys($threadlist);
 if ($_G['forum']['recyclebin']) {
     deletethread($tids, true, true, true);
     manage_addnotify('verifyrecycle', $modpostsnum);
 } else {
     deletethread($tids, true, true);
     $updatemodlog = FALSE;
 }
 $forumstickthreads = $_G['setting']['forumstickthreads'];
 $forumstickthreads = !empty($forumstickthreads) ? unserialize($forumstickthreads) : array();
 $delkeys = array_keys($threadlist);
 foreach ($delkeys as $k) {
     unset($forumstickthreads[$k]);
 }
 $forumstickthreads = addslashes(serialize($forumstickthreads));
 DB::query("UPDATE " . DB::table('common_setting') . " SET svalue='{$forumstickthreads}' WHERE skey='forumstickthreads'");
 DB::delete('forum_forum_threadtable', "threads='0'");
 if (!empty($deleteredirect)) {
     deletethread($deleteredirect);
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:topicadmin_moderate.php

示例3: register


//.........这里部分代码省略.........
             return;
         }
     }
     $censorexp = '/^(' . str_replace(array('\\*', "\r\n", ' '), array('.*', '|', ''), preg_quote($_G['setting']['censoruser'] = trim($_G['setting']['censoruser']), '/')) . ')$/i';
     if ($_G['setting']['censoruser'] && @preg_match($censorexp, $username)) {
         if (!$return) {
             showmessage('profile_username_protect');
         } else {
             return;
         }
     }
     if (!$_G['wechat']['setting']['wechat_disableregrule']) {
         loadcache('ipctrl');
         if ($_G['cache']['ipctrl']['ipregctrl']) {
             foreach (explode("\n", $_G['cache']['ipctrl']['ipregctrl']) as $ctrlip) {
                 if (preg_match("/^(" . preg_quote($ctrlip = trim($ctrlip), '/') . ")/", $_G['clientip'])) {
                     $ctrlip = $ctrlip . '%';
                     $_G['setting']['regctrl'] = $_G['setting']['ipregctrltime'];
                     break;
                 } else {
                     $ctrlip = $_G['clientip'];
                 }
             }
         } else {
             $ctrlip = $_G['clientip'];
         }
         if ($_G['setting']['regctrl']) {
             if (C::t('common_regip')->count_by_ip_dateline($ctrlip, $_G['timestamp'] - $_G['setting']['regctrl'] * 3600)) {
                 if (!$return) {
                     showmessage('register_ctrl', NULL, array('regctrl' => $_G['setting']['regctrl']));
                 } else {
                     return;
                 }
             }
         }
         $setregip = null;
         if ($_G['setting']['regfloodctrl']) {
             $regip = C::t('common_regip')->fetch_by_ip_dateline($_G['clientip'], $_G['timestamp'] - 86400);
             if ($regip) {
                 if ($regip['count'] >= $_G['setting']['regfloodctrl']) {
                     if (!$return) {
                         showmessage('register_flood_ctrl', NULL, array('regfloodctrl' => $_G['setting']['regfloodctrl']));
                     } else {
                         return;
                     }
                 } else {
                     $setregip = 1;
                 }
             } else {
                 $setregip = 2;
             }
         }
         if ($setregip !== null) {
             if ($setregip == 1) {
                 C::t('common_regip')->update_count_by_ip($_G['clientip']);
             } else {
                 C::t('common_regip')->insert(array('ip' => $_G['clientip'], 'count' => 1, 'dateline' => $_G['timestamp']));
             }
         }
     }
     $uid = uc_user_register(addslashes($username), $password, $email, '', '', $_G['clientip']);
     if ($uid <= 0) {
         if (!$return) {
             if ($uid == -1) {
                 showmessage('profile_username_illegal');
             } elseif ($uid == -2) {
                 showmessage('profile_username_protect');
             } elseif ($uid == -3) {
                 showmessage('profile_username_duplicate');
             } elseif ($uid == -4) {
                 showmessage('profile_email_illegal');
             } elseif ($uid == -5) {
                 showmessage('profile_email_domain_illegal');
             } elseif ($uid == -6) {
                 showmessage('profile_email_duplicate');
             } else {
                 showmessage('undefined_action');
             }
         } else {
             return;
         }
     }
     $init_arr = array('credits' => explode(',', $_G['setting']['initcredits']));
     C::t('common_member')->insert($uid, $username, $password, $email, $_G['clientip'], $groupid, $init_arr);
     if ($_G['setting']['regctrl'] || $_G['setting']['regfloodctrl']) {
         C::t('common_regip')->delete_by_dateline($_G['timestamp'] - ($_G['setting']['regctrl'] > 72 ? $_G['setting']['regctrl'] : 72) * 3600);
         if ($_G['setting']['regctrl']) {
             C::t('common_regip')->insert(array('ip' => $_G['clientip'], 'count' => -1, 'dateline' => $_G['timestamp']));
         }
     }
     if ($_G['setting']['regverify'] == 2) {
         C::t('common_member_validate')->insert(array('uid' => $uid, 'submitdate' => $_G['timestamp'], 'moddate' => 0, 'admin' => '', 'submittimes' => 1, 'status' => 0, 'message' => '', 'remark' => ''), false, true);
         manage_addnotify('verifyuser');
     }
     setloginstatus(array('uid' => $uid, 'username' => $username, 'password' => $password, 'groupid' => $groupid), 0);
     //统计
     include_once libfile('function/stat');
     updatestat('register');
     return $uid;
 }
开发者ID:deepziyu,项目名称:JX3PVE,代码行数:101,代码来源:wechat.class.php

示例4: newthread


//.........这里部分代码省略.........
     if (!$this->param['special']) {
         $this->param['price'] = $this->group['maxprice'] ? $this->param['price'] <= $this->group['maxprice'] ? $this->param['price'] : $this->group['maxprice'] : 0;
     }
     if (!$this->param['typeid'] && $this->forum['threadtypes']['required'] && !$this->param['special']) {
         return $this->showmessage('post_type_isnull');
     }
     if (!$this->param['sortid'] && $this->forum['threadsorts']['required'] && !$this->param['special']) {
         return $this->showmessage('post_sort_isnull');
     }
     if (!$this->param['special'] && $this->param['price'] > 0 && floor($this->param['price'] * (1 - $this->setting['creditstax'])) == 0) {
         return $this->showmessage('post_net_price_iszero');
     }
     $this->param['sortid'] = $this->param['special'] && $this->forum['threadsorts']['types'][$this->param['sortid']] ? 0 : $this->param['sortid'];
     $this->param['typeexpiration'] = intval($this->param['typeexpiration']);
     if ($this->forum['threadsorts']['expiration'][$this->param['typeid']] && !$this->param['typeexpiration']) {
         return $this->showmessage('threadtype_expiration_invalid');
     }
     $author = !$this->param['isanonymous'] ? $this->member['username'] : '';
     $this->param['moderated'] = $this->param['digest'] || $this->param['displayorder'] > 0 ? 1 : 0;
     $this->param['ordertype'] && ($this->param['tstatus'] = setstatus(4, 1, $this->param['tstatus']));
     $this->param['imgcontent'] && ($this->param['tstatus'] = setstatus(15, $this->param['imgcontent'], $this->param['tstatus']));
     $this->param['hiddenreplies'] && ($this->param['tstatus'] = setstatus(2, 1, $this->param['tstatus']));
     $this->param['allownoticeauthor'] && ($this->param['tstatus'] = setstatus(6, 1, $this->param['tstatus']));
     $this->param['isgroup'] = $this->forum['status'] == 3 ? 1 : 0;
     $this->param['publishdate'] = !$this->param['modnewthreads'] ? $this->param['publishdate'] : TIMESTAMP;
     $newthread = array('fid' => $this->forum['fid'], 'posttableid' => 0, 'readperm' => $this->param['readperm'], 'price' => $this->param['price'], 'typeid' => $this->param['typeid'], 'sortid' => $this->param['sortid'], 'author' => $author, 'authorid' => $this->member['uid'], 'subject' => $this->param['subject'], 'dateline' => $this->param['publishdate'], 'lastpost' => $this->param['publishdate'], 'lastposter' => $author, 'displayorder' => $this->param['displayorder'], 'digest' => $this->param['digest'], 'special' => $this->param['special'], 'attachment' => 0, 'moderated' => $this->param['moderated'], 'status' => $this->param['tstatus'], 'isgroup' => $this->param['isgroup'], 'replycredit' => $this->param['replycredit'], 'closed' => $this->param['closed'] ? 1 : 0);
     $this->tid = C::t('forum_thread')->insert($newthread, true);
     C::t('forum_newthread')->insert(array('tid' => $this->tid, 'fid' => $this->forum['fid'], 'dateline' => $this->param['publishdate']));
     useractionlog($this->member['uid'], 'tid');
     if (!getuserprofile('threads') && $this->setting['newbie']) {
         C::t('forum_thread')->update($this->tid, array('icon' => $this->setting['newbie']));
     }
     if ($this->param['publishdate'] != TIMESTAMP) {
         $cron_publish_ids = dunserialize($this->cache('cronpublish'));
         $cron_publish_ids[$this->tid] = $this->tid;
         $cron_publish_ids = serialize($cron_publish_ids);
         savecache('cronpublish', $cron_publish_ids);
     }
     if (!$this->param['isanonymous']) {
         C::t('common_member_field_home')->update($this->member['uid'], array('recentnote' => $this->param['subject']));
     }
     if ($this->param['moderated']) {
         updatemodlog($this->tid, $this->param['displayorder'] > 0 ? 'STK' : 'DIG');
         updatemodworks($this->param['displayorder'] > 0 ? 'STK' : 'DIG', 1);
     }
     $this->param['bbcodeoff'] = checkbbcodes($this->param['message'], !empty($this->param['bbcodeoff']));
     $this->param['smileyoff'] = checksmilies($this->param['message'], !empty($this->param['smileyoff']));
     $this->param['parseurloff'] = !empty($this->param['parseurloff']);
     $this->param['htmlon'] = $this->group['allowhtml'] && !empty($this->param['htmlon']) ? 1 : 0;
     $this->param['usesig'] = !empty($this->param['usesig']) && $this->group['maxsigsize'] ? 1 : 0;
     $class_tag = new tag();
     $this->param['tagstr'] = $class_tag->add_tag($this->param['tags'], $this->tid, 'tid');
     $this->param['pinvisible'] = $this->param['modnewthreads'] ? -2 : (empty($this->param['save']) ? 0 : -3);
     $this->param['message'] = preg_replace('/\\[attachimg\\](\\d+)\\[\\/attachimg\\]/is', '[attach]\\1[/attach]', $this->param['message']);
     $this->param['pstatus'] = intval($this->param['pstatus']);
     defined('IN_MOBILE') && ($this->param['pstatus'] = setstatus(4, 1, $this->param['pstatus']));
     if ($this->param['imgcontent']) {
         stringtopic($this->param['message'], $this->tid, true, $this->param['imgcontentwidth']);
     }
     $this->pid = insertpost(array('fid' => $this->forum['fid'], 'tid' => $this->tid, 'first' => '1', 'author' => $this->member['username'], 'authorid' => $this->member['uid'], 'subject' => $this->param['subject'], 'dateline' => $this->param['publishdate'], 'message' => $this->param['message'], 'useip' => $this->param['clientip'] ? $this->param['clientip'] : getglobal('clientip'), 'port' => $this->param['remoteport'] ? $this->param['remoteport'] : getglobal('remoteport'), 'invisible' => $this->param['pinvisible'], 'anonymous' => $this->param['isanonymous'], 'usesig' => $this->param['usesig'], 'htmlon' => $this->param['htmlon'], 'bbcodeoff' => $this->param['bbcodeoff'], 'smileyoff' => $this->param['smileyoff'], 'parseurloff' => $this->param['parseurloff'], 'attachment' => '0', 'tags' => $this->param['tagstr'], 'replycredit' => 0, 'status' => $this->param['pstatus']));
     $statarr = array(0 => 'thread', 1 => 'poll', 2 => 'trade', 3 => 'reward', 4 => 'activity', 5 => 'debate', 127 => 'thread');
     include_once libfile('function/stat');
     updatestat($this->param['isgroup'] ? 'groupthread' : $statarr[$this->param['special']]);
     if ($this->param['geoloc'] && IN_MOBILE == 2) {
         list($mapx, $mapy, $location) = explode('|', $this->param['geoloc']);
         if ($mapx && $mapy && $location) {
             C::t('forum_post_location')->insert(array('pid' => $this->pid, 'tid' => $this->tid, 'uid' => $this->member['uid'], 'mapx' => $mapx, 'mapy' => $mapy, 'location' => $location));
         }
     }
     if ($this->param['modnewthreads']) {
         updatemoderate('tid', $this->tid);
         C::t('forum_forum')->update_forum_counter($this->forum['fid'], 0, 0, 1);
         manage_addnotify('verifythread');
         return 'post_newthread_mod_succeed';
     } else {
         if ($this->param['displayorder'] != -4) {
             if ($this->param['digest']) {
                 updatepostcredits('+', $this->member['uid'], 'digest', $this->forum['fid']);
             }
             updatepostcredits('+', $this->member['uid'], 'post', $this->forum['fid']);
             if ($this->param['isgroup']) {
                 C::t('forum_groupuser')->update_counter_for_user($this->member['uid'], $this->forum['fid'], 1);
             }
             $subject = str_replace("\t", ' ', $this->param['subject']);
             $lastpost = "{$this->tid}\t" . $subject . "\t" . TIMESTAMP . "\t{$author}";
             C::t('forum_forum')->update($this->forum['fid'], array('lastpost' => $lastpost));
             C::t('forum_forum')->update_forum_counter($this->forum['fid'], 1, 1, 1);
             if ($this->forum['type'] == 'sub') {
                 C::t('forum_forum')->update($this->forum['fup'], array('lastpost' => $lastpost));
             }
         }
         if ($this->param['isgroup']) {
             C::t('forum_forumfield')->update($this->forum['fid'], array('lastupdate' => TIMESTAMP));
             require_once libfile('function/grouplog');
             updategroupcreditlog($this->forum['fid'], $this->member['uid']);
         }
         C::t('forum_sofa')->insert(array('tid' => $this->tid, 'fid' => $this->forum['fid']));
         return 'post_newthread_succeed';
     }
 }
开发者ID:vanloswang,项目名称:discuzx-1,代码行数:101,代码来源:model_forum_thread.php

示例5: addportalarticlecomment

function addportalarticlecomment($id, $message, $idtype = 'aid')
{
    global $_G;
    $id = intval($id);
    if (empty($id)) {
        return 'comment_comment_noexist';
    }
    $message = getstr($message, $_G['group']['allowcommentarticle'], 0, 0, 1, 0);
    if (strlen($message) < 2) {
        return 'content_is_too_short';
    }
    $idtype = in_array($idtype, array('aid', 'topicid')) ? $idtype : 'aid';
    $tablename = $idtype == 'aid' ? 'portal_article_title' : 'portal_topic';
    $data = C::t($tablename)->fetch($id);
    if (empty($data)) {
        return 'comment_comment_noexist';
    }
    if ($data['allowcomment'] != 1) {
        return 'comment_comment_notallowed';
    }
    $message = censor($message);
    if (censormod($message)) {
        $comment_status = 1;
    } else {
        $comment_status = 0;
    }
    $setarr = array('uid' => $_G['uid'], 'username' => $_G['username'], 'id' => $id, 'idtype' => $idtype, 'postip' => $_G['clientip'], 'dateline' => $_G['timestamp'], 'status' => $comment_status, 'message' => $message);
    $pcid = C::t('portal_comment')->insert($setarr, true);
    if ($comment_status == 1) {
        updatemoderate($idtype . '_cid', $pcid);
        $notifykey = $idtype == 'aid' ? 'verifyacommont' : 'verifytopiccommont';
        manage_addnotify($notifykey);
    }
    $tablename = $idtype == 'aid' ? 'portal_article_count' : 'portal_topic';
    C::t($tablename)->increase($id, array('commentnum' => 1));
    C::t('common_member_status')->update($_G['uid'], array('lastpost' => $_G['timestamp']), 'UNBUFFERED');
    if ($data['uid'] != $_G['uid']) {
        updatecreditbyaction('portalcomment', 0, array(), $idtype . $id);
    }
    return 'do_success';
}
开发者ID:softhui,项目名称:discuz,代码行数:41,代码来源:function_portalcp.php

示例6: blog_post


//.........这里部分代码省略.........
					unset($uploads[$urlmd5]);
				}
			}
		}
		foreach ($uploads as $value) {
			$picurl = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote'], 0);
			$message .= "<div class=\"uchome-message-pic\"><img src=\"$picurl\"><p>$value[title]</p></div>";
		}
	}

	$ckmessage = preg_replace("/(\<div\>|\<\/div\>|\s|\&nbsp\;|\<br\>|\<p\>|\<\/p\>)+/is", '', $message);
	if(empty($ckmessage)) {
		return false;
	}


	if(checkperm('manageblog')) {
		$blogarr['hot'] = intval($POST['hot']);
	}

	if($olds['blogid']) {

		if($blogarr['catid'] != $olds['catid']) {
			if($olds['catid']) {
				C::t('home_blog_category')->update_num_by_catid(-1, $olds['catid'], true, true);
			}
			if($blogarr['catid']) {
				C::t('home_blog_category')->update_num_by_catid(1, $blogarr['catid']);
			}
		}

		$blogid = $olds['blogid'];
		C::t('home_blog')->update($blogid, $blogarr);

		$fuids = array();

		$blogarr['uid'] = $olds['uid'];
		$blogarr['username'] = $olds['username'];
	} else {

		if($blogarr['catid']) {
			C::t('home_blog_category')->update_num_by_catid(1, $blogarr['catid']);
		}

		$blogarr['uid'] = $_G['uid'];
		$blogarr['username'] = $_G['username'];
		$blogarr['dateline'] = empty($POST['dateline'])?$_G['timestamp']:$POST['dateline'];
		$blogid = C::t('home_blog')->insert($blogarr, true);

		C::t('common_member_status')->update($_G['uid'], array('lastpost' => $_G['timestamp']));
		C::t('common_member_field_home')->update($_G['uid'], array('recentnote'=>$POST['subject']));
	}

	$blogarr['blogid'] = $blogid;
	$class_tag = new tag();
	$POST['tag'] = $olds ? $class_tag->update_field($POST['tag'], $blogid, 'blogid') : $class_tag->add_tag($POST['tag'], $blogid, 'blogid');
	$fieldarr = array(
		'message' => $message,
		'postip' => $_G['clientip'],
		'target_ids' => $POST['target_ids'],
		'tag' => $POST['tag']
	);

	if(!empty($titlepic)) {
		$fieldarr['pic'] = $titlepic;
	}

	if($olds) {
		C::t('home_blogfield')->update($blogid, $fieldarr);
	} else {
		$fieldarr['blogid'] = $blogid;
		$fieldarr['uid'] = $blogarr['uid'];
		C::t('home_blogfield')->insert($fieldarr);
	}

	if($isself && !$olds && $blog_status == 0) {
		updatecreditbyaction('publishblog', 0, array('blogs' => 1));

		include_once libfile('function/stat');
		updatestat('blog');
	}

	if($olds['blogid'] && $blog_status == 1) {
		updatecreditbyaction('publishblog', 0, array('blogs' => -1), '', -1);
		include_once libfile('function/stat');
		updatestat('blog');
	}

	if($POST['makefeed'] && $blog_status == 0) {
		include_once libfile('function/feed');
		feed_publish($blogid, 'blogid', $olds?0:1);
	}

	if(!empty($__G)) $_G = $__G;
	if($blog_status == 1) {
		updatemoderate('blogid', $blogid);
		manage_addnotify('verifyblog');
	}
	return $blogarr;
}
开发者ID:xDiglett,项目名称:discuzx30,代码行数:101,代码来源:function_blog.php

示例7: editpost


//.........这里部分代码省略.........
             $this->param['threadupdatearr']['readperm'] = $this->param['readperm'];
         }
         $this->param['threadupdatearr']['price'] = $this->param['price'];
         $this->param['threadupdatearr']['status'] = $this->thread['status'];
         if (getglobal('forum_auditstatuson') && $this->param['audit'] == 1) {
             $this->param['threadupdatearr']['displayorder'] = 0;
             $this->param['threadupdatearr']['moderated'] = 1;
         } else {
             $this->param['threadupdatearr']['displayorder'] = $displayorder;
         }
         C::t('forum_thread')->update($this->thread['tid'], $this->param['threadupdatearr'], true);
         if ($this->thread['tid'] > 1) {
             if ($this->thread['closed'] > 1) {
                 C::t('forum_thread')->update($this->thread['closed'], array('subject' => $this->param['subject']), true);
             } elseif (empty($this->thread['isgroup'])) {
                 $threadclosed = C::t('forum_threadclosed')->fetch($thread['tid']);
                 if ($threadclosed['redirect']) {
                     C::t('forum_thread')->update($threadclosed['redirect'], array('subject' => $this->param['subject']), true);
                 }
             }
         }
         $class_tag = new tag();
         $tagstr = $class_tag->update_field($this->param['tags'], $this->thread['tid'], 'tid', $this->thread);
     } else {
         if ($this->param['subject'] == '' && $this->param['message'] == '' && $this->thread['special'] != 2) {
             showmessage('post_sm_isnull');
         }
     }
     $this->param['htmlon'] = $this->group['allowhtml'] && !empty($this->param['htmlon']) ? 1 : 0;
     if ($this->setting['editedby'] && TIMESTAMP - $this->post['dateline'] > 60 && $this->member['adminid'] != 1) {
         $editor = $this->param['isanonymous'] && $isorigauthor ? lang('forum/misc', 'anonymous') : $this->member['username'];
         $edittime = dgmdate(TIMESTAMP);
         $this->param['message'] = lang('forum/misc', $this->param['htmlon'] ? 'post_edithtml' : (!$this->forum['allowbbcode'] || $this->param['bbcodeoff'] ? 'post_editnobbcode' : 'post_edit'), array('editor' => $editor, 'edittime' => $edittime)) . $this->param['message'];
     }
     $this->param['bbcodeoff'] = checkbbcodes($this->param['message'], !empty($this->param['bbcodeoff']));
     $this->param['smileyoff'] = checksmilies($this->param['message'], !empty($this->param['smileyoff']));
     $tagoff = $isfirstpost ? !empty($tagoff) : 0;
     if (getglobal('forum_auditstatuson') && $this->param['audit'] == 1) {
         C::t('forum_post')->update($this->thread['posttableid'], $this->post['pid'], array('status' => 4), false, false, null, -2, null, 0);
         updatepostcredits('+', $this->post['authorid'], $isfirstpost ? 'post' : 'reply', $this->forum['fid']);
         updatemodworks('MOD', 1);
         updatemodlog($this->thread['tid'], 'MOD');
     }
     $displayorder = $pinvisible = 0;
     if ($isfirstpost) {
         $displayorder = $this->param['modnewthreads'] ? -2 : $this->thread['displayorder'];
         $pinvisible = $this->param['modnewthreads'] ? -2 : (empty($this->param['save']) ? 0 : -3);
     } else {
         $pinvisible = $this->param['modnewreplies'] ? -2 : ($this->thread['displayorder'] == -4 ? -3 : 0);
     }
     $this->param['message'] = preg_replace('/\\[attachimg\\](\\d+)\\[\\/attachimg\\]/is', '[attach]\\1[/attach]', $this->param['message']);
     $this->param['parseurloff'] = !empty($this->param['parseurloff']);
     $setarr = array('message' => $this->param['message'], 'usesig' => $this->param['usesig'], 'htmlon' => $this->param['htmlon'], 'bbcodeoff' => $this->param['bbcodeoff'], 'parseurloff' => $this->param['parseurloff'], 'smileyoff' => $this->param['smileyoff'], 'subject' => $this->param['subject'], 'tags' => $tagstr, 'port' => getglobal('remoteport'));
     $setarr['status'] = $this->post['status'];
     if ($this->param['modstatus']) {
         foreach ($this->param['modstatus'] as $modbit => $modvalue) {
             $setarr['status'] = setstatus($modbit, $modvalue, $setarr['status']);
         }
     }
     if ($anonymousadd !== '') {
         $setarr['anonymous'] = $anonymousadd;
     }
     if ($publishdate) {
         $setarr['dateline'] = $publishdate;
     }
     if (getglobal('forum_auditstatuson') && $this->param['audit'] == 1) {
         $setarr['invisible'] = 0;
     } else {
         $setarr['invisible'] = $pinvisible;
     }
     C::t('forum_post')->update('tid:' . $this->thread['tid'], $this->post['pid'], $setarr);
     $this->forum['lastpost'] = explode("\t", $this->forum['lastpost']);
     if ($this->post['dateline'] == $this->forum['lastpost'][2] && ($this->post['author'] == $this->forum['lastpost'][3] || $this->forum['lastpost'][3] == '' && $this->post['anonymous'])) {
         $lastpost = $this->thread['tid'] . "\t" . ($isfirstpost ? $this->param['subject'] : $this->thread['subject']) . "\t" . $this->post['dateline'] . "\t" . ($this->param['isanonymous'] ? '' : $this->post['author']);
         C::t('forum_forum')->update($this->forum['fid'], array('lastpost' => $lastpost));
     }
     if (!getglobal('forum_auditstatuson') || $this->param['audit'] != 1) {
         if ($isfirstpost && $this->param['modnewthreads']) {
             C::t('forum_thread')->update($this->thread['tid'], array('displayorder' => -2));
             manage_addnotify('verifythread');
         } elseif (!$isfirstpost && $this->param['modnewreplies']) {
             C::t('forum_thread')->increase($this->thread['tid'], array('replies' => -1));
             manage_addnotify('verifypost');
         }
         if ($this->param['modnewreplies'] || $this->param['modnewthreads']) {
             C::t('forum_forum')->update($this->forum['fid'], array('modworks' => '1'));
         }
     }
     if ($this->thread['lastpost'] == $this->post['dateline'] && (!$this->post['anonymous'] && $this->thread['lastposter'] == $this->post['author'] || $this->post['anonymous'] && $this->thread['lastposter'] == '') && $this->post['anonymous'] != $this->param['isanonymous']) {
         C::t('forum_thread')->update($this->thread['tid'], array('lastposter' => $this->param['isanonymous'] ? '' : $this->post['author']), true);
     }
     if (!$isorigauthor) {
         updatemodworks('EDT', 1);
         require_once libfile('function/misc');
         modlog($this->thread, 'EDT');
     }
     if ($isfirstpost && $this->thread['displayorder'] == -4 && empty($this->param['save'])) {
         threadpubsave($this->thread['tid']);
     }
 }
开发者ID:MCHacker,项目名称:docker-discuz,代码行数:101,代码来源:model_forum_post.php

示例8: preg_replace

     }
     $message = preg_replace('/\\[attachimg\\](\\d+)\\[\\/attachimg\\]/is', '[attach]\\1[/attach]', $message);
     $parseurloff = !empty($_G['gp_parseurloff']);
     DB::query("UPDATE " . DB::table($posttable) . " SET message='{$message}', usesig='{$_G['gp_usesig']}', htmlon='{$htmlon}', bbcodeoff='{$bbcodeoff}', parseurloff='{$parseurloff}',\r\n\t\t\tsmileyoff='{$smileyoff}', subject='{$subject}' {$anonymousadd} " . ($_G['forum_auditstatuson'] && $audit == 1 ? ",invisible='0'" : ", invisible='{$pinvisible}'") . " , tags='" . $tagstr . "'  WHERE pid='{$pid}'");
     $_G['forum']['lastpost'] = explode("\t", $_G['forum']['lastpost']);
     if ($orig['dateline'] == $_G['forum']['lastpost'][2] && ($orig['author'] == $_G['forum']['lastpost'][3] || $_G['forum']['lastpost'][3] == '' && $orig['anonymous'])) {
         $lastpost = "{$_G['tid']}\t" . ($isfirstpost ? $subject : addslashes($thread['subject'])) . "\t{$orig['dateline']}\t" . ($isanonymous ? '' : addslashes($orig['author']));
         DB::query("UPDATE " . DB::table('forum_forum') . " SET lastpost='{$lastpost}' WHERE fid='{$_G['fid']}'", 'UNBUFFERED');
     }
     if (!$_G['forum_auditstatuson'] || $audit != 1) {
         if ($isfirstpost && $modnewthreads) {
             DB::query("UPDATE " . DB::table('forum_thread') . " SET displayorder='-2' WHERE tid='{$_G['tid']}'");
             manage_addnotify('verifythread');
         } elseif (!$isfirstpost && $modnewreplies) {
             DB::query("UPDATE " . DB::table('forum_thread') . " SET replies=replies-'1' WHERE tid='{$_G['tid']}'");
             manage_addnotify('verifypost');
         }
         if ($modnewreplies || $modnewthreads) {
             DB::update('forum_forum', array('modworks' => '1'), "fid='{$_G['fid']}'");
         }
     }
     if ($thread['lastpost'] == $orig['dateline'] && (!$orig['anonymous'] && $thread['lastposter'] == $orig['author'] || $orig['anonymous'] && $thread['lastposter'] == '') && $orig['anonymous'] != $isanonymous) {
         DB::query("UPDATE " . DB::table('forum_thread') . " SET lastposter='" . ($isanonymous ? '' : addslashes($orig['author'])) . "' WHERE tid='{$_G['tid']}'", 'UNBUFFERED');
     }
     if (!$isorigauthor) {
         updatemodworks('EDT', 1);
         require_once libfile('function/misc');
         modlog($thread, 'EDT');
     }
 } else {
     if (!$_G['setting']['editperdel']) {
开发者ID:kleitz,项目名称:sports,代码行数:31,代码来源:post_editpost.php

示例9: on_register


//.........这里部分代码省略.........
         $status_data = array('uid' => $uid, 'regip' => $_G['clientip'], 'lastip' => $_G['clientip'], 'lastvisit' => TIMESTAMP, 'lastactivity' => TIMESTAMP, 'lastpost' => 0, 'lastsendmail' => 0);
         $profile['uid'] = $uid;
         $field_forum['uid'] = $uid;
         $field_home['uid'] = $uid;
         if ($this->extrafile && file_exists(libfile('member/' . $this->extrafile, 'module'))) {
             require_once libfile('member/' . $this->extrafile, 'module');
         }
         DB::insert('common_member', $userdata);
         DB::insert('common_member_status', $status_data);
         DB::insert('common_member_profile', $profile);
         DB::insert('common_member_field_forum', $field_forum);
         DB::insert('common_member_field_home', $field_home);
         if ($verifyarr) {
             $setverify = array('uid' => $uid, 'username' => $username, 'verifytype' => '0', 'field' => daddslashes(serialize($verifyarr)), 'dateline' => TIMESTAMP);
             DB::insert('common_member_verify_info', $setverify);
             DB::insert('common_member_verify', array('uid' => $uid));
         }
         $count_data = array('uid' => $uid, 'extcredits1' => $init_arr[1], 'extcredits2' => $init_arr[2], 'extcredits3' => $init_arr[3], 'extcredits4' => $init_arr[4], 'extcredits5' => $init_arr[5], 'extcredits6' => $init_arr[6], 'extcredits7' => $init_arr[7], 'extcredits8' => $init_arr[8]);
         DB::insert('common_member_count', $count_data);
         DB::insert('common_setting', array('skey' => 'lastmember', 'svalue' => $username), false, true);
         manyoulog('user', $uid, 'add');
         $totalmembers = DB::result_first("SELECT COUNT(*) FROM " . DB::table('common_member'));
         $userstats = array('totalmembers' => $totalmembers, 'newsetuser' => stripslashes($username));
         save_syscache('userstats', $userstats);
         if ($this->setting['regctrl'] || $this->setting['regfloodctrl']) {
             DB::query("DELETE FROM " . DB::table('common_regip') . " WHERE dateline<='{$_G['timestamp']}'-" . ($this->setting['regctrl'] > 72 ? $this->setting['regctrl'] : 72) . "*3600", 'UNBUFFERED');
             if ($this->setting['regctrl']) {
                 DB::query("INSERT INTO " . DB::table('common_regip') . " (ip, count, dateline)\r\n\t\t\t\t\t\tVALUES ('{$_G['clientip']}', '-1', '{$_G['timestamp']}')");
             }
         }
         $regmessage = dhtmlspecialchars($_G['gp_regmessage']);
         if ($this->setting['regverify'] == 2) {
             DB::query("REPLACE INTO " . DB::table('common_member_validate') . " (uid, submitdate, moddate, admin, submittimes, status, message, remark)\r\n\t\t\t\t\tVALUES ('{$uid}', '{$_G['timestamp']}', '0', '', '1', '0', '{$regmessage}', '')");
             manage_addnotify('verifyuser');
         }
         setloginstatus(array('uid' => $uid, 'username' => dstripslashes($_G['username']), 'password' => $password, 'groupid' => $groupinfo['groupid']), 0);
         include_once libfile('function/stat');
         updatestat('register');
         if ($invite['id']) {
             $result = DB::result_first("SELECT COUNT(*) FROM " . DB::table('common_invite') . " WHERE uid='{$invite['uid']}' AND fuid='{$uid}'");
             if (!$result) {
                 DB::update("common_invite", array('fuid' => $uid, 'fusername' => $_G['username'], 'regdateline' => $_G['timestamp'], 'status' => 2), array('id' => $invite['id']));
                 updatestat('invite');
             } else {
                 $invite = array();
             }
         }
         if ($invite['uid']) {
             if ($this->setting['inviteconfig']['inviteaddcredit']) {
                 updatemembercount($uid, array($this->setting['inviteconfig']['inviterewardcredit'] => $this->setting['inviteconfig']['inviteaddcredit']));
             }
             if ($this->setting['inviteconfig']['invitedaddcredit']) {
                 updatemembercount($invite['uid'], array($this->setting['inviteconfig']['inviterewardcredit'] => $this->setting['inviteconfig']['invitedaddcredit']));
             }
             require_once libfile('function/friend');
             friend_make($invite['uid'], $invite['username'], false);
             notification_add($invite['uid'], 'friend', 'invite_friend', array('actor' => '<a href="home.php?mod=space&uid=' . $invite['uid'] . '" target="_blank">' . $invite['username'] . '</a>'), 1);
             space_merge($invite, 'field_home');
             if (!empty($invite['privacy']['feed']['invite'])) {
                 require_once libfile('function/feed');
                 $tite_data = array('username' => '<a href="home.php?mod=space&uid=' . $_G['uid'] . '">' . $_G['username'] . '</a>');
                 feed_add('friend', 'feed_invite', $tite_data, '', array(), '', array(), array(), '', '', '', 0, 0, '', $invite['uid'], $invite['username']);
             }
             if ($invite['appid']) {
                 updatestat('appinvite');
             }
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:67,代码来源:class_member.php

示例10: add_comment


//.........这里部分代码省略.........
        $comment_status = 0;
    }
    $setarr = array('uid' => $tospace['uid'], 'id' => $id, 'idtype' => $idtype, 'authorid' => $_G['uid'], 'author' => $_G['username'], 'dateline' => $_G['timestamp'], 'message' => $message, 'ip' => $_G['clientip'], 'port' => $_G['remoteport'], 'status' => $comment_status);
    $cid = C::t('home_comment')->insert($setarr, true);
    $action = 'comment';
    $becomment = 'getcomment';
    $note = $q_note = '';
    $note_values = $q_values = array();
    switch ($idtype) {
        case 'uid':
            $n_url = "home.php?mod=space&uid={$tospace['uid']}&do=wall&cid={$cid}";
            $note_type = 'wall';
            $note = 'wall';
            $note_values = array('url' => $n_url);
            $q_note = 'wall_reply';
            $q_values = array('url' => $n_url);
            if ($comment) {
                $msg = 'note_wall_reply_success';
                $magvalues = array('username' => $tospace['username']);
                $becomment = '';
            } else {
                $msg = 'do_success';
                $magvalues = array();
                $becomment = 'getguestbook';
            }
            $action = 'guestbook';
            break;
        case 'picid':
            $n_url = "home.php?mod=space&uid={$tospace['uid']}&do=album&picid={$id}&cid={$cid}";
            $note_type = 'comment';
            $note = 'pic_comment';
            $note_values = array('url' => $n_url);
            $q_note = 'pic_comment_reply';
            $q_values = array('url' => $n_url);
            $msg = 'do_success';
            $magvalues = array();
            break;
        case 'blogid':
            $n_url = "home.php?mod=space&uid={$tospace['uid']}&do=blog&id={$id}&cid={$cid}";
            $note_type = 'comment';
            $note = 'blog_comment';
            $note_values = array('url' => $n_url, 'subject' => $blog['subject']);
            $q_note = 'blog_comment_reply';
            $q_values = array('url' => $n_url);
            $msg = 'do_success';
            $magvalues = array();
            break;
        case 'sid':
            $n_url = "home.php?mod=space&uid={$tospace['uid']}&do=share&id={$id}&cid={$cid}";
            $note_type = 'comment';
            $note = 'share_comment';
            $note_values = array('url' => $n_url);
            $q_note = 'share_comment_reply';
            $q_values = array('url' => $n_url);
            $msg = 'do_success';
            $magvalues = array();
            break;
    }
    if (empty($comment)) {
        if ($tospace['uid'] != $_G['uid']) {
            if (ckprivacy('comment', 'feed')) {
                require_once libfile('function/feed');
                $fs['title_data']['hash_data'] = "{$idtype}{$id}";
                feed_add($fs['icon'], $fs['title_template'], $fs['title_data'], $fs['body_template'], $fs['body_data'], $fs['body_general'], $fs['images'], $fs['image_links'], $fs['target_ids'], $fs['friend']);
            }
            $note_values['from_id'] = $id;
            $note_values['from_idtype'] = $idtype;
            $note_values['url'] .= "&goto=new#comment_{$cid}_li";
            notification_add($tospace['uid'], $note_type, $note, $note_values);
        }
    } elseif ($comment['authorid'] != $_G['uid']) {
        notification_add($comment['authorid'], $note_type, $q_note, $q_values);
    }
    if ($comment_status == 1) {
        updatemoderate($idtype . '_cid', $cid);
        manage_addnotify('verifycommontes');
    }
    if ($stattype) {
        include_once libfile('function/stat');
        updatestat($stattype);
    }
    if ($tospace['uid'] != $_G['uid']) {
        $needle = $id;
        if ($idtype != 'uid') {
            $needle = $idtype . $id;
        } else {
            $needle = $tospace['uid'];
        }
        updatecreditbyaction($action, 0, array(), $needle);
        if ($becomment) {
            if ($idtype == 'uid') {
                $needle = $_G['uid'];
            }
            updatecreditbyaction($becomment, $tospace['uid'], array(), $needle);
        }
    }
    C::t('common_member_status')->update($_G['uid'], array('lastpost' => $_G['timestamp']), 'UNBUFFERED');
    $magvalues['cid'] = $cid;
    return array('cid' => $cid, 'msg' => $msg, 'magvalues' => $magvalues);
}
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:101,代码来源:function_comment.php

示例11: showmessage

    if (!($comment = DB::fetch($query))) {
        showmessage('no_privilege_comment_edit');
    }
    if (submitcheck('editsubmit')) {
        $message = getstr($_POST['message'], 0, 1, 1, 2);
        if (strlen($message) < 2) {
            showmessage('content_is_too_short');
        }
        $message = censor($message);
        if (censormod($message)) {
            $comment_status = 1;
        } else {
            $comment_status = 0;
        }
        if ($comment_status == 1) {
            manage_addnotify('verifycommontes');
        }
        DB::update('home_comment', array('message' => $message, 'status' => $comment_status), array('cid' => $comment['cid']));
        showmessage('do_success', dreferer(), array('cid' => $comment['cid']), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true));
    }
    $comment['message'] = $bbcode->html2bbcode($comment['message']);
} elseif ($_GET['op'] == 'delete') {
    if (submitcheck('deletesubmit')) {
        require_once libfile('function/delete');
        if (deletecomments(array($cid))) {
            showmessage('do_success', dreferer(), array('cid' => $cid), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true));
        } else {
            showmessage('no_privilege_comment_del');
        }
    }
} elseif ($_GET['op'] == 'reply') {
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:31,代码来源:spacecp_comment.php

示例12: register


//.........这里部分代码省略.........
     // 这里是对ip注册的限制
     if ($_G['cache']['ipctrl']['ipregctrl']) {
         foreach (explode("\n", $_G['cache']['ipctrl']['ipregctrl']) as $ctrlip) {
             if (preg_match("/^(" . preg_quote($ctrlip = trim($ctrlip), '/') . ")/", $_G['clientip'])) {
                 $ctrlip = $ctrlip . '%';
                 $ctlObj->setting['regctrl'] = $ctlObj->setting['ipregctrltime'];
                 break;
             } else {
                 $ctrlip = $_G['clientip'];
             }
         }
     } else {
         $ctrlip = $_G['clientip'];
     }
     // ip在一定时间内不能注册
     if ($ctlObj->setting['regctrl']) {
         if (C::t('common_regip')->count_by_ip_dateline($ctrlip, $_G['timestamp'] - $ctlObj->setting['regctrl'] * 3600)) {
             return self::errorInfo(lang('message', 'register_ctrl', array('regctrl' => $ctlObj->setting['regctrl'])));
         }
     }
     // IP 地址在 24 小时内只能注册几次
     $setregip = null;
     if ($ctlObj->setting['regfloodctrl']) {
         $regip = C::t('common_regip')->fetch_by_ip_dateline($_G['clientip'], $_G['timestamp'] - 86400);
         if ($regip) {
             if ($regip['count'] >= $ctlObj->setting['regfloodctrl']) {
                 return self::errorInfo(lang('message', 'register_flood_ctrl', array('regfloodctrl' => $ctlObj->setting['regfloodctrl'])));
             } else {
                 $setregip = 1;
             }
         } else {
             $setregip = 2;
         }
     }
     $uid = uc_user_register(addslashes($username), $password, $email, '', '', $_G['clientip']);
     if ($uid <= 0) {
         if ($uid == -1) {
             // 用户名包含敏感字符
             return self::errorInfo(lang('message', 'profile_username_illegal'));
         } elseif ($uid == -2) {
             // 用户名包含被系统屏蔽的字符
             return self::errorInfo(lang('message', 'profile_username_protect'));
         } elseif ($uid == -3) {
             // 该用户名已被注册
             return self::errorInfo(lang('message', 'profile_username_duplicate'));
         } elseif ($uid == -4) {
             // Email 地址无效
             return self::errorInfo(lang('message', 'profile_email_illegal'));
         } elseif ($uid == -5) {
             // 抱歉,Email 包含不可使用的邮箱域名
             return self::errorInfo(lang('message', 'profile_email_domain_illegal'));
         } elseif ($uid == -6) {
             // 该 Email 地址已被注册
             return self::errorInfo(lang('message', 'profile_email_duplicate'));
         }
     }
     $_G['username'] = $username;
     $password = md5(random(10));
     if ($setregip !== null) {
         if ($setregip == 1) {
             C::t('common_regip')->update_count_by_ip($_G['clientip']);
         } else {
             C::t('common_regip')->insert(array('ip' => $_G['clientip'], 'count' => 1, 'dateline' => $_G['timestamp']));
         }
     }
     $profile = $verifyarr = array();
     $emailstatus = 0;
     $init_arr = array('credits' => explode(',', $ctlObj->setting['initcredits']), 'profile' => $profile, 'emailstatus' => $emailstatus);
     C::t('common_member')->insert($uid, $username, $password, $email, $_G['clientip'], $groupinfo['groupid'], $init_arr);
     if ($ctlObj->setting['regctrl'] || $ctlObj->setting['regfloodctrl']) {
         C::t('common_regip')->delete_by_dateline($_G['timestamp'] - ($ctlObj->setting['regctrl'] > 72 ? $ctlObj->setting['regctrl'] : 72) * 3600);
         if ($ctlObj->setting['regctrl']) {
             C::t('common_regip')->insert(array('ip' => $_G['clientip'], 'count' => -1, 'dateline' => $_G['timestamp']));
         }
     }
     if ($ctlObj->setting['regverify'] == 1) {
         $idstring = random(6);
         $authstr = $ctlObj->setting['regverify'] == 1 ? "{$_G['timestamp']}\t2\t{$idstring}" : '';
         C::t('common_member_field_forum')->update($uid, array('authstr' => $authstr));
         $verifyurl = "{$_G[siteurl]}member.php?mod=activate&amp;uid={$uid}&amp;id={$idstring}";
         $email_verify_message = lang('email', 'email_verify_message', array('username' => $username, 'bbname' => $ctlObj->setting['bbname'], 'siteurl' => $_G['siteurl'], 'url' => $verifyurl));
         if (!sendmail("{$username} <{$email}>", lang('email', 'email_verify_subject'), $email_verify_message)) {
             runlog('sendmail', "{$email} sendmail failed.");
         }
     }
     // [add]更新欢迎注册等 data:2015.01.04
     require_once libfile('cache/userstats', 'function');
     build_cache_userstats();
     $_GET['regmessage'] = Webutils::t('来自手机客户端注册');
     $regmessage = dhtmlspecialchars($_GET['regmessage']);
     if ($ctlObj->setting['regverify'] == 2) {
         C::t('common_member_validate')->insert(array('uid' => $uid, 'submitdate' => $_G['timestamp'], 'moddate' => 0, 'admin' => '', 'submittimes' => 1, 'status' => 0, 'message' => $regmessage, 'remark' => ''), false, true);
         manage_addnotify('verifyuser');
     }
     setloginstatus(array('uid' => $uid, 'username' => $_G['username'], 'password' => $password, 'groupid' => $groupinfo['groupid']), 0);
     // 统计用户表
     include_once libfile('function/stat');
     updatestat('register');
     return self::errorInfo('', 0, array('uid' => $uid));
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:101,代码来源:UserUtils.php

示例13: blog_post


//.........这里部分代码省略.........
    if (!empty($POST['picids'])) {
        $picids = array_keys($POST['picids']);
        $query = DB::query("SELECT * FROM " . DB::table('home_pic') . " WHERE picid IN (" . dimplode($picids) . ") AND uid='{$_G['uid']}'");
        while ($value = DB::fetch($query)) {
            if (empty($titlepic) && $value['thumb']) {
                $titlepic = getimgthumbname($value['filepath']);
                $blogarr['picflag'] = $value['remote'] ? 2 : 1;
            }
            $uploads[$POST['picids'][$value['picid']]] = $value;
        }
        if (empty($titlepic) && $value) {
            $titlepic = $value['filepath'];
            $blogarr['picflag'] = $value['remote'] ? 2 : 1;
        }
    }
    if ($uploads) {
        preg_match_all("/\\[imgid\\=(\\d+)\\]/i", $message, $mathes);
        if (!empty($mathes[1])) {
            $searchs = $replaces = array();
            foreach ($mathes[1] as $key => $value) {
                if (!empty($uploads[$value])) {
                    $picurl = pic_get($uploads[$value]['filepath'], 'album', $uploads[$value]['thumb'], $uploads[$value]['remote'], 0);
                    $searchs[] = "[imgid={$value}]";
                    $replaces[] = "<img src=\"{$picurl}\">";
                    unset($uploads[$value]);
                }
            }
            if ($searchs) {
                $message = str_replace($searchs, $replaces, $message);
            }
        }
        foreach ($uploads as $value) {
            $picurl = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote'], 0);
            $message .= "<div class=\"uchome-message-pic\"><img src=\"{$picurl}\"><p>{$value['title']}</p></div>";
        }
    }
    $ckmessage = preg_replace("/(\\<div\\>|\\<\\/div\\>|\\s|\\&nbsp\\;|\\<br\\>|\\<p\\>|\\<\\/p\\>)+/is", '', $message);
    if (empty($ckmessage)) {
        return false;
    }
    $message = addslashes($message);
    if (checkperm('manageblog')) {
        $blogarr['hot'] = intval($POST['hot']);
    }
    if ($olds['blogid']) {
        if ($blogarr['catid'] != $olds['catid']) {
            if ($olds['catid']) {
                DB::query("UPDATE " . DB::table('home_blog_category') . " SET num=num-1 WHERE catid='{$olds['catid']}' AND num>0");
            }
            if ($blogarr['catid']) {
                DB::query("UPDATE " . DB::table('home_blog_category') . " SET num=num+1 WHERE catid='{$blogarr['catid']}'");
            }
        }
        $blogid = $olds['blogid'];
        DB::update('home_blog', $blogarr, array('blogid' => $blogid));
        $fuids = array();
        $blogarr['uid'] = $olds['uid'];
        $blogarr['username'] = $olds['username'];
    } else {
        if ($blogarr['catid']) {
            DB::query("UPDATE " . DB::table('home_blog_category') . " SET num=num+1 WHERE catid='{$blogarr['catid']}'");
        }
        $blogarr['uid'] = $_G['uid'];
        $blogarr['username'] = $_G['username'];
        $blogarr['dateline'] = empty($POST['dateline']) ? $_G['timestamp'] : $POST['dateline'];
        $blogid = DB::insert('home_blog', $blogarr, 1);
        DB::update('common_member_status', array('lastpost' => $_G['timestamp']), array('uid' => $_G['uid']));
        DB::update('common_member_field_home', array('recentnote' => $POST['subject']), array('uid' => $_G['uid']));
    }
    $blogarr['blogid'] = $blogid;
    $POST['tag'] = $olds ? modblogtag($POST['tag'], $blogid) : addblogtag($POST['tag'], $blogid);
    $fieldarr = array('message' => $message, 'postip' => $_G['clientip'], 'target_ids' => $POST['target_ids'], 'tag' => $POST['tag']);
    if (!empty($titlepic)) {
        $fieldarr['pic'] = $titlepic;
    }
    if ($olds) {
        DB::update('home_blogfield', $fieldarr, array('blogid' => $blogid));
    } else {
        $fieldarr['blogid'] = $blogid;
        $fieldarr['uid'] = $blogarr['uid'];
        DB::insert('home_blogfield', $fieldarr);
    }
    if ($isself && !$olds && $blog_status == 0) {
        updatecreditbyaction('publishblog', 0, array('blogs' => 1));
        include_once libfile('function/stat');
        updatestat('blog');
    }
    if ($POST['makefeed'] && $blog_status == 0) {
        include_once libfile('function/feed');
        feed_publish($blogid, 'blogid', $olds ? 0 : 1);
    }
    if (!empty($__G)) {
        $_G = $__G;
    }
    if ($blog_status == 1) {
        updatemoderate('blogid', $blogid);
        manage_addnotify('verifyblog');
    }
    return $blogarr;
}
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:101,代码来源:function_blog.php

示例14: libfile

         DB::query("UPDATE " . DB::table('home_pic') . " SET sharetimes=sharetimes+1 WHERE picid='{$picid}'");
         break;
     case 'thread':
         DB::query("UPDATE " . DB::table('forum_thread') . " SET sharetimes=sharetimes+1 WHERE tid='{$id}'");
         if ($_G['setting']['heatthread']['type'] == 2) {
             require_once libfile('function/forum');
             update_threadpartake($id);
         }
         break;
     case 'article':
         DB::query("UPDATE " . DB::table('portal_article_count') . " SET sharetimes=sharetimes+1 WHERE aid='{$id}'");
         break;
 }
 if ($arr['status'] == 1) {
     updatemoderate('sid', $sid);
     manage_addnotify('verifyshare');
 }
 if ($type == 'link' || !DB::result_first("SELECT COUNT(*) FROM " . DB::table('home_share') . " WHERE uid='{$_G['uid']}' AND itemid='{$id}' AND type='{$type}'")) {
     include_once libfile('function/stat');
     updatestat('share');
 }
 if ($note_uid && $note_uid != $_G['uid']) {
     notification_add($note_uid, 'sharenotice', $note_message, $note_values);
 }
 $needle = $id ? $type . $id : '';
 updatecreditbyaction('createshare', $_G['uid'], array('sharings' => 1), $needle);
 $referer = "home.php?mod=space&uid={$_G['uid']}&do=share&view={$_GET['view']}&from={$_GET['from']}";
 $magvalues['sid'] = $sid;
 if (!$redirecturl) {
     $redirecturl = dreferer();
 }
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:31,代码来源:spacecp_share.php

示例15: on_register


//.........这里部分代码省略.........
             if ($setregip == 1) {
                 C::t('common_regip')->update_count_by_ip($_G['clientip']);
             } else {
                 C::t('common_regip')->insert(array('ip' => $_G['clientip'], 'count' => 1, 'dateline' => $_G['timestamp']));
             }
         }
         if ($invite && $this->setting['inviteconfig']['invitegroupid']) {
             $groupinfo['groupid'] = $this->setting['inviteconfig']['invitegroupid'];
         }
         $init_arr = array('credits' => explode(',', $this->setting['initcredits']), 'profile' => $profile, 'emailstatus' => $emailstatus);
         C::t('common_member')->insert($uid, $username, $password, $email, $_G['clientip'], $groupinfo['groupid'], $init_arr);
         if ($emailstatus) {
             updatecreditbyaction('realemail', $uid);
         }
         if ($verifyarr) {
             $setverify = array('uid' => $uid, 'username' => $username, 'verifytype' => '0', 'field' => serialize($verifyarr), 'dateline' => TIMESTAMP);
             C::t('common_member_verify_info')->insert($setverify);
             C::t('common_member_verify')->insert(array('uid' => $uid));
         }
         require_once libfile('cache/userstats', 'function');
         build_cache_userstats();
         if ($this->extrafile && file_exists($this->extrafile)) {
             require_once $this->extrafile;
         }
         if ($this->setting['regctrl'] || $this->setting['regfloodctrl']) {
             C::t('common_regip')->delete_by_dateline($_G['timestamp'] - ($this->setting['regctrl'] > 72 ? $this->setting['regctrl'] : 72) * 3600);
             if ($this->setting['regctrl']) {
                 C::t('common_regip')->insert(array('ip' => $_G['clientip'], 'count' => -1, 'dateline' => $_G['timestamp']));
             }
         }
         $regmessage = dhtmlspecialchars($_GET['regmessage']);
         if ($this->setting['regverify'] == 2) {
             C::t('common_member_validate')->insert(array('uid' => $uid, 'submitdate' => $_G['timestamp'], 'moddate' => 0, 'admin' => '', 'submittimes' => 1, 'status' => 0, 'message' => $regmessage, 'remark' => ''), false, true);
             manage_addnotify('verifyuser');
         }
         setloginstatus(array('uid' => $uid, 'username' => $_G['username'], 'password' => $password, 'groupid' => $groupinfo['groupid']), 0);
         include_once libfile('function/stat');
         updatestat('register');
         if ($invite['id']) {
             $result = C::t('common_invite')->count_by_uid_fuid($invite['uid'], $uid);
             if (!$result) {
                 C::t('common_invite')->update($invite['id'], array('fuid' => $uid, 'fusername' => $_G['username'], 'regdateline' => $_G['timestamp'], 'status' => 2));
                 updatestat('invite');
             } else {
                 $invite = array();
             }
         }
         if ($invite['uid']) {
             if ($this->setting['inviteconfig']['inviteaddcredit']) {
                 updatemembercount($uid, array($this->setting['inviteconfig']['inviterewardcredit'] => $this->setting['inviteconfig']['inviteaddcredit']));
             }
             if ($this->setting['inviteconfig']['invitedaddcredit']) {
                 updatemembercount($invite['uid'], array($this->setting['inviteconfig']['inviterewardcredit'] => $this->setting['inviteconfig']['invitedaddcredit']));
             }
             require_once libfile('function/friend');
             friend_make($invite['uid'], $invite['username'], false);
             notification_add($invite['uid'], 'friend', 'invite_friend', array('actor' => '<a href="home.php?mod=space&uid=' . $invite['uid'] . '" target="_blank">' . $invite['username'] . '</a>'), 1);
             space_merge($invite, 'field_home');
             if (!empty($invite['privacy']['feed']['invite'])) {
                 require_once libfile('function/feed');
                 $tite_data = array('username' => '<a href="home.php?mod=space&uid=' . $_G['uid'] . '">' . $_G['username'] . '</a>');
                 feed_add('friend', 'feed_invite', $tite_data, '', array(), '', array(), array(), '', '', '', 0, 0, '', $invite['uid'], $invite['username']);
             }
             if ($invite['appid']) {
                 updatestat('appinvite');
             }
开发者ID:torrent520,项目名称:torrent520.github.io,代码行数:67,代码来源:class_member.php


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