Ejemplo n.º 1
0
            $page = (int) $_GET['page'] - 1;
        } else {
            $page = 0;
        }
        $start = $page * $perpage;
        $total = $perpage;
    } else {
        $pages = 1;
        $page = 0;
        $start = 0;
        $total = sizeof($files);
    }
    $keys = @array_keys($files);
    $pagination = rcms_pagination(sizeof($files), $perpage, $page + 1, '?' . $_SERVER['QUERY_STRING']);
    //Output
    if (!empty($pagination)) {
        $frm->addrow($pagination);
    }
    $c = $start;
    while ($total > 0 && $c < sizeof($keys)) {
        $filename =& $files[$keys[$c]];
        $data = $gallery->getData($filename);
        $frm->addrow($filename . ' aka ' . $frm->text_box('title[' . $filename . ']', $data['title']) . '<br/>' . __('Keywords') . ': ' . $frm->text_box('keywords[' . $filename . ']', @$data['keywords']) . '<br/>' . $data['type'] . '(' . $data['size'] . ')<br/>' . $frm->checkbox('delete[' . $filename . ']', 'true', __('Delete')), $gallery->getThumbnail($filename), 'top');
        $total--;
        $c++;
    }
    $frm->addmessage(__('To divide keywords use ; symbol'));
} else {
    $frm->addmessage(__('Nothing founded'));
}
$frm->show();
Ejemplo n.º 2
0
<?php

////////////////////////////////////////////////////////////////////////////////
//   Copyright (C) ReloadCMS Development Team                                 //
//   http://reloadcms.com                                                     //
//   This product released under GNU General Public License v2                //
////////////////////////////////////////////////////////////////////////////////
$gallery = new gallery();
$images = $gallery->getFullImagesList();
if (!empty($images)) {
    $i = rand(0, sizeof($images) - 1);
    $id = 0;
    foreach ($images as $filename) {
        if ($id == $i) {
            show_window(__('Random image'), '<a href="?module=gallery&amp;id=' . $filename . '">' . $gallery->getThumbnail($filename) . '</a>', 'center');
            break;
        }
        $id++;
    }
}
Ejemplo n.º 3
0
         } else {
             $result .= __('Cannot update title') . ': ' . $filename . '<br/>';
         }
         if (@$current['keywords'] !== $_POST['keywords']) {
             if ($gallery->changeKeywords($filename, $_POST['keywords'])) {
                 $result .= __('Keywords updated') . ': ' . $filename . '<br/>';
             } else {
                 $result .= __('Cannot update keywords') . ': ' . $filename . '<br/>';
             }
         }
         $gallery->saveIndexFiles();
     }
     $current = $gallery->getData(basename($_GET['edit']));
     $frm = new InputForm('', 'post', __('Submit'));
     $frm->hidden('save', 1);
     $frm->addrow(__('Title') . ': ' . $frm->text_box('title', $current['title']) . '<br/>' . __('Keywords') . ': ' . $frm->text_box('keywords', @$current['keywords']) . '<br/>' . $current['type'] . '(' . $current['size'] . ')<br/>' . $frm->checkbox('delete', $filename, __('Delete')), $gallery->getThumbnail($filename), 'top');
     $frm->addmessage(__('To divide keywords use ; symbol'));
     if (!empty($result)) {
         show_window($gallery_link . ' &rarr; ' . __('Result'), $result);
     }
     show_window($gallery_link . ' &rarr; ' . __('Edit') . ' ' . $filename, $frm->show(true) . back_button());
 }
 $result = '';
 if (!empty($_GET['delete'])) {
     $filename = $_GET['delete'];
     if ($gallery->removeImage($filename)) {
         $result .= __('Image removed') . ': ' . $filename . '<br/>';
     } else {
         $result .= __('Error occurred') . ': ' . $filename . '<br/>';
     }
 }
Ejemplo n.º 4
0
    }
    if (!empty($system->config['perpage'])) {
        $pages = ceil(sizeof($images) / $system->config['perpage']);
        if (!empty($_GET['page']) && (int) $_GET['page'] > 0) {
            $page = (int) $_GET['page'] - 1;
        } else {
            $page = 0;
        }
        $start = $page * $system->config['perpage'];
        $total = $system->config['perpage'];
    } else {
        $pages = 1;
        $page = 0;
        $start = 0;
        $total = sizeof($images);
    }
    $keys = @array_keys($images);
    $data['pagination'] = rcms_pagination(sizeof($images), $system->config['perpage'], $page + 1, '?' . $_SERVER['QUERY_STRING']);
    $c = $start;
    $data['images'] = array();
    while ($total > 0 && $c < sizeof($keys)) {
        $image =& $images[$keys[$c]];
        if ($image_data = $gallery->getData($image)) {
            $data['images'][$image] = $image_data + array('thumbnail' => $gallery->getThumbnail($image), 'comments' => $gallery->countComments($image));
        }
        $total--;
        $c++;
    }
    $data['linkdata'] = $linkdata;
    show_window('<a href="?module=gallery">' . __('Gallery') . '</a>' . (cfr('GALLERY') ? '&nbsp;' . edit_button(ADMIN_FILE . '?show=module&id=gallery.upload&tab=5') : '') . (get('keyword') ? ' &rarr; ' . get('keyword') : ''), !empty($images) ? rcms_parse_module_template('gallery.tpl', $data) : __('Nothing founded'), 'center');
}