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


PHP account::setPhoto方法代码示例

本文整理汇总了PHP中account::setPhoto方法的典型用法代码示例。如果您正苦于以下问题:PHP account::setPhoto方法的具体用法?PHP account::setPhoto怎么用?PHP account::setPhoto使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在account的用法示例。


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

示例1: header

 case "ghost_set":
     $account->setGhost(1);
     header("Location: /admin/profile.php/?id=" . $accountInfo['id']);
     break;
 case "ghost_unset":
     $account->setGhost(0);
     header("Location: /admin/profile.php/?id=" . $accountInfo['id']);
     break;
 case "delete-cover":
     $data = array("originCoverUrl" => '', "normalCoverUrl" => '');
     $account->setCover($data);
     header("Location: /admin/profile.php/?id=" . $accountInfo['id']);
     break;
 case "delete-photo":
     $data = array("originPhotoUrl" => '', "normalPhotoUrl" => '', "lowPhotoUrl" => '');
     $account->setPhoto($data);
     header("Location: /admin/profile.php/?id=" . $accountInfo['id']);
     break;
 default:
     if (!empty($_POST)) {
         $authToken = isset($_POST['authenticity_token']) ? $_POST['authenticity_token'] : '';
         $username = isset($_POST['username']) ? $_POST['username'] : '';
         $fullname = isset($_POST['fullname']) ? $_POST['fullname'] : '';
         $location = isset($_POST['location']) ? $_POST['location'] : '';
         $balance = isset($_POST['balance']) ? $_POST['balance'] : 0;
         $fb_page = isset($_POST['fb_page']) ? $_POST['fb_page'] : '';
         $instagram_page = isset($_POST['instagram_page']) ? $_POST['instagram_page'] : '';
         $email = isset($_POST['email']) ? $_POST['email'] : '';
         $username = helper::clearText($username);
         $username = helper::escapeText($username);
         $fullname = helper::clearText($fullname);
开发者ID:JohnWilliamsMSU,项目名称:Steady,代码行数:31,代码来源:profile.php

示例2: auth

    $auth = new auth($dbo);
    if (!$auth->authorize($accountId, $accessToken)) {
        api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
    }
    if (isset($_FILES['uploaded_file']['name'])) {
        $uploaded_file = $_FILES['uploaded_file']['tmp_name'];
        $uploaded_file_name = basename($_FILES['uploaded_file']['name']);
        $uploaded_file_ext = pathinfo($_FILES['uploaded_file']['name'], PATHINFO_EXTENSION);
        try {
            $time = time();
            if (!move_uploaded_file($_FILES['uploaded_file']['tmp_name'], "../../" . TEMP_PATH . "{$time}." . $uploaded_file_ext)) {
                // make error flag true
                $response['error'] = true;
                $response['message'] = 'Could not move the file!';
            }
            $imglib = new imglib($dbo);
            $response = $imglib->createPhoto("../../" . TEMP_PATH . "{$time}." . $uploaded_file_ext);
            unset($imglib);
            if ($response['error'] === false) {
                $account = new account($dbo, $accountId);
                $account->setPhoto($response);
            }
        } catch (Exception $e) {
            // Exception occurred. Make error flag true
            $response['error'] = true;
            $response['message'] = $e->getMessage();
        }
    }
    // Echo final json response to client
    echo json_encode($response);
}
开发者ID:JohnWilliamsMSU,项目名称:Steady,代码行数:31,代码来源:profile.uploadPhoto.inc.php


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