singapore: the smallest big galery
home » forum » Templates » NEAT2 & columns/rows

You are not logged in.

#1 2009-06-23 16:51:34

kdga
Member

NEAT2 & columns/rows

Hi,

I'm seeing what I think could be a possible issue with the NEAT2 template. I installed it yesterday from http://sgal-lab.primaveraphoto.com.

When I set the variable "thumb_number_gallery" to a number lower than the total number of galleries, I see some of the galleries doubled up.

Currently, I have the variables as follows:

thumb_cols_gallery = 4
thumb_rows_gallery = 2
thumb_number_gallery = 8

The result is that I have 8 columns and 2 rows.  The last 4 galleries in the top row are repeated as the first 4 of the bottom row, like this:

1  2  3  4  5  6  7  8
5  6  7  8  9  10 11 12

See it here: http://www.kdga.com/gallery

I'm struggling to follow the "for" loops in the template, do you have any ideas?

Thanks!

K.

Offline

 

#2 2009-06-27 01:05:53

DC
Administrator

Re: NEAT2 & columns/rows

Let us look into this and get back to you ...

FYI you have 3 columns on the main page then clicking a gal you have 4 across realy it should match so that your not scrolling left to right  just my 2 cents keep consistancy ...

DC


To code or not to code that is the question?

Did my response help you out? Consider donating by buying me a slice, Whats this? Read More!
http://www.clickcraft.net/slice.php

Offline

 

#3 2009-06-27 12:09:02

kdga
Member

Re: NEAT2 & columns/rows

When the main page is working correctly I will change the number of columns/rows - this was just the best way to demonstrate the problem I'm trying to illustrate.  I'm not finished playing with the layout yet :-)

I don't have the experience to follow some of the variables and their loops fully, so I'm not able to work out why the problem is occurring.

Thanks for looking into this, it's much appreciated!

Offline

 

#4 2009-07-05 17:55:01

DC
Administrator

Re: NEAT2 & columns/rows

Ok do me a fave and try this.


In album.tpl.php where you see a block of code that looks somthing like this. around line 10.

//DC Auto cols check fix!
//Check that our cols setting is not more then our image count.
//This prevents blank cols from being written thus throwing
//our thumb-image off center...

$gcount  = $sg->galleryTab();
$counter = substr($gcount,strrpos($gcount," "));
$counit  = explode(" ", $gcount);

if ($counter < $counit[3]){
$cnum =($sg->config->thumb_cols_album);
}else
if ($counter < $sg->config->thumb_cols_album){
$cnum = $counter;
}else{
$cnum =($sg->config->thumb_cols_album);
}



Replace that whole code block with this.

//DC Auto cols check fix!
//Check that our cols setting is not more then our image count.
//This prevents blank cols from being written thus throwing
//our thumb-image off center...

$gcount  = $sg->galleryTab();
$counter = substr($gcount,strrpos($gcount," "));
$counit  = explode(" ", $gcount);

if ($counter <= $counit[3]){
$cnum =($sg->config->thumb_cols_album);
}else
if ($counter <= $sg->config->thumb_cols_album){
$cnum = $counter;
}else{
$cnum =($sg->config->thumb_cols_album);
}


Let me know if that works.

DC


To code or not to code that is the question?

Did my response help you out? Consider donating by buying me a slice, Whats this? Read More!
http://www.clickcraft.net/slice.php

Offline

 

#5 2009-07-05 22:43:08

kdga
Member

Re: NEAT2 & columns/rows

Thanks very much for looking into this for me, it appears to be working perfectly now!

Two small notes:

1. I think you meant that this section could be found in gallery.tpl.php, rather than album.tpl.php, right?

2. The text to be replaced is different to what you have posted.  I downloaded what I think is the the most recent version (Neat2-0.10.0) from the sgal-lab website, and the section of the file you're referring to originally had the following:

//DC Auto cols check!
//Check that our cols setting is not more then our image count.
//This prevents blank cols from being written thus throwing
//our thumb-images off center...

$gcount  = $sg->galleryTab();
$counter = substr($gcount,strrpos($gcount," "));

if ($counter < $sg->config->thumb_cols_gallery){
$cnum = $counter;
}else{
$cnum = ($sg->config->thumb_cols_gallery);
}

Either way, everything is working well now, thank you very much for your time. I'm off to look for the "donate" button on the website.

K.

Offline

 

#6 2009-07-06 06:37:44

DC
Administrator

Re: NEAT2 & columns/rows

Great glad that worked if you would like to donate to me, I have a fun way to do so, see my signature bottom of my posts.

I will update the file in the lab tomorrow with the new code.
I actually ran my quick test in album.tpl.php if you have other probs it may be required to mod both files.

DC


To code or not to code that is the question?

Did my response help you out? Consider donating by buying me a slice, Whats this? Read More!
http://www.clickcraft.net/slice.php

Offline

 

#7 2009-07-06 16:36:22

DC
Administrator

Re: NEAT2 & columns/rows

NEAT2 has now been updated with this fix, and is avail from the lab.

DC


To code or not to code that is the question?

Did my response help you out? Consider donating by buying me a slice, Whats this? Read More!
http://www.clickcraft.net/slice.php

Offline