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


PHP get_user_data函数代码示例

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


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

示例1: user_avatar_shortcode

function user_avatar_shortcode($parm = '')
{
    global $loop_uid;
    $height = e107::getPref("im_height");
    $width = e107::getPref("im_width");
    $tp = e107::getParser();
    if (intval($loop_uid) > 0 && trim($parm) == "") {
        $parm = $loop_uid;
    }
    if (is_numeric($parm)) {
        if ($parm == USERID) {
            $image = USERIMAGE;
        } else {
            $row = get_user_data(intval($parm));
            $image = $row['user_image'];
        }
    } elseif ($parm) {
        $image = $parm;
    } elseif (USERIMAGE) {
        $image = USERIMAGE;
    } else {
        $image = "";
    }
    if (vartrue($image)) {
        $img = strpos($image, "://") !== false ? $image : $tp->thumbUrl(e_MEDIA . "avatars/" . $image, "aw=" . $width . "&ah=" . $height);
        $text = "<img class='user-avatar e-tip' src='" . $img . "' alt='' style='width:" . $width . "px; height:" . $height . "px' />\n\t\t";
    } else {
        $img = $tp->thumbUrl(e_IMAGE . "generic/blank_avatar.jpg", "aw=" . $width . "&ah=" . $height);
        $text = "<img class='user-avatar' src='" . $img . "' alt='' />";
    }
    return $text;
}
开发者ID:notzen,项目名称:e107,代码行数:32,代码来源:user_avatar.php

示例2: get_message

function get_message()
{
    $id = is_logged_in();
    $ci =& get_instance();
    $ci->load->helper('text');
    $query = $ci->db->query('SELECT * FROM (SELECT * FROM `workstreams` ORDER BY time DESC) AS t where receiver ="' . $id . '" GROUP BY job_id');
    $result = $query->result_object();
    if (!empty($result)) {
        $total = '';
        $liHtml = '';
        foreach ($result as $key => $value) {
            $job_data = job_data('id', $value->job_id, ['slug', 'user_id']);
            $rel = $job_data->user_id == $id ? 'buyer' : 'seller';
            $first_name = get_user_data($value->sender, 'first_name');
            if ($value->is_read == 0) {
                $class = 'active';
                $total++;
            } else {
                $class = '';
            }
            $liHtml .= '<li class=' . $class . '><a href="' . base_url("job/view/" . $job_data->slug . '?rel=' . $rel) . '">' . character_limiter($first_name . ' : ' . $value->message, 55) . '</a></li><hr style="margin-top:5px; margin-bottom:5px">';
        }
        return array('html' => $liHtml, 'total' => $total);
    } else {
        return $liHtml = '<li><a href="javascript:void(0)">No Message</a></li>';
    }
}
开发者ID:Hussu,项目名称:jobdesk,代码行数:27,代码来源:notification_helper.php

示例3: update_password

function update_password($password)
{
    $db = new db();
    $user = get_user_data();
    $id = $user['id'];
    $password = md5($password);
    $result = $db->update("users", array("password" => $password), "id = :id", array(":id" => $id));
    return $result;
}
开发者ID:thuraucsy,项目名称:holiday,代码行数:9,代码来源:user.php

示例4: show_account

function show_account()
{
    $user = get_user_data();
    if ($user) {
        $data['name'] = $user['name'];
        $data['email'] = $user['email'];
        render("account", $data);
    } else {
        redirect("user/signin");
    }
}
开发者ID:thuraucsy,项目名称:holiday,代码行数:11,代码来源:user2.php

示例5: get_user_role

function get_user_role($user_id = 0)
{
    $CI =& get_instance();
    if (!$user_id) {
        $user_data = get_user_data();
        return $user_data['role'];
    }
    $CI->load->model('user_model');
    $row = $CI->user_model->get_where(array('id' => $user_id))->row_array;
    if (!$row) {
        return FALSE;
    }
    return $row['role'];
}
开发者ID:ram-1501,项目名称:rs,代码行数:14,代码来源:common_helper.php

示例6: save_user

function save_user($fbuid, $user_object)
{
    global $mongo;
    $db = $mongo->combined;
    $users = $db->users;
    $users->save($user_object);
    $users->ensureIndex(array('id' => 1), array("unique" => true));
    $user_exists = check_user_exist($fbuid);
    if (!$user_exists) {
        $user_object_id = set_object('user', $fbuid, $fbuid);
        $res->status = 'new';
        return $res;
    } else {
        return get_user_data($fbuid);
    }
}
开发者ID:roieki,项目名称:CE_Core,代码行数:16,代码来源:db_functions.php

示例7: recover

function recover($mode, $email)
{
    $mode = sanitize($mode);
    $email = sanitize($email);
    $user_data = get_user_data(user_id_from_email($email), 'user_id', 'first_name', 'username');
    if ($mode == 'username') {
        email($email, 'Your Username Recovery - Factionizer', "Hello " . $user_data['first_name'] . ",\n\nThank you for using the Factionizer.  Your username is:\n" . $user_data['username'] . "\n\n   ---Factionizer");
    } else {
        if ($mode == 'password') {
            $generated_password = substr(md5(rand(999, 999999)), 0, 8);
            change_password($user_data['user_id'], $generated_password);
            update_user($user_data['user_id'], array('password_recover' => '1'));
            email($email, 'Your Password Recovery - Factionizer', "Hello " . $user_data['first_name'] . ",\n\nThank you for using the Factionizer.  Your password has been reset.  Once you log in with this new password, you will be prompted to change it.\n Your new password is:\n\n" . $generated_password . "\n\n   ---Factionizer");
        } else {
            echo 'Error.';
        }
    }
}
开发者ID:skinnerdev,项目名称:ballin-batman,代码行数:18,代码来源:users.php

示例8: get_user_by_id

/**
 * Retrieves a user from storage by its ID number.
 * @param  int $id              Must be an integer
 * @return mix|boolean|array    Returns the user array if success, returns false if fail.
 */
function get_user_by_id($id)
{
    $output = false;
    $findings = 0;
    $user_found = array();
    foreach (get_user_data() as $user => $attrs) {
        if ($attrs['id'] == $id) {
            $findings = $findings + 1;
            array_push($user_found, $attrs);
        }
    }
    if ($findings === 1) {
        $output = $user_found[0];
        unset($user_found);
    } else {
        unset($user_found);
    }
    return $output;
}
开发者ID:jCalderon80,项目名称:IBS-BlogSystem,代码行数:24,代码来源:iface-functions.php

示例9: send_note_to_email

function send_note_to_email($email, $id)
{
    $db = new db();
    $result = $db->read("notes", "id = :id", array(":id" => $id));
    $subject = "[TinyNote] " . $result[0]['title'];
    $body = "<html><body>";
    $body .= $result[0]['body'];
    $body .= "</body></html>";
    $user = get_user_data();
    $user_id = $user['id'];
    $user_email = $db->get_query("SELECT email FROM users WHERE id={$user_id}");
    $user_email = $user_email[0]['email'];
    $headers = "From: {$user_email}\r\n";
    $headers .= "Reply-To: {$user_email}\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
    @mail($email, $subject, $body, $headers);
    return true;
}
开发者ID:thuraucsy,项目名称:holiday,代码行数:19,代码来源:note.php

示例10: delete_user

function delete_user($username)
{
    // Connect to the DB
    $ret = create_connection($connection);
    if ($ret !== true) {
        return $ret;
    }
    // Validate input
    $ret = validate_input($username);
    if ($ret !== true) {
        $connection->close();
        return $ret;
    }
    // Get user data
    $user_data = get_user_data($username, $connection);
    if ($user_data === false) {
        $connection->close();
        return 'Username provided does not exist';
    }
    // Delete feeds
    if (delete_feeds($user_data, $connection) !== true) {
        $connection->close();
        return 'Error while deleting the feeds';
    }
    // Delete inputs
    if (delete_inputs($user_data, $connection) !== true) {
        $connection->close();
        return 'Error while deleting the inputs';
    }
    // Delete EWatcher panels
    if (delete_ewatcher($user_data, $connection) !== true) {
        $connection->close();
        return 'Error while deleting user configuration (EWatcher)';
    }
    // Delete user
    if (delete_user_data($user_data, $connection) !== true) {
        $connection->close();
        return 'Error while deleting user data';
    }
    $connection->close();
    return true;
}
开发者ID:JSidrach,项目名称:ewatcher-users,代码行数:42,代码来源:delete_query.php

示例11: threadGetUserViewed

 function threadGetUserViewed($uid = USERID)
 {
     $e107 = e107::getInstance();
     if ($uid == USERID) {
         $viewed = $e107->currentUser['user_plugin_forum_viewed'];
     } else {
         $tmp = get_user_data($uid);
         $viewed = $tmp['user_plugin_forum_viewed'];
         unset($tmp);
     }
     return explode(',', $viewed);
 }
开发者ID:notzen,项目名称:e107,代码行数:12,代码来源:forum_class.php

示例12: _

</h2><br/>
	    <div>
		    <p><?php 
    echo _('You\'ll need this license key to');
    ?>
 <a href="http://sendy.co/get-updated" target="_blank" style="text-decoration:underline"><?php 
    echo _('download the latest version of Sendy on our website');
    ?>
</a>.</p>
		    <div class="well"><strong><?php 
    echo get_user_data('license');
    ?>
</strong></div>
	    </div>
	    <h2><?php 
    echo _('Your API key');
    ?>
</h2><br/>
	    <div>
		    <div class="well"><strong><?php 
    echo get_user_data('api_key');
    ?>
</strong></div>
	    </div>
    </div>
    <?php 
}
?>
</div>
<?php 
include 'includes/footer.php';
开发者ID:narareddy,项目名称:sendy,代码行数:31,代码来源:settings.php

示例13: trim

$old_password = trim(htmlspecialchars($_POST["old_password"]));
$new_password = trim(htmlspecialchars($_POST["new_password"]));
$new_password_repeat = trim(htmlspecialchars($_POST["new_password_repeat"]));
// Check cookie, grab username
$user_cookie = $cookie_handler->get_cookie("compsec");
// This case should never happen because the cookie is checked
// on page load, and is deleted if it has been tampered with
if ($cookie_handler->validate_cookie($user_cookie) == false) {
    print "Error: Invalid cookie. The offending cookie has been deleted. Please log in again.";
    $cookie_handler->delete_cookie("compsec");
} else {
    if ($new_password != $new_password_repeat) {
        print "Error: New passwords do not match. Press the back button to try again.";
    } else {
        $uuid = $user_cookie->get_uuid();
        $results = get_user_data($uuid);
        $database_password = $results[2];
        $salt = $results[3];
        // Validate that the supplied password is correct
        $hashed_password = hash("sha512", $old_password . $salt);
        if ($database_password == $hashed_password) {
            // Replace password
            $hashed_new_password = hash("sha512", $new_password . $salt);
            update_user_password($uuid, $hashed_new_password);
            $cookie_handler->delete_cookie("compsec");
            print "Password successfully changed! Please <a href =\"login.php\">log in</a> with your new password.";
        } else {
            print "Error: Invalid password. Press the back button to try again.";
        }
    }
}
开发者ID:newmight2015,项目名称:csc235_project1,代码行数:31,代码来源:process_passwd.php

示例14: exit

<?php

if (!isset($_COOKIE['loggin'])) {
    exit(0);
}
header("Content-type: application/json; charset=utf-8");
include '../mysql_connection.php';
$json = get_user_data($_COOKIE['loggin']);
if (!is_null($json)) {
    echo $json;
}
开发者ID:zolken,项目名称:InvisibleFriend,代码行数:11,代码来源:get_user_info.php

示例15: OUT

                        </td><td width=50%><?php 
                    OUT(gethours($adata["time"]) . ":" . getmins($adata["time"]) . ":" . getsecs($adata["time"]));
                    ?>
</td></tr>                        
                      </table>
                    </td>
                  </table>                
                  <table width=100%><td width=35% class=tbl1 align=left>
                  <td align=center class=tbl1 width=32%>
                    <a href="<?php 
                    OUT("?p={$p}&act=stats&action=sessions&user=" . $data["user"]);
                    ?>
">статистика</a>  
                  </td> <td align=center class=tbl1 width=32%>
                    <?php 
                    $ud = get_user_data($data["uid"]);
                    if ($ud["level"] < $CURRENT_USER["level"] || $CURRENT_USER["id"] == $ud["id"]) {
                        ?>
<a href="<?php 
                        OUT("?p={$p}&act={$act}&action=add&mode=edit&uid=" . $data["uid"]);
                        ?>
">редактировать</a> <?php 
                    }
                    ?>
                  
                  </td></table><br>    
     <?php 
                }
            }
            if (isset($show) && $show == "tbl") {
                echo "</table>";
开发者ID:aricent123,项目名称:cadbis,代码行数:31,代码来源:admin_edit_user.php


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