本文整理汇总了PHP中Listing::GetLimitPhotoUpload方法的典型用法代码示例。如果您正苦于以下问题:PHP Listing::GetLimitPhotoUpload方法的具体用法?PHP Listing::GetLimitPhotoUpload怎么用?PHP Listing::GetLimitPhotoUpload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Listing
的用法示例。
在下文中一共展示了Listing::GetLimitPhotoUpload方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SavePhotoListing
/**
* @Author: ANH DUNG Aug 12, 2014
* @Todo: save photo listing upload
* @Param: $model model
*/
public static function SavePhotoListing($model)
{
$uid = Yii::app()->user->id;
if (isset($_FILES['Listing']['name']['photo_listing_anhdung']) && count($_FILES['Listing']['name']['photo_listing_anhdung'])) {
$cMaxDisplay = ProListingPhotos::GetMaxDisplayOrder($model->id);
foreach ($_FILES['Listing']['name']['photo_listing_anhdung'] as $key => $item) {
if (Listing::CountPhotoListing($model->id) >= Listing::GetLimitPhotoUpload()) {
return;
}
$mFile = new ProListingPhotos();
$mFile->FileValidate = CUploadedFile::getInstanceByName('Listing[photo_listing_anhdung][' . $key . ']');
$mFile->validate();
if (!$mFile->hasErrors()) {
$ext = $mFile->FileValidate->getExtensionName();
$mFile->image = $uid . "-" . time() . ActiveRecord::randString() . $key . '.' . $ext;
// file name
$mFile->listing_id = $model->id;
$mFile->default = 0;
$mFile->display_order = ++$cMaxDisplay;
$mFile->save();
Listing::saveFile($mFile, 'FileValidate', $mFile->image);
Listing::ResizePhotoListing($mFile);
Listing::PutWarterMarkPhotoListing($mFile);
Listing::ResizePhotoListingSmall($mFile);
}
}
Listing::AutoSetCoverPhotoListing($model->id);
}
}