Advanced search  

News:

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.
[more]

Pages: [1]   Go Down

Author Topic: Multiple Catagory Columns  (Read 2354 times)

0 Members and 1 Guest are viewing this topic.

Bacchus72

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Multiple Catagory Columns
« on: November 17, 2008, 06:11:32 pm »

I am looking for a hack to have multiple columns for my columns/albums. Basically, I want to save vertical space, and the present set up takes up too much space.

I have searched the forums, and I have only come across older threads about older release (1.3.x), which of course no longer applies to the new themes/album.

I have lots of categories, and lots of albums, and I want them all to display (actually, I'd like for the categories to be none-clickable, and only the albums be clickable. So the categories would be more like titles). Preferably, their would be 2-3 columns.

I'd really appreciate any help/direction on this.

Best,

Rob
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Multiple Catagory Columns
« Reply #1 on: November 17, 2008, 10:09:39 pm »

The thread http://coppermine-gallery.net/forum/index.php?topic=15400.msg107765#msg107765 on the cpg1.3.x board applies still applies. Here's what I use on my personal page:
Code: [Select]
function theme_display_cat_list($breadcrumb, &$cat_data, $statistics)
{
  // Taken from http://coppermine-gallery.net/forum/index.php?topic=15400.msg107765#msg107765
  global $template_cat_list, $lang_cat_list;

  starttable('100%');

  if (count($cat_data) > 0) {
    $template = template_extract_block($template_cat_list, 'header');
    $params = array('{CATEGORY}' => $lang_cat_list['category'],
    '{ALBUMS}' => $lang_cat_list['albums'],
    '{PICTURES}' => $lang_cat_list['pictures'],
    );
    echo template_eval($template, $params);
  }

  $template_noabl = template_extract_block($template_cat_list, 'catrow_noalb');
  $template = template_extract_block($template_cat_list, 'catrow');
  $template_blank = template_extract_block($template_cat_list, 'catrow_blank');

  $count=0;
  $columnCount=2;
  echo "<tr>";

  foreach($cat_data as $category) {
    $count++;
    if (count($category) == 3) {
      if ($count%$columnCount==0) {
        $params = array('{DEBUG}' => "");
        echo template_eval($template_blank, $params);
      }
      $params = array('{CAT_TITLE}' => $category[0],
                '{CAT_THUMB}' => $category['cat_thumb'],
                '{CAT_DESC}' => $category[1],
                '{DEBUG}' => ""
      );
      $count=0;
      echo template_eval($template_noabl, $params);
    } else {
      $params = array('{CAT_TITLE}' => $category[0],
                '{CAT_THUMB}' => $category['cat_thumb'],
                '{CAT_DESC}' => $category[1],
                '{CAT_ALBUMS}' => $category['cat_albums'],
                '{ALB_COUNT}' => $category[2],
                '{PIC_COUNT}' => $category[3],
                '{DEBUG}' => ""
      );
      echo template_eval($template, $params);
    }
    if ($count%$columnCount==0) {
      echo "</tr>\n\r <tr>";
    }
  }

   echo "</tr>";
    if ($statistics && count($cat_data) > 0) {
        $template = template_extract_block($template_cat_list, 'footer');
        $params = array('{STATISTICS}' => $statistics);
        echo template_eval($template, $params);
    }
    endtable();

    if (count($cat_data) > 0)
        echo template_extract_block($template_cat_list, 'spacer');
}
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.