本文整理汇总了PHP中gallery::scanForNewImages方法的典型用法代码示例。如果您正苦于以下问题:PHP gallery::scanForNewImages方法的具体用法?PHP gallery::scanForNewImages怎么用?PHP gallery::scanForNewImages使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gallery
的用法示例。
在下文中一共展示了gallery::scanForNewImages方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gallery
<?php
////////////////////////////////////////////////////////////////////////////////
// Copyright (C) ReloadCMS Development Team //
// http://reloadcms.com //
// This product released under GNU General Public License v2 //
////////////////////////////////////////////////////////////////////////////////
$gallery = new gallery();
if (!empty($_POST['rebuild'])) {
$save = false;
if (!empty($_POST['scanfornew'])) {
$gallery->scanForNewImages();
rcms_showAdminMessage(__('Scan for new uploaded images') . '... ' . __('Done'));
$save = true;
}
if (!empty($_POST['cleanupdirs'])) {
$gallery->cleanUpDirectories();
rcms_showAdminMessage(__('Directories cleanup from images not listed in index') . '... ' . __('Done'));
$save = true;
}
if (!empty($_POST['cleanup'])) {
$gallery->scanForRemovedImages();
$gallery->cleanUpIndexes();
rcms_showAdminMessage(__('Indexes cleanup') . '... ' . __('Done'));
$save = true;
}
if ($save) {
$gallery->saveIndexFiles();
}
}
/******************************************************************************
示例2: gallery
<?php
////////////////////////////////////////////////////////////////////////////////
// Copyright (C) ReloadCMS Development Team //
// http://reloadcms.com //
// This product released under GNU General Public License v2 //
////////////////////////////////////////////////////////////////////////////////
rcms_loadAdminLib('file-uploads');
$gallery = new gallery();
// Uploading
if (!empty($_FILES['upload'])) {
$result = '';
if (fupload_array($_FILES['upload'], GALLERY_UPLOAD_DIR, $gallery->img_preg)) {
$new_names = $gallery->scanForNewImages();
foreach ($_FILES['upload']['name'] as $key => $name) {
$keywords = (!empty($_POST['gkeywords']) ? $_POST['gkeywords'] : '') . (!empty($_POST['keywords'][$key]) ? (!empty($_POST['gkeywords']) ? ';' : '') . $_POST['keywords'][$key] : '');
if (!empty($keywords)) {
$gallery->setKeywords(@$new_names[$name], $keywords);
}
if (!empty($_POST['title'][$key])) {
$gallery->setDataValue(@$new_names[$name], 'title', $_POST['title'][$key]);
$result .= '<br/>' . __('Filename') . ': ' . @$new_names[$name] . ' ' . __('Title') . ': ' . $_POST['title'][$key];
} elseif (!empty($_POST['gtitle'])) {
if (!empty($_POST['gadd'])) {
$skey = (int) $_POST['gstart'] + $key;
$snum = str_pad($skey, $_POST['gdigits'], '0', STR_PAD_LEFT);
} else {
$snum = '';
}
$title = $_POST['gtitle'] . $snum;
$gallery->setDataValue(@$new_names[$name], 'title', $title);