本文整理汇总了PHP中user_name函数的典型用法代码示例。如果您正苦于以下问题:PHP user_name函数的具体用法?PHP user_name怎么用?PHP user_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了user_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set_defaults
function set_defaults($record = NULL)
{
$data['mode'] = '';
$data['message'] = '';
$data = data_table($this->table_name, $record);
if ($record == NULL) {
$data['app_id'] = $this->nomor_bukti();
}
$data['score'] = '';
$data['cust_name'] = '';
$data['counter_name'] = '';
$data['loan_id'] = '';
if ($record == NULL) {
$data['app_date'] = date("Y-m-d");
$data['create_date'] = date("Y-m-d");
$data['create_by'] = user_id();
}
$data['username'] = user_name();
if (!$record == NULL) {
if ($query = $this->db->select('cust_name')->where('cust_id', $data['cust_id'])->get('ls_cust_master')) {
if ($query->row()) {
$data['cust_name'] = $query->row()->cust_name;
}
}
if ($query = $this->db->select('counter_name')->where('counter_id', $data['counter_id'])->get('ls_counter')) {
if ($query->row()) {
$data['counter_name'] = $query->row()->counter_name;
}
}
} else {
$data['cust_name'] = '';
$data['counter_name'] = '';
}
return $data;
}
示例2: get
static function get($params)
{
$params2 = array();
if (is_string($params)) {
$params = parse_str($params, $params2);
$params = $params2;
}
if (isset($params['content_id'])) {
$params['rel_type'] = 'content';
$params['rel_id'] = mw()->database_manager->escape_string($params['content_id']);
}
$table = MODULE_DB_COMMENTS;
$params['table'] = $table;
$comments = db_get($params);
if (is_array($comments)) {
$i = 0;
foreach ($comments as $item) {
if (isset($item['created_by']) and intval($item['created_by']) > 0 and ($item['comment_name'] == false or $item['comment_name'] == '')) {
$comments[$i]['comment_name'] = user_name($item['created_by']);
}
$i++;
}
}
return $comments;
}
示例3: fetchLatestDeaths_03
function fetchLatestDeaths_03($rowz = 30, $killers = false)
{
$countz = 0;
if ($rowz === false || $killers === true) {
$getdeaths = mysql_select_multi("SELECT * FROM player_deaths ORDER BY date DESC;");
} else {
$getdeaths = mysql_select_multi("SELECT * FROM `player_deaths` ORDER BY `date` DESC LIMIT 0, {$rowz};");
}
$data = false;
//while ($showdeaths = mysql_fetch_assoc($getdeaths)) {
if ($getdeaths !== false) {
for ($i = 0; $i < count($getdeaths); $i++) {
$pid = $getdeaths[$i]['player_id'];
$level = $getdeaths[$i]['level'];
$kid = user_get_kid($getdeaths[$i]['id']);
$killedby = user_name(user_get_killer_id($kid));
if ($killedby == false) {
$killedby = user_get_killer_m_name($kid);
$player = 0;
} else {
$player = 1;
}
if ($killedby === false) {
$player = 2;
$killedby = "Deleted player.";
}
$getname = mysql_select_single("SELECT `name` FROM `players` WHERE `id` = '{$pid}' LIMIT 1;");
$name = $getname['name'];
$row = array();
$row['level'] = $level;
$row['victim'] = $name;
$row['time'] = $getdeaths[$i]['date'];
$row['is_player'] = $player;
$row['killed_by'] = $killedby;
if ($killers) {
if ($player == 1) {
if ($rowz !== false) {
if ($countz < $rowz) {
$data[] = $row;
$countz++;
}
} else {
$data[] = $row;
}
}
} else {
$data[] = $row;
}
}
}
return $data;
}
示例4: set_defaults
function set_defaults($record = NULL)
{
$data = data_table($this->table_name, $record);
$data['mode'] = '';
$data['message'] = '';
$data['gender'] = '';
$data['birth_place'] = '';
$data['birth_date'] = '';
$data['marital_status'] = '';
$data['no_of_dependents'] = '';
$data['house_status'] = '';
// $data['lama_thn']='';
$data['salary'] = '0';
$data['spouse_salary'] = '0';
$data['other_income'] = '0';
$data['salary_source'] = '';
$data['spouse_salary_source'] = '';
$data['other_income_source'] = '';
$data['comp_name'] = '';
$data['comp_desc'] = '';
$data['job_status'] = '';
$data['com_kec'] = '';
$data['job_status_etc'] = '';
$data['emp_status'] = '';
$data['bussiness_type'] = '';
$data['emp_status_etc'] = '';
$data['since_year'] = '';
$data['com_city'] = '';
$data['job_level'] = '';
$data['com_zip_pos'] = '';
$data['job_type'] = '';
$data['total_employee'] = '';
$data['job_type_etc'] = '';
$data['com_contact_phone'] = '';
$data['com_street'] = '';
$data['office_status'] = '';
$data['com_rtrw'] = '';
$data['office_status_etc'] = '';
$data['com_kel'] = '';
$data['phone_ext'] = '';
$data['spv_name'] = '';
$data['hrd_name'] = '';
if ($record == NULL) {
$data['create_date'] = date("Y-m-d");
$data['create_by'] = user_id();
}
$data['username'] = user_name();
return $data;
}
示例5: User
/**
*
*/
function User($var)
{
global $CFG;
$this->exists = false;
// Both username or userid may be passed
if (is_numeric($var)) {
// Numeric, we probably received a userid
$info = get_record('users', 'ident', $var);
} elseif (is_string($var)) {
// String, we probably recieved a username
$info = get_record('users', 'username', $var);
}
if (!empty($info)) {
$this->exists = true;
$this->ident = $info->ident;
$this->username = $info->username;
$this->email = $info->email;
$this->name = user_name($info->ident);
$this->alias = $info->alias;
$this->code = $info->code;
$this->icon_quota = $info->icon_quota;
$this->file_quota = $info->file_quota;
$this->user_type = $info->user_type;
$this->owner = $info->owner;
ereg('^([a-zA-Z]*) (.*)', $this->name, $groups);
$this->firstname = trim($groups[1]);
$this->lastname = trim($groups[2]);
// Load the weblog id's, starting with communities
// Need to select two fields to collect instead of just u.ident else
// this very handy datalib function will return false...
$communities = get_records_sql('SELECT DISTINCT u.ident,u.name
FROM ' . $CFG->prefix . 'friends f
JOIN ' . $CFG->prefix . 'users u
ON u.ident = f.friend
WHERE f.owner = ?
AND u.user_type = ?', array($this->ident, 'community'));
$this->blogs = array();
// Add the own weblog id (is same as user id)
$this->blogs[] = $this->ident;
// Add the communities
if ($communities) {
foreach ($communities as $community) {
$this->blogs[] = $community->ident;
}
}
$this->icon = user_icon_html($info->ident, 100, true);
}
}
示例6: _e
?>
" alt="Logo"> <span class="mw-sign-version">v. <?php
print MW_VERSION;
?>
</span> </a>
<div class="mw-ui-box">
<div class="mw-ui-box-content" id="admin_login">
<?php
if ($user != false) {
?>
<div>
<?php
_e("Welcome");
?>
<?php
print user_name();
?>
</div>
<a href="<?php
print site_url();
?>
">
<?php
_e("Go to");
?>
<?php
print site_url();
?>
</a> <a href="<?php
print api_link('logout');
?>
示例7: username
function username()
{
return user_name();
}
示例8: view_spk
function view_spk($app_id)
{
$data['app_id'] = $app_id;
if ($q = $this->db->where("app_id", $app_id)->get("ls_app_master")) {
$app = $q->row();
}
$this->load->model("leasing/cust_master_model");
$model = $this->cust_master_model->get_by_id($app->cust_id)->row();
$data = $this->set_defaults($model, "ls_cust_master");
// field cust_master yg sama dengan company
$field_sama['street'] = $data['street'];
$field_sama['city'] = $data['city'];
$field_sama['kel'] = $data['kel'];
$field_sama['kec'] = $data['kec'];
$field_sama['rtrw'] = $data['rtrw'];
$field_sama['zip_pos'] = $data['zip_pos'];
$data = array_merge($data, $this->cust_master_model->personal(), $this->cust_master_model->company());
// benerin field_sama
$data['com_street'] = $data['street'];
$data['com_city'] = $data['city'];
$data['com_kel'] = $data['kel'];
$data['com_kec'] = $data['kec'];
$data['com_rtrw'] = $data['rtrw'];
$data['com_zip_pos'] = $data['zip_pos'];
$data['com_contact_phone'] = $data['contact_phone'];
// kembalikan
$data['street'] = $field_sama['street'];
$data['city'] = $field_sama['city'];
$data['kel'] = $field_sama['kel'];
$data['kec'] = $field_sama['kec'];
$data['rtrw'] = $field_sama['rtrw'];
$data['zip_pos'] = $field_sama['zip_pos'];
$data['mode'] = 'view';
$data['app'] = $app;
$data['app_id'] = $app_id;
$data['username'] = user_name();
$this->template->display("leasing/approve_form", $data);
}
示例9: user_id_from_url
<?php
require ACTIVE_TEMPLATE_DIR . 'dashboard/dashboard_top_nav.php';
?>
<div id="wall">
<? $dashboard_user = user_id_from_url();
?>
<? if($dashboard_user != $user_id) : ?>
<? $is_friend = CI::model('users')->realtionsCheckIfUserIsConfirmedFriendWithUser($user_id, $dashboard_user, $is_special = false); ?>
<? if($is_friend == true): ?>
<microweber module="users/profile_view" user_id="<? print $dashboard_user ?>"></microweber>
<? else: ?>
<h3>You must be friend with <? print user_name($dashboard_user) ?> in order to view the contact info.</h3>
<? endif; ?>
<? else: ?>
<microweber module="users/profile"></microweber>
<? endif; ?>
</div>
示例10: dirname
// Run includes
require_once dirname(dirname(__FILE__)) . "/../includes.php";
run("profile:init");
run("friends:init");
run("files:init");
global $profile_id;
global $individual;
global $page_owner;
$individual = 1;
$sitename = htmlspecialchars(sitename, ENT_COMPAT, 'utf-8');
$tag = trim(optional_param('tag'));
$output = "";
if (isset($profile_id)) {
$rssfiles = sprintf(__gettext("Files tagged with %s"), $tag);
if ($info = get_record('users', 'ident', $page_owner)) {
$name = stripslashes(user_name($info->ident));
$mainurl = $CFG->wwwroot . $info->username . "/files/";
$rssurl = $mainurl . "rss/" . urlencode($tag);
$rssdescription = sprintf(__gettext("Files for %s, hosted on %s."), $name, $sitename);
$output .= <<<END
<?xml-stylesheet type="text/xsl" href="{$rssurl}/rssstyles.xsl"?>
<rss version='2.0' xmlns:dc='http://purl.org/dc/elements/1.1/'>
<channel xml:base='{$mainurl}'>
<title><![CDATA[{$name} : {$rssfiles}]]></title>
<description><![CDATA[{$rssdescription}]]></description>
<link>{$mainurl}</link>
END;
$output .= run("files:rss:getitems", array($page_owner, 10, $tag));
$output .= <<<END
</channel>
示例11: profile_link
function profile_link($user_id)
{
global $CI;
if ($user_id == false) {
$user_id = user_id();
}
return site_url('userbase/action:profile/username:' . user_name($user_id, 'username'));
}
示例12: if
<? if($user_id == false){
$user_id = user_id();
}
?>
<? $form_values = get_user($user_id); ?>
<div class="c" style="padding-bottom: 4px"> </div>
<a href="<? print profile_link($user_id) ?>" class="user_photo left" style="background-image:url(<? print user_thumbnail($user_id, 90); ?>);margin-right: 10px"></a>
<p style="padding-bottom: 5px"> Name :
<a class="" href="<? print profile_link($user_id) ?>"><? print user_name($user_id) ?></a></p>
<? ($res['custom_fields']['country'])? print $res['custom_fields']['country'].', ':false; ?> <? ($res['custom_fields']['city'])? print $res['custom_fields']['city'].'':false; ?>
<a href="javascript:mw.users.UserMessage.compose(<?php
echo $user_id;
?>
);" class="btn" title="Send new message"><span>Send a message</span></a>
示例13: site_url
<? endif; ?>
</div>
<? endif ?>
<<?php print $wrap_element_items; ?> class="<?php print $wrap_element_items_class; ?>" >
<a href="<?php print site_url('userbase/action:profile/username:'.$user['username']) ?>" class="img" style="background-image: url(<? print user_thumbnail($user['id'], 70) ?>)" > </a>
<p><a href="<?php print site_url('userbase/action:profile/username:'.$user['username']) ?>"><strong><? print user_name($item['id']); ?></strong></a> <a href="javascript:mw.users.UserMessage.compose(<?php echo $user['id']; ?>);" class="send_msg" style="margin:0" title="Send new message to <?php echo $user['first_name']; ?>"></a><br />
</p>
<div class="c"></div><br />
</<?php print $wrap_element_items; ?>>
<? endforeach; ?>
</<?php print $wrap_element; ?>>
示例14: if
?>
<h2>Payment history</h2>
<br />
<? if(!empty($ord)): ?>
<? foreach($ord as $item): ?>
<div class="bluebox">
<div class="blueboxcontent">
<div class="richtext">
<p>You paid <strong>$<? print floatval($item['amount']); ?></strong> on <? print ($item['created_on']); ?></p>
<?php
switch ($item['to_table']) {
case 'table_users':
?>
<? $user_paid_for = get_user($item['to_table_id']); ?>
<p>for the account of <? print user_name($item['to_table_id']); ?></p>
<?php
break;
?>
<?php
default:
?>
<? print $item['to_table'] ?>, <? print $item['to_table_id'] ?>
<?php
break;
?>
<?php
}
?>
<!-- <p>Your account will expire on 12.12.2012.</p>-->
示例15: print
if($expires < $expires2) :?>
<h3 class="user_sidebar_title">Account status</h3>
<div class="richtext"> <br />
<span class="red">Your account will expire on <? print ($usr_data['expires_on']) ?></span><br />
<br />
<a href="<? print site_url('dashboard/action:extend-account/ns:true') ?>" class="mw_btn_x_orange left"><span>Extend Account</span></a> <br />
<br />
</div>
<? endif; ?>
<? endif; ?>
<? endif; ?>
<h3 class="user_sidebar_title">Information about Me</h3>
<div class="richtext">
<p> Name<br />
<strong><? print user_name($dashboard_user); ?></strong> </p>
<? if($user_info['bday'] and $user_info['bmonth'] and $user_info['byear']): ?>
<p> Date of birthday<br />
<strong><? print $user_info['bday'] ?>/<? print $user_info['bmonth'] ?>/<? print $user_info['byear'] ?></strong> </p>
<? endif; ?>
<? if($user_info['country']): ?>
<p> Country<br />
<strong><? print $user_info['country'] ?></strong> </p>
<? endif; ?>
<? if($user_info['city']): ?>
<p> City<br />
<strong><? print $user_info['city'] ?></strong> </p>
<? endif; ?>
</div>
<? if($user_info['about']): ?>
<h3 class="user_sidebar_title">About me</h3>