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: Removing 'Albums' and 'Files' columns on main page  (Read 3221 times)

0 Members and 1 Guest are viewing this topic.

deadele

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Removing 'Albums' and 'Files' columns on main page
« on: April 29, 2012, 06:31:06 am »

Hi..

Just wondering if it's possible to remove 'Albums' and 'Files' column on the main page only. So when it goes to sub-category page, it will still show the two columns.

I have tried the solution given here : http://forum.coppermine-gallery.net/index.php?topic=74523.0 (tweaked it a bit so it would only display one column of category) but can't figure out how to have the two columns still displayed on sub-category.

I hope it's clear as to what i'm trying to achieve..
thank you!

Gallery link: http://ash-benson.org/gallery
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Removing 'Albums' and 'Files' columns on main page
« Reply #1 on: April 29, 2012, 09:51:20 am »

Please post your current code.
Logged

deadele

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Removing 'Albums' and 'Files' columns on main page
« Reply #2 on: May 03, 2012, 01:58:31 am »

i simply just removed the other {CATEGORY} table.. is this the code you were asking for? thanks again!

Code: [Select]
/******************************************************************************
** Section <<<$template_cat_list>>> - START
******************************************************************************/
// HTML template for the category list
$template_cat_list = <<<EOT
<!-- BEGIN header -->
        <tr>
                <td class="tableh1" width="100%" align="left">{CATEGORY}</td>
        </tr>
<!-- END header -->
<!-- BEGIN catrow_noalb -->
        <tr>
                <td class="catrow_noalb" colspan="6"><table border="0"><tr><td align="left">{CAT_THUMB}</td><td align="left"><span class="catlink">{CAT_TITLE}</span>{CAT_DESC}</td></tr></table></td>
        </tr>
<!-- END catrow_noalb -->
<!-- BEGIN catrow -->
                <td class="catrow" align="left"><table border="0"><tr><td>{CAT_THUMB}</td><td><span class="catlink">{CAT_TITLE}</span>{CAT_DESC}</td></tr></table></td>
<!-- END catrow -->
<!-- BEGIN footer -->
        <tr>
                <td colspan="6" class="tableh1" align="center"><span class="statlink">{STATISTICS}</span></td>
        </tr>
<!-- END footer -->
<!-- BEGIN spacer -->
        <img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->

EOT;
/******************************************************************************
** Section <<<$template_cat_list>>> - END
******************************************************************************/


/******************************************************************************
** Section <<<theme_display_cat_list>>> - START
******************************************************************************/
function theme_display_cat_list($breadcrumb, &$cat_data, $statistics)
{
    global $template_cat_list, $lang_cat_list;
    if (count($cat_data) > 0) {
        starttable('100%');
        $template = template_extract_block($template_cat_list, 'header');
        $params = array(
                '{CATEGORY}' => $lang_cat_list['category'],
        );
        echo template_eval($template, $params);
    }

    $template_noalb = template_extract_block($template_cat_list, 'catrow_noalb');
    $template = template_extract_block($template_cat_list, 'catrow');

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

    foreach($cat_data as $category) {
        $count++;
        if (!isset($category['cat_thumb'])) { $category['cat_thumb'] = ''; }
        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],
            );
            $count=0;
            echo template_eval($template_noalb, $params);
        } elseif (isset($category['cat_albums']) && ($category['cat_albums'] != '')) {
            $params = array(
                    '{CAT_TITLE}' => $category[0],
                    '{CAT_THUMB}' => $category['cat_thumb'],
                    '{CAT_DESC}' => $category[1],
                    '{CAT_ALBUMS}' => $category['cat_albums'],
            );
            echo template_eval($template, $params);
        } else {
            $params = array(
                    '{CAT_TITLE}' => $category[0],
                    '{CAT_THUMB}' => $category['cat_thumb'],
                    '{CAT_DESC}' => $category[1],
                    '{CAT_ALBUMS}' => '',
            );
            echo template_eval($template, $params);
        }
        if ($count%$columnCount==0) {
            echo "</tr> <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);
    }


    if (count($cat_data) > 0)
          endtable();
        echo template_extract_block($template_cat_list, 'spacer');
}
/******************************************************************************
** Section <<<theme_display_cat_list>>> - END
******************************************************************************/
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Removing 'Albums' and 'Files' columns on main page
« Reply #3 on: May 03, 2012, 08:39:30 am »

Basically that was the code I was asking for. Unfortunately your tweak doesn't work:
tweaked it a bit so it would only display one column of category
so it's maybe easier to start from scratch. Please explain what you want to display where.

1.) on the main page you want to display your categories in one column and remove the albums and files count?
2.) on all other pages you want to display your categories in two columns and remove the albums and files count?

Correct?
Logged

deadele

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Removing 'Albums' and 'Files' columns on main page
« Reply #4 on: May 29, 2012, 08:33:47 am »

Sorry for the late reply Andre! D:
but yes thats exactly what I am trying to achieve. thank you.. :)
Logged
Pages: [1]   Go Up
 

Page created in 0.027 seconds with 19 queries.