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: Curve theme help.  (Read 13421 times)

0 Members and 1 Guest are viewing this topic.

dai

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Curve theme help.
« on: February 08, 2011, 01:57:06 am »

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Curve theme help.
« Reply #1 on: February 08, 2011, 10:04:59 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.


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/
Logged

dai

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: Curve theme help.
« Reply #2 on: February 09, 2011, 03:32:54 am »

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Curve theme help.
« Reply #3 on: February 09, 2011, 09:22:32 am »

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

dai

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: Curve theme help.
« Reply #4 on: February 09, 2011, 09:46:24 am »

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Curve theme help.
« Reply #5 on: February 09, 2011, 11:04:02 am »

Copy the following code to themes/curve/theme.php (right before the ?> sign at the last line):
Code: [Select]
/******************************************************************************
** 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
******************************************************************************/
« Last Edit: September 17, 2013, 09:54:03 am by Αndré »
Logged

dai

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: Curve theme help.
« Reply #6 on: February 09, 2011, 03:54:14 pm »

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

Thank you very, very much.

Dai
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Curve theme help.
« Reply #7 on: February 09, 2011, 03:59:48 pm »

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

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Curve theme help.
« Reply #8 on: June 06, 2013, 01:39:30 am »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Curve theme help.
« Reply #9 on: June 06, 2013, 09:02:42 am »

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

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Curve theme help.
« Reply #10 on: June 08, 2013, 05:16:35 am »

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

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Curve theme help.
« Reply #11 on: June 08, 2013, 05:48:56 am »

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


from this:


(http://i42.tinypic.com/2rhbt36.jpg)

to this:

(http://i39.tinypic.com/am2ihl.jpg)

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

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Curve theme help.
« Reply #12 on: June 08, 2013, 05:51:10 am »

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Curve theme help.
« Reply #13 on: August 20, 2013, 02:42:20 pm »

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?
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Curve theme help.
« Reply #14 on: September 16, 2013, 09:01:52 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Curve theme help.
« Reply #15 on: September 17, 2013, 09:54:26 am »

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

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Curve theme help.
« Reply #16 on: September 17, 2013, 10:05:25 am »

1000 thanks
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 20 queries.