當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BuckysUser::getUserLinks方法代碼示例

本文整理匯總了PHP中BuckysUser::getUserLinks方法的典型用法代碼示例。如果您正苦於以下問題:PHP BuckysUser::getUserLinks方法的具體用法?PHP BuckysUser::getUserLinks怎麽用?PHP BuckysUser::getUserLinks使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BuckysUser的用法示例。


在下文中一共展示了BuckysUser::getUserLinks方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: dirname

<?php

require dirname(__FILE__) . '/includes/bootstrap.php';
//If the user is not logged in, redirect to the index page
if (!($userID = buckys_is_logged_in())) {
    buckys_redirect('/index.php');
}
//Getting UserData from Id
$userData = BuckysUser::getUserLinks($userID);
if (isset($_POST['action'])) {
    //Check the user id is same with the current logged user id
    if ($_POST['userID'] != $userID) {
        echo 'Invalid Request!';
        exit;
    }
    //Save Address
    if ($_POST['action'] == 'save_links') {
        $data = array();
        for ($i = 0; $i < count($_POST['title']); $i++) {
            $data[] = array('title' => $_POST['title'][$i], 'url' => $_POST['url'][$i], 'visibility' => $_POST['visibility'][$i]);
        }
        //Update User Phone numbers
        if (BuckysUser::updateUserLinks($userID, $data)) {
            echo 'Success';
        } else {
            echo $db->getLastError();
        }
        exit;
    }
}
buckys_enqueue_stylesheet('account.css');
開發者ID:kishoreks,項目名稱:BuckysRoom,代碼行數:31,代碼來源:info_links.php

示例2: getLinkInfoAction

 public function getLinkInfoAction()
 {
     $request = $_GET;
     $token = isset($request['TOKEN']) ? trim($request['TOKEN']) : null;
     if (!$token) {
         return ['STATUS_CODE' => STATUS_CODE_BAD_REQUEST, 'DATA' => buckys_api_get_error_result('Api token should not be blank')];
     }
     if (!($userID = BuckysUsersToken::checkTokenValidity($token, "api"))) {
         return ['STATUS_CODE' => STATUS_CODE_UNAUTHORIZED, 'DATA' => buckys_api_get_error_result('Api token is not valid.')];
     }
     $linkInfo = BuckysUser::getUserLinks($userID);
     return ['STATUS_CODE' => STATUS_CODE_OK, 'DATA' => ['STATUS' => 'SUCCESS', 'RESULT' => $linkInfo]];
 }
開發者ID:HAPwebsite,項目名稱:Social-Network-Website,代碼行數:13,代碼來源:accountApi.php


注:本文中的BuckysUser::getUserLinks方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。