Curve theme help. Curve theme help.
 

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]

Main Menu

Curve theme help.

Started by dai, February 08, 2011, 01:57:06 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

dai

Using Coppermine 1.5.12 and standard Curve Theme. Gallery link http://wildlifewales.co.uk/gallery/index.php.
I will be adding at least another ten Categories which will make the user scroll down to see them. I would like to have the Categories in two columns to save some space, I have searched the forum but the only information I can find is for another theme from Coppermine 1.4.
Can the Curve theme be modified for two cloumns of categories. I don't know code but I can copy and paste. Are there any themes for 1.5.12 that already have this feature.

Thank you in advance.
Dai

Αndré

Quote from: dai on February 08, 2011, 01:57:06 AM
I have searched the forum but the only information I can find is for another theme from Coppermine 1.4.
Can the Curve theme be modified for two cloumns of categories.
Please post the cpg1.4.x mod, so we don't have to search it ourselves. Maybe it's possible to use that mod for cpg1.5.x, too.


Quote from: dai on February 08, 2011, 01:57:06 AM
Are there any themes for 1.5.12 that already have this feature.
You can browse all public available themes here: http://coppermine-gallery.net/demo/cpg15x/

dai

The theme was caliskinV6 theme for 1.4 and the post was here http://forum.coppermine-gallery.net/index.php/topic,49837.0.html

Thanks
Dai

Αndré

Do you want to port that theme to cpg1.5.x or do you want to modify the curve theme? Please also have a look at that thread.

dai

I would like to modify the curve theme because I have based my web site based around the Curve theme. My web site is www.wildlifewales.co.uk
I have looked at the other thread but I can't find the code in the curve theme that I am supposed to alter also it is a bit confusing.

Dai

Αndré

#5
Copy the following code to themes/curve/theme.php (right before the ?> sign at the last line):
/******************************************************************************
** Section <<<$template_cat_list>>> - START
******************************************************************************/
// HTML template for the category list
$template_cat_list = <<<EOT
<!-- BEGIN header -->
        <tr>
                <td class="tableh1" width="40%" align="left">{CATEGORY}</td>
                <td class="tableh1" width="5%" align="center">{ALBUMS}</td>
                <td class="tableh1" width="5%" align="center">{PICTURES}</td>
                <td class="tableh1" width="40%" align="left">{CATEGORY}</td>
                <td class="tableh1" width="5%" align="center">{ALBUMS}</td>
                <td class="tableh1" width="5%" align="center">{PICTURES}</td>
        </tr>
<!-- END header -->
<!-- BEGIN catrow_noalb -->
                <td class="catrow_noalb" colspan="3"><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>
                <td class="catrow" align="center">{ALB_COUNT}</td>
                <td class="catrow" align="center">{PIC_COUNT}</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'],
                '{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;
    $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],
            );
            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);
        }
        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
******************************************************************************/

dai

Andre. You are a genius. I don't know how to thank you enough.

Thank you very, very much.

Dai

Αndré

Marking as solved. In the future, please do that yourself.

allvip

I used your script.

If I have albums in the categories then the categories do show 2 columns,but if I have subcategories in the categories they have only 1 columns.

Can you tell me what I should change in theme.php to have 2 columns for the categories that have subcategory?

Is it possible to have more columns for the category only on the index page?

Thanks


Thanks.

Αndré

Please post a link to your gallery where I can see the issue.

allvip

Sorry for the late response.I was out of town.

1 - The index page has 2 categories with subcategories:

http://allvip.us/gallery/index.php

and they don't show on 2 columns.they show one under the other.

2 - Here are subcategories that have subcategories.they also show one under the other (like a list).

http://allvip.us/gallery/index.php?cat=254

3 - Here I have subcategories that have albums .they show on two columns.

http://allvip.us/gallery/index.php?cat=252

The script shows 2 colums only for categories that have albums , not for categories that have subcategories.

When the categories of my index pages had albums ,they showed on 2 columns.
Now that I moved the albums in subcategories ,they show in 1 column.

allvip

Also, can you please help me to remove the black bar with Category Albums Files from the index page:


from this:


(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fi42.tinypic.com%2F2rhbt36.jpg&hash=e1a3179c92d7ebed46a6cfac9fb63c9e56456f74)

to this:

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fi39.tinypic.com%2Fam2ihl.jpg&hash=bcf1711aa6b46bb8601353f03ac010ef5a279550)

Is possible on this page:

http://allvip.us/gallery/index.php?cat=254

to show the numbers of albums and files? if not can I remove the black bar from there too?

sorry for asking so many questions.
thanks.


Αndré

It seems that you re-structured your gallery, as I cannot see any categories on the first page. Your link #2 returns an error and link #3 works as expected. Is everything solved?

allvip

no
1 row for category list with subcategories:

http://allvip.us/gallery/index.php?cat=298

2 rows for categories with albums:

http://allvip.us/gallery/index.php?cat=252

I would like to rows even for category list with subcategories.

Αndré

I just updated the above code. Please replace it in your theme's theme.php file.

allvip