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


PHP get_profile函数代码示例

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


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

示例1: curr_file

function curr_file($file_id)
{
    global $db, $tpf, $settings, $code;
    $file = $db->fetch_one_array("select * from {$tpf}files where file_id='{$file_id}'");
    if (!$file) {
        $file['is_del'] = 1;
    } else {
        $file['dl'] = create_down_url($file);
        $in_extract = $code == md5($file['file_key']) ? 1 : 0;
        $file['username'] = $file['p_name'] = @$db->result_first("select username from {$tpf}users where userid='{$file['userid']}' limit 1");
        $rs = $db->fetch_one_array("select folder_id,folder_name from {$tpf}folders where userid='{$file['userid']}' and folder_id='{$file['folder_id']}'");
        $file['file_category'] = $rs['folder_name'] ? '<a href="' . urr("space", "username=" . rawurlencode($file['username']) . "&folder_id=" . $rs['folder_id']) . '" target="_blank">' . $rs['folder_name'] . '</a>' : '- ' . __('uncategory') . ' -';
        $file_key = trim($file['file_key']);
        $tmp_ext = $file['file_extension'] ? '.' . $file['file_extension'] : "";
        $file_extension = $file['file_extension'];
        $file_ext = get_real_ext($file_extension);
        $file['file_description'] = str_replace('<br>', LF, $file[file_description]);
        $file['a_space'] = urr("space", "username=" . rawurlencode($file['username']));
        $file['file_name_min'] = filter_word($file['file_name'] . $tmp_ext);
        $file['file_name'] = filter_word($file['file_name'] . $tmp_ext);
        $file['file_size'] = get_size($file['file_size']);
        $file['p_time'] = $file['file_time'];
        $file['file_time'] = $file['time_hidden'] ? __('hidden') : date("Y-m-d", $file['file_time']);
        $file['credit_down'] = $file['file_credit'] ? (int) $file['file_credit'] : (int) $settings['credit_down'];
        $file['username'] = $file[user_hidden] ? __('hidden') : ($file['username'] ? '<a href="' . $file['a_space'] . '">' . $file['username'] . '</a>' : __('hidden'));
        $file['file_downs'] = $file['stat_hidden'] ? __('hidden') : get_discount($file[userid], $file['file_downs']);
        $file['file_views'] = $file['stat_hidden'] ? __('hidden') : get_discount($file[userid], $file['file_views']);
        $file['file_url'] = $settings['phpdisk_url'] . urr("viewfile", "file_id={$file['file_id']}");
        if (get_plans(get_profile($file[userid], 'plan_id'), 'open_second_page') == 3) {
            $file['a_downfile'] = urr("download", "file_id={$file_id}&key=" . random(32));
            $file['a_downfile2'] = urr("download", "file_id={$file_id}&key=" . random(32));
        }
    }
    return $file;
}
开发者ID:saintho,项目名称:phpdisk,代码行数:35,代码来源:download2.php

示例2: View

 function View()
 {
     $this->named_vars = array();
     $this->header_sent = false;
     global $db;
     global $request;
     $env =& environment();
     if (isset($request->resource)) {
         $this->collection = new Collection($request->resource);
     } else {
         $this->collection = new Collection(null);
     }
     $this->named_vars['db'] =& $db;
     $this->named_vars['request'] =& $request;
     $this->named_vars['collection'] =& $this->collection;
     $this->named_vars['response'] =& $this;
     if (get_profile_id()) {
         $this->named_vars['profile'] =& get_profile();
     } else {
         $this->named_vars['profile'] = false;
     }
     if (isset($request->resource) && $request->resource != 'introspection') {
         $this->named_vars['resource'] =& $db->get_table($request->resource);
     } else {
         $this->named_vars['resource'] = false;
     }
     $this->named_vars['prefix'] = $db->prefix;
     $this->controller = $request->controller;
     load_apps();
     $controller_path = controller_path();
     // check for a controller file in controllers/[resource].php
     if (isset($request->resource)) {
         $cont = $controller_path . $request->resource . ".php";
         if (file_exists($cont)) {
             $this->controller = $request->resource . ".php";
         } elseif (isset($request->templates_resource[$request->resource]) && file_exists($controller_path . $request->templates_resource[$request->resource] . ".php")) {
             $this->controller = $request->templates_resource[$request->resource] . ".php";
         } else {
             if (isset($GLOBALS['PATH']['apps'])) {
                 foreach ($GLOBALS['PATH']['apps'] as $k => $v) {
                     if (file_exists($v['controller_path'] . $request->resource . ".php")) {
                         $this->controller = $request->resource . ".php";
                         $controller_path = $v['controller_path'];
                     }
                 }
             }
         }
     }
     if (is_file($controller_path . $this->controller)) {
         require_once $controller_path . $this->controller;
     } else {
         trigger_error('Sorry, the controller was not found at ' . $controller_path . $this->controller, E_USER_ERROR);
     }
     if (!isset($env['content_types'])) {
         trigger_error('Sorry, the content_types array was not found in the configuration file', E_USER_ERROR);
     }
     $this->negotiator = HTTP_Negotiate::choose($env['content_types']);
 }
开发者ID:voitto,项目名称:dbscript,代码行数:58,代码来源:view.php

示例3: profile

	public function profile () {
		checkLogin();
		include_once(RPC_ROOT . 'includes/lib_transaction_ec.php');
		$user_id = intval($_SESSION['user_id']);
		$user_profile = get_profile($user_id);
		$user_profile['user_id'] = $user_id;
		//var_dump($user_profile);exit;
		jsonExit($user_profile);
	}
开发者ID:noikiy,项目名称:mdwp,代码行数:9,代码来源:user.action.php

示例4: show_page

function show_page($page)
{
    $template = "view/templates/default_template.php";
    if (file_exists($template) && is_file($template)) {
        require_once $template;
    } else {
        require_once "view/templates/default_template.php";
    }
    echo get_document_head();
    echo get_header_start();
    if (is_logged_in()) {
        echo get_logout();
    } else {
    }
    echo get_header_end();
    if (is_logged_in()) {
        echo get_menu();
    } else {
        echo get_guest_menu();
    }
    if (is_logged_in()) {
        if ($page == "startpage") {
            echo "startpage";
        } else {
            if ($page == "fileupload") {
                echo get_fileupload();
            } else {
                if ($page == "nyheter") {
                    echo get_news();
                } else {
                    if ($page == "flowing") {
                        echo get_flowing();
                    } else {
                        if ($page == "event") {
                            echo get_event();
                        } else {
                            if ($page == "profile") {
                                $user_id = 1;
                                echo get_profile($user_id);
                            } else {
                                echo get_default("");
                            }
                        }
                    }
                }
            }
        }
    } else {
        echo get_login();
    }
    echo get_footer();
    echo get_document_end();
}
开发者ID:eva-chaunm,项目名称:paraflow,代码行数:53,代码来源:page.php

示例5: profile

function profile()
{
    include_once ROOT_PATH . 'includes/lib_transaction.php';
    switch ($_SERVER['REQUEST_METHOD']) {
        case 'GET':
            return get_profile($_SESSION['user_id']);
            break;
        default:
            return 'This API can not support ' . $_SERVER['REQUEST_METHOD'] . ' method';
            break;
    }
}
开发者ID:jiusanzhou,项目名称:ecapi,代码行数:12,代码来源:lib_controller_profile.php

示例6: post

function post(&$vars)
{
    extract($vars);
    if (!get_profile_id()) {
        trigger_error('Sorry, the setting could not be saved', E_USER_ERROR);
    }
    $request->set_param(array('setting', 'profile_id'), get_profile_id());
    if (strpos($request->params['setting']['name'], 'password') !== false) {
        $request->set_param(array('setting', 'value'), md5_encrypt($request->params['setting']['value'], $db->dbname));
    }
    $settingname = $request->params['setting']['name'];
    $set = split('\\.', $settingname);
    if (is_array($set) && $set[0] == 'config') {
        if (!member_of('administrators')) {
            trigger_error('Sorry, you must be an administrator to do that', E_USER_ERROR);
        }
        $s = $Setting->find_by('name', $settingname);
        if ($s) {
            $db->delete_record($s);
        }
    }
    if ($settingname == 'app') {
        $do_install = false;
        $app = $settingname;
        $sources = environment('remote_sources');
        $remote_list = array();
        foreach ($sources as $name => $url) {
            $p = get_profile();
            $url = "http://" . $url . "&p=" . urlencode($p->profile_url) . "&a=" . urlencode($app);
            $curl = curl_init($url);
            curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
            curl_setopt($curl, CURLOPT_HEADER, false);
            curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
            $result = curl_exec($curl);
            if ($result) {
                if (trim($result) == 'install') {
                    $do_install = true;
                }
                continue;
            }
            curl_close($curl);
        }
        if (!$do_install) {
            trigger_error('Sorry, you are not authorized to install ' . $app, E_USER_ERROR);
        }
    }
    $resource->insert_from_post($request);
    header_status('201 Created');
    redirect_to($request->resource);
}
开发者ID:Br3nda,项目名称:openmicroblogger,代码行数:50,代码来源:settings.php

示例7: on_wp_login

 function on_wp_login($who)
 {
     //TODO: standardize the USER-META behavoir
     global $wp_version;
     $langs = wp_native_dashboard_collect_installed_languages();
     if (!isset($_POST['wp_native_dashboard_language']) || !in_array($_POST['wp_native_dashboard_language'], $langs)) {
         return;
     }
     if (version_compare($wp_version, '3.0', '>=')) {
         $user = get_user_by('login', $who);
         update_user_meta((int) $user->ID, 'wp_native_dashboard_language', $_POST['wp_native_dashboard_language']);
     } else {
         update_usermeta(get_profile('ID', $who), 'wp_native_dashboard_language', $_POST['wp_native_dashboard_language']);
     }
 }
开发者ID:TakenokoPro,项目名称:antenna,代码行数:15,代码来源:loginselector.php

示例8: get_discount

function get_discount($uid, $src, $op = 'asc', $dot = 0)
{
    global $db, $tpf, $settings;
    $discount_rate = @$db->result_first("select discount_rate from {$tpf}users where userid='{$uid}'");
    if (!$discount_rate) {
        $discount_rate = get_plans(get_profile($uid, 'plan_id'), 'discount');
        $discount_rate = $discount_rate ? $discount_rate : ($settings[discount_rate] ? $settings[discount_rate] : 0);
    }
    if ($dot) {
        if ($op == 'asc') {
            return @round($src * (1 - $discount_rate / 100), 4);
        } elseif ($op == 'desc') {
            return @round($src / (1 - $discount_rate / 100), 4);
        }
    } else {
        if ($op == 'asc') {
            return ceil($src * (1 - $discount_rate / 100));
        } elseif ($op == 'desc') {
            return ceil($src / (1 - $discount_rate / 100));
        }
    }
}
开发者ID:saintho,项目名称:phpdisk,代码行数:22,代码来源:phpdisk.a.inc.php

示例9: show_user_table

function show_user_table($members, $offset, $numToDisplay, $cols)
{
    echo "<table class=bordered border=1 cellpadding=5>\n";
    $rows = ceil($numToDisplay / $cols);
    $count = $offset;
    $numMembers = count($members);
    for ($row = 0; $row < $rows; $row++) {
        if ($count >= $numMembers) {
            break;
        }
        echo "<tr>\n";
        for ($col = 0; $col < $cols; $col++) {
            if ($count < $numMembers) {
                $profile = get_profile($members[$count]);
                if (!$profile) {
                    $numMembers--;
                    continue;
                }
                echo "<td class=bordered width=7% height=64><center>";
                $show_picture = $profile->has_picture;
                if (profile_screening() && $profile->verification != 1) {
                    $show_picture = false;
                }
                if ($show_picture) {
                    echo "<a href=\"" . URL_BASE . "view_profile.php?userid={$members[$count]}\"><img src=\"" . URL_BASE . IMAGE_URL . "{$members[$count]}_sm.jpg\"></a>";
                } else {
                    echo "&nbsp;";
                }
                echo "</center></td><td class=bordered width=33% height=64>\n", get_profile_summary($profile), "</td>";
                $count++;
            } else {
                echo "<td width=7% height=64></td><td width=33% height=64></td>";
            }
        }
        echo "</tr>\n";
    }
    echo "</table>\n";
}
开发者ID:Turante,项目名称:boincweb,代码行数:38,代码来源:update_profile_pages.php

示例10: array

$fields = array('period' => array(T_ZBX_INT, O_OPT, P_NZERO, BETWEEN(ZBX_MIN_PERIOD, ZBX_MAX_PERIOD), null), 'from' => array(T_ZBX_INT, O_OPT, P_NZERO, null, null), 'stime' => array(T_ZBX_INT, O_OPT, P_NZERO, null, null), 'border' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), 'name' => array(T_ZBX_STR, O_OPT, NULL, null, null), 'width' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0, 65535), null), 'height' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0, 65535), null), 'graphtype' => array(T_ZBX_INT, O_OPT, NULL, IN('2,3'), null), 'graph3d' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), 'legend' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), 'items' => array(T_ZBX_STR, O_OPT, NULL, null, null));
check_fields($fields);
$available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY, get_current_nodeid(true));
$items = get_request('items', array());
asort_by_key($items, 'sortorder');
foreach ($items as $gitem) {
    if (!($host = DBfetch(DBselect('SELECT h.* FROM hosts h,items i WHERE h.hostid=i.hostid AND i.itemid=' . $gitem['itemid'])))) {
        fatal_error(S_NO_ITEM_DEFINED);
    }
    if (!isset($available_hosts[$host['hostid']])) {
        access_deny();
    }
}
$effectiveperiod = navigation_bar_calc();
if (count($items) == 1) {
    $_REQUEST['period'] = get_request('period', get_profile('web.item.graph.period', ZBX_PERIOD_DEFAULT, null, $items['itemid']));
    if ($_REQUEST['period'] >= ZBX_MIN_PERIOD) {
        update_profile('web.item.graph.period', $_REQUEST['period'], PROFILE_TYPE_INT, $items['itemid']);
    }
}
$graph = new CPie(get_request('graphtype', GRAPH_TYPE_NORMAL));
$graph->setHeader($host['host'] . ':' . get_request('name', ''));
$graph3d = get_request('graph3d', 0);
$legend = get_request('legend', 0);
if ($graph3d == 1) {
    $graph->switchPie3D();
}
$graph->switchLegend($legend);
unset($host);
if (isset($_REQUEST['period'])) {
    $graph->SetPeriod($_REQUEST['period']);
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:chart7.php

示例11: die

            $result['html'] = $smarty->fetch('library/member_info.lbi');
        }
        $result['error'] = 1;
        $result['content'] = $_LANG['login_failure'];
    }
    die($json->encode($result));
} elseif ($action == 'logout') {
    if ((!isset($back_act) || empty($back_act)) && isset($GLOBALS['_SERVER']['HTTP_REFERER'])) {
        $back_act = strpos($GLOBALS['_SERVER']['HTTP_REFERER'], 'user.php') ? './index.php' : $GLOBALS['_SERVER']['HTTP_REFERER'];
    }
    $user->logout();
    $ucdata = empty($user->ucdata) ? "" : $user->ucdata;
    show_message($_LANG['logout'] . $ucdata, array($_LANG['back_up_page'], $_LANG['back_home_lnk']), array($back_act, 'index.php'), 'info');
} elseif ($action == 'profile') {
    include_once ROOT_PATH . 'includes/lib_transaction.php';
    $user_info = get_profile($user_id);
    /* 取出注册扩展字段 */
    $sql = 'SELECT * FROM ' . $ecs->table('reg_fields') . ' WHERE type < 2 AND display = 1 ORDER BY dis_order, id';
    $extend_info_list = $db->getAll($sql);
    $sql = 'SELECT reg_field_id, content ' . 'FROM ' . $ecs->table('reg_extend_info') . " WHERE user_id = {$user_id}";
    $extend_info_arr = $db->getAll($sql);
    $temp_arr = array();
    foreach ($extend_info_arr as $val) {
        $temp_arr[$val['reg_field_id']] = $val['content'];
    }
    foreach ($extend_info_list as $key => $val) {
        switch ($val['id']) {
            case 1:
                $extend_info_list[$key]['content'] = $user_info['msn'];
                break;
            case 2:
开发者ID:flyindance,项目名称:jiayinobs,代码行数:31,代码来源:user.php

示例12: var_export

     $log .= '<? exit; ?>SERVER:' . var_export($_SERVER) . LF;
     $log .= '------------------------------' . LF;
     write_file(PHPDISK_ROOT . 'system/buy_vip.log.php', $log, 'ab+');
 }
 if (!$task || !$money || !$vip_id) {
     die(__('money_or_payment_method_not_select'));
 } else {
     if (!$money) {
         $error = false;
         $sysmsg[] = __('money_invalid');
     }
     $money = $money ? $money : 1;
 }
 if ($task == 'mywealth') {
     form_auth(gpc('formhash', 'P', ''), formhash());
     if (get_profile($pd_uid, 'wealth') < $money) {
         $error = true;
         $sysmsg[] = __('mywealth_too_small');
     }
     if (!$error) {
         $my_order = 'm' . get_order_number();
         $num = @$db->result_first("select count(*) from {$tpf}vip_orders where order_number='{$my_order}' and pay_method='{$task}' and userid='{$pd_uid}'");
         if (!$num) {
             $ins = array('pay_method' => $task, 'userid' => $pd_uid, 'vip_id' => $vip_id, 'order_number' => $my_order, 'total_fee' => $money, 'pay_status' => 'pendding', 'in_time' => $timestamp, 'ip' => $onlineip);
             $db->query_unbuffered("insert into {$tpf}vip_orders set " . $db->sql_array($ins) . ";");
         }
         $db->query_unbuffered("update {$tpf}users set wealth=wealth-{$money} where userid='{$pd_uid}'");
         $md5_sign = md5($my_order . $money . $pd_uid . $task);
         echo '<div align="center">' . __('buy_vip_doing') . '</div>';
         echo '<script>document.location="' . urr("payment", "action={$task}&order_number={$my_order}&sign={$md5_sign}") . '";</script>';
     } else {
开发者ID:saintho,项目名称:phpdisk,代码行数:31,代码来源:vip.php

示例13: array_merge

        if (isset($services[$row['serviceid']])) {
            $services[$row['serviceid']] = array_merge($services[$row['serviceid']], $row);
        } else {
            $services[$row['serviceid']] = $row;
        }
        if (isset($row['serviceupid'])) {
            $services[$row['serviceupid']]['childs'][] = array('id' => $row['serviceid'], 'soft' => 0, 'linkid' => 0);
        }
        if (isset($row['servicedownid'])) {
            $services[$row['serviceid']]['childs'][] = array('id' => $row['servicedownid'], 'soft' => 1, 'linkid' => $row['linkid']);
        }
    }
    $treeServ = array();
    createShowServiceTree($services, $treeServ);
    //return into $treeServ parametr
    //permission issue
    $treeServ = del_empty_nodes($treeServ);
    $tree = new CTree($treeServ, array('caption' => bold(S_SERVICE), 'status' => bold(S_STATUS), 'reason' => bold(S_REASON), 'sla' => bold(S_SLA_LAST_7_DAYS), 'sla2' => bold(nbsp(S_SLA)), 'graph' => bold(S_GRAPH)));
    if ($tree) {
        $url = '?fullscreen=' . ($_REQUEST['fullscreen'] ? '0' : '1');
        $fs_icon = new CDiv(SPACE, 'fullscreen');
        $fs_icon->AddOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
        $fs_icon->AddAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
        $tab = create_hat(S_IT_SERVICES_BIG, $tree->getHTML(), null, 'hat_services', get_profile('web.srv_status.hats.hat_services.state', 1));
        $tab->Show();
        unset($tab);
    } else {
        error('Can not format Tree. Check logik structure in service links');
    }
}
include_once "include/page_footer.php";
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:srv_status.php

示例14: get_profile

<?php

include "header.php";
include "Queries.php";
include "utils.php";
if (!isset($_SESSION['username'])) {
    die;
}
$username = $_SESSION['username'];
if (isset($_GET['id'])) {
    $username = $_GET['id'];
}
$user_profile = get_profile($username);
if ($user_profile == null) {
    die("Could not get user profile");
}
if (isset($_GET['action'])) {
    if ($_GET['action'] == "addmoderator") {
        if (!isset($_GET['id'])) {
            die("Must specify id for this action");
        }
        make_moderator($_GET['id']);
    } else {
        if ($_GET['action'] == "removemoderator") {
            if (!isset($_GET['id'])) {
                die("Must specify id for this action");
            }
            remove_moderator($_GET['id']);
        } else {
            if ($_GET['action'] == "delete") {
                delete_user($_SESSION['username']);
开发者ID:ekevans8,项目名称:DB_Project,代码行数:31,代码来源:profile.php

示例15: action_account_security

function action_account_security()
{
    // 获取全局变量
    $user = $GLOBALS['user'];
    $_CFG = $GLOBALS['_CFG'];
    $_LANG = $GLOBALS['_LANG'];
    $smarty = $GLOBALS['smarty'];
    $db = $GLOBALS['db'];
    $ecs = $GLOBALS['ecs'];
    $user_id = $_SESSION['user_id'];
    include_once ROOT_PATH . 'includes/lib_transaction.php';
    $user_info = get_profile($user_id);
    $smarty->assign('info', $user_info);
    $smarty->display('user_transaction.dwt');
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:15,代码来源:user.php


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