本文整理汇总了PHP中fetch_userinfo函数的典型用法代码示例。如果您正苦于以下问题:PHP fetch_userinfo函数的具体用法?PHP fetch_userinfo怎么用?PHP fetch_userinfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fetch_userinfo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: output
public function output()
{
global $vbulletin;
$vbulletin->input->clean_array_gpc('r', array('userid' => TYPE_UINT));
// verify the userid exists, don't want useless entries in our table.
if ($vbulletin->GPC['userid'] and $vbulletin->GPC['userid'] != $vbulletin->userinfo['userid']) {
if (!($userinfo = fetch_userinfo($vbulletin->GPC['userid']))) {
standard_error(fetch_error('invalidid', $vbphrase['user'], $vbulletin->options['contactuslink']));
}
// are we a member of this user's blog?
if (!is_member_of_blog($vbulletin->userinfo, $userinfo)) {
print_no_permission();
}
$userid = $userinfo['userid'];
/* Blog posting check */
if (!($userinfo['permissions']['vbblog_entry_permissions'] & $vbulletin->bf_ugp_vbblog_entry_permissions['blog_canpost']) or !($userinfo['permissions']['vbblog_general_permissions'] & $vbulletin->bf_ugp_vbblog_general_permissions['blog_canviewown'])) {
print_no_permission();
}
} else {
$userinfo =& $vbulletin->userinfo;
$userid = '';
/* Blog posting check, no guests! */
if (!($vbulletin->userinfo['permissions']['vbblog_general_permissions'] & $vbulletin->bf_ugp_vbblog_general_permissions['blog_canviewown']) or !($vbulletin->userinfo['permissions']['vbblog_entry_permissions'] & $vbulletin->bf_ugp_vbblog_entry_permissions['blog_canpost']) or !$vbulletin->userinfo['userid']) {
print_no_permission();
}
}
require_once DIR . '/includes/blog_functions_shared.php';
prepare_blog_category_permissions($userinfo, true);
$globalcats = $this->construct_category($userinfo, 'global');
$localcats = $this->construct_category($userinfo, 'local');
return array('globalcategorybits' => $globalcats, 'localcategorybits' => $localcats);
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:32,代码来源:api_blogcategorylist.php
示例2: showItem
function showItem()
{
global $vbulletin, $vbphrase, $itembit_right_column;
$showvalues = false;
$this->getExtraInfo();
if (!$this->bypassEnableForm() and $this->itemtypedata['options']['edit_time']) {
if (!$this->canEdit()) {
$itembit_right_column .= construct_phrase($vbphrase['kbank_itemshow_customize_userinfo_cantedit'], vb_number_format($this->data['options']['edit_time']));
$showvalues = true;
} else {
$itembit_right_column .= construct_phrase($vbphrase['kbank_itemshow_customize_userinfo_canedit'], vb_number_format($this->data['options']['edit_time']), vb_number_format($this->itemtypedata['options']['edit_time']));
}
}
if ($this->data['status'] == KBANK_ITEM_ENABLED or $showvalues) {
if ($this->data['userid'] == $vbulletin->userinfo['userid']) {
$userinfo =& $vbulletin->userinfo;
} else {
if (!$vbulletin->userinfo['kbank_granted'][$this->data['userid']]['fetched']) {
$vbulletin->userinfo['kbank_granted'][$this->data['userid']] = fetch_userinfo($this->data['userid']);
$vbulletin->userinfo['kbank_granted'][$this->data['userid']]['fetched'] = true;
}
$userinfo =& $vbulletin->userinfo['kbank_granted'][$this->data['userid']];
}
$userinfo['musername'] = null;
$this->work($userinfo);
if ($this->data['options']['username'] or $this->data['options']['username_color'] or $this->data['options']['username_strong']) {
$itembit_right_column .= construct_phrase($vbphrase['kbank_itemshow_customize_userinfo_username'], $userinfo['musername']);
}
if ($this->data['options']['usertitle'] or $this->data['options']['usertitle_color']) {
$itembit_right_column .= construct_phrase($vbphrase['kbank_itemshow_customize_userinfo_usertitle'], $userinfo['usertitle']);
}
}
return parent::showItem();
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:34,代码来源:customize_userinfo.kbank.php
示例3: _make_message_body
/**
* Формирует(но не сохраняет) тело сообщения
*
* @param array $post
* @global vB_Registry $vbulletin
* @return string
*/
protected function _make_message_body($post)
{
global $vbulletin, $foruminfo, $threadinfo;
$message = '';
if (!intval($this->_post_id)) {
return $message;
}
if (empty($post['pagetext'])) {
$post['pagetext'] = $post['message'];
}
$post['allowsmilie'] = $post['enablesmilies'];
// get attachments
require_once DIR . '/packages/vbattach/attach.php';
$attach = new vB_Attach_Display_Content($vbulletin, 'vBForum_Post');
$postattach = $attach->fetch_postattach(0, $this->_post_id);
$post['attachments'] = $postattach;
$userinfo = fetch_userinfo($post['userid']);
require_once DIR . '/includes/class_postbit.php';
$postbit_factory = new vB_Postbit_Factory();
$postbit_factory->registry =& $vbulletin;
$postbit_factory->forum =& $foruminfo;
$postbit_factory->thread =& $threadinfo;
$postbit_factory->cache = array();
$postbit_factory->bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$postbit_factory->bbcode_parser->set_parse_userinfo($userinfo);
$postbit_obj =& $postbit_factory->fetch_postbit('post_nntp');
$this->_body = $postbit_obj->construct_postbit($post);
return $this->_body;
}
开发者ID:rcdesign-cemetery,项目名称:vb-nntp,代码行数:36,代码来源:class_nntpgate_forum_index.php
示例4: RegisterService
function RegisterService($who)
{
global $db, $vbulletin, $server;
$result = array();
if (!$vbulletin->options['vbb_serviceonoff']) {
$result['Code'] = 1;
$result['Text'] = 'vbb_service_turned_off';
} else {
if ($vbulletin->options['vbb_servicepw'] != $_SERVER['PHP_AUTH_PW']) {
$result['Code'] = 1;
$result['Text'] = 'vbb_invalid_servicepw';
} else {
$userid = fetch_userid_by_service($who['ServiceName'], $who['Username']);
if (empty($userid) || $userid <= 0) {
$result['Code'] = 1;
$result['Text'] = 'invalid_user';
} else {
unset($vbulletin->userinfo);
$vbulletin->userinfo =& fetch_userinfo($userid);
$permissions = cache_permissions($vbulletin->userinfo);
$vbulletin->options['hourdiff'] = (date('Z', TIMENOW) / 3600 - $vbulletin->userinfo['timezoneoffset']) * 3600;
fetch_options_overrides($vbulletin->userinfo);
fetch_time_data();
// everything is ok
$result['Code'] = 0;
}
}
}
return $result;
}
开发者ID:TheProjecter,项目名称:vbulletinbot,代码行数:30,代码来源:vbulletinbot.php
示例5: createFromId
/**
* Create from the user id
*
* @param int $id
* @return vB_Legacy_User
*/
public static function createFromId($id, $extra_flags = 0)
{
$user = new vB_Legacy_User();
if ($id == 0) {
$user->initGuest();
} else {
$user->record = fetch_userinfo($id, $extra_flags);
}
return $user;
}
开发者ID:Kheros,项目名称:MMOver,代码行数:16,代码来源:user.php
示例6: fetch_userinfo_from_username
function fetch_userinfo_from_username($username, $option = 0, $languageid = 0)
{
$result = $this->db->query("SELECT * FROM " . TABLE_PREFIX . "user WHERE username = '" . $username . "'");
$useridq = $this->db->fetch_array($result);
if (!$useridq) {
return $useridq;
}
$userid = $useridq['userid'];
return fetch_userinfo($userid, $option, $languageid);
}
开发者ID:louisnorthmore,项目名称:mangoswebv3,代码行数:10,代码来源:class.vbulletin-bridge.php
示例7: hqth_get_value
function hqth_get_value($userid)
{
global $vbulletin;
$userinfo = fetch_userinfo($userid);
$user_post_number = $userinfo['posts'];
$user_num_buyed = hqth_get_num_buyed($userid);
$user_oldmaster_fee = $vbulletin->options['hqthffs_fee_oldmaster'];
$ffs_default_money = $vbulletin->options['hqthffs_default_money'];
$user_page_fee = $vbulletin->options['hqthffs_fee_page'];
$user_redeemer_fee = $vbulletin->options['hqthffs_fee_redeemer'];
eval('$userprice = ' . $vbulletin->options['hqthffs_pet_cast'] . ';');
return $userprice;
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:13,代码来源:functions_ffs.php
示例8: add_member_to_group
function add_member_to_group($member, $order_details, $renewal)
{
if ($renewal || is_wp_error($member) || !$member) {
return;
}
if (!empty($order_details['_acp_order_product_id'])) {
$member_group = get_post_meta($order_details['_acp_order_product_id'], '_acp_product_vbulletin_group', true);
}
if (empty($member_group)) {
$member_group = accesspress_get_option('vbulletin_group');
}
if (!$member_group) {
return;
}
$vb_user_id = get_user_meta($member, 'vbulletin_user_id', true);
if (empty($vb_user_id)) {
return;
}
// get the vBulletin user
$vb_user_data = datamanager_init('User', $GLOBALS['vbulletin'], ERRTYPE_ARRAY);
$user_info = fetch_userinfo($vb_user_id);
$vb_user_data->set_existing($user_info);
// check for existing user
$vb_primary_group = $vb_user_data->fetch_field('usergroupid');
if (empty($vb_primary_group) || !is_numeric($vb_primary_group)) {
$vb_user_data->set('usergroupid', $member_group);
// user already has this primary group
} elseif ($vb_primary_group == $member_group) {
return;
// add to secondary group
} else {
$secondary_groups = array($member_group);
$groups = $vb_user_data->fetch_field('membergroupids');
if (!empty($groups)) {
$secondary_groups = explode(',', $groups);
if (in_array($member_group, $secondary_groups)) {
return;
}
$secondary_groups[] = $member_group;
sort($secondary_groups);
}
$vb_user_data->set('membergroupids', implode(',', $secondary_groups));
}
$vb_user_data->pre_save();
if (empty($vb_user_data->errors)) {
$vb_user_id = $vb_user_data->save();
}
}
开发者ID:hscale,项目名称:webento,代码行数:48,代码来源:class-vbulletinbridge.php
示例9: login
/**
* Validates login status on external service and logs in vBulletin
*/
public function login()
{
global $vbulletin;
$vbulletin->session = NULL;
// Get and store vbnexus-id and vbnexus-srv
$vBNexus = vBNexus::getInstance();
$vbnexus_service = $vBNexus->getConfig('vbnexus_service');
$vbnexus_userid = $vBNexus->getConfig('vbnexus_userid');
if (!$vbnexus_userid) {
$vbnexus_userid = $this->getUserOnline();
$vBNexus->setConfig('vbnexus_userid', $vbnexus_userid);
}
// Returning null if authentication from service failed (unexpected error)
// If this happens, there's likely cookies issues on the server or the
// applications config is wrong/incomplete in fb or gfc
if (!$vbnexus_userid) {
return NULL;
}
// Get all available information on this user
$sql = "SELECT `u`.`usergroupid`,\r\n `u`.`username`,\r\n `u`.`email`,\r\n `n`.*\r\n FROM " . TABLE_PREFIX . "vbnexus_user `n`\r\n LEFT JOIN " . TABLE_PREFIX . "user `u` USING (`userid`)\r\n WHERE `n`.`service` = '{$vbnexus_service}'\r\n AND `n`.`nonvbid` = '{$vbnexus_userid}'";
$res = $vbulletin->db->query_first($sql);
// Returning false if user not registered yet with this external account
if (!$res || !$res['userid']) {
return false;
}
/************* Starts: fix proxied emails from vBNexus3 ***************/
$oldemails = array('fb' => '/@proxymail\\.facebook\\.com$/', 'gfc' => "/apps\\+|{$vbnexus_userid}[@\\.]/");
if (preg_match($oldemails[$vbnexus_service], $res['email'])) {
$this->fixOldEmail($res, $vbnexus_userid);
} elseif ($vbnexus_service == 'gfc' && !$res['associated']) {
$this->associateAccount($res, $vbnexus_userid);
}
/********** Ends: ask for a valid password for GFC accounts ***********/
// Process vBulletin login
require_once DIR . '/includes/functions_login.php';
$vbulletin->userinfo = fetch_userinfo($res['userid']);
$vbulletin->session->created = false;
process_new_login('', false, '');
// On login, store a cookie with vbnexus params
if ($vbulletin->session->created) {
$vBNexusInfo = array('userid' => $res['userid'], 'service' => $vbnexus_service, 'nexusid' => $vbnexus_userid, 'can_publish' => $this->canPublish());
setcookie(COOKIE_PREFIX . 'vbnexus', serialize($vBNexusInfo));
}
return !!$vbulletin->session->created;
}
开发者ID:benyamin20,项目名称:vbregistration,代码行数:48,代码来源:vBNexus_user.php
示例10: print_cp_header
// ######################### START MAIN SCRIPT ############################
// ########################################################################
print_cp_header($vbphrase['administrator_permissions_manager']);
if (!in_array($vbulletin->userinfo['userid'], preg_split('#\\s*,\\s*#s', $vbulletin->config['SpecialUsers']['superadministrators'], -1, PREG_SPLIT_NO_EMPTY))) {
print_stop_message('sorry_you_are_not_allowed_to_edit_admin_permissions');
}
// ############################# LOG ACTION ###############################
$vbulletin->input->clean_array_gpc('r', array('userid' => TYPE_INT));
if ($vbulletin->GPC['userid']) {
$user = $db->query_first("\n\t\tSELECT administrator.*, IF(administrator.userid IS NULL, 0, 1) AS isadministrator,\n\t\t\tuser.userid, user.username\n\t\tFROM " . TABLE_PREFIX . "user AS user\n\t\tLEFT JOIN " . TABLE_PREFIX . "administrator AS administrator ON(administrator.userid = user.userid)\n\t\tWHERE user.userid = " . $vbulletin->GPC['userid']);
if (!$user) {
print_stop_message('no_matches_found');
} else {
if (!$user['isadministrator']) {
// should this user have an administrator record??
$userinfo = fetch_userinfo($user['userid']);
cache_permissions($userinfo);
if ($userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']) {
$admindm =& datamanager_init('Admin', $vbulletin, ERRTYPE_SILENT);
$admindm->set('userid', $userinfo['userid']);
$admindm->save();
unset($admindm);
} else {
print_stop_message('invalid_user_specified');
}
}
}
$admindm =& datamanager_init('Admin', $vbulletin, ERRTYPE_CP);
$admindm->set_existing($user);
} else {
$user = array();
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:adminpermissions.php
示例11: exec_send_sg_notification
/**
* Sends email notifications for discussions.
*
* @param int $discussion - The discussion being updated
* @param int $messageid - Id of the message that triggered the update
* @param string $postusername - Optional username displayed on post
*/
function exec_send_sg_notification($discussionid, $gmid = false, $postusername = false)
{
global $vbulletin;
if (!$vbulletin->options['enableemail']) {
return;
}
$discussion = fetch_socialdiscussioninfo($discussionid);
// if there are no subscribers, no need to send notifications
if (!$discussion['subscribers']) {
return;
}
// if the discussion is moderated or deleted, don't send notification
if ('deleted' == $discussion['state'] or 'moderation' == $discussion['state']) {
return;
}
$group = fetch_socialgroupinfo($discussion['groupid']);
if (!$gmid) {
// get last gmid from discussion
$gmid = $vbulletin->db->query_first("\n\t\t\tSELECT MAX(gmid) AS gmid\n\t\t\tFROM " . TABLE_PREFIX . "groupmessage AS groupmessage\n\t\t\tWHERE discussionid = {$discussion['discussionid']}\n\t\t\t\tAND state = 'visible'\n\t\t");
$gmid = $gmid['gmid'];
}
// get message details
$gmessage = fetch_groupmessageinfo($gmid);
if (!$gmessage) {
return;
}
// get post time of previous message - if a user hasn't been active since then we won't resend a notification
$lastposttime = ($lastposttime = $vbulletin->db->query_first("\n\t\t\tSELECT MAX(dateline) AS dateline\n\t\t\tFROM " . TABLE_PREFIX . "groupmessage AS groupmessage\n\t\t\tWHERE discussionid = {$discussion['discussionid']}\n\t\t\t\tAND dateline < {$gmessage['dateline']}\n\t\t\t\tAND state = 'visible'\n\t")) ? $lastposttime['dateline'] : $gmessage['dateline'];
$discussion['title'] = unhtmlspecialchars($discussion['title']);
$group['name'] = unhtmlspecialchars($group['name']);
// temporarily use postusername in userinfo
if (!$postusername) {
// get current user name if user exists
if ($gmessage['postuserid'] and $userinfo = fetch_userinfo($gmessage['postuserid'])) {
$postusername = $userinfo['username'];
} else {
$postusername = $gmessage['postusername'];
}
}
$postusername = unhtmlspecialchars($postusername);
$userid = $gmessage['postuserid'];
($hook = vBulletinHook::fetch_hook('newpost_sg_notification_start')) ? eval($hook) : false;
$useremails = $vbulletin->db->query_read_slave("\n\t\tSELECT user.*, subscribediscussion.emailupdate, subscribediscussion.subscribediscussionid, IF(socialgroupmember.userid IS NOT NULL,1,0) ismember\n\t\tFROM " . TABLE_PREFIX . "subscribediscussion AS subscribediscussion\n\t\tINNER JOIN " . TABLE_PREFIX . "user AS user ON (subscribediscussion.userid = user.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "usergroup AS usergroup ON (usergroup.usergroupid = user.usergroupid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON (usertextfield.userid = user.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "socialgroupmember AS socialgroupmember ON (socialgroupmember.userid = user.userid AND socialgroupmember.groupid = {$group['groupid']})\n\t\tWHERE subscribediscussion.discussionid = {$discussion['discussionid']}\n\t\t AND subscribediscussion.emailupdate = 1\n\t\t AND " . ($gmessage['postuserid'] ? " CONCAT(' ', IF(usertextfield.ignorelist IS NULL, '', usertextfield.ignorelist), ' ') NOT LIKE ' " . intval($userid) . " '" : '') . "\n\t\t AND user.usergroupid <> 3\n\t\t AND user.userid <> " . intval($userid) . "\n\t\t AND user.lastactivity >= " . intval($lastposttime) . "\n\t\t AND (usergroup.genericoptions & " . $vbulletin->bf_ugp_genericoptions['isnotbannedgroup'] . ")\n\t");
vbmail_start();
// parser for plaintexting the message pagetext
require_once DIR . '/includes/class_bbcode_alt.php';
$plaintext_parser =& new vB_BbCodeParser_PlainText($vbulletin, fetch_tag_list());
$pagetext_cache = array();
// used to cache the results per languageid for speed
$evalemail = array();
while ($touser = $vbulletin->db->fetch_array($useremails)) {
// check user can view discussion
$permissions = cache_permissions($touser, false);
if (!($vbulletin->usergroupcache["{$touser['usergroupid']}"]['genericoptions'] & $vbulletin->bf_ugp_genericoptions['isnotbannedgroup']) or !($permissions['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview']) or !($permissions['socialgrouppermissions'] & $vbulletin->bf_ugp_socialgrouppermissions['canviewgroups']) or $group['options'] & $vbulletin->bf_misc_socialgroupoptions['join_to_view'] and !$touser['ismember'] and !($permissions['socialgrouppermissions'] & $vbulletin->bf_ugp_socialgrouppermissions['canalwayscreatediscussion']) and !($permissions['socialgrouppermissions'] & $vbulletin->bf_ugp_socialgrouppermissions['canalwayspostmessage'])) {
continue;
}
$touser['username'] = unhtmlspecialchars($touser['username']);
$touser['languageid'] = iif($touser['languageid'] == 0, $vbulletin->options['languageid'], $touser['languageid']);
$touser['auth'] = md5($touser['userid'] . $touser['subscribediscussionid'] . $touser['salt'] . COOKIE_SALT);
if (empty($evalemail)) {
$email_texts = $vbulletin->db->query_read_slave("\n\t\t\t\tSELECT text, languageid, fieldname\n\t\t\t\tFROM " . TABLE_PREFIX . "phrase\n\t\t\t\tWHERE fieldname IN ('emailsubject', 'emailbody') AND varname = 'notify_discussion'\n\t\t\t");
while ($email_text = $vbulletin->db->fetch_array($email_texts)) {
$emails["{$email_text['languageid']}"]["{$email_text['fieldname']}"] = $email_text['text'];
}
require_once DIR . '/includes/functions_misc.php';
foreach ($emails as $languageid => $email_text) {
// lets cycle through our array of notify phrases
$text_message = str_replace("\\'", "'", addslashes(iif(empty($email_text['emailbody']), $emails['-1']['emailbody'], $email_text['emailbody'])));
$text_message = replace_template_variables($text_message);
$text_subject = str_replace("\\'", "'", addslashes(iif(empty($email_text['emailsubject']), $emails['-1']['emailsubject'], $email_text['emailsubject'])));
$text_subject = replace_template_variables($text_subject);
$evalemail["{$languageid}"] = '
$message = "' . $text_message . '";
$subject = "' . $text_subject . '";
';
}
}
// parse the page text into plain text, taking selected language into account
if (!isset($pagetext_cache["{$touser['languageid']}"])) {
$plaintext_parser->set_parsing_language($touser['languageid']);
$pagetext_cache["{$touser['languageid']}"] = $plaintext_parser->parse($gmessage['pagetext']);
}
$pagetext = $pagetext_cache["{$touser['languageid']}"];
($hook = vBulletinHook::fetch_hook('new_sg_message_notification_message')) ? eval($hook) : false;
eval(iif(empty($evalemail["{$touser['languageid']}"]), $evalemail["-1"], $evalemail["{$touser['languageid']}"]));
vbmail($touser['email'], $subject, $message);
}
$vbulletin->db->free_result($useremails);
unset($plaintext_parser, $pagetext_cache);
vbmail_end();
}
开发者ID:benyamin20,项目名称:vbregistration,代码行数:98,代码来源:functions_socialgroup.php
示例12: delete_user_pms
/**
* Deletes all private messages belonging to the specified user
*
* @param integer User ID
* @param boolean If true, update the user record in the database to reflect their new number of private messages
*
* @return mixed If messages are deleted, will return a string to be printed out detailing work done by this function
*/
function delete_user_pms($userid, $updateuser = true)
{
global $vbulletin, $vbphrase;
$userid = intval($userid);
// array to store pm ids message ids
$pms = array();
// array to store the number of pmtext records used by this user
$pmTextCount = array();
// array to store the ids of any pmtext records that are used soley by this user
$deleteTextIDs = array();
// array to store results
$out = array();
// first zap all receipts belonging to this user
$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "pmreceipt WHERE userid = {$userid}");
$out['receipts'] = $vbulletin->db->affected_rows();
// now find all this user's private messages
$messages = $vbulletin->db->query_read("\n\t\tSELECT pmid, pmtextid\n\t\tFROM " . TABLE_PREFIX . "pm\n\t\tWHERE userid = {$userid}\n\t");
while ($message = $vbulletin->db->fetch_array($messages)) {
// stick this record into our $pms array
$pms["{$message['pmid']}"] = $message['pmtextid'];
// increment the number of PMs that use the current PMtext record
$pmTextCount["{$message['pmtextid']}"]++;
}
$vbulletin->db->free_result($messages);
if (!empty($pms)) {
// zap all pm records belonging to this user
$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "pm WHERE userid = {$userid}");
$out['pms'] = $vbulletin->db->affected_rows();
$out['pmtexts'] = 0;
// update the user record if necessary
if ($updateuser and $user = fetch_userinfo($userid)) {
$updateduser = true;
$userdm =& datamanager_init('User', $vbulletin, ERRTYPE_SILENT);
$userdm->set_existing($user);
$userdm->set('pmtotal', 0);
$userdm->set('pmunread', 0);
$userdm->set('pmpopup', 'IF(pmpopup=2, 1, pmpopup)', false);
$userdm->save();
unset($userdm);
}
} else {
$out['pms'] = 0;
$out['pmtexts'] = 0;
}
// in case the totals have been corrupted somehow
if (!isset($updateduser) and $updateuser and $user = fetch_userinfo($userid)) {
$userdm =& datamanager_init('User', $vbulletin, ERRTYPE_SILENT);
$userdm->set_existing($user);
$userdm->set('pmtotal', 0);
$userdm->set('pmunread', 0);
$userdm->set('pmpopup', 'IF(pmpopup=2, 1, pmpopup)', false);
$userdm->save();
unset($userdm);
}
foreach ($out as $k => $v) {
$out["{$k}"] = vb_number_format($v);
}
return $out;
}
开发者ID:benyamin20,项目名称:vbregistration,代码行数:67,代码来源:adminfunctions.php
示例13: eval
$search = $db->query_first("
SELECT *
FROM " . TABLE_PREFIX . "blog_search
WHERE blogsearchid = " . $vbulletin->GPC['searchid']
);
if (!$search OR ($search['userid'] AND $search['userid'] != $vbulletin->userinfo['userid']))
{
standard_error(fetch_error('invalidid', $vbphrase['search'], $vbulletin->options['contactuslink']));
}
($hook = vBulletinHook::fetch_hook('blog_search_results_start')) ? eval($hook) : false;
if ($search['searchuserid'])
{
$userinfo = fetch_userinfo($search['searchuserid'], 1);
$sidebar =& build_user_sidebar($userinfo);
}
else
{
$sidebar =& build_overview_sidebar();
}
// Set Perpage .. this limits it to 10. Any reason for more?
if ($vbulletin->GPC['perpage'] == 0)
{
$perpage = 15;
}
else if ($vbulletin->GPC['perpage'] > 10)
{
$perpage = 30;
开发者ID:hungnv0789,项目名称:vhtm,代码行数:30,代码来源:blog_search.php
示例14: do_report
/**
* Does the report
*
* @param string The Reason for the report
* @param array Information regarding the item being reported
*
*/
function do_report($reason, &$iteminfo)
{
global $vbphrase;
$this->iteminfo =& $iteminfo;
$reportinfo = array('rusername' => unhtmlspecialchars($this->registry->userinfo['username']), 'ruserid' => $this->registry->userinfo['userid'], 'remail' => $this->registry->userinfo['email']);
if ($this->registry->options['postmaxchars'] > 0) {
$reportinfo['reason'] = substr($reason, 0, $this->registry->options['postmaxchars']);
} else {
$reportinfo['reason'] = $reason;
}
$reportthread = ($rpforumid = $this->registry->options['rpforumid'] and $rpforuminfo = fetch_foruminfo($rpforumid));
$reportemail = ($this->registry->options['enableemail'] and $this->registry->options['rpemail']);
$mods = array();
$reportinfo['modlist'] = '';
$moderators = $this->fetch_affected_moderators();
if ($moderators) {
while ($moderator = $this->registry->db->fetch_array($moderators)) {
$mods["{$moderator['userid']}"] = $moderator;
$reportinfo['modlist'] .= (!empty($reportinfo['modlist']) ? ', ' : '') . unhtmlspecialchars($moderator['username']);
}
}
if (empty($reportinfo['modlist'])) {
$reportinfo['modlist'] = $vbphrase['n_a'];
}
$this->set_reportinfo($reportinfo);
if ($reportthread) {
// Determine if we need to create a thread or a post
if (!$this->iteminfo['reportthreadid'] or !($rpthreadinfo = fetch_threadinfo($this->iteminfo['reportthreadid'])) or $rpthreadinfo and ($rpthreadinfo['isdeleted'] or !$rpthreadinfo['visible'] or $rpthreadinfo['forumid'] != $rpforuminfo['forumid'])) {
eval(fetch_email_phrases('report' . $this->phrasekey . '_newthread', 0));
if (!$this->registry->options['rpuserid'] or !($userinfo = fetch_userinfo($this->registry->options['rpuserid']))) {
$userinfo =& $this->registry->userinfo;
}
$threadman =& datamanager_init('Thread_FirstPost', $this->registry, ERRTYPE_SILENT, 'threadpost');
$threadman->set_info('forum', $rpforuminfo);
$threadman->set_info('is_automated', true);
$threadman->set_info('skip_moderator_email', true);
$threadman->set_info('mark_thread_read', true);
$threadman->set_info('parseurl', true);
$threadman->set('allowsmilie', true);
$threadman->set('userid', $userinfo['userid']);
$threadman->setr_info('user', $userinfo);
$threadman->set('title', $subject);
$threadman->set('pagetext', $message);
$threadman->set('forumid', $rpforuminfo['forumid']);
$threadman->set('visible', 1);
if ($userinfo['userid'] != $this->registry->userinfo['userid']) {
// not posting as the current user, IP won't make sense
$threadman->set('ipaddress', '');
}
$rpthreadid = $threadman->save();
if ($this->update_item_reportid($rpthreadid)) {
$threadman->set_info('skip_moderator_email', false);
$threadman->email_moderators(array('newthreademail', 'newpostemail'));
$this->iteminfo['reportthreadid'] = 0;
$rpthreadinfo = array('threadid' => $rpthreadid, 'forumid' => $rpforuminfo['forumid'], 'postuserid' => $userinfo['userid']);
// check the permission of the other user
$userperms = fetch_permissions($rpthreadinfo['forumid'], $userinfo['userid'], $userinfo);
if ($userperms & $this->registry->bf_ugp_forumpermissions['canview'] and $userperms & $this->registry->bf_ugp_forumpermissions['canviewthreads'] and $userinfo['autosubscribe'] != -1) {
$this->registry->db->query_write("\n\t\t\t\t\t\t\tINSERT IGNORE INTO " . TABLE_PREFIX . "subscribethread\n\t\t\t\t\t\t\t\t(userid, threadid, emailupdate, folderid, canview)\n\t\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t\t\t(" . $userinfo['userid'] . ", {$rpthreadinfo['threadid']}, {$userinfo['autosubscribe']}, 0, 1)\n\t\t\t\t\t\t");
}
} else {
// Delete the thread we just created
if ($delthread = fetch_threadinfo($rpthreadid)) {
$threadman =& datamanager_init('Thread', $this->registry, ERRTYPE_SILENT, 'threadpost');
$threadman->set_existing($delthread);
$threadman->delete($rpforuminfo['countposts'], true, NULL, false);
unset($threadman);
}
$this->refetch_iteminfo();
}
}
if ($this->iteminfo['reportthreadid'] and $rpthreadinfo = fetch_threadinfo($this->iteminfo['reportthreadid']) and !$rpthreadinfo['isdeleted'] and $rpthreadinfo['visible'] == 1 and $rpthreadinfo['forumid'] == $rpforuminfo['forumid']) {
eval(fetch_email_phrases('reportitem_newpost', 0));
// Already reported, thread still exists/visible, and thread is in the right forum.
// Technically, if the thread exists but is in the wrong forum, we should create the
// thread, but that should only occur in a race condition.
if (!$this->registry->options['rpuserid'] or !$userinfo and !($userinfo = fetch_userinfo($this->registry->options['rpuserid']))) {
$userinfo =& $this->registry->userinfo;
}
$postman =& datamanager_init('Post', $this->registry, ERRTYPE_STANDARD, 'threadpost');
$postman->set_info('thread', $rpthreadinfo);
$postman->set_info('forum', $rpforuminfo);
$postman->set_info('is_automated', true);
$postman->set_info('parseurl', true);
$postman->set('threadid', $rpthreadinfo['threadid']);
$postman->set('userid', $userinfo['userid']);
$postman->set('allowsmilie', true);
$postman->set('visible', true);
$postman->set('title', $subject);
$postman->set('pagetext', $message);
if ($userinfo['userid'] != $this->registry->userinfo['userid']) {
// not posting as the current user, IP won't make sense
$postman->set('ipaddress', '');
//.........这里部分代码省略.........
开发者ID:holandacz,项目名称:nb4,代码行数:101,代码来源:class_reportitem.php
示例15: associateAccount
/**
* protected void associateAccount(array $user, int $vbnexus_userid)
* Forces GFC users to choose a password (and a valid email too for
* users of vbnexus3). The change is then flagged in the database with
* field vbnexus_user.associated set to 2.
*
* @param array $user
* @param int $vbnexus_userid
* @return void
*/
protected function associateAccount($user, $vbnexus_userid)
{
global $vbulletin, $vboptions, $vbphrase, $stylevar, $vbnexus_loc;
if (!intval($user['userid'])) {
return false;
}
// If the user is submitting email and/or password, process it
if (isset($_POST['vbnexus_gfc_fix'])) {
// Validate input
if (empty($_POST['email'])) {
$vbnexus_error = "A valid email is required";
} elseif (empty($_POST['password'])) {
$vbnexus_error = "A valid password is required";
} elseif (empty($_POST['password2']) || $_POST['password'] != $_POST['password2']) {
$vbnexus_error = "Passwords do not match";
} else {
$require_activation = $vbulletin->options['verifyemail'] && $user['email'] != $_POST['email'];
$userdata =& datamanager_init('user', $vbulletin, ERRTYPE_SILENT);
$userdata->set_existing(fetch_userinfo($user['userid']));
$userdata->set('password', $_POST['password']);
// We can ignore validation of the email if it wasn't changed
$user['email'] == $_POST['email'] || $userdata->set('email', $_POST['email']);
if ($require_activation) {
$userdata->set('usergroupid', 3);
}
if ($userdata->has_errors(false)) {
$vbnexus_error = join('</li><li>', $userdata->errors);
} elseif ($userdata->save()) {
if ($require_activation) {
// Email phrase 'activateaccount' expects vars called $userid, $username
// and $activateid to be defined and meaningfull
$userid = $user['userid'];
$username = $user['username'];
$activateid = build_user_activation_id($userid, $user['usergroupid'], 0);
eval(fetch_email_phrases('activateaccount', $languageid));
// After eval'ing activateaccount we have vars $subject and $message set
vbmail($_POST['email'], $subject, $message, true);
}
// The user was updated, there's now a valid password and email, so let's flag it
$sql = "UPDATE `" . TABLE_PREFIX . "vbnexus_user`\r\n SET `associated` = 2\r\n WHERE `nonvbid` = '{$vbnexus_userid}'\r\n AND `service` = 'gfc'";
$vbulletin->db->query_write($sql);
if ($vbulletin->db->query_write($sql)) {
// Returning since we're done here and execution should go on normally
return;
} else {
// This should never happen, it's mostly for debugging if something goes wrong
$errmsg = "An error occurred trying to update your GFC information. Please try again." . " If the problem persists please report it to an admin.";
return eval(standard_error($errmsg));
// Prints and exits
}
} else {
// This should never happen, it's mostly for debugging if something goes wrong
$errmsg = "An error occurred trying to update the account information. Please try again." . " If the problem persists please report it to an admin.";
return eval(standard_error($errmsg));
// Prints and exits
}
}
$user['email'] = $_POST['email'];
}
$vBNexusUser = $user;
// No need to show mock emails from old vbnexus (< 3)
if (empty($_POST['email']) && preg_match("/apps\\+|{$vbnexus_userid}[@\\.]/", $user['email'])) {
$vBNexusUser['email'] = '';
}
$vbnexus_loc = $_GET['loc'];
// This will print a Message box (not really an error, but the actual form) and exit
eval('$html = "' . fetch_template('vbnexus_3_gfc_invalid_email') . '";');
eval(standard_error($html));
}
开发者ID:benyamin20,项目名称:vbregistration,代码行数:79,代码来源:vBNexus_gfc.php
示例16: pre_save_post
/**
* This is a pre_save method that only applies to the subclasses that have post
* fields as their members (ie, not _Thread). Likely only called in those class's
* pre_save methods.
*
* @return bool True on success, false on failure
*/
function pre_save_post($doquery = true)
{
if ($this->info['forum']['podcast'] and $this->info['podcasturl'] and empty($this->info['podcastsize'])) {
require_once DIR . '/includes/class_upload.php';
$upload = new vB_Upload_Abstract($this->registry);
if (!($this->info['podcastsize'] = intval($upload->fetch_remote_filesize($this->info['podcasturl'])))) {
$this->error('invalid_podcasturl');
return false;
}
}
if (!$this->condition) {
if ($this->fetch_field('userid', 'post') == 0 and $this->fetch_field('username', 'post') == '') {
$this->error('nousername');
return false;
}
if ($this->fetch_field('dateline', 'post') === null) {
$this->set('dateline', TIMENOW);
}
if ($this->fetch_field('ipaddress', 'post') === null) {
$this->set('ipaddress', $this->registry->options['logip'] ? IPADDRESS : '');
}
// flood check
if ($this->registry->options['floodchecktime'] > 0 and empty($this->info['preview']) and empty($this->info['is_automated']) and $this->fetch_field('userid', 'post')) {
if (!$this->info['user']) {
$this->info['user'] = fetch_userinfo($this->fetch_field('userid', 'post'));
}
$user =& $this->info['user'];
if ($user['lastpost'] <= TIMENOW and !can_moderate($this->info['forum']['forumid'], '', $user['userid'], $user['usergroupid'] . (trim($user['membergroupids']) ? ",{$user['membergroupids']}" : ''))) {
if (!class_exists('vB_FloodCheck')) {
require_once DIR . '/includes/class_floodcheck.php';
}
$this->floodcheck =& new vB_FloodCheck($this->registry, 'user', 'lastpost');
$this->floodcheck->commit_key($this->registry->userinfo['userid'], TIMENOW, TIMENOW - $this->registry->options['floodchecktime']);
if ($this->floodcheck->is_flooding()) {
$this->error('postfloodcheck', $this->registry->options['floodchecktime'], $this->floodcheck->flood_wait());
return false;
}
if ($this->errors) {
// if we already have errors, the save won't happen, so rollback now...
$this->floodcheck->rollback();
} else {
// ...or, in case we have a new error
$this->set_failure_callback(array(&$this->floodcheck, 'rollback'));
}
}
}
}
if (!$this->verify_image_count('pagetext', 'allowsmilie', $this->info['forum']['forumid'], 'post')) {
return false;
}
if ($this->info['posthash']) {
$this->info['newattach'] = $this->fetch_attachment_count($this->info['posthash'], $this->fetch_field('userid', 'post'));
$this->set('attach', intval($this->fetch_field('attach')) + $this->info['newattach']);
}
// New posts that aren't automated and are visible should be scanned
if (!$this->condition and !empty($this->registry->options['vb_antispam_key']) and empty($this->info['is_automated']) and $this->fetch_field('visible') == 1 and (!$this->registry->options['vb_antispam_posts'] or $this->registry->userinfo['posts'] < $this->registry->options['vb_antispam_posts']) and !can_moderate()) {
require_once DIR . '/includes/class_akismet.php';
$akismet = new vB_Akismet($this->registry);
$akismet->akismet_board = $this->registry->options['bburl'];
$akismet->akismet_key = $this->registry->options['vb_
|
请发表评论