Advanced search  


cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.

Pages: [1]   Go Down

Author Topic: layout control  (Read 3762 times)

0 Members and 1 Guest are viewing this topic.


  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 1
layout control
« on: February 16, 2007, 11:05:49 pm »

I am not very sure if i am in a right forum. But i think this is a feature request.

Index.php has a layout control that allows coppermine site manager to control the structure of the layout ( main_page_layout var in config table ). I suggest that the same structure should be copied to other  pages too ( at least to thumbnails and displayimage ). I have hacked this for my thumbnails.php script. I include the script here, so that someone with access to cvs can look at it and maybe take the functionality and put in the next version?

Here is the php that actually does the work:

$elements = preg_split("|/|", $CONFIG['thumbnail_page_layout'], -1, PREG_SPLIT_NO_EMPTY);
foreach ($elements as $element) {
   if (preg_match("/(\w+),*(\d+)*/", $element, $matches)){
       if (!isset($matches[2])) { // added to fix notice about undefined index
            $matches[2] = 0;
        $matches = CPGPluginAPI::filter('plugin_block', $matches);
CPGPluginAPI::filter('pre_'.$matches, null);
     if (is_array($matches)) {
           switch ($matches[1]) {
               case 'breadcrumb':
                   if ($breadcrumb) {
                       if (!(strpos($CONFIG['main_page_layout'], "breadcrumb") === false)) {
                            theme_display_breadcrumb($breadcrumb, $cat_data);
                       theme_display_cat_list($breadcrumb, $cat_data, '');
               case 'thumbnails':
                 if (!$valid) {
                 } else {
                     display_thumbnails($album, (isset($cat) ? $cat : 0), $page, $CONFIG['thumbcols'], $CONFIG['thumbrows'], true);

CPGPluginAPI::filter('post_'.$matches, null);

I also added  pre_* and post* hooks for each block if someone wants to use 'em in their plugins. I'm not very sure if it is done this way in general in coppermine. The included thumbnails.php is a version from cpg 1.4.9 and i hope that there has not been any bigger changes in the script on version 1.4.10
Pages: [1]   Go Up

Page created in 0.017 seconds with 19 queries.