caliSkinV6 with 2 category columns caliSkinV6 with 2 category columns
 

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

caliSkinV6 with 2 category columns

Started by natrlhy, January 17, 2008, 05:37:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

natrlhy

Hello,

I found this info posted by Stramm to get 3 columns on the main page:

http://forum.coppermine-gallery.net/index.php?topic=33615.msg156786#msg156786

Everything seems to be displaying correctly (I have made the basic modifications to the code to have 2 columns instead of 3), however when I click on the category or album links, it seems to be "pushing" the outer boarders of the caliSkinV6 theme and it also "pushes" out the album tables and basically makes it appear as though there is not right hand border anymore. I've been trying to play with the width of things for this theme but I'm not having any luck. When I remove the php code that Stramm had posted in the above thread, everything is displayed properly again (but I don't get my 2 columns :) )

I have attached my theme.php, template.html and styles.css files in case this may help anyone fix this issue.

The two columns display properly here: http://www.natrlhy.net/gallery/

But when one browses to any category the issue I am describing can be seen by clicking on any category (and also any album with thumbnails)

An example would be here: http://www.natrlhy.net/gallery/index.php?cat=25 (look on the right side. You can see what I am describing there. Try scrolling all the way down as well and more weirdness can be seen).

Any help in resolving this would be greatly appreciated!


phill104

Have you tried Mehdi's coppermine-joomla bridge?

As well as merging the user database and logon it integrates into your joomla theme properly without using the wrapper.

Might solve some of your theme problems rather than having to build a custom theme to make it look like you are integrating.
It is a mistake to think you can solve any major problems just with potatoes.

natrlhy

I haven't tried Mehdi's bridge but I have seen it. I really like the caliskinV6 theme and it seems like the Mehdi bridge would make the GPG gallery too narrow in Joomla.

I'm still going around in circles as to why the 2 column code causes the category list (and album list views) to break the width of the columns, so if anyone see's something, please let me know.

Also something I didn't mention in my first post was that I have applied the same code that Stramm supplied to the classic theme, and it looks fine. So there is something buried in the attached theme.php, template.html or styles.css files that I can't figure out.

Many thanks!

natrlhy

AT LAST! I have discovered what was wrong.

So, I followed another post here: http://forum.coppermine-gallery.net/index.php?topic=15400.msg107765#msg107765

I basically removed the sections MadPole referenced in his modifications and after I carefully did that to the caliskinV6 theme.php file it worked!

I the began comparing modifications to the theme.php file that I attached to my first post to the one I modified to get it to work and here is what I found to be wrong:

I saw in the broken theme.php file that this statement was in the wrong place:

Look for this line in the theme.php file:
    global $template_cat_list, $lang_cat_list;
    if (count($cat_data) > 0) {
        starttable('100%');


Move this code OUTSIDE of the if loop:
        starttable('100%');

So it looks like this:
    global $template_cat_list, $lang_cat_list;

        starttable('100%');

    if (count($cat_data) > 0) {


Once I did that! Voila! It fixed my misalignment problem!

There are also some width settings that I liked better in MadePole's modifications so I am keeping that one ;)

Here are the working 2 column theme.php modifications that I am using for the caliskinV6 theme for my site:

// HTML template for the category list
$template_cat_list = <<<EOT
<!-- BEGIN header -->
        <tr>
                <td class="tableh1" width="40%"><b>{CATEGORY}</b></td>
                <td class="tableh1" width="5%" align="center"><b>{ALBUMS}</b></td>
                <td class="tableh1" width="5%" align="center"><b>{PICTURES}</b></td>
                <td class="tableh1" width="40%"><b>{CATEGORY}</b></td>
                <td class="tableh1" width="5%" align="center"><b>{ALBUMS}</b></td>
                <td class="tableh1" width="5%" align="center"><b>{PICTURES}</b></td>
        </tr>
<!-- END header -->
<!-- BEGIN catrow_noalb -->
        <tr>
                <td class="tableh2" colspan="6"><table border="0"><tr><td>{CAT_THUMB} {DEBUG}</td><td><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
        </tr>
<!-- END catrow_noalb -->
<!-- BEGIN catrow -->
                <td class="tableb"><table border="0"><tr><td>{CAT_THUMB}</td><td><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
                <td class="tableb" align="center">{ALB_COUNT} {DEBUG}</td>
                <td class="tableb" align="center">{PIC_COUNT}</td>
<!-- END catrow -->
<!-- BEGIN catrow_blank -->
                <td class="tableb" align="center"></td>
                <td class="tableb" align="center">{DEBUG}</td>
                <td class="tableb" align="center"></td>
<!-- END catrow_blank -->
<!-- BEGIN footer -->
        <tr>
                <td colspan="6" class="tableh1" align="center"><span class="statlink"><b>{STATISTICS}</b></span></td>
        </tr>
<!-- END footer -->
<!-- BEGIN spacer -->
        <img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->

EOT;

function theme_display_cat_list($breadcrumb, &$cat_data, $statistics)
{
        global $template_cat_list, $lang_cat_list;

        starttable('100%');

        if (count($cat_data) > 0) {
                $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_noabl = template_extract_block($template_cat_list, 'catrow_noalb');
        $template = template_extract_block($template_cat_list, 'catrow');
        $template_blank = template_extract_block($template_cat_list, 'catrow_blank');

        $count=0;
        $columnCount=2;
        echo "<tr>";   
   
        foreach($cat_data as $category) {
                $count++;   
                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],
                                                                '{DEBUG}' => ""
                        );
                        $count=0;
                        echo template_eval($template_noabl, $params);
                } else {
                        $params = array('{CAT_TITLE}' => $category[0],
                                                                '{CAT_THUMB}' => $category['cat_thumb'],
                                                                '{CAT_DESC}' => $category[1],
                                                                '{CAT_ALBUMS}' => $category['cat_albums'],
                                                                '{ALB_COUNT}' => $category[2],
                                                                '{PIC_COUNT}' => $category[3],
                                                                '{DEBUG}' => ""
                        );
                        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);
    }
    endtable();

    if (count($cat_data) > 0)
        echo template_extract_block($template_cat_list, 'spacer');
}


I sure hope this helps others!  ;D