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


PHP getAge函数代码示例

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


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

示例1: motm

function motm()
{
    global $db, $allowHover;
    $userpics = get_files(basePath . '/inc/images/uploads/userpics/');
    $qry = db("SELECT * FROM " . $db['users'] . " WHERE level >= 2");
    while ($rs = _fetch($qry)) {
        foreach ($userpics as $userpic) {
            $tmpId = intval($userpic);
            if ($tmpId == $rs['id']) {
                $temparr[] = $rs['id'];
                $a++;
                break;
            }
        }
    }
    $arrayID = rand(0, count($temparr) - 1);
    $uid = $temparr[$arrayID];
    $get = _fetch(db("SELECT * FROM " . $db['users'] . " WHERE id = '" . $uid . "'"));
    if (!empty($get) && !empty($temparr)) {
        $status = $get['status'] == 1 || $get['level'] == 1 ? _aktiv : _inaktiv;
        if ($allowHover == 1) {
            $info = 'onmouseover="DZCP.showInfo(\'<tr><td colspan=2 align=center padding=3 class=infoTop>' . rawautor($get['id']) . '</td></tr><tr><td width=80px><b>' . _posi . ':</b></td><td>' . getrank($get['id']) . '</td></tr><tr><td><b>' . _status . ':</b></td><td>' . $status . '</td></tr><tr><td><b>' . _age . ':</b></td><td>' . getAge($get['bday']) . '</td></tr><tr><td colspan=2 align=center>' . jsconvert(userpic($get['id'])) . '</td></tr>\')" onmouseout="DZCP.hideInfo()"';
        }
        $member = show("menu/motm", array("uid" => $get['id'], "upic" => userpic($get['id'], 130, 161), "info" => $info));
    } else {
        $member = '';
    }
    return empty($member) ? '' : '<table class="navContent" cellspacing="0">' . $member . '</table>';
}
开发者ID:nopuls,项目名称:dzcp,代码行数:29,代码来源:motm.php

示例2: createNpc

function createNpc()
{
    $trait_table = "npc_traits";
    $table = "npc";
    $columns = getColumnNames($table);
    if (empty($_POST["sex"])) {
        $_POST["sex"] = getGender();
    }
    if (empty($_POST["weight"])) {
        $_POST["weight"] = getWeight();
    }
    if (empty($_POST["feet"]) || empty($_POST["inches"])) {
        $_POST["height"] = getHeight();
    } else {
        $_POST["height"] = $_POST["feet"] * 12 + $_POST["inches"];
    }
    if (empty($_POST["age"])) {
        $_POST["age"] = getAge();
    }
    if (empty($_POST["first_name"])) {
        $_POST["first_name"] = getName();
    }
    // will add the remaining traits not already added
    foreach ($columns as $column) {
        if (empty($_POST[$column])) {
            $_POST[$column] = getTrait($trait_table, $column);
        }
    }
}
开发者ID:Cassioblu55,项目名称:aesop_php,代码行数:29,代码来源:npc.php

示例3: execute

 function execute($requests)
 {
     $u = $GLOBALS['KTAI_C_MEMBER_ID'];
     // --- リクエスト変数
     $target_c_member_id = $requests['target_c_member_id'];
     // ----------
     if ($target_c_member_id == $u) {
         openpne_redirect('ktai', 'page_h_home');
     }
     if (!db_member_is_active_c_member_id($target_c_member_id)) {
         ktai_display_error('該当するメンバーが見つかりません。');
     }
     if (db_member_is_access_block($u, $target_c_member_id)) {
         openpne_redirect('ktai', 'page_h_access_block');
     }
     //管理画面HTML
     $this->set('c_siteadmin', p_common_c_siteadmin4target_pagename('k_f_home'));
     //ターゲットのc_member
     $is_friend = db_friend_is_friend($u, $target_c_member_id);
     $target_c_member = db_member_c_member_with_profile($target_c_member_id, 'private');
     $target_c_member['last_login'] = p_f_home_last_login4access_date($target_c_member['access_date']);
     if ($target_c_member['birth_year']) {
         $target_c_member['age'] = getAge($target_c_member['birth_year'], $target_c_member['birth_month'], $target_c_member['birth_day']);
     }
     $this->set("target_c_member", $target_c_member);
     //ターゲットの最新日記5件
     $this->set("c_diary_list", db_diary_get_c_diary_list4c_member_id($target_c_member_id, 5, $u));
     //フレンドランダム5人
     $this->set("c_friend_list", db_friend_c_friend_list_random4c_member_id($target_c_member_id, 5));
     //参加コミュニティ最新書き込み5件
     $this->set("c_commu_list", db_commu_c_commu_list_lastupdate4c_member_id($target_c_member_id, 5));
     //共通コミュニティ
     $this->set('common_commu_count', count(db_common_commu_common_commu_id4c_member_id($target_c_member_id, $u)));
     //ターゲットと自分との関係
     $this->set("relation", db_friend_relationship4two_members($u, $target_c_member_id));
     $is_friend = db_friend_is_friend($u, $target_c_member_id);
     if ($is_friend) {
         $this->set('is_friend', $is_friend);
     } else {
         $this->set('friend_path', db_friend_friend_path4c_member_ids($u, $target_c_member_id));
     }
     $this->set('profile_list', db_member_c_profile_list());
     // 誕生日まであと何日?
     $this->set('days_birthday', db_member_count_days_birthday4c_member_id($target_c_member_id));
     if (OPENPNE_USE_POINT_RANK) {
         // ポイント
         $point = db_point_get_point($target_c_member_id);
         $this->set("point", $point);
         // ランク
         $this->set("rank", db_point_get_rank4point($point));
     }
     // inc_entry_point
     $this->set('inc_ktai_entry_point', fetch_inc_entry_point($this->getView(), 'ktai_f_home'));
     //あしあとをつける
     db_ashiato_insert_c_ashiato($target_c_member_id, $u);
     return 'success';
 }
开发者ID:KimuraYoichi,项目名称:PukiWiki,代码行数:57,代码来源:f_home.php

示例4: decodeUserDetails

function decodeUserDetails($req)
{
    include_once "dbconnect.php";
    $res = file_get_contents($req);
    $jsonObject = json_decode($res);
    $user_id = $jsonObject->id;
    $user_name = $jsonObject->name;
    $user_birthday = $jsonObject->birthday;
    $user_gender = $jsonObject->gender;
    $user_relationship_status = $jsonObject->relationship_status;
    $user_age = getAge($user_birthday);
    $user_location = $jsonObject->location->name;
    $user_hometown = $jsonObject->hometown->name;
    echo 'User ID : ' . $user_id . ' <br/>';
    echo 'Name : ' . $user_name . ' <br/>';
    echo 'Birthday : ' . $user_birthday . ' <br/>';
    echo 'Gender : ' . $user_gender . ' <br/>';
    echo 'Relationship Statuds : ' . $user_relationship_status . ' <br/>';
    echo 'Location : ' . $user_location . ' <br/>';
    echo 'Hometown : ' . $user_hometown . ' <br/>';
    echo 'Age : ' . $user_age;
    try {
        $id = mysqli_real_escape_string($dbc, $user_id);
        global $u_id;
        $u_id = $id;
        $age = mysqli_real_escape_string($dbc, $user_age);
        $gender = mysqli_real_escape_string($dbc, $user_gender);
        $rel = mysqli_real_escape_string($dbc, $user_relationship_status);
        $sql = "INSERT INTO user_details VALUES(" . $user_id . ", " . $user_age . ", '" . $user_gender . "', '" . $user_relationship_status . "', 'apple') ";
        mysqli_query($dbc, $sql);
    } catch (Exception $e) {
        echo '<br/>skipped ' . $user_id . '<br/><br/>';
    }
    echo '<br/> EDUCATION <br/>';
    foreach ($jsonObject->education as $edu) {
        $school_id = $edu->school->id;
        $school_name = $edu->school->name;
        $school_type = $edu->type;
        echo $school_id . ' : ' . $school_name . ' : ' . $school_type . ' <br/>';
    }
    echo '<br/> WORK <br/>';
    foreach ($jsonObject->work as $job) {
        $employer_id = $job->employer->id;
        $employer_name = $job->employer->name;
        $location = $job->location->name;
        $position = $job->position->name;
        $start_date = $job->start_date;
        $end_date = $job->end_date;
        echo $employer_id . ' : ' . $employer_name . ' : ' . $location . ' : ' . $position . ' : ' . $start_date . ' to ' . $end_date . ' <br/>';
    }
    echo '<br/> INTERESTED IN <br/>';
    foreach ($jsonObject->interested_in as $inter) {
        echo $inter . ' <br/>';
    }
    echo '<div onload="isDoneLoading()" style="display : none">';
    mysqli_close($dbc);
}
开发者ID:nimantha,项目名称:sankranthi_test,代码行数:57,代码来源:process.php

示例5: execute

 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     $target_c_member_id = $u;
     $this->set('is_h_prof', 1);
     $this->set('inc_navi', fetch_inc_navi('h'));
     $target_c_member = db_member_c_member_with_profile($u, 'private');
     $this->set('is_friend', 0);
     $this->set('c_diary_list', db_diary_get_c_diary_list4c_member_id($target_c_member_id, 5, null, 'friend'));
     if (OPENPNE_USE_ALBUM) {
         // アルバム
         $this->set('c_album_list', db_album_get_c_album_subject_list4c_member_id($target_c_member_id, 5, null, 'friend'));
     }
     // --- f_home, h_prof 共通処理
     $this->set('target_c_member_id', $target_c_member_id);
     $target_c_member['last_login'] = p_f_home_last_login4access_date($target_c_member['access_date']);
     if ($target_c_member['birth_year']) {
         $target_c_member['age'] = getAge($target_c_member['birth_year'], $target_c_member['birth_month'], $target_c_member['birth_day']);
     }
     $this->set('target_c_member', $target_c_member);
     $this->set('c_rss_cache_list', db_rss_c_rss_cache_list4c_member_id($target_c_member_id, 5));
     $this->set('c_friend_comment_list', db_friend_c_friend_comment4c_member_id($target_c_member_id));
     $this->set('c_friend_list', db_friend_c_friend_list4c_member_id($target_c_member_id, 9));
     $this->set('c_friend_count', db_friend_count_friends($target_c_member_id));
     $this->set('user_count', db_commu_count_c_commu4c_member_id($target_c_member_id));
     $this->set('c_commu_list', db_commu_c_commu_list4c_member_id_2($target_c_member_id, 9));
     $this->set('c_review_list', db_review_c_review_list4member($target_c_member_id, 5));
     $this->set('profile_list', db_member_c_profile_list());
     // 誕生日まであと何日?
     $this->set('days_birthday', db_member_count_days_birthday4c_member_id($target_c_member_id));
     if (OPENPNE_USE_POINT_RANK) {
         // ポイント
         $point = db_point_get_point($target_c_member_id);
         $this->set("point", $point);
         // ランク
         $this->set("rank", db_point_get_rank4point($point));
     }
     // ---bizここから
     $this->set('is_h_prof', 1);
     //カレンダー表示用
     $biz_dir = OPENPNE_MODULES_BIZ_DIR . '/biz/';
     //bizモジュールディレクトリの定義
     include_once $biz_dir . 'lib/smarty_functions.php';
     //bizモジュールよりライブラリを拝借
     include_once $biz_dir . 'lib/mysql_functions.php';
     //bizモジュールよりライブラリを拝借
     $this->set('calendar', biz_getScheduleWeek($u, $u, $requests['w'], 'p', true, true, true, $target_c_member));
     $todolist = biz_getTodoList($u, $u, "h", $target_c_member['nickname']);
     $this->set("todolist", $todolist);
     $group_list = biz_getHomeGroupList($u);
     $this->set('group_list', $group_list);
     // ---bizここまで
     // inc_entry_point
     $this->set('inc_entry_point', fetch_inc_entry_point($this->getView(), 'f_home'));
     return 'success';
 }
开发者ID:KimuraYoichi,项目名称:PukiWiki,代码行数:56,代码来源:h_prof.php

示例6: userinfo

 /**
  * 用户信息
  **/
 public function userinfo()
 {
     $user_id = $this->get_user_id(TRUE);
     $user_info = $this->model->get_user_detail($user_id, TRUE);
     if ($user_info) {
         $user = array('user_id' => $user_info['user_id'], 'user_name' => $user_info['user_name'], 'state' => $user_info['state'], 'nick_name' => $user_info['nick_name'], 'headimg' => $user_info['headimg'], 'signature' => $user_info['signature'], 'birthday' => $user_info['birthday'], 'age' => getAge($user_info['birthday']), 'sex' => $user_info['sex'], 'role' => $user_info['role'], 'mobile_phone' => $user_info['user_mobile']);
         response_json('1', $user);
     }
     response_code('4005');
 }
开发者ID:qiuai,项目名称:qieyou,代码行数:13,代码来源:home.php

示例7: compare

 /**
  * in this function we compare ages of human1 and human 2
  * @param unknown $human1
  * @param unknown $human2
  */
 public static function compare($human1, $human2)
 {
     if ($human1 . getAge() > $human2 . getAge()) {
         return 1;
     } else {
         if ($human1 . getAge() < $human2 . getAge()) {
             return -1;
         } else {
             return 0;
         }
     }
 }
开发者ID:piiskop,项目名称:pstk,代码行数:17,代码来源:sort.php

示例8: storeStaffCredentials

function storeStaffCredentials($staffInfo)
{
    $dbConnection = connectToDB();
    if (!$dbConnection) {
        //echo "Unable to connect to MySQL.".PHP_EOL;
        return 0;
    }
    $fname = $staffInfo["firstName"];
    //
    $middleInitial = $staffInfo["middleName"];
    //
    $lname = $staffInfo["lastName"];
    //
    $nickname = $staffInfo["nickName"];
    //
    $usernameProvided = $staffInfo["username"];
    //
    $emailProvided = $staffInfo["email"];
    //
    $password = $staffInfo["password"];
    //
    $dob = $staffInfo["dob"];
    //
    $phone = $staffInfo["phone"];
    //
    $age = getAge($dob);
    //Cleaning data (prevent SQL injections)
    $username = mysqli_real_escape_string($dbConnection, $usernameProvided);
    $email = mysqli_real_escape_string($dbConnection, $emailProvided);
    $hashCodeEmail = mysqli_real_escape_string($dbConnection, md5(rand(0, 1000)));
    $cleanPassword = mysqli_real_escape_string($dbConnection, $password);
    //hashing password
    $options = array('cost' => 10);
    $passwordHashed = password_hash($cleanPassword, PASSWORD_BCRYPT, $options);
    $query = "INSERT INTO registered_staff ( username, password, email, hashEmail, firstName, middleInitial, lastName, nickname, phone, dateOfBirth, age)\n      VALUES ('" . $username . "', '" . $passwordHashed . "', '" . $email . "', '" . $hashCodeEmail . "' , '" . $fname . "', '" . $middleInitial . "', '" . $lname . "', '" . $nickname . "', '" . $phone . "', '" . $dob . "', '" . $age . "')";
    // echo "<p>".$query."</p>";
    $result = mysqli_query($dbConnection, $query);
    if ($result) {
        $staffID = $dbConnection->insert_id;
        if (isset($staffID)) {
            //echo "<p>staff saved with id $staffID</p>";
            return $staffID;
        } else {
            // echo "Unable to retrieve staff ID";
            return -3;
        }
    }
    // echo "Unable to store staff credentials";
    return -2;
}
开发者ID:rviant,项目名称:ASI,代码行数:50,代码来源:studentAPI.php

示例9: team

function team($tID = '')
{
    global $db, $teamRow, $l_team;
    //SQL
    if (!empty($tID)) {
        $where = "WHERE id = '" . intval($tID) . "' AND navi = 1";
    } else {
        $where = "WHERE navi = '1' ORDER BY RAND()";
    }
    $get = _fetch(db("SELECT * FROM " . $db['squads'] . " " . $where . ""));
    //Members
    $qrym = db("SELECT s1.squad,s2.id,s2.level,s2.nick,s2.status,s2.rlname,s2.bday,s4.position\n                FROM " . $db['squaduser'] . " AS s1\n                LEFT JOIN " . $db['users'] . " AS s2\n                ON s2.id=s1.user\n                LEFT JOIN " . $db['userpos'] . " AS s3\n                ON s3.squad=s1.squad AND s3.user=s1.user\n                LEFT JOIN " . $db['pos'] . " AS s4\n                ON s4.id=s3.posi\n                WHERE s1.squad='" . $get['id'] . "'\n                AND s2.level != 0\n                ORDER BY s4.pid");
    $i = 1;
    $cnt = 0;
    while ($getm = _fetch($qrym)) {
        unset($tr1, $tr2);
        if ($i == 0 || $i == 1) {
            $tr1 = "<tr>";
        }
        if ($i == $teamRow) {
            $tr2 = "</tr>";
            $i = 0;
        }
        $status = $getm['status'] == 1 || $getm['level'] == 1 ? _aktiv : _inaktiv;
        $info = 'onmouseover="DZCP.showInfo(\'<tr><td colspan=2 align=center padding=3 class=infoTop>' . rawautor($getm['id']) . '</td></tr><tr><td width=80px><b>' . _posi . ':</b></td><td>' . getrank($getm['id'], $get['id']) . '</td></tr><tr><td><b>' . _status . ':</b></td><td>' . $status . '</td></tr><tr><td><b>' . _age . ':</b></td><td>' . getAge($getm['bday']) . '</td></tr><tr><td colspan=2 align=center>' . jsconvert(userpic($getm['id'])) . '</td></tr>\')" onmouseout="DZCP.hideInfo()"';
        $member .= show("menu/team_show", array("pic" => userpic($getm['id'], 40, 50), "tr1" => $tr1, "tr2" => $tr2, "squad" => $get['id'], "info" => $info, "id" => $getm['id'], "width" => round(100 / $teamRow, 0)));
        $i++;
        $cnt++;
    }
    if (is_float($cnt / $teamRow)) {
        for ($e = $i; $e <= $teamRow; $e++) {
            $end .= '<td></td>';
        }
        $end = $end . "</tr>";
    }
    // Next / last ID
    $all = cnt($db['squads'], "WHERE `navi` = '1'");
    $next = _fetch(db("SELECT id FROM " . $db['squads'] . " WHERE `navi` = '1' AND `id` > '" . $get['id'] . "' ORDER BY `id` ASC LIMIT 1"));
    if (empty($next)) {
        $next = _fetch(db("SELECT id FROM " . $db['squads'] . " WHERE `navi` = '1' ORDER BY `id` ASC LIMIT 1"));
    }
    $last = _fetch(db("SELECT id FROM " . $db['squads'] . " WHERE `navi` = '1' AND `id` < '" . $get['id'] . "' ORDER BY `id` DESC LIMIT 1"));
    if (empty($last)) {
        $last = _fetch(db("SELECT id FROM " . $db['squads'] . " WHERE `navi` = '1' ORDER BY `id` DESC LIMIT 1"));
    }
    //Output
    $team = show("menu/team", array("row" => $teamRow, "team" => re($get['name']), "id" => $get['id'], "next" => $next['id'], "last" => $last['id'], "br1" => $all <= 1 ? '<!--' : '', "br2" => $all <= 1 ? '-->' : '', "member" => $member, "end" => $end));
    return '<div id="navTeam">' . $team . '</div>';
}
开发者ID:nopuls,项目名称:dzcp,代码行数:49,代码来源:team.php

示例10: uotm

function uotm()
{
    global $db, $allowHover;
    $imgFiles = array();
    $folder = get_files('../inc/images/uploads/userpics');
    foreach ($folder as $file) {
        array_push($imgFiles, $file);
    }
    if (count($imgFiles) != 0) {
        $userid = intval($imgFiles[rand(0, count($imgFiles) - 1)]);
        $get = _fetch(db("SELECT id,nick,country,bday FROM " . $db['users'] . " WHERE id = '" . $userid . "'"));
        if (!empty($get)) {
            if ($allowHover == 1) {
                $info = 'onmouseover="DZCP.showInfo(\'<tr><td colspan=2 align=center padding=3 class=infoTop>' . rawautor($get['id']) . '</td></tr><tr><td width=50%><b>' . _age . ':</b></td><td>' . getAge($get['bday']) . '</td></tr><tr><td colspan=2 align=center>' . jsconvert(userpic($get['id'])) . '</td></tr>\')" onmouseout="DZCP.hideInfo()"';
            }
            $uotm = show("menu/uotm", array("uid" => $userid, "upic" => userpic($get['id'], 130, 161), "info" => $info));
        }
    }
    return empty($uotm) ? '' : '<table class="navContent" cellspacing="0">' . $uotm . '</table>';
}
开发者ID:nopuls,项目名称:dzcp,代码行数:20,代码来源:uotm.php

示例11: execute

 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     $target_c_member_id = $u;
     $this->set('is_h_prof', 1);
     $this->set('inc_navi', fetch_inc_navi('h'));
     $target_c_member = db_member_c_member_with_profile($u, 'private');
     $this->set('is_friend', 0);
     $this->set('c_diary_list', db_diary_get_c_diary_list4c_member_id($target_c_member_id, 5, null, 'friend'));
     if (OPENPNE_USE_ALBUM) {
         // アルバム
         $this->set('c_album_list', db_album_get_c_album_subject_list4c_member_id($target_c_member_id, 5, null, 'friend'));
     }
     // --- f_home, h_prof 共通処理
     $this->set('target_c_member_id', $target_c_member_id);
     $target_c_member['last_login'] = p_f_home_last_login4access_date($target_c_member['access_date']);
     if ($target_c_member['birth_year']) {
         $target_c_member['age'] = getAge($target_c_member['birth_year'], $target_c_member['birth_month'], $target_c_member['birth_day']);
     }
     $this->set('target_c_member', $target_c_member);
     $this->set('c_rss_cache_list', db_rss_c_rss_cache_list4c_member_id($target_c_member_id, 5));
     $this->set('c_friend_comment_list', db_friend_c_friend_comment4c_member_id($target_c_member_id));
     $this->set('c_friend_list', db_friend_c_friend_list4c_member_id($target_c_member_id, 9));
     $this->set('c_friend_count', db_friend_count_friends($target_c_member_id));
     $this->set('user_count', db_commu_count_c_commu4c_member_id($target_c_member_id));
     $this->set('c_commu_list', db_commu_c_commu_list4c_member_id_2($target_c_member_id, 9));
     $this->set('c_review_list', db_review_c_review_list4member($target_c_member_id, 5));
     $this->set('profile_list', db_member_c_profile_list());
     // 誕生日まであと何日?
     $this->set('days_birthday', db_member_count_days_birthday4c_member_id($target_c_member_id));
     if (OPENPNE_USE_POINT_RANK) {
         // ポイント
         $point = db_point_get_point($target_c_member_id);
         $this->set("point", $point);
         // ランク
         $this->set("rank", db_point_get_rank4point($point));
     }
     // inc_entry_point
     $this->set('inc_entry_point', fetch_inc_entry_point($this->getView(), 'f_home'));
     return 'success';
 }
开发者ID:KimuraYoichi,项目名称:PukiWiki,代码行数:41,代码来源:h_prof.php

示例12: getHTML

 public function getHTML()
 {
     $container = isset($_SESSION['opensocial_container']) ? $_SESSION['opensocial_container'] : null;
     $page = new Neuron_Core_Template();
     $player = Neuron_GameServer::getPlayer();
     if ($player) {
         $page->set('plid', $player->getId());
     } else {
         $page->set('plid', '');
     }
     if (isset($_SESSION['birthday'])) {
         $page->set('birthday', date('Y-m-d', $_SESSION['birthday']));
         $page->set('age', getAge(date('Y-m-d', $_SESSION['birthday'])));
     }
     if (isset($_SESSION['gender'])) {
         $page->set('gender', $_SESSION['gender']);
     }
     $page->set('container', $container);
     //print_r ($_SESSION);
     return $page->parse('neuron/advertisement/loading.phpt');
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:21,代码来源:Advertisement.php

示例13: getUserInfo

/**
 * Gets user's information from database by user's id
 * @param $sId - user ID
 * @return $aInfo - user info
 */
function getUserInfo($sId)
{
    global $sWomanImageUrl;
    global $sManImageUrl;
    global $sImagesPath;
    global $sProfileUrl;
    global $sRootURL;
    //get info by ID on these fields
    $sNick = "";
    $sSex = "";
    $sAge = "0";
    $sDesc = "";
    $sImg = "";
    $sProfile = "";
    // You should change this query to retrieve user's data correctly
    $aUser = getArray("SELECT * FROM `Profiles` WHERE `ID` = '" . $sId . "' LIMIT 1");
    /**
     * Define photo.
     * If this user has a photo you should define it's uri here.
     * Otherwise a "no_photo" image is used.
     */
    if ((int) $aUser['PrimPhoto'] != 0) {
        $sPhoto = $sImagesPath . $aUser['ID'] . "/thumb_" . getValue("SELECT `med_file` FROM `media` WHERE `med_id`='" . $aUser['PrimPhoto'] . "'");
    } else {
        $sPhoto = $aUser['Sex'] == 'female' ? $sWomanImageUrl : $sManImageUrl;
    }
    $sSex = isset($aUser['Sex']) ? $aUser['Sex'] : "male";
    $sNick = $aUser['NickName'];
    $sAge = isset($aUser['DateOfBirth']) ? getAge($aUser['DateOfBirth']) : "25";
    $sDesc = isset($aUser['DescriptionMe']) ? $aUser['DescriptionMe'] : "";
    $sModRewrite = getValue("SELECT `VALUE` FROM `GlParams` WHERE `Name`='enable_modrewrite' LIMIT 1");
    $sProfile = $sModRewrite == "on" ? $sRootURL . $sNick : $sProfileUrl . "?ID=" . $sId;
    /**
     * Return user info.
     * NOTE. Do not change the return statement order.
     */
    return array("nick" => $sNick, "sex" => $sSex, "age" => $sAge, "desc" => $sDesc, "photo" => $sPhoto, "profile" => $sProfile);
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:43,代码来源:customFunctions.inc.php

示例14: getUserInfo

/**
 * Gets user's information from database by user's id
 * @param $sId - user ID
 * @return $aInfo - user info
 */
function getUserInfo($sId, $bNick = false)
{
    global $sWomanImageUrl;
    global $sManImageUrl;
    global $sProfileUrl;
    global $sRootURL;
    //get info by ID on these fields
    $sNick = "";
    $sSex = "";
    $sAge = "0";
    $sDesc = "";
    $sPhoto = "";
    $sProfile = "";
    //You should change this query to retrieve user's data correctly
    $sWherePart = ($bNick ? "`NickName`" : "`ID`") . " = '" . $sId . "'";
    $aUser = getArray("SELECT * FROM `Profiles` WHERE " . $sWherePart . " LIMIT 1");
    /**
     * Define photo.
     * If this user has a photo you should define it's uri here.
     * Otherwise a "no_photo" image is used.
     */
    $oBaseFunctions = bx_instance("BxBaseFunctions");
    $sSex = !empty($aUser['Sex']) ? $aUser['Sex'] : "male";
    $sPhoto = $oBaseFunctions->getMemberAvatar($sId);
    if (empty($sPhoto)) {
        $sPhoto = $sSex == "male" ? $sManImageUrl : $sWomanImageUrl;
    }
    $sNick = $aUser['NickName'];
    $sAge = isset($aUser['DateOfBirth']) ? getAge($aUser['DateOfBirth']) : "25";
    $sDesc = isset($aUser['DescriptionMe']) ? strip_tags($aUser['DescriptionMe']) : "";
    $sProfile = getParam('enable_modrewrite') == "on" ? $sRootURL . $sNick : $sProfileUrl . "?ID=" . $sId;
    /**
     * Return user info.
     * NOTE. Do not change the return statement order.
     */
    return array("id" => (int) $aUser["ID"], "nick" => $sNick, "sex" => $sSex, "age" => $sAge, "desc" => $sDesc, "photo" => $sPhoto, "profile" => $sProfile);
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:42,代码来源:customFunctions.inc.php

示例15: view

 public function view()
 {
     $uid = intval($_REQUEST['uid']);
     if (!$uid) {
         $this->error('错误用户');
     }
     $userModel = D('User');
     $intentionModel = D('Intention');
     $introModel = D('Intro');
     $userJoinKeywordModel = D('UserJoinKeyword');
     $userJoinFunctionModel = D('UserJoinFunction');
     $jobModel = D('Job');
     $projectModel = D('Project');
     $dictMajorModel = D('DictMajor');
     $dictLocationModel = D('DictLocation');
     $data = array();
     $data['user'] = $userModel->where(" uid = {$uid} ")->find();
     $data['intention'] = $intentionModel->where(" uid = {$uid} ")->find();
     $data['intro'] = $introModel->where(" uid = {$uid} ")->getfield('intro');
     $data['keyword'] = $userJoinKeywordModel->field('keyword.keyword')->join('LEFT JOIN keyword ON user_join_keyword.keyword_id = keyword.id ')->where(" uid = {$uid} ")->select();
     $data['function'] = $userJoinFunctionModel->field('dict_function.function_name')->join('LEFT JOIN dict_function ON user_join_function.function_id = dict_function.function_id ')->where(" uid = {$uid} ")->select();
     $data['job'] = $jobModel->where(" uid = {$uid} ")->select();
     $data['project'] = $projectModel->where(" uid = {$uid} ")->select();
     $data['user']['sex'] = getSex($data['user']['sex']);
     $data['user']['age'] = getAge($data['user']['birthday']);
     $data['user']['birthday'] = getBirthday($data['user']['birthday']);
     $data['user']['workyear'] = getDictValue('WORKYEAR', $data['user']['workyear']);
     $data['user']['location'] = $dictLocationModel->getLocationName($data['user']['location']);
     $data['user']['jobstatus'] = getDictValue('JOBSTATUS', $data['user']['jobstatus']);
     $data['user']['degrees'] = getDictValue('DEGREES', $data['user']['degrees']);
     $data['user']['major'] = $dictMajorModel->getMajorName($data['user']['major']);
     $data['intention']['jobarea'] = $dictLocationModel->getLocationName($data['intention']['jobarea']);
     $data['intention']['salary'] = getDictValue('SALARY', $data['intention']['salary']);
     $this->assign('data', $data);
     $this->assign('title', '查看');
     $this->display();
 }
开发者ID:hanngao,项目名称:ResumeManagementSystem,代码行数:37,代码来源:ResumeAction.class.php


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