本文整理汇总了PHP中Club::updateLogo方法的典型用法代码示例。如果您正苦于以下问题:PHP Club::updateLogo方法的具体用法?PHP Club::updateLogo怎么用?PHP Club::updateLogo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Club
的用法示例。
在下文中一共展示了Club::updateLogo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: imgurl
* Date: 12.09.12
* Time: 21:15
* To change this template use File | Settings | File Templates.
*/
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
CModule::IncludeModule("iblock");
global $USER;
$userID = intval($USER::GetID());
if ($userID <= 0) {
die;
}
$filename = translate(basename($_FILES['myfile']['name']));
if (!preg_match("#^.*\\.(jpg|png|gif)\$#i", $filename)) {
die;
}
$uploaddir = $_SERVER['DOCUMENT_ROOT'] . "/upload/profile/" . $userID . "/";
if (!file_exists($uploaddir)) {
@mkdir($uploaddir);
}
$uploadfile = $uploaddir . $filename;
move_uploaded_file($_FILES['myfile']['tmp_name'], $uploadfile);
$BX_image = CFile::MakeFileArray($uploadfile);
$user = new CUser();
$fields = array("PERSONAL_PHOTO" => $BX_image);
$user->Update($userID, $fields);
$userRes = new User($userID);
$props = $userRes->getProps(array("PROPERTY_CLUB"));
$clubID = $props['PROPERTY_CLUB_VALUE'];
$club = new Club($clubID);
$club->updateLogo($BX_image);
echo imgurl("/upload/profile/{$userID}/{$filename}", array("w" => intval($_POST["w"]), "h" => intval($_POST["h"])));