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


PHP Club::stock方法代码示例

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


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

示例1: Club

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== TRUE) {
    die;
}
CModule::IncludeModule("iblock");
global $USER;
$CLUB_ID = $arParams["CLUB_ID"];
$club = new Club($CLUB_ID);
$array = array("stocks" => array("name" => "Действующие акции", "list" => array(), "show" => false), "event" => array("name" => "Предстоящие события", "list" => array(), "show" => false));
$stokRes = $club->stock();
$eventRes = $club->event();
$countSock = $stokRes->getCount();
$countEvent = $eventRes->getCount();
if ($countSock[$CLUB_ID] > 0) {
    $array["stocks"]["list"] = $stokRes->getListArray(array(">=DATE_ACTIVE_TO" => date("d.m.Y")));
    $array["stocks"]["show"] = true;
    $arResult["LIST"]["stocks"] = $array["stocks"];
}
if ($countEvent[$CLUB_ID] > 0) {
    $array["event"]["list"] = $eventRes->getListArray(array(">=DATE_ACTIVE_TO" => date("d.m.Y")));
    $array["event"]["show"] = true;
    $arResult["LIST"]["event"] = $array["event"];
}
$arResult["CLUB_ID"] = $CLUB_ID;
$arResult["CLUB"] = $club->getInfo(array("arSelect" => array("NAME", "PREVIEW_PICTURE")));
$this->IncludeComponentTemplate();
开发者ID:nProfessor,项目名称:Mytb,代码行数:27,代码来源:component.php

示例2: 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());
$stockID = intval($_POST['stockID']);
$clubID = Club::getClubID($userID);
if ($userID <= 0) {
    die;
}
$filename = translate(basename($_FILES['myfile']['name']));
if (!preg_match("#^.*\\.(jpg|png|gif)\$#i", $filename)) {
    die;
}
$uploaddir = $_SERVER['DOCUMENT_ROOT'] . "/upload/tmp/" . $userID . "/";
if (!file_exists($uploaddir)) {
    @mkdir($uploaddir);
}
$uploadfile = $uploaddir . $filename;
move_uploaded_file($_FILES['myfile']['tmp_name'], $uploadfile);
$BX_image = CFile::MakeFileArray($uploadfile);
$el = new CIBlockElement();
$arLoadProductArray = array("MODIFIED_BY" => $USER->GetID(), "DETAIL_PICTURE" => $BX_image);
$res = $el->Update($stockID, $arLoadProductArray);
$club = new Club($clubID);
$pic = $club->stock()->getInfo($stockID);
$arFile = CFile::GetFileArray($pic["DETAIL_PICTURE"]);
echo imgurl($arFile['SRC'], array("w" => intval($_POST["w"]), "h" => intval($_POST["h"])));
开发者ID:nProfessor,项目名称:Mytb,代码行数:31,代码来源:club_stock_img.php


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