More colums in sub categories More colums in sub categories
 

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

Main Menu

More colums in sub categories

Started by fersauce, September 11, 2011, 11:39:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fersauce

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

fersauce

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


Αndré

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:
/******************************************************************************
** 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
******************************************************************************/

fersauce

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.

Αndré

Quote from: fersauce on September 13, 2011, 05:45:22 PM
1.- Cat_title and cat_description just behind the cat_thum (not it is on the right)
Do you mean "below" the thumbnail?


Quote from: fersauce on September 13, 2011, 05:45:22 PM
2.- A break before each category name
What do you mean with a "break"?

fersauce

I´sorry

of course I meant below de thumnail, centered.

Now with your mod i see these

Cat sub


fersauce

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



Αndré

#7
Try this updated code:
/******************************************************************************
** 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
******************************************************************************/

fersauce

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


Αndré

Then please
Quote from: Joachim Müller on September 28, 2008, 12:46:26 PM
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.

fersauce

Quote from: Αndré on October 05, 2011, 02:39:27 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,

Αndré

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

fersauce

Here it is.

Αndré

Try this updated code:
/******************************************************************************
** 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
******************************************************************************/

fersauce

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

fersauce

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

fersauce

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

Αndré

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

fersauce

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é.


fersauce

Quote from: fersauce 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é.