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


PHP account::setCover方法代码示例

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


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

示例1: 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->createCover("../../" . TEMP_PATH . "{$time}." . $uploaded_file_ext, "../../" . TEMP_PATH . "{$time}." . $uploaded_file_ext);
            unset($imgLib);
            if ($response['error'] === false) {
                $account = new account($dbo, $accountId);
                $account->setCover($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.uploadCover.inc.php

示例2: header

     break;
 case "unverify":
     $account->setVerify(0);
     header("Location: /admin/profile.php/?id=" . $accountInfo['id']);
     break;
 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'] : '';
开发者ID:JohnWilliamsMSU,项目名称:Steady,代码行数:31,代码来源:profile.php


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