forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: qba on June 28, 2012, 11:18:51 am
-
Hello,
I`m using CP gallery to present my brochure collection. Order sorting is: World Area (categories) -> Brand (albums). Inside albums I`m presenting brochures. To make more readable I`d like to sort pictures: each model starts from new line (blank fields from previous line should be filled in by something transparent till end of that line). Maybe another sollution will be better (?)
Is it possible to make?
-
How exactly should Coppermine determine when a model ends and the next begins? What happens if there are more pictures for a model than available columns?
-
You understood me wrong. I know which models should be divided. And I`ll do it "manually"
The question is: how to divide chosen pictures between lines?
My idea is to insert between chosen pictures transparent object to fill in the fields in table (but this object must be missed in "Last add" category). But I don`t know how to make this kind of object
-
Or second idea: to make special command which make new table (in the same album) below the previous one.
I think second idea is much difficult and impossible to implement
-
insert between chosen pictures transparent object to fill in the fields in table
I assume the easiest solution will be to upload transparent pictures.
this object must be missed in "Last add" category
That is quite easy by adjusting $RESTRICTEDWHERE just before we use it in the meta albums. But we need some static information how we can exclude them from the query, e.g. by adding to all of that objects the keyword "blank".
-
I assume the easiest solution will be to upload transparent pictures.
That is quite easy by adjusting $RESTRICTEDWHERE just before we use it in the meta albums. But we need some static information how we can exclude them from the query, e.g. by adding to all of that objects the keyword "blank".
Good idea. The transparent picture should have constant name, reserved only for this object. Then script can easy recognise that this is special object, not picture
-
If it`s possible we can make a step forward: whes script "meet" that special object after picture, then automatically fill in rest of fields in this concrete line. This sollution permits to use only one object regardless of how many fields is after chosen picture till end of line in table
-
Copy the function theme_display_thumbnails from themes/sample/theme.php to your theme's theme.php file, if it doesn't exist. Then, find
foreach($thumb_list as $thumb) {
and above, add
$count = count($thumb_list);
find
if ((($i % $thumbcols) == 0) && ($i < count($thumb_list))) {
echo $row_separator;
}
and replace with
if (stripos($thumb['filename'], 'separator') !== FALSE) {
while ($i % $thumbcols != 0) {
$i++;
$count++;
echo $empty_cell;
}
}
if ((($i % $thumbcols) == 0) && ($i < $count)) {
echo $row_separator;
}
-
Done! Thank you.
But what next? How to sort my pictures?
-
The current code searches for files which contains the string "separator"
if (stripos($thumb['filename'], 'separator') !== FALSE) {
You can of course change that string to your needs. Depending on your default thumbnail sort order you have to move the "object(s)" to it's desired place(s).
If it works as expected the next step will be to exclude those objects from the meta albums.
-
It works! See: http://www.car-brochures.one.pl/thumbnails.php?album=190 Thank you
But on Start page - below - I have section "Last add" with 4 files. Now I see only 3 files.
-
Please read what I already wrote
the next step will be to exclude those objects from the meta albums.
by
adjusting $RESTRICTEDWHERE just before we use it in the meta albums
So please, open include/functions.inc.php, find
switch($album) {
and above, add
$RESTRICTEDWHERE .= " AND filename NOT LIKE '%separator%' ";
(at two places in that file).
-
I read it but I didn`t know how to do it in PHP code. At evening I`ll modify code.
I have two additional questions to make better:
1) is it possible to make "invisible" separator for website counter (quantity of images)?
2) now to make much readable order in album I`m using doubble separators (blank fields till end of line + one line free). Is it possible to separator filling empty fields till end of line (as it is currently) and one line below?
Something like this (here I used doubble separators):
http://car-brochures.one.pl/thumbnails.php?album=49
-
Is it possible to separator filling empty fields till end of line (as it is currently) and one line below?
Undo that code change:
find
if ((($i % $thumbcols) == 0) && ($i < count($thumb_list))) {
echo $row_separator;
}
and replace with
if (stripos($thumb['filename'], 'separator') !== FALSE) {
while ($i % $thumbcols != 0) {
$i++;
$count++;
echo $empty_cell;
}
}
if ((($i % $thumbcols) == 0) && ($i < $count)) {
echo $row_separator;
}
instead, find
echo template_eval($thumb_cell, $params);
if ((($i % $thumbcols) == 0) && ($i < count($thumb_list))) {
echo $row_separator;
}
and replace with
if (stripos($thumb['filename'], 'separator') !== FALSE) {
echo $empty_cell;
while ($i % $thumbcols != 0) {
$i++;
$count++;
echo $empty_cell;
}
echo $row_separator;
for ($j = 0; $j < $thumbcols; $j++) {
echo $empty_cell;
}
} else {
echo template_eval($thumb_cell, $params);
}
if ((($i % $thumbcols) == 0) && ($i < $count)) {
echo $row_separator;
}
That code also hides the separator itself, so your users won't be able to click on it.
is it possible to make "invisible" separator for website counter (quantity of images)?
I guess you want to exclude the separator objects from the website stats, right?
-
Just had another idea to avoid the whole meta album and stats issues. Why don't you just append "separator" to the last image's file name of each block? This way it also separates as desired, but we avoid those extra files. Of course my last code suggestion has to be adjusted slightly, as it currently hides the separator file.
-
You`re right! It`s really easiest way.
Look: http://car-brochures.one.pl/thumbnails.php?album=97 - this result is with first code modification (from yesterday) and works really good.
May you post code which only adds free line below separatod (without hide it)?
Thank you !!
-
To make it easier to read, here the complete mod from scratch.
Copy the function theme_display_thumbnails from themes/sample/theme.php to your theme's theme.php file, if it doesn't exist. Then, find
foreach($thumb_list as $thumb) {
and above, add
$count = count($thumb_list);
find
if ((($i % $thumbcols) == 0) && ($i < count($thumb_list))) {
echo $row_separator;
}
and replace with
if (stripos($thumb['filename'], 'separator') !== FALSE) {
while ($i % $thumbcols != 0) {
$i++;
$count++;
echo $empty_cell;
}
echo $row_separator;
for ($j = 0; $j < $thumbcols; $j++) {
echo $empty_cell;
}
}
if ((($i % $thumbcols) == 0) && ($i < $count)) {
echo $row_separator;
}
-
Works! :)
Is it possible to make more space between picture groups? (f.ex. by enlarge free line to h=50pix or make 3 or 4 free lines)?
-
Now it looks: http://car-brochures.one.pl/thumbnails.php?album=97
-
Αndré,
During weekend I tested both sollutions: (1) separator as separate photo (invisible for meta albums) and (2) add word 'separator' to file name. Both sollutions have disadvantages.
Sollution 1)
- Photo-Separator is invisible in Album, but on start page in "Last add" each photo-separator means one photo fewer.
- In "Last add" album each photo-separator means first line lower
Sollution 2)
- It`s unconfortable to upload new photos because by each upload it`s necessary to delete 'separator' word from last file and add to new file which now is the last one in concrete group
- In "Last add" album after file with 'separator' word line is empty and files are continue from new line below
I think the nearest to perfection is sollution no 1 but now I have no idea how to do it
-
I have no idea how to do it
What exactly is to do, except excluding the separator files from the gallery stats?
-
Photo-separator actually is not visible in Last add album but has an effect on the rest photos in that album (in Last add album, in last add section on home page, in last add section in categories). Compare attached screens.
So to do is:
- exclude photo-separator from gallery stats
- exclude effect (impact) the photo-separator from Last add album and Last add section
- if its possible: after photo-separator make one line below free with high f.ex. 20 pix
-
exclude effect (impact) the photo-separator from Last add album and Last add section
open include/functions.inc.php, find
switch($album) {
and above, add
$RESTRICTEDWHERE .= " AND filename NOT LIKE '%separator%' ";
(at two places in that file).
-
Sorry, I overlooked it.
It works of course.
And is it possible or not?
after photo-separator make one line below free with high f.ex. defined 20 pix or high=high of photo-separator
-
exclude photo-separator from gallery stats
Open index.php, find
$sql = "SELECT COUNT(*) FROM {$CONFIG['TABLE_PICTURES']}";
if ($pic_filter) {
$sql .= " AS p INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON a.aid = p.aid WHERE approved = 'YES' $pic_filter";
} else {
$sql .= " WHERE approved = 'YES'";
}
and below, add
$sql .= " AND filename NOT LIKE '%separator%' ";
after photo-separator make one line below free with high f.ex. 20 pix
In that solution (http://forum.coppermine-gallery.net/index.php/topic,75118.msg361850.html#msg361850), find
for ($j = 0; $j < $thumbcols; $j++) {
echo $empty_cell;
}
and replace with
for ($j = 0; $j < $thumbcols; $j++) {
echo str_replace('<td ', '<td height="20" ', $empty_cell);
}
-
All is OK ;D
Thank you for your support :D