Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Multiple Catagory Columns  (Read 2486 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.017 seconds with 20 queries.