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: More colums in sub categories  (Read 5245 times)

0 Members and 1 Guest are viewing this topic.

fersauce

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
More colums in sub categories
« on: September 11, 2011, 11:39:54 am »

Hy there everybody.

In need to show two or three colums of sub categories whitout liks of archives and pages because I have a lot of sub categories and its page is very large.

these is my gallery in 1.4 http://www.fotoserver.es/server/index.php
and this is in 1.5 http://www.fotoserver.es/server2/index.php

Thanks a lot
Logged

fersauce

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: More colums in sub categories
« Reply #1 on: September 12, 2011, 09:38:11 am »

Nobody replies?

What I meen is this: Now I see this

Categories
   Subcat
   Subcat
   Subcat
    ...

And I need this

Categories
   Subcat  Subcat   Subcat
   Subcat  Subcat   Subcat
   Subcat  Subcat   Subcat
   ....

In this link http://www.fotoserver.es/server2/index.php you can register like  User: invitado   Pass: invitado

Thanks

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: More colums in sub categories
« Reply #2 on: September 12, 2011, 02:14:06 pm »

Quote
<!--Coppermine Photo Gallery 1.5.12 (stable)-->

You should upgrade to cpg1.5.16.



The following code is maybe not the final solution, but for a start copy it to your theme's theme.php file:
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" colspan="3">{CATEGORY}</td>
        </tr>
<!-- END header -->
<!-- BEGIN catrow_noalb -->
                <td class="catrow_noalb"><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>
<!-- 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="3" 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'],
                '{ALBUMS}' => $lang_cat_list['albums'],
                '{PICTURES}' => $lang_cat_list['pictures'],
        );
        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;
    echo "<tr>";
    foreach($cat_data as $category) {
        if ($count%3 == 0) {
            echo "</tr><tr>";
        }
        $count++;
        if (!isset($category['cat_thumb'])) { $category['cat_thumb'] = ''; }
        if (count($category) == 3) {
            $params = array(
                    '{CAT_TITLE}' => $category[0],
                    '{CAT_THUMB}' => $category['cat_thumb'],
                    '{CAT_DESC}' => $category[1],
            );
            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'],
                    '{ALB_COUNT}' => cpg_float2decimal($category[2]),
                    '{PIC_COUNT}' => cpg_float2decimal($category[3]),
            );
            echo template_eval($template, $params);
        } else {
            $params = array(
                    '{CAT_TITLE}' => $category[0],
                    '{CAT_THUMB}' => $category['cat_thumb'],
                    '{CAT_DESC}' => $category[1],
                    '{CAT_ALBUMS}' => '',
                    '{ALB_COUNT}' => cpg_float2decimal($category[2]),
                    '{PIC_COUNT}' => cpg_float2decimal($category[3]),
            );
            echo template_eval($template, $params);
        }
    }
    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

fersauce

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: More colums in sub categories
« Reply #3 on: September 13, 2011, 05:45:22 pm »

THAKS A LOT ANDRÉ!!!

Its almost perfect.

May I ask you two more things?

1.- Cat_title and cat_description just behind the cat_thum (not it is on the right)
2.- A break before each category name

it's posible?

You can see yor mods here http://www.fotoserver.es/server2/index.php

user:  invitado
pass:  invitado


Thaks.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: More colums in sub categories
« Reply #4 on: September 19, 2011, 01:32:12 pm »

1.- Cat_title and cat_description just behind the cat_thum (not it is on the right)
Do you mean "below" the thumbnail?


2.- A break before each category name
What do you mean with a "break"?
Logged

fersauce

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: More colums in sub categories
« Reply #5 on: September 20, 2011, 12:00:09 am »

I´sorry

of course I meant below de thumnail, centered.

Now with your mod i see these

Cat sub

Logged

fersauce

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: More colums in sub categories
« Reply #6 on: September 20, 2011, 12:05:23 am »

I'm so sorry

of course I meant below de thumnail, and centered.

Now with your mod i see these

Cat         subcat     subcat
subcat     subcat     subcat
subcat      Cat         subcat
subcat     subcat

An I need these

Cat
subcat    subcat    subcat
subcat    subcat    subcat
Cat
subcat    subcat    subcat

etc


Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: More colums in sub categories
« Reply #7 on: September 20, 2011, 04:14:19 pm »

Try this updated code:
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" colspan="3">{CATEGORY}</td>
        </tr>
<!-- END header -->
<!-- BEGIN catrow_noalb -->
                <td class="catrow_noalb" align="left"><table border="0"><tr><td align="center">{CAT_THUMB}<span class="catlink">{CAT_TITLE}</span>{CAT_DESC}</td></tr></table></td>
<!-- END catrow_noalb -->
<!-- BEGIN catrow -->
                <td class="catrow" align="left"><table border="0"><tr><td align="center">{CAT_THUMB}<span class="catlink">{CAT_TITLE}</span>{CAT_DESC}</td></tr></table></td>
<!-- END catrow -->
<!-- BEGIN footer -->
        <tr>
                <td colspan="3" 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'],
                '{ALBUMS}' => $lang_cat_list['albums'],
                '{PICTURES}' => $lang_cat_list['pictures'],
        );
        echo template_eval($template, $params);
    }

    $template_noalb = template_extract_block($template_cat_list, 'catrow_noalb');
    $template = template_extract_block($template_cat_list, 'catrow');
    $cols = 3;
    $count = 0;
    echo "<tr>";
    foreach($cat_data as $category) {
        if ($count%$cols == 0) {
            echo "</tr><tr>";
        }
        $count++;
        if (!isset($category['cat_thumb'])) { $category['cat_thumb'] = ''; }
        if (count($category) == 3) {
            $params = array(
                    '{CAT_TITLE}' => $category[0],
                    '{CAT_THUMB}' => $category['cat_thumb'],
                    '{CAT_DESC}' => $category[1],
            );
            $cell = 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'],
                    '{ALB_COUNT}' => cpg_float2decimal($category[2]),
                    '{PIC_COUNT}' => cpg_float2decimal($category[3]),
            );
            $cell = template_eval($template, $params);
        } else {
            $params = array(
                    '{CAT_TITLE}' => $category[0],
                    '{CAT_THUMB}' => $category['cat_thumb'],
                    '{CAT_DESC}' => $category[1],
                    '{CAT_ALBUMS}' => '',
                    '{ALB_COUNT}' => cpg_float2decimal($category[2]),
                    '{PIC_COUNT}' => cpg_float2decimal($category[3]),
            );
            $cell = template_eval($template, $params);
        }
        if (!strpos($category['cat_thumb'], '<img src="images/spacer.gif"')) {
            $cell = str_replace('<td class', '<td colspan="'.$cols.'" class', $cell);
            echo $cell;
            echo "</tr><tr>";
            $count = 0;
        } else {
            echo $cell;
        }
    }
    while ($count++%$cols != 0) {
        echo "<td class=\"catrow_noalb\"></td>";
    }
    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
******************************************************************************/
« Last Edit: September 20, 2011, 04:21:01 pm by Αndré »
Logged

fersauce

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: More colums in sub categories
« Reply #8 on: October 03, 2011, 01:14:19 pm »

Hello Andre.
Now its perfect, than you a lot.

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: More colums in sub categories
« Reply #9 on: October 05, 2011, 02:39:27 pm »

Then please
tag your answer as "solved" by clicking on the "Topic Solved" button on the bar at the left hand side at the bottom of your thread.
Logged

fersauce

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: Re: More colums in sub categories
« Reply #10 on: May 21, 2012, 02:23:53 pm »

Then please


Hi André,

I know this post has been closed months ago and I apologize for coming back to it, but I need some help with a problem that I have with the modification you made.

The problem is not with the "category" section you programmed, but with the subsequent pages. When choosing a "category" and entering into the "albums" page, this page appears out of order. These disorders are clearly visible especially at the "header" and the "footer" of the page. We can find the same mess when entering into an album, in that case the page of "thumbnails" is also out of order. Same alteration occurs when the system asks for the password of an album (for instance  http://www.informagen.es/server/thumbnails.php?album=149)

This is my gallery   http://www.informagen.es/server/login.php.

You can use this web access:

Usuario:      invitado
Password:   invitado

Many thanks in advance for your help.

Best regards,
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: More colums in sub categories
« Reply #11 on: May 21, 2012, 03:03:11 pm »

Please attach your whole theme as zip file, as it doesn't happen in my testbed.
Logged

fersauce

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: More colums in sub categories
« Reply #12 on: May 21, 2012, 03:11:46 pm »

Here it is.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: More colums in sub categories
« Reply #13 on: May 21, 2012, 03:42:18 pm »

Try this updated code:
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" colspan="3">{CATEGORY}</td>
        </tr>
<!-- END header -->
<!-- BEGIN catrow_noalb -->
                <td class="catrow_noalb"><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>
<!-- 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="3" 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'],
                '{ALBUMS}' => $lang_cat_list['albums'],
                '{PICTURES}' => $lang_cat_list['pictures'],
        );
        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;
    if (count($cat_data)) {
        echo "<tr>";
        foreach($cat_data as $category) {
            if ($count%3 == 0) {
                echo "</tr><tr>";
            }
            $count++;
            if (!isset($category['cat_thumb'])) { $category['cat_thumb'] = ''; }
            if (count($category) == 3) {
                $params = array(
                        '{CAT_TITLE}' => $category[0],
                        '{CAT_THUMB}' => $category['cat_thumb'],
                        '{CAT_DESC}' => $category[1],
                );
                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'],
                        '{ALB_COUNT}' => cpg_float2decimal($category[2]),
                        '{PIC_COUNT}' => cpg_float2decimal($category[3]),
                );
                echo template_eval($template, $params);
            } else {
                $params = array(
                        '{CAT_TITLE}' => $category[0],
                        '{CAT_THUMB}' => $category['cat_thumb'],
                        '{CAT_DESC}' => $category[1],
                        '{CAT_ALBUMS}' => '',
                        '{ALB_COUNT}' => cpg_float2decimal($category[2]),
                        '{PIC_COUNT}' => cpg_float2decimal($category[3]),
                );
                echo template_eval($template, $params);
            }
        }
        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

fersauce

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: More colums in sub categories
« Reply #14 on: May 21, 2012, 04:35:30 pm »

Great. It´s ok.   But now I need a "break" before each category name. it´s possible?
Logged

fersauce

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: More colums in sub categories
« Reply #15 on: May 21, 2012, 04:40:53 pm »

I´m so sorry. I meant "after" each categoryes name
Logged

fersauce

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: More colums in sub categories
« Reply #16 on: May 21, 2012, 07:04:02 pm »

.... and the "catlink" under the thumnail.    ;D
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: More colums in sub categories
« Reply #17 on: May 22, 2012, 02:03:34 pm »

Where do you need a break? Which catlink under which thumbnail? Please post screenshots.
Logged

fersauce

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: More colums in sub categories
« Reply #18 on: May 22, 2012, 10:53:28 pm »

Now I see this:


CategorieName     thumb  catlink         thumb  catlink

thumb  catlink        thumb  catlink         thumb  catlink

thumb  catlink        CategorieName      thumb  catlink

thumb  catlink        thumb  catlink         thumb  catlink





An I need this:


CategorieName

Thumb       Thumb      Thumb
Catlink       Catlink      Catlink

Thumb       Thumb      Thumb
Catlink       Catlink      Catlink

Thumb       Thumb     
Catlink       Catlink   

CategorieName

Thumb       Thumb      Thumb
Catlink       Catlink      Catlink

CategorieName

Thumb       Thumb      Thumb
Catlink       Catlink      Catlink 


Please, if it's possible, the thumbs and the catlink centered in each row. Really, you made it in your first mod. (see previous post)


Thank you André.

Logged

fersauce

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: More colums in sub categories
« Reply #19 on: May 25, 2012, 05:32:17 pm »

Now I see this:


CategorieName     thumb  catlink         thumb  catlink

thumb  catlink        thumb  catlink         thumb  catlink

thumb  catlink        CategorieName      thumb  catlink

thumb  catlink        thumb  catlink         thumb  catlink





An I need this:


CategorieName

Thumb       Thumb      Thumb
Catlink       Catlink      Catlink

Thumb       Thumb      Thumb
Catlink       Catlink      Catlink

Thumb       Thumb     
Catlink       Catlink   

CategorieName

Thumb       Thumb      Thumb
Catlink       Catlink      Catlink

CategorieName

Thumb       Thumb      Thumb
Catlink       Catlink      Catlink 


Please, if it's possible, the thumbs and the catlink centered in each row. Really, you made it in your first mod. (see previous post)


Thank you André.
Logged
Pages: [1]   Go Up
 

Page created in 0.033 seconds with 20 queries.