本文整理匯總了PHP中Images::stat方法的典型用法代碼示例。如果您正苦於以下問題:PHP Images::stat方法的具體用法?PHP Images::stat怎麽用?PHP Images::stat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Images
的用法示例。
在下文中一共展示了Images::stat方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
$cells = array();
$size = '';
if ($stats['total_size']) {
$size = ' (' . Skin::build_number($stats['total_size']) . ')';
}
$cells[] = Skin::build_link('files/', SQL::table_name('files'), 'basic') . $size;
$cells[] = 'center=' . $stats['count'];
$cells[] = 'center=' . ($stats['oldest_date'] ? Skin::build_date($stats['oldest_date']) : '--');
$cells[] = 'center=' . ($stats['newest_date'] ? Skin::build_date($stats['newest_date']) : '--');
$text .= Skin::table_row($cells, $lines++);
} else {
$text .= Skin::table_row(array(SQL::table_name('files'), i18n::s('unknown or empty table'), ' ', ' '), $lines++);
}
// images
include_once '../images/images.php';
if ($stats = Images::stat()) {
$cells = array();
$size = '';
if ($stats['total_size']) {
$size = ' (' . Skin::build_number($stats['total_size']) . ')';
}
$cells[] = Skin::build_link('images/', SQL::table_name('images'), 'basic') . $size;
$cells[] = 'center=' . $stats['count'];
$cells[] = 'center=' . ($stats['oldest_date'] ? Skin::build_date($stats['oldest_date']) : '--');
$cells[] = 'center=' . ($stats['newest_date'] ? Skin::build_date($stats['newest_date']) : '--');
$text .= Skin::table_row($cells, $lines++);
} else {
$text .= Skin::table_row(array(SQL::table_name('images'), i18n::s('unknown or empty table'), ' ', ' '), $lines++);
}
// issues
if ($row = SQL::table_stat('issues')) {
示例2: load_skin
// load the skin
load_skin('images');
// the maximum number of images per page
if (!defined('IMAGES_PER_PAGE')) {
define('IMAGES_PER_PAGE', 50);
}
// the title of the page
$context['page_title'] = i18n::s('Images');
// this page is really only for associates
if (!Surfer::is_associate()) {
Safe::header('Status: 401 Unauthorized', TRUE, 401);
Logger::error(i18n::s('You are not allowed to perform this operation.'));
// display the index
} else {
// count images in the database
$stats = Images::stat();
if ($stats['count']) {
$context['page_menu'] += array('_count' => sprintf(i18n::ns('%d image', '%d images', $stats['count']), $stats['count']));
}
// navigation commands for images, if necessary
if ($stats['count'] > IMAGES_PER_PAGE) {
$home = 'images/';
if ($context['with_friendly_urls'] == 'Y') {
$prefix = $home . 'index.php/';
} elseif ($context['with_friendly_urls'] == 'R') {
$prefix = $home;
} else {
$prefix = $home . '?page=';
}
$context['page_menu'] += Skin::navigate($home, $prefix, $stats['count'], IMAGES_PER_PAGE, $page);
}