コード例 #1
0
ファイル: index.php プロジェクト: rair/yacs
     $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
0
ファイル: index.php プロジェクト: rair/yacs
// 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);
    }