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

PHP vb_number_format函数代码示例

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

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



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

示例1: create_array

	public static function create_array($ids)
	{
		global $vbulletin;

		$set = $vbulletin->db->query_read_slave("
			SELECT announcementid, startdate, title, announcement.views, forumid,
				user.username, user.userid, user.usertitle, user.customtitle, user.usergroupid,
				IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
			FROM " . TABLE_PREFIX . "announcement AS announcement
			LEFT JOIN " . TABLE_PREFIX . "user AS user USING (userid)
			WHERE announcementid IN (" . implode(',', array_map('intval', $ids)) . ")
		");

		$items = array();
		while ($record = $vbulletin->db->fetch_array($set))
		{
			fetch_musername($record);
			$record['title'] = fetch_censored_text($record['title']);
			$record['postdate'] = vbdate($vbulletin->options['dateformat'], $record['startdate']);
			$record['statusicon'] = 'new';
			$record['views'] = vb_number_format($record['views']);
			$record['forumtitle'] = $vbulletin->forumcache["$record[forumid]"]['title'];
			$show['forumtitle'] = ($record['forumid'] == -1) ? false : true;

			$announcement = new vBForum_Search_Result_Announcement();
			$announcement->record = $record;
			$items[$record['announcementid']] = $announcement;
		}
		return $items;
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:30,代码来源:announcement.php


示例2: create_from_criteria

 /**
  * Create the results based on a list of ids return from the search implmentation
  *
  * @param vB_Current_User $user
  * @param vB_Search_Criteria criteria for the search
  * @return vB_Search_Results
  */
 public static function create_from_criteria($user, $criteria, $searchcontroller = null)
 {
     global $vbulletin;
     $results = new vB_Search_Results();
     $results->user = $user;
     $results->criteria = $criteria;
     $start = microtime();
     if (is_null($searchcontroller)) {
         $searchcontroller = vB_Search_Core::get_instance()->get_search_controller();
         $searchcontroller->clear();
     }
     $results->results = $searchcontroller->get_results($user, $criteria);
     //move log_search call after get_results to allow for any changes to the $criteria
     //object that might be made by the searchcontroller
     $results->searchid = $results->log_search();
     $results->dateline = TIMENOW;
     $results->cache_results();
     $searchtime = vb_number_format(fetch_microtime_difference($start), 2);
     $results->searchtime = $searchtime;
     $results->complete_search($searchtime);
     //log tag search
     $filter = $criteria->get_filters('tag');
     if (isset($filter[vB_Search_Core::OP_EQ])) {
         $dm = datamanager_init('tag', $vbulletin, ERRTYPE_ARRAY);
         $dm->log_tag_search($filter[vB_Search_Core::OP_EQ]);
     }
     return $results;
 }
开发者ID:Kheros,项目名称:MMOver,代码行数:35,代码来源:results.php


示例3: prepare_milestone_stats

/**
* Creates the milestone stats array (target date, total issues, progress).
* Array contains formatted data.
*
* @param	array	Array of milestone info
* @param	array	Array of raw count info
*
* @return	array	Formatted stats data
*/
function prepare_milestone_stats($milestone, $raw_counts)
{
    global $vbulletin;
    $stats = array('total_issues' => vb_number_format($raw_counts['total_issues']), 'total_completed' => vb_number_format($raw_counts['total_completed']), 'total_active' => vb_number_format($raw_counts['total_active']), 'percent_completed' => vb_number_format($raw_counts['percent_completed']));
    if ($milestone['completeddate']) {
        $stats['completed_date'] = vbdate($vbulletin->options['dateformat'], $milestone['completeddate']);
        $stats['milestone_overdue'] = false;
    } else {
        $stats['target_date'] = vbdate($vbulletin->options['dateformat'], $milestone['targetdate']);
        $stats['milestone_overdue'] = ($milestone['targetdate'] and $milestone['targetdate'] < TIMENOW);
    }
    return $stats;
}
开发者ID:holandacz,项目名称:nb4,代码行数:22,代码来源:functions_pt_milestone.php


示例4: verify_name

 /**
  * Verify that the name doesn't already exists
  *
  * @param	string	Group Name
  *
  * @return	boolean
  */
 function verify_name(&$name)
 {
     // replace html-encoded spaces with actual spaces
     $name = preg_replace('/&#(0*32|x0*20);/', ' ', $name);
     $name = trim($name);
     if (!$this->condition or $name != $this->existing['name']) {
         $dupegroup = $this->registry->db->query_first("\n\t\t\t\tSELECT *\n\t\t\t\tFROM " . TABLE_PREFIX . "socialgroup\n\t\t\t\tWHERE name = '" . $this->registry->db->escape_string($name) . "'\n\t\t\t\t\tAND groupid <> " . intval($this->fetch_field('groupid')));
         if ($dupegroup) {
             $this->error('group_already_exists_view_x', 'group.php?' . $this->registry->session->vars['sessionurl'] . 'do=view&amp;groupid=' . $dupegroup['groupid']);
             return false;
         }
     }
     if (empty($name)) {
         $this->error('must_enter_group_name');
         return false;
     }
     if (vbstrlen($name, true) > $this->registry->options['sg_name_maxchars']) {
         $this->error('name_too_long_max_x', vb_number_format($this->registry->options['sg_name_maxchars']));
         return false;
     }
     return true;
 }
开发者ID:holandacz,项目名称:nb4,代码行数:29,代码来源:class_dm_socialgroup.php


示例5: htmlspecialchars_uni

 }
 $photoplog['select_row'] = htmlspecialchars_uni(photoplog_get_category_title($photoplog_file_catid));
 $photoplog['title'] = $photoplog_file_info['title'];
 $photoplog['title'] = photoplog_process_text($photoplog['title'], $photoplog_file_catid, true, false);
 if ($photoplog['title'] == $vbphrase['photoplog_untitled']) {
     $photoplog['title'] = '';
 }
 $photoplog['description'] = $photoplog_file_info['description'];
 $photoplog['description'] = photoplog_process_text($photoplog['description'], $photoplog_file_catid, false, false);
 $photoplog_fielddata = $photoplog_file_info['fielddata'];
 $photoplog_fielddata = $photoplog_fielddata == '' ? array() : unserialize($photoplog_fielddata);
 if (!is_array($photoplog_fielddata)) {
     $photoplog_fielddata = array();
 }
 $photoplog['maxfilesize'] = intval($permissions['photoplogmaxfilesize']);
 $photoplog['maxfilesize'] = vb_number_format($photoplog['maxfilesize'], 1, true);
 $do_html = 0;
 $do_smilies = 0;
 $do_bbcode = 0;
 $do_imgcode = 0;
 if ($photoplog_file_catid > 0 && in_array($photoplog_file_catid, array_keys($photoplog_ds_catopts))) {
     $photoplog_categorybit = $photoplog_ds_catopts["{$photoplog_file_catid}"]['options'];
     $photoplog_catoptions = convert_bits_to_array($photoplog_categorybit, $photoplog_categoryoptions);
     $do_html = $photoplog_catoptions['allowhtml'] ? 1 : 0;
     $do_smilies = $photoplog_catoptions['allowsmilies'] ? 1 : 0;
     $do_bbcode = $photoplog_catoptions['allowbbcode'] ? 1 : 0;
     // this is to show the little image toolbar icon
     $do_imgcode = $photoplog_catoptions['allowimgcode'] ? 1 : 0;
     $vbulletin->options['allowbbimagecode'] = $do_imgcode;
 } else {
     photoplog_output_page('photoplog_error_page', $vbphrase['photoplog_error'], $vbphrase['photoplog_no'] . ' ' . $vbphrase['photoplog_category']);
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:edit.php


示例6: eval

            // build group template
            eval('$messagelist_periodgroups .= "' . fetch_template('pm_messagelist_periodgroup') . '";');
        }
        // build pagenav
        $pagenav = construct_page_nav($vbulletin->GPC['pagenumber'], $vbulletin->GPC['perpage'], $totalmessages, 'private.php?' . $vbulletin->session->vars['sessionurl'] . 'folderid=' . $vbulletin->GPC['folderid'] . '&amp;pp=' . $vbulletin->GPC['perpage']);
    }
    if ($vbulletin->GPC['folderid'] == -1) {
        $show['sentto'] = true;
        $show['movetofolder'] = false;
    } else {
        $show['sentto'] = false;
        $show['movetofolder'] = true;
    }
    $totalmessages = vb_number_format($totalmessages);
    $pmtotal = vb_number_format($vbulletin->userinfo['pmtotal']);
    $pmquota = vb_number_format($vbulletin->userinfo['permissions']['pmquota']);
    $templatename = 'pm_messagelist';
}
// #############################################################################
if ($templatename != '') {
    // draw cp nav bar
    construct_usercp_nav($templatename);
    // build navbar
    $navbits = construct_navbits($navbits);
    eval('$navbar = "' . fetch_template('navbar') . '";');
    ($hook = vBulletinHook::fetch_hook('private_complete')) ? eval($hook) : false;
    // print page
    eval('$HTML = "' . fetch_template($templatename) . '";');
    eval('print_output("' . fetch_template('USERCP_SHELL') . '");');
}
/*======================================================================*\
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:private.php


示例7: print_no_permission

    }
    if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) and ($threadinfo['postuserid'] != $vbulletin->userinfo['userid'] or !$vbulletin->userinfo['userid'])) {
        print_no_permission();
    }
    $attachs = $db->query_read_slave("\n\t\tSELECT attachment.*\n\t\tFROM " . TABLE_PREFIX . "post AS post\n\t\tINNER JOIN " . TABLE_PREFIX . "attachment AS attachment ON (attachment.postid=post.postid AND attachment.visible=1)\n\t\tWHERE threadid = {$threadinfo['threadid']}\n\t\t\tAND post.visible = 1\n\t\tORDER BY filename DESC\n\t");
    if ($db->num_rows($attachs)) {
        require_once DIR . '/includes/functions_bigthree.php';
        while ($attachment = $db->fetch_array($attachs)) {
            // hide users in Coventry
            $ast = '';
            if (in_coventry($attachment['userid']) and !can_moderate($threadinfo['forumid'])) {
                continue;
            }
            $attachment['filename'] = fetch_censored_text(htmlspecialchars_uni($attachment['filename']));
            $attachment['attachmentextension'] = strtolower(file_extension($attachment['filename']));
            $attachment['filesize'] = vb_number_format($attachment['filesize'], 1, true);
            exec_switch_bg();
            eval('$attachments .= "' . fetch_template('attachmentbit') . '";');
        }
        ($hook = vBulletinHook::fetch_hook('misc_showattachments_complete')) ? eval($hook) : false;
        eval('print_output("' . fetch_template('ATTACHMENTS') . '");');
    } else {
        eval(standard_error(fetch_error('noattachments')));
    }
}
// ############################### start show avatars ###############################
if ($_REQUEST['do'] == 'showavatars') {
    $vbulletin->input->clean_array_gpc('r', array('pagenumber' => TYPE_UINT));
    ($hook = vBulletinHook::fetch_hook('misc_avatars_start')) ? eval($hook) : false;
    $perpage = $vbulletin->options['numavatarsperpage'];
    $totalavatars = $db->query_first_slave("\n\t\tSELECT COUNT(*) AS count\n\t\tFROM " . TABLE_PREFIX . "avatar AS avatar\n\t\tLEFT JOIN " . TABLE_PREFIX . "imagecategorypermission AS perm ON (perm.imagecategoryid=avatar.imagecategoryid AND perm.usergroupid=" . $vbulletin->userinfo['usergroupid'] . ")\n\t\tWHERE ISNULL(perm.imagecategoryid)\n\t");
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:misc.php


示例8: ceil

 $totalpages = ceil($totalinf / $vbulletin->GPC['perpage']);
 $args = '&status=' . $vbulletin->GPC['status'] . '&u=' . $vbulletin->GPC['userid'] . '&whoadded=' . $vbulletin->GPC['whoadded'] . '&startstamp=' . $vbulletin->GPC['start'] . '&endstamp=' . $vbulletin->GPC['end'] . '&pp=' . $vbulletin->GPC['perpage'] . '&page=' . $vbulletin->GPC['pagenumber'] . '&infractionlevelid=' . $vbulletin->GPC['infractionlevelid'] . '&orderby=';
 $infractions = $db->query_read("\n\t\tSELECT infraction.*,\n\t\t\tuser2.username,\n\t\t\tuser.username AS leftby_username,\n\t\t\tIF(ISNULL(post.postid) AND infraction.postid != 0, 1, 0) AS postdeleted\n\t\tFROM " . TABLE_PREFIX . "infraction AS infraction\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON (infraction.whoadded = user.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user2 ON (infraction.userid = user2.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "post AS post ON (infraction.postid = post.postid)\n\t\tWHERE {$condition}\n\t\tORDER BY {$orderby}\n\t\tLIMIT {$startat}, " . $vbulletin->GPC['perpage']);
 if ($db->num_rows($infractions)) {
     if ($vbulletin->GPC['pagenumber'] != 1) {
         $prv = $vbulletin->GPC['pagenumber'] - 1;
         $firstpage = "<input type=\"button\" class=\"button\" tabindex=\"1\" value=\"&laquo; " . $vbphrase['first_page'] . "\" onclick=\"window.location='admininfraction.php?" . $vbulletin->session->vars['sessionurl'] . "do=dolist" . $args . $vbulletin->GPC['orderby'] . "&page=1'\">";
         $prevpage = "<input type=\"button\" class=\"button\" tabindex=\"1\" value=\"&lt; " . $vbphrase['prev_page'] . "\" onclick=\"window.location='admininfraction.php?" . $vbulletin->session->vars['sessionurl'] . "do=dolist" . $args . $vbulletin->GPC['orderby'] . "&page={$prv}'\">";
     }
     if ($vbulletin->GPC['pagenumber'] != $totalpages) {
         $nxt = $vbulletin->GPC['pagenumber'] + 1;
         $nextpage = "<input type=\"button\" class=\"button\" tabindex=\"1\" value=\"" . $vbphrase['next_page'] . " &gt;\" onclick=\"window.location='admininfraction.php?" . $vbulletin->session->vars['sessionurl'] . "do=dolist" . $args . $vbulletin->GPC['orderby'] . "&page={$nxt}'\">";
         $lastpage = "<input type=\"button\" class=\"button\" tabindex=\"1\" value=\"" . $vbphrase['last_page'] . " &raquo;\" onclick=\"window.location='admininfraction.php?" . $vbulletin->session->vars['sessionurl'] . "do=dolist" . $args . $vbulletin->GPC['orderby'] . "&page={$totalpages}'\">";
     }
     print_form_header('admininfraction', 'remove');
     print_table_header(construct_phrase($vbphrase['infraction_viewer_page_x_y_there_are_z_total_log_entries'], vb_number_format($vbulletin->GPC['pagenumber']), vb_number_format($totalpages), vb_number_format($counter['total'])), 8);
     $headings = array();
     $headings[] = "<a href=\"admininfraction.php?" . $vbulletin->session->vars['sessionurl'] . "do=dolist" . $args . "\" title=\"" . $vbphrase['order_by_username'] . "\">" . $vbphrase['user_name'] . "</a>";
     $headings[] = "<a href=\"admininfraction.php?" . $vbulletin->session->vars['sessionurl'] . "do=dolist" . $args . "leftby_username\" title=\"" . $vbphrase['order_by_username'] . "\">" . $vbphrase['left_by'] . "</a>";
     $headings[] = "<a href=\"admininfraction.php?" . $vbulletin->session->vars['sessionurl'] . "do=dolist" . $args . "date\" title=\"" . $vbphrase['order_by_date'] . "\">" . $vbphrase['date'] . "</a>";
     $headings[] = $vbphrase['infraction_type'];
     $headings[] = "<a href=\"admininfraction.php?" . $vbulletin->session->vars['sessionurl'] . "do=dolist" . $args . "points\" title=\"" . $vbphrase['order_by_points'] . "\">" . $vbphrase['points'] . "</a>";
     $headings[] = "<a href=\"admininfraction.php?" . $vbulletin->session->vars['sessionurl'] . "do=dolist" . $args . "expires\" title=\"" . $vbphrase['order_by_expiration'] . "\">" . $vbphrase['expires'] . "</a>";
     $headings[] = $vbphrase['post'];
     $headings[] = $vbphrase['controls'];
     print_cells_row($headings, 1);
     while ($infraction = $db->fetch_array($infractions)) {
         $cell = array();
         $cell[] = "<a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;u={$infraction['userid']}\"><b>{$infraction['username']}</b></a>";
         $cell[] = "<a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;u={$infraction['whoadded']}\"><b>{$infraction['leftby_username']}</b></a>";
         $cell[] = '<span class="smallfont">' . vbdate($vbulletin->options['logdateformat'], $infraction['dateline']) . '</span>';
开发者ID:benyamin20,项目名称:vbregistration,代码行数:31,代码来源:admininfraction.php


示例9: vb_number_format

 }
 $option['number'] = $counter;
 //number of the option
 //Now we check if the user has voted or not
 if ($showresults or $uservoted) {
     // user did vote or poll is closed
     if ($value <= 0) {
         $option['percentraw'] = 0;
     } else {
         if ($pollinfo['multiple']) {
             $option['percentraw'] = $value < $pollinfo['voters'] ? $value / $pollinfo['voters'] * 100 : 100;
         } else {
             $option['percentraw'] = $value < $pollinfo['numbervotes'] ? $value / $pollinfo['numbervotes'] * 100 : 100;
         }
     }
     $option['percent'] = vb_number_format($option['percentraw'], 2);
     $option['graphicnumber'] = $option['number'] % 6 + 1;
     $option['barnumber'] = round($option['percent']) * 2;
     $option['remainder'] = 201 - $option['barnumber'];
     // Phrase parts below
     if ($nopermission) {
         $pollstatus = $vbphrase['you_may_not_vote_on_this_poll'];
     } else {
         if ($showresults) {
             $pollstatus = $vbphrase['this_poll_is_closed'];
         } else {
             if ($uservoted) {
                 $pollstatus = $vbphrase['you_have_already_voted_on_this_poll'];
             }
         }
     }
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:showthread.php


示例10: print_form_header

            print_form_header('user', 'dopruneusers');
            construct_hidden_code('usergroupid', $vbulletin->GPC['usergroupid']);
            construct_hidden_code('daysprune', $vbulletin->GPC['daysprune']);
            construct_hidden_code('minposts', $vbulletin->GPC['minposts']);
            construct_hidden_code('joindate[day]', $vbulletin->GPC['joindate']['day']);
            construct_hidden_code('joindate[month]', $vbulletin->GPC['joindate']['month']);
            construct_hidden_code('joindate[year]', $vbulletin->GPC['joindate']['year']);
            construct_hidden_code('order', $order);
            print_table_header(construct_phrase($vbphrase['showing_users_x_to_y_of_z'], 1, $numusers, $numusers), 7);
            print_cells_row(array('Userid', $vbphrase['username'], $vbphrase['email'], $vbphrase['post_count'], $vbphrase['last_activity'], $vbphrase['join_date'], '<input type="checkbox" name="allbox" onclick="js_check_all(this.form)" title="' . $vbphrase['check_all'] . '" checked="checked" />'), 1);
            while ($user = $db->fetch_array($users)) {
                $cell = array();
                $cell[] = $user['userid'];
                $cell[] = "<a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&u={$user['userid']}\" target=\"_blank\">{$user['username']}</a><br /><span class=\"smallfont\">{$user['title']}" . iif($user['moderatorid'], ', Moderator', '') . "</span>";
                $cell[] = "<a href=\"mailto:{$user['email']}\">{$user['email']}</a>";
                $cell[] = vb_number_format($user['posts']);
                $cell[] = vbdate($vbulletin->options['dateformat'], $user['lastactivity']);
                $cell[] = vbdate($vbulletin->options['dateformat'], $user['joindate']);
                if ($user['userid'] == $vbulletin->userinfo['userid'] or $user['usergroupid'] == 6 or $user['usergroupid'] == 5 or $user['moderatorid'] or is_unalterable_user($user['userid'])) {
                    $cell[] = '<input type="button" class="button" value=" ! " onclick="js_alert_no_permission()" />';
                } else {
                    $cell[] = "<input type=\"checkbox\" name=\"users[{$user['userid']}]\" value=\"1\" checked=\"checked\" tabindex=\"1\" />";
                }
                print_cells_row($cell);
            }
            print_description_row('<center><span class="smallfont">
				<b>' . $vbphrase['action'] . ':
				<label for="dw_delete"><input type="radio" name="dowhat" value="delete" id="dw_delete" tabindex="1" />' . $vbphrase['delete'] . '</label>
				<label for="dw_move"><input type="radio" name="dowhat" value="move" id="dw_move" tabindex="1" />' . $vbphrase['move'] . '</label>
				<select name="movegroup" tabindex="1" class="bginput">' . $groupslist . '</select></b>
				</span></center>', 0, 7);
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:user.php


示例11: IN

    if ($vbulletin->GPC['product']) {
        if ($vbulletin->GPC['product'] == 'vbulletin') {
            $sqlconds[] = "product IN ('', 'vbulletin')";
        } else {
            $sqlconds[] = "product = '" . $db->escape_string($vbulletin->GPC['product']) . "'";
        }
    }
    $logs = $db->query_first("\n\t\tSELECT COUNT(*) AS total\n\t\tFROM " . TABLE_PREFIX . "moderatorlog\n\t\tWHERE " . (!empty($sqlconds) ? implode("\r\n\tAND ", $sqlconds) : "") . "\n\t");
    if ($logs['total']) {
        print_form_header('modlog', 'doprunelog');
        construct_hidden_code('datecut', $datecut);
        construct_hidden_code('modaction', $vbulletin->GPC['modaction']);
        construct_hidden_code('userid', $vbulletin->GPC['userid']);
        construct_hidden_code('product', $vbulletin->GPC['product']);
        print_table_header($vbphrase['prune_moderator_log']);
        print_description_row(construct_phrase($vbphrase['are_you_sure_you_want_to_prune_x_log_entries_from_moderator_log'], vb_number_format($logs['total'])));
        print_submit_row($vbphrase['yes'], 0, 0, $vbphrase['no']);
    } else {
        print_stop_message('no_logs_matched_your_query');
    }
}
// ###################### Start do prune log #######################
if ($_POST['do'] == 'doprunelog' and can_access_logs($vbulletin->config['SpecialUsers']['canpruneadminlog'], 0, '<p>' . $vbphrase['control_panel_log_pruning_permission_restricted'] . '</p>')) {
    $vbulletin->input->clean_array_gpc('p', array('datecut' => TYPE_UINT, 'modaction' => TYPE_STR, 'userid' => TYPE_UINT, 'product' => TYPE_STR));
    $sqlconds = array("dateline < " . $vbulletin->GPC['datecut']);
    if (!empty($vbulletin->GPC['modaction'])) {
        $sqlconds[] = "action LIKE '%" . $db->escape_string_like($vbulletin->GPC['modaction']) . "%'";
    }
    if (!empty($vbulletin->GPC['userid'])) {
        $sqlconds[] = "userid = " . $vbulletin->GPC['userid'];
    }
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:modlog.php


示例12: cropImg

 public function cropImg($imgInfo, $maxwidth = 100, $maxheight = 100, $forceResize = false)
 {
     $thumbnail = array('filedata' => '', 'filesize' => 0, 'dateline' => 0, 'imageerror' => '');
     $filename = $imgInfo['filename'];
     $imgInfo['extension'] = strtoupper($imgInfo['extension']);
     if ($imgInfo['extension'] == 'JPG') {
         $imgInfo['extension'] = 'JPEG';
     }
     if ($validfile = $this->isValidThumbnailExtension($imgInfo['extension'])) {
         $thumbnail['source_width'] = $new_width = $width = $imgInfo['width'];
         $thumbnail['source_height'] = $new_height = $height = $imgInfo['height'];
         if ($forceResize or $width >= $maxwidth or $height >= $maxheight) {
             $memoryok = true;
             $checkmem = false;
             if (function_exists('memory_get_usage') and $memory_limit = @ini_get('memory_limit') and $memory_limit != -1) {
                 $memorylimit = vb_number_format($memory_limit, 0, false, null, '');
                 $memoryusage = memory_get_usage();
                 $freemem = $memorylimit - $memoryusage;
                 $checkmem = true;
                 $tmemory = $width * $height * ($imgInfo['extension'] == 'JPEG' ? 5 : 2) + 7372.8 + sqrt(sqrt($width * $height));
                 $tmemory += 166000;
                 // fudge factor, object overhead, etc
                 if ($freemem > 0 and $tmemory > $freemem and $tmemory <= $memorylimit * 3) {
                     // attempt to increase memory within reason, no more than triple
                     if (($current_memory_limit = vB_Utilities::ini_size_to_bytes(@ini_get('memory_limit'))) < $memorylimit + $tmemory and $current_memory_limit > 0) {
                         @ini_set('memory_limit', $memorylimit + $tmemory);
                     }
                     $memory_limit = @ini_get('memory_limit');
                     $memorylimit = vb_number_format($memory_limit, 0, false, null, '');
                     $memoryusage = memory_get_usage();
                     $freemem = $memorylimit - $memoryusage;
                 }
             }
             $fh = fopen($filename, 'w');
             fwrite($fh, $imgInfo['filedata']);
             fclose($fh);
             switch ($imgInfo['extension']) {
                 case 'GIF':
                     if (function_exists('imagecreatefromgif')) {
                         if ($checkmem) {
                             if ($freemem > 0 and $tmemory > $freemem) {
                                 throw new vB_Exception_Api('thumbnail_notenoughmemory');
                             }
                         }
                         if ($memoryok and !($image = @imagecreatefromgif($filename))) {
                             throw new vB_Exception_Api('thumbnail_nocreateimage_gif');
                         }
                     } else {
                         throw new vB_Exception_Api('thumbnail_nosupport');
                     }
                     break;
                 case 'JPEG':
                     if (function_exists('imagecreatefromjpeg')) {
                         if ($checkmem) {
                             if ($freemem > 0 and $tmemory > $freemem) {
                                 throw new vB_Exception_Api('thumbnail_notenoughmemory');
                             }
                         }
                         if ($memoryok and !($image = @imagecreatefromjpeg($filename))) {
                             throw new vB_Exception_Api('thumbnail_nocreateimage_jpeg');
                         }
                     } else {
                         throw new vB_Exception_Api('thumbnail_nosupport');
                     }
                     break;
                 case 'PNG':
                     if (function_exists('imagecreatefrompng')) {
                         if ($checkmem) {
                             if ($freemem > 0 and $tmemory > $freemem) {
                                 throw new vB_Exception_Api('thumbnail_notenoughmemory');
                             }
                         }
                         if ($memoryok and !($image = @imagecreatefrompng($filename))) {
                             throw new vB_Exception_Api('thumbnail_nocreateimage_png');
                         }
                     } else {
                         throw new vB_Exception_Api('thumbnail_nosupport');
                     }
                     break;
             }
             if ($image) {
                 $xratio = $maxwidth == 0 ? 1 : $width / $maxwidth;
                 $yratio = $maxheight == 0 ? 1 : $height / $maxheight;
                 if ($xratio > $yratio) {
                     $new_width = round($width / $xratio);
                     $new_height = round($height / $xratio);
                 } else {
                     $new_width = round($width / $yratio);
                     $new_height = round($height / $yratio);
                 }
             }
             if (!($finalimage = @imagecreatetruecolor($new_width, $new_height))) {
                 imagedestroy($image);
                 throw new vB_Exception_Api('thumbnail_nocreateimage_truecolor');
             }
             $bgcolor = imagecolorallocate($finalimage, 255, 255, 255);
             imagefill($finalimage, 0, 0, $bgcolor);
             imagecopyresampled($finalimage, $image, 0, 0, $imgInfo['x1'], $imgInfo['y1'], $new_width, $new_height, $imgInfo['width'], $imgInfo['height']);
             imagedestroy($image);
             if ($imgInfo['extension'] != 'GIF') {
//.........这里部分代码省略.........
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:101,代码来源:gd.php


示例13: prepare_socialgroup

/**
 * Takes information regardign a group, and prepares the information within it
 * for display
 *
 * @param	array	Group Array
 * @param	bool	Whether to fetch group members and avatars
 *
 * @return	array	Group Array with prepared information
 *
 */
function prepare_socialgroup($group, $fetchmembers = false)
{
    global $vbulletin;
    if (!is_array($group)) {
        return array();
    }
    if ($fetchmembers) {
        $membersinfo = cache_group_members();
        $group['membersinfo'] = $membersinfo[$group['groupid']];
    }
    $group['joindate'] = !empty($group['joindate']) ? vbdate($vbulletin->options['dateformat'], $group['joindate'], true) : '';
    $group['createtime'] = !empty($group['createdate']) ? vbdate($vbulletin->options['timeformat'], $group['createdate'], true) : '';
    $group['createdate'] = !empty($group['createdate']) ? vbdate($vbulletin->options['dateformat'], $group['createdate'], true) : '';
    $group['lastupdatetime'] = !empty($group['lastupdate']) ? vbdate($vbulletin->options['timeformat'], $group['lastupdate'], true) : '';
    $group['lastupdatedate'] = !empty($group['lastupdate']) ? vbdate($vbulletin->options['dateformat'], $group['lastupdate'], true) : '';
    $group['visible'] = vb_number_format($group['visible']);
    $group['moderation'] = vb_number_format($group['moderation']);
    $group['members'] = vb_number_format($group['members']);
    $group['moderatedmembers'] = vb_number_format($group['moderatedmembers']);
    $group['categoryname'] = htmlspecialchars_uni($group['categoryname']);
    $group['discussions'] = vb_number_format($group['discussions']);
    $group['lastdiscussion'] = fetch_word_wrapped_string(fetch_censored_text($group['lastdiscussion']));
    $group['trimdiscussion'] = fetch_trimmed_title($group['lastdiscussion']);
    if (!($group['options'] & $vbulletin->bf_misc_socialgroupoptions['enable_group_albums'])) {
        // albums disabled in this group - force 0 pictures
        $group['picturecount'] = 0;
    }
    $group['rawpicturecount'] = $group['picturecount'];
    $group['picturecount'] = vb_number_format($group['picturecount']);
    $group['rawname'] = $group['name'];
    $group['rawdescription'] = $group['description'];
    $group['name'] = fetch_word_wrapped_string(fetch_censored_text($group['name']));
    if ($group['description']) {
        $group['shortdescription'] = fetch_word_wrapped_string(fetch_censored_text(fetch_trimmed_title($group['description'], 185)));
    } else {
        $group['shortdescription'] = $group['name'];
    }
    $group['mediumdescription'] = fetch_word_wrapped_string(fetch_censored_text(fetch_trimmed_title($group['description'], 1000)));
    $group['description'] = nl2br(fetch_word_wrapped_string(fetch_censored_text($group['description'])));
    $group['is_owner'] = $group['creatoruserid'] == $vbulletin->userinfo['userid'];
    $group['is_automoderated'] = ($group['options'] & $vbulletin->bf_misc_socialgroupoptions['owner_mod_queue'] and $vbulletin->options['sg_allow_owner_mod_queue'] and !$vbulletin->options['social_moderation']);
    $group['canviewcontent'] = (!($group['options'] & $vbulletin->bf_misc_socialgroupoptions['join_to_view']) or !$vbulletin->options['sg_allow_join_to_view'] or $group['membertype'] == 'member' or can_moderate(0, 'canmoderategroupmessages') or can_moderate(0, 'canremovegroupmessages') or can_moderate(0, 'candeletegroupmessages') or fetch_socialgroup_perm('canalwayspostmessage') or fetch_socialgroup_perm('canalwascreatediscussion'));
    $group['lastpostdate'] = vbdate($vbulletin->options['dateformat'], $group['lastpost'], true);
    $group['lastposttime'] = vbdate($vbulletin->options['timeformat'], $group['lastpost']);
    $group['lastposterid'] = $group['canviewcontent'] ? $group['lastposterid'] : 0;
    $group['lastposter'] = $group['canviewcontent'] ? $group['lastposter'] : '';
    // check read marking
    //remove notice and make readtime determination a bit more clear
    if (!empty($group['readtime'])) {
        $readtime = $group['readtime'];
    } else {
        $readtime = fetch_bbarray_cookie('group_marking', $group['groupid']);
        if (!$readtime) {
            $readtime = $vbulletin->userinfo['lastvisit'];
        }
    }
    // get thumb url
    $group['iconurl'] = fetch_socialgroupicon_url($group, true);
    // check if social group is moderated to join
    $group['membermoderated'] = 'moderated' == $group['type'];
    // posts older than markinglimit days won't be highlighted as new
    $oldtime = TIMENOW - $vbulletin->options['markinglimit'] * 24 * 60 * 60;
    $readtime = max((int) $readtime, $oldtime);
    $group['readtime'] = $readtime;
    $group['is_read'] = $readtime >= $group['lastpost'];
    // Legacy Hook 'group_prepareinfo' Removed //
    return $group;
}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:78,代码来源:functions_socialgroup.php


示例14: print_usergroup_row

 function print_usergroup_row($usergroup, $options)
 {
     global $usergroupleaders, $vbphrase, $promotions, $vbulletin;
     if ($promotions["{$usergroup['usergroupid']}"]) {
         $options['promote'] .= " ({$promotions[$usergroup[usergroupid]]})";
     }
     $cell = array();
     $cell[] = "<b>{$usergroup['title']}" . iif($usergroup['canoverride'], '*') . "</b>" . iif($usergroup['ispublicgroup'], '<br /><span class="smallfont">' . $usergroup['description'] . '</span>');
     $cell[] = iif($usergroup['count'], vb_number_format($usergroup['count']), '-');
     $cell[] = iif($usergroup['secondarycount'], vb_number_format($usergroup['secondarycount']), '-');
     if ($usergroup['ispublicgroup']) {
         $cell[] = iif($usergroup['requests'], vb_number_format($usergroup['requests']), '0');
     }
     if ($usergroup['ispublicgroup']) {
         $cell_out = '<span class="smallfont">';
         if (is_array($usergroupleaders["{$usergroup['usergroupid']}"])) {
             foreach ($usergroupleaders["{$usergroup['usergroupid']}"] as $usergroupleader) {
                 $cell_out .= "<a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;u={$usergroupleader['userid']}\"><b>{$usergroupleader['username']}</b></a>" . construct_link_code($vbphrase['delete'], "usergroup.php?" . $vbulletin->session->vars['sessionurl'] . "do=removeleader&amp;usergroupleaderid={$usergroupleader['usergroupleaderid']}") . '<br />';
             }
         }
         $cell[] = $cell_out . '</span>';
     }
     $options['edit'] .= " (id: {$usergroup['usergroupid']})";
     $cell[] = "\n\t<select name=\"u{$usergroup['usergroupid']}\" onchange=\"js_usergroup_jump({$usergroup['usergroupid']});\" class=\"bginput\">\n" . construct_select_options($options) . "\t</select><input type=\"button\" class=\"button\" value=\"" . $vbphrase['go'] . "\" onclick=\"js_usergroup_jump({$usergroup['usergroupid']});\" />\n\t";
     print_cells_row($cell);
 }
开发者ID:holandacz,项目名称:nb4,代码行数:26,代码来源:usergroup.php


示例15: xml_import_style

/**
* Reads XML style file and imports data from it into the database
*
* @param	string	XML data
* @param	integer	Style ID
* @param	integer	Parent style ID
* @param	string	New style title
* @param	boolean	Allow vBulletin version mismatch
* @param	integer	Display order for new style
* @param	boolean	Allow user selection of new style
* @param  int|null Starting template group index for this run of importing templates (0 based).
*		Null means all templates (single run)
* @paream int|null
*
* @return	array	Array of information about the imported style
*/
function xml_import_style(
	$xml = false,
	$styleid = -1,
	$parentid = -1,
	$title = '',
	$anyversion = false,
	$displayorder = 1,
	$userselect = true,
	$startat = null,
	$perpage = null
)
{
	// $GLOBALS['path'] needs to be passed into this function or reference $vbulletin->GPC['path']

	global $vbulletin, $vbphrase;

	print_dots_start('<b>' . $vbphrase['importing_style'] . "</b>, $vbphrase[please_wait]", ':', 'dspan');

	require_once(DIR . '/includes/class_xml.php');

	//where is this used?  I hate having this random global value in the middle of this function
	$xmlobj = new vB_XML_Parser($xml, $vbulletin->GPC['path']);
	if ($xmlobj->error_no == 1)
	{
			print_dots_stop();
			print_stop_message('no_xml_and_no_path');
	}
	else if ($xmlobj->error_no == 2)
	{
			print_dots_stop();
			print_stop_message('please_ensure_x_file_is_located_at_y', 'vbulletin-style.xml', $vbulletin->GPC['path']);
	}

	if(!$parsed_xml = $xmlobj->parse())
	{
		print_dots_stop();
		print_stop_message('xml_error_x_at_line_y', $xmlobj->error_string(), $xmlobj->error_line());
	}

	$version = $parsed_xml['vbversion'];
	$master = ($parsed_xml['type'] == 'master' ? 1 : 0);
	$title = (empty($title) ? $parsed_xml['name'] : $title);
	$product = (empty($parsed_xml['product']) ? 'vbulletin' : $parsed_xml['product']);


	$one_pass = (is_null($startat) AND is_null($perpage));
	if (!$one_pass AND (!is_numeric($startat) OR !is_numeric($perpage) OR $perpage <= 0 OR $startat < 0))
	{
			print_dots_stop();
			print_stop_message('');
	}

	if ($one_pass OR ($startat == 0))
	{
		// version check
		$full_product_info = fetch_product_list(true);
		$product_info = $full_product_info["$product"];

		if ($version != $product_info['version'] AND !$anyversion AND !$master)
		{
			print_dots_stop();
			print_stop_message('upload_file_created_with_different_version', $product_info['version'], $version);
		}

		//Initialize the style -- either init the master, create a new style, or verify the style to overwrite.
		if ($master)
		{
			$import_data = @unserialize(fetch_adminutil_text('master_style_import'));
			if (!empty($import_data) AND (TIMENOW - $import_data['last_import']) <= 30)
			{
				print_dots_stop();
				print_stop_message('must_wait_x_seconds_master_style_import', vb_number_format($import_data['last_import'] + 30 - TIMENOW));
			}

			// overwrite master style
			echo "<h3>$vbphrase[master_style]</h3>\n<p>$vbphrase[please_wait]</p>";
			vbflush();

			$vbulletin->db->query_write("
				DELETE FROM " . TABLE_PREFIX . "template
				WHERE styleid = -10 AND (product = '" . $vbulletin->db->escape_string($product) . "'" .
					iif($product == 'vbulletin', " OR product = ''") . ")"
			);

//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:adminfunctions_template.php


示例16: prepare_usernote

 /**
  * Prepares Information regarding the Users's usernotes
  *
  */
 function prepare_usernote()
 {
     global $show;
     if (!($this->prepared['userperms']['genericpermissions'] & $this->registry->bf_ugp_genericpermissions['canbeusernoted'])) {
         $this->prepared['usernotecount'] = 0;
         $this->prepared['usernoteinfo'] = array();
         $show['usernoteview'] = false;
         return;
     }
     if ($this->prepared['userid'] == $this->registry->userinfo['userid'] and $this->registry->userinfo['permissions']['genericpermissions'] & $this->registry->bf_ugp_genericpermissions['canviewownusernotes'] or $this->prepared['userid'] != $this->registry->userinfo['userid'] and $this->registry->userinfo['permissions']['genericpermissions'] & $this->registry->userinfo->bf_ugp_genericpermissions['canviewothersusernotes']) {
         $show['usernotes'] = true;
     }
     if ($this->prepared['userid'] == $this->registry->userinfo['userid'] and $this->registry->userinfo['permissions']['genericpermissions'] & $this->registry->bf_ugp_genericpermissions['canpostownusernotes'] or $this->prepared['userid'] != $this->registry->userinfo['userid'] and $this->registry->userinfo['permissions']['genericpermissions'] & $this->registry->bf_ugp_genericpermissions['canpostothersusernotes']) {
         $show['usernotes'] = true;
         $show['usernotepost'] = true;
     }
     $usernote = $this->registry->db->query_first_slave("\n\t\t\tSELECT MAX(dateline) AS lastpost, COUNT(*) AS total\n\t\t\tFROM " . TABLE_PREFIX . "usernote AS usernote\n\t\t\tWHERE userid = " . $this->userinfo['userid']);
     $this->prepared['usernotecount'] = vb_number_format($usernote['total']);
     $show['usernoteview'] = intval($usernote['total']) ? true : false;
     $usernote['lastpostdate'] = vbdate($this->registry->options['dateformat'], $usernote['lastpost'], true);
     $usernote['lastposttime'] = vbdate($this->registry->options['timeformat'], $usernote['lastpost'], true);
     $this->prepared['usernoteinfo'] = $usernote;
 }
开发者ID:holandacz,项目名称:nb4,代码行数:27,代码来源:class_userprofile.php


示例17: mktime

该文章已有0人参与评论

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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