本文整理汇总了PHP中get_user_name函数的典型用法代码示例。如果您正苦于以下问题:PHP get_user_name函数的具体用法?PHP get_user_name怎么用?PHP get_user_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_user_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: morePageTitle
/**
* Fucntion to display more videos page title
*
* @param unknown $type_name
* @param unknown $typename
* @return string
*/
function morePageTitle($type_name, $typename)
{
$div = '';
/** Check type name and get title for the more pages */
switch ($type_name) {
case 'Category':
/** Get playlsit name based on playl id */
$playlist_name = get_playlist_name(intval(absint($this->_playid)));
/** Display playlist title in category page*/
$div .= '<h2 class="titleouter" >' . $playlist_name . ' </h2>';
break;
case 'User':
/** Get user name based on user id */
$user_name = get_user_name(intval($this->_userid));
/** Display user name in user videos page */
$div .= '<h2 >' . $user_name . ' </h2>';
break;
case 'popular':
case 'recent':
case 'random':
case 'featured':
/** Get current more type and display as page title */
$div .= '<h2 >' . $typename . ' ' . __('Videos', APPTHA_VGALLERY) . ' </h2>';
break;
default:
break;
}
/** Return more page title */
return $div;
}
示例2: update_logo
function update_logo()
{
global $cfg;
if (isset($_POST['uaction']) && $_POST['uaction'] === 'upload_logo') {
$file_type = $_FILES['logo_file']['type'];
if (empty($_FILES['logo_file']['name'])) {
set_page_message(tr('Upload file error!'));
return;
}
if (!($file_type === "image/gif" || $file_type === "image/jpeg" || $file_type === "image/pjpeg")) {
set_page_message(tr('You can upload only images!'));
return;
} else {
$fname = $_FILES['logo_file']['name'];
$fsize = $_FILES['logo_file']['size'];
$user_id = $_SESSION['user_id'];
$path1 = substr($_SERVER['SCRIPT_FILENAME'], 0, strpos($_SERVER['SCRIPT_FILENAME'], '/admin/layout.php') + 1);
$path2 = substr($cfg['ROOT_TEMPLATE_PATH'], 0, strpos($cfg['ROOT_TEMPLATE_PATH'], '/tpl') + 1);
//
move_uploaded_file($_FILES['logo_file']['tmp_name'], $path1 . "/themes/user_logos/" . get_user_name($user_id) . ".jpg");
update_user_gui_props(get_user_name($user_id) . ".jpg", $user_id);
set_page_message(tr('Your logo was successful uploaded!'));
}
}
}
示例3: _update
protected function _update()
{
$id = $_POST["id"];
$model = M("MailOrganize");
$model->where("id={$id}")->delete();
$model = D("MailOrganize");
if (false === $model->create()) {
$this->error($model->getError());
}
if (in_array('user_id', $model->getDbFields())) {
$model->user_id = get_user_id();
}
if (in_array('user_name', $model->getDbFields())) {
$model->user_name = get_user_name();
}
//保存当前数据对象
$list = $model->add();
if ($list !== false) {
//保存成功
$this->assign('jumpUrl', get_return_url());
$this->success('编辑成功!');
} else {
//失败提示
$this->error('编辑失败!');
}
}
示例4: view_order
public function view_order()
{
$id = intval($_REQUEST['id']);
$list = M("GoodsOrder")->where("id =" . $id)->find();
if ($list['is_delivery'] == 0) {
$list['is_delivery_format'] = "否";
} else {
$list['is_delivery_format'] = "是";
}
if ($list['order_status'] == 0) {
$list['order_status_format'] = "未发货";
} elseif ($list['order_status'] == 1) {
$list['order_status_format'] = "已发货";
} elseif ($list['order_status'] == 2) {
$list['order_status_format'] = "无效订单";
} elseif ($list['order_status'] == 3) {
$list['order_status_format'] = "用户删除";
}
$list['ex_time'] = to_date($list['ex_time'], "Y-m-d H:i:s");
$list['delivery_time'] = to_date($list['delivery_time'], "Y-m-d H:i:s");
$list['user_name'] = get_user_name($list['user_id']);
$list['attr_format'] = unserialize($list['attr']);
foreach ($list['attr_format'] as $kk => $vv) {
$attr_str .= $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "goods_type_attr where id =" . $kk);
$attr_str .= ":";
$attr_str .= $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "goods_attr where id =" . $vv);
$attr_str .= " ";
}
$list['attr_str'] = $attr_str;
$this->assign('list', $list);
$this->display();
}
示例5: _insert
protected function _insert()
{
$model = M('MailAccount');
if (false === $model->create()) {
$this->error($model->getError());
}
if (in_array('id', $model->getDbFields())) {
$model->id = get_user_id();
}
if (in_array('user_name', $model->getDbFields())) {
$model->user_name = get_user_name();
}
$email = $_POST['email'];
//保存当前数据对象
$list = $model->add();
if ($list !== false) {
//保存成功
$this->_set_email($email);
$this->assign('jumpUrl', get_return_url());
$this->success('新增成功!');
} else {
//失败提示
$this->error('新增失败!');
}
}
示例6: goods_user_go
private function goods_user_go($uid = null, $gid = null, $num = null)
{
System::load_sys_fun('user');
$good_info = $gid;
$gid = $good_info['id'];
$uinfo = $uid;
$uid = $uinfo['uid'];
$gtitle = $good_info['title'];
$utitle = get_user_name($uinfo);
$paydb = System::load_app_class('pay', 'pay');
$number = $num;
$reg = $paydb->pay_user_go_shop($uid, $gid, $number);
if ($reg) {
$specify = $this->db->GetOne("select * from `@#_goodspecify` where `gid` = '{$gid}' and `uid` = '{$uid}'");
if ($specify) {
$number = $specify['num'] + $number;
$this->db->Query("UPDATE `@#_goodspecify` SET `num` = '{$number}' where `id` = '{$specify['id']}'");
} else {
$inster = $this->db->Query("INSERT INTO `@#_goodspecify` (`uid`,`gid`,`num`,`utitle`,`gtitle`) VALUES ('{$uid}','{$gid}','{$number}','{$utitle}','{$gtitle}')");
if (!$inster) {
_message("商品购买成功但准备会员插入失败!");
}
}
}
return $reg;
}
示例7: _before_update
function _before_update(&$data, $options)
{
$old_data = M("Crm")->find($data['id']);
$diff = array_diff_assoc($data, $old_data);
$diff = array_keys($diff);
$desc = array('name' => '姓名', 'mobile_tel' => '手机', 'district' => '小区', 'need' => '客户需求', 'source' => '客户来源', 'age' => '年龄', 'work' => '职业');
if (!empty($diff)) {
foreach ($diff as $val) {
$model->need = implode(",", $model->need);
if (is_array($data[$val])) {
$new = implode(",", $data[$val]);
} else {
$new = $data[$val];
}
$comment .= $desc[$val] . ":" . $old_data[$val] . "->" . $new . " ; ";
}
$model = D("CrmLog");
$log['user_id'] = get_user_id();
$log['user_name'] = get_user_name();
$log['create_time'] = time();
$log['crm_id'] = $data['id'];
$log['emp_no'] = get_emp_no();
$log['comment'] = $comment;
$model->add($log);
}
}
示例8: print_login_button
function print_login_button()
{
if (is_logged_in()) {
echo '<a href="userprofile.php?userid=' . get_user_id() . '">' . get_user_name() . '</a> | <a href="./twitteroauth/clearsessions.php">Log out</a>';
} else {
echo '<a href="./twitteroauth/redirect.php">Sign in with Twitter</a>';
}
}
示例9: lottery_shop_json
public function lottery_shop_json()
{
if (!isset($_GET['gid'])) {
echo json_encode(array("error" => '1'));
return;
exit;
}
$gid = trim($_GET['gid']);
$times = (int) System::load_sys_config('system', 'goods_end_time');
if (!$times) {
$times = 1;
}
$db = System::load_sys_class('model');
$gid = safe_replace($gid);
$gid = str_ireplace("select", "", $gid);
$gid = str_ireplace("union", "", $gid);
$gid = str_ireplace("'", "", $gid);
$gid = str_ireplace("%27", "", $gid);
$gid = trim($gid, ',');
if (!$gid) {
$info = $db->GetOne("select qishu,xsjx_time,id,zongrenshu,thumb,title,q_uid,q_user,q_user_code,q_end_time from `@#_shoplist` where `q_showtime` = 'Y' order by `q_end_time` ASC");
} else {
$infos = $db->GetList("select qishu,xsjx_time,id,zongrenshu,thumb,title,q_uid,q_user,q_user_code,q_end_time from `@#_shoplist` where `q_showtime` = 'Y' order by `q_end_time` ASC limit 0,4");
$gid = @explode('_', $gid);
$info = false;
foreach ($infos as $infov) {
if (!in_array($infov['id'], $gid)) {
$info = $infov;
break;
}
}
}
if (!$info) {
echo json_encode(array("error" => '1'));
return;
exit;
}
if ($info['xsjx_time']) {
$info['q_end_time'] = $info['q_end_time'] + $times;
}
System::load_sys_fun("user");
$user = unserialize($info['q_user']);
$user = get_user_name($info['q_uid'], "username");
$uid = $info['q_uid'];
$upload = G_UPLOAD_PATH;
$q_time = substr($info['q_end_time'], 0, 10);
if ($q_time <= time()) {
$db->Query("update `@#_shoplist` SET `q_showtime` = 'N' where `id` = '{$info['id']}' and `q_showtime` = 'Y' and `q_uid` is not null");
echo json_encode(array("error" => '-1'));
return;
exit;
}
$user_shop_number = $db->GetOne("select sum(gonumber) as gonumber from `@#_member_go_record` where `uid`= '{$uid}' and `shopid` = '{$info['id']}' and `shopqishu` = '{$info['qishu']}'");
$user_shop_number = $user_shop_number['gonumber'];
$times = $q_time - time();
echo json_encode(array("error" => "0", "user_shop_number" => "{$user_shop_number}", "user" => "{$user}", "zongrenshu" => $info['zongrenshu'], "q_user_code" => $info['q_user_code'], "qishu" => $info['qishu'], "upload" => $upload, "thumb" => $info['thumb'], "id" => $info['id'], "uid" => "{$uid}", "title" => $info['title'], "user" => $user, "times" => $times));
exit;
}
示例10: send_shop_code
public function send_shop_code()
{
if (!isset($_POST['send']) && !isset($_POST['uid']) && !isset($_POST['gid'])) {
exit(0);
}
$uid = abs($_POST['uid']);
$gid = abs($_POST['gid']);
$db = System::load_sys_class("model");
$sendinfo = $db->GetOne("SELECT id,send_type FROM `@#_send` WHERE `gid` = '{$gid}' and `uid` = '{$uid}'");
if ($sendinfo) {
exit(0);
}
$member = $db->GetOne("SELECT * FROM `@#_member` WHERE `uid` = '{$uid}'");
if (!$member) {
exit(0);
}
$info = $db->GetOne("SELECT id,q_user_code,q_end_time,title,q_user FROM `@#_shoplist` WHERE `id` = '{$gid}' and `q_uid` = '{$uid}'");
if (!$info) {
exit(0);
}
$username = get_user_name($member, 'username', 'all');
$this->send_insert($uid, $gid, $username, $info['title'], '-1');
$type = System::load_sys_config("send", "type");
if (!$type) {
exit(0);
}
$q_time = abs(substr($info['q_end_time'], 0, 10));
while (time() < $q_time) {
sleep(5);
}
$ret_send = false;
if ($type == '1') {
if (!empty($member['email'])) {
send_email_code($member['email'], $username, $uid, $info['q_user_code'], $info['title']);
$ret_send = true;
}
}
if ($type == '2') {
if (!empty($member['mobile'])) {
send_mobile_shop_code($member['mobile'], $uid, $info['q_user_code']);
$ret_send = true;
}
}
if ($type == '3') {
if (!empty($member['email'])) {
send_email_code($member['email'], $username, $uid, $info['q_user_code'], $info['title']);
$ret_send = true;
}
if (!empty($member['mobile'])) {
send_mobile_shop_code($member['mobile'], $uid, $info['q_user_code']);
$ret_send = true;
}
}
if ($ret_send) {
$this->send_insert($uid, $gid, $username, $info['title'], $type);
}
exit(0);
}
示例11: whoami
function whoami()
{
if (check_login()) {
echo "<p></p>";
echo "Logged in as " . get_user_name();
echo "<a href=\"index.php?logout\" id=\"logout\">logout</a>";
} else {
echo "<p></p>";
echo "Not Logged in.";
echo "<a href=\"login.php\">login</a>";
}
}
示例12: thread_to_xml
function thread_to_xml($thread, $link)
{
global $state_chatting, $threadstate_to_string, $threadstate_key, $mibew_encoding, $operator, $settings, $can_viewthreads, $can_takeover, $mysqlprefix;
$state = $threadstate_to_string[$thread['istate']];
$result = "<thread id=\"" . safe_htmlspecialchars(safe_htmlspecialchars($thread['threadid'])) . "\" stateid=\"{$state}\"";
if ($state == "closed") {
return $result . "/>";
}
$state = getstring($threadstate_key[$thread['istate']]);
$nextagent = $thread['nextagent'] != 0 ? operator_by_id_($thread['nextagent'], $link) : null;
$threadoperator = $nextagent ? get_operator_name($nextagent) : ($thread['agentName'] ? $thread['agentName'] : "-");
if ($threadoperator == "-" && $thread['groupname']) {
$threadoperator = "- " . $thread['groupname'] . " -";
}
if (!($thread['istate'] == $state_chatting && $thread['agentId'] != $operator['operatorid'] && !is_capable($can_takeover, $operator))) {
$result .= " canopen=\"true\"";
}
if ($thread['agentId'] != $operator['operatorid'] && $thread['nextagent'] != $operator['operatorid'] && is_capable($can_viewthreads, $operator)) {
$result .= " canview=\"true\"";
}
if ($settings['enableban'] == "1") {
$result .= " canban=\"true\"";
}
$banForThread = $settings['enableban'] == "1" ? ban_for_addr_($thread['remote'], $link) : false;
if ($banForThread) {
$result .= " ban=\"blocked\" banid=\"" . safe_htmlspecialchars(safe_htmlspecialchars($banForThread['banid'])) . "\"";
}
$result .= " state=\"{$state}\" typing=\"" . safe_htmlspecialchars(safe_htmlspecialchars($thread['userTyping'])) . "\">";
$result .= "<name>";
if ($banForThread) {
$result .= safe_htmlspecialchars(getstring('chat.client.spam.prefix'));
}
$result .= safe_htmlspecialchars(safe_htmlspecialchars(get_user_name($thread['userName'], $thread['remote'], $thread['userid']))) . "</name>";
$result .= "<addr>" . safe_htmlspecialchars(get_user_addr($thread['remote'])) . "</addr>";
$result .= "<agent>" . safe_htmlspecialchars(safe_htmlspecialchars($threadoperator)) . "</agent>";
$result .= "<time>" . safe_htmlspecialchars(safe_htmlspecialchars($thread['unix_timestamp(dtmcreated)'])) . "000</time>";
$result .= "<modified>" . safe_htmlspecialchars(safe_htmlspecialchars($thread['unix_timestamp(dtmmodified)'])) . "000</modified>";
if ($banForThread) {
$result .= "<reason>" . safe_htmlspecialchars(safe_htmlspecialchars($banForThread['comment'])) . "</reason>";
}
$userAgent = get_useragent_version($thread['userAgent']);
$result .= "<useragent>" . safe_htmlspecialchars($userAgent) . "</useragent>";
if ($thread["shownmessageid"] != 0) {
$query = "select tmessage from {$mysqlprefix}chatmessage where messageid = " . intval($thread["shownmessageid"]);
$line = select_one_row($query, $link);
if ($line) {
$message = preg_replace("/[\r\n\t]+/", " ", $line["tmessage"]);
$result .= "<message>" . safe_htmlspecialchars(safe_htmlspecialchars($message)) . "</message>";
}
}
$result .= "</thread>";
return $result;
}
示例13: notification_new_post
/**
* Plugin Name: Post Notification
* Plugin Description: Sends an Notification email if there's a new post to an favorite topic. (Modified Version 1.4 with Post Content included in E-Mail)
* Author: Thomas Klaiber
* Author URI: http://thomasklaiber.com/
* Plugin URI: http://thomasklaiber.com/bbpress/post-notification/
* Version: 1.4
*/
function notification_new_post($post_id = 0)
{
global $bbdb, $bb_table_prefix, $topic_id, $bb_current_user;
$all_users = notification_select_all_users();
foreach ($all_users as $userdata) {
if (notification_is_activated($userdata->ID)) {
if (is_user_favorite($userdata->ID, $topic_id)) {
//$topic = get_topic($topic_id);
$message = __("Hello,\n\nA new post on \"%1\$s\" has been added by %2\$s at DHAnswers. \n\nMessage:\n\n%3\$s \n\n%4\$s ");
mail($userdata->user_email, '[DHAnswers] New Post for Favorite Question', sprintf($message, get_topic_title($topic_id), get_user_name($bb_current_user->ID), strip_tags(get_post_text($post_id)), get_topic_link($topic_id)), 'From: ' . bb_get_option('name') . ' <' . bb_get_option('from_email') . '>');
}
}
}
}
示例14: getInfoHtml
function getInfoHtml($uid)
{
$avatar_width = 100;
$avatar_height = 100;
$avatar_class = "avatar";
$config = new avatarupload_config();
$avatar_img = "";
if ($a = avatarupload_get_avatar($uid, 1, 1)) {
$avatar_img = '<img src="' . $a[0] . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . $a[4] . '" class="' . $class . '" />';
}
$user_name = get_user_name($uid);
$profile_link = get_user_profile_link($uid);
$html = $avatar_img . '<div class="nombre_usuario"><b><a href="' . $profile_link . '">' . $user_name . '</a></b></div>';
return $html;
}
示例15: currentUserName
/**
* Get the currently logged in user name.
*
* @return string
*/
public static function currentUserName()
{
if (function_exists('\\get_user_name')) {
$username = \get_user_name();
}
if (empty($username)) {
$username = \get_current_user();
}
if (empty($username)) {
$username = Request::header('php-auth-user');
}
if (empty($username)) {
$username = 'system';
}
return $username;
}