2 colums on the main page

Bukken

Joined: 2003-09-16
Posts: 14
Posted: Wed, 2004-09-22 14:20

I've searched the forum for a way to get 2 colums on the main page in stead of just one, but didn't find anything....
I tried to edit the albums.php file, but I only managed to get this result:
[img]http://wralgyr.org/images/gallery.jpg[/img]
The same images/albums in both columns :(
Is it possible and how do I do it? Any help would be great :)

Bukken

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Sat, 2004-09-25 17:55

Hei, bkn! :-)

Have a look at http://gallery.menalto.com/node/21358

 
Bukken

Joined: 2003-09-16
Posts: 14
Posted: Sat, 2004-09-25 19:55

Thanks for the link h0bbel, but it's not quite what I was looking for. It's seems that this mod adds 2-3 columns to the sub-albums and not the main page. I want something like that on the main page, as I won't be using sub-albums on my gallery as there is no need for it.
I'm able to create 2 colums on the main page, but as you can see from the image it don't work the way I want it :(
Any help would be great...

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2004-09-26 22:55

bukken,
H0bbel asked me to give you a hand...It looks like you are most of the way there.

a 2-column mod has been done before but for a much older version I am sure that you have searched for those and had no luck in implementing them.
But here is a example I think you are looking for:
http://www.fractalfairy.com/~feusers/themes/gallery/
and the discution about how to do it:
http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=4945&start=0&postdays=0&postorder=asc&highlight=

If you get stuck post your code and a example and We will try to help out.

Dave

 
Bukken

Joined: 2003-09-16
Posts: 14
Posted: Mon, 2004-09-27 14:38

floridave
Thanks for the info and links, looks like there is a solution to my question in them. I'll try this out and let you and h0bbel know how it goes.
Once again thanks.

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Wed, 2004-09-29 20:40

bukken, you seem to be doing good :-)

 
justchil
justchil's picture

Joined: 2003-02-07
Posts: 225
Posted: Tue, 2004-11-09 15:07

Anyone got any updated code for 1.4.4pl2? Not having much luck with this :(

 
Bukken

Joined: 2003-09-16
Posts: 14
Posted: Tue, 2004-11-09 18:11
justchil wrote:
Anyone got any updated code for 1.4.4pl2? Not having much luck with this :(

I mostly followed this link that floridave pasted: http://gallery.menalto.com/index.php?na ... highlight=
Also do check your PM

 
MelRayUS

Joined: 2004-08-14
Posts: 4
Posted: Wed, 2004-11-17 05:29

Hate to bump a REALLY old topic, but I could not get this to work on my gallery v1.4.4-pl2, and the post above mine...the link dosent work.

Wondering if anybody would be kind enough to share how it is now accomplished, or if gallery 2 supports more colums on the main albums page...etc. Whatever it takes to get it changed from the default one on top of the other.

-Ray

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2004-11-22 00:20

MelRayUS, All I did was follow the steps in this thread: http://gallery.menalto.com/node/5114

attached is albums.php for version 1.4.4pl4 that will have 2 columns

you will have to rename it to albums.php

if you want to change it to 3 columns change

<?php if (round($i/2,0) <= ($i/2)) { ?> 
</tr><tr valign="top"> 
<?php } ?>

to

<?php if ((round($i/3,0) > (($i/3)-0.01)) and (round($i/3,0) <= ($i/3))) { ?> 
</tr><tr valign="top"> 
<?php } ?>

updated for 1.5:
http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&p=139070#139070

 
tmothy

Joined: 2004-03-06
Posts: 53
Posted: Mon, 2004-11-22 07:33

Qestion.
How do we get the info under the picture insead of to the right. It seems to save alot of space if it's under the picture. Thx

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2004-11-26 04:39

two column with title and description under image.
you will have to keep the images the same height as it will look out of place. Not extensively tested with descriptions of varring lengths.
Updated for 1.5:
http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&p=139070#139070

Dave

 
carvjo

Joined: 2004-10-20
Posts: 4
Posted: Fri, 2004-11-26 15:12

Thanks Floridave - Just what I was looking for..

 
jassyjas

Joined: 2004-10-13
Posts: 34
Posted: Tue, 2004-12-07 18:35

Hi, I've used the above - thanks Floridave. Would you be able to tell me how to centre the text beneath the highlights. Currently they are too far left and look kinda odd.
Thanks in anticipation

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2004-12-08 01:56

jassyjas,
not tested but look for <td align="<?php echo $left ?>" valign="top" class="albumdesc"> and change to <td align="center" valign="top" class="albumdesc">

Why the echo $left you ask? Well it is used for languages that are read right to left.

Dave

 
jassyjas

Joined: 2004-10-13
Posts: 34
Posted: Wed, 2004-12-08 13:09

Thanks for the response. I cannot find this Code though. I'm looking in the Album.txt file posted above in this thread right?

Any further help much appreciated.
Thanks

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2004-12-08 18:11

jassyjas,

I hope you are talking about the title of the album.....

          <table cellspacing="0" cellpadding="0" border="0" class="mod_title_bg">
            <tr>
              <td class="mod_title_left"></td>
              <td nowrap class="title">
                <?php _("title") ?>
                <?php echo editField($gallery->album, "title", $albumURL) ?>
              </td>
              <td class="mod_title_right"></td>
            </tr>
          </table>

and add a align="center" to the table tag.
If this is not what you want then post back with a url and location if you cant figure it out on your own. You might have to play with the classes in your css as well.

Dave

 
jassyjas

Joined: 2004-10-13
Posts: 34
Posted: Thu, 2004-12-09 16:01

Perfect!

Thank you

 
Chanosfar

Joined: 2004-12-14
Posts: 7
Posted: Tue, 2004-12-14 06:55
floridave wrote:
jassyjas,

I hope you are talking about the title of the album.....

          <table cellspacing="0" cellpadding="0" border="0" class="mod_title_bg">
            <tr>
              <td class="mod_title_left"></td>
              <td nowrap class="title">
                <?php _("title") ?>
                <?php echo editField($gallery->album, "title", $albumURL) ?>
              </td>
              <td class="mod_title_right"></td>
            </tr>
          </table>

and add a align="center" to the table tag.
If this is not what you want then post back with a url and location if you cant figure it out on your own. You might have to play with the classes in your css as well.

Dave

I guess I'm the one that is stupid :)
I can't get it done, so that the colums are equal size. Can anyone help me ??
My gallery is at: www.chano.dk

 
Chanosfar

Joined: 2004-12-14
Posts: 7
Posted: Thu, 2004-12-16 20:00

Anyone ???

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2004-12-17 01:07

Chanosfar,
The rendering of tables is dependent on the cells content. The table above has a cell peramiter of <td nowrap class="title">.
If you have a title that is long then the cell will be bigger than adjacent cells. The text in the cell will not wrap because of the 'nowrap'. You can remove the 'nowrap'and see if it helps. The other option is to give some of the tables and cells absolude width values.

or (if using the second albums.php (text below)) look for

<!-- Begin Image Cell -->
  <td align="center" valign="middle">

and give it value like 25%. But then your images might be out for size.

Dave

 
Chanosfar

Joined: 2004-12-14
Posts: 7
Posted: Fri, 2004-12-17 10:28
floridave wrote:
Chanosfar,
The rendering of tables is dependent on the cells content. The table above has a cell peramiter of <td nowrap class="title">.
If you have a title that is long then the cell will be bigger than adjacent cells. The text in the cell will not wrap because of the 'nowrap'. You can remove the 'nowrap'and see if it helps. The other option is to give some of the tables and cells absolude width values.

or (if using the second albums.php (text below)) look for

<!-- Begin Image Cell -->
  <td align="center" valign="middle">

and give it value like 25%. But then your images might be out for size.

Dave

Okay thanks Dave, I can't get it work so that they are equal :) But I'm not that good at php, so.........

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2004-12-18 03:48
Chanosfar wrote:
Okay thanks Dave, I can't get it work so that they are equal :) But I'm not that good at php, so.........

So What? This is HTML and tables not php. Can you give me a url and tell me what you changed. Do you want all cells the same width? the image cells as well as the title/discription cell?

Dave

 
Chanosfar

Joined: 2004-12-14
Posts: 7
Posted: Mon, 2004-12-20 07:48

LOL ok thanks Dave

www.chano.dk

the cells right to the thumbnails I would like same size

 
patience

Joined: 2005-01-06
Posts: 1
Posted: Thu, 2005-01-06 19:37

I have done the two-colums mod sucsessfully. And changed the rows so as they're equal. But there's one thing that I really felt in love with. And that is the skin used above in the first post.

http://wralgyr.org/images/gallery.jpg

Where can I get this skin? I really loved the simplity and the colours..

Anyone?? :)

 
pmona

Joined: 2005-01-22
Posts: 9
Posted: Sat, 2005-01-22 01:08

I have modified the main page to display 1, 2, or 3 columns.

The 3 column_*.inc files go in the gallery root.
There are 2 patches, 1 for albums.php and another for setup/config_data.inc

You then can select from the configuration wizard the number of columns to display - (under the Main Gallery page tab).

Paul

 
pmona

Joined: 2005-01-22
Posts: 9
Posted: Sat, 2005-01-22 01:09

The patch was written for 1.4.4-pl4

 
Chanosfar

Joined: 2004-12-14
Posts: 7
Posted: Sat, 2005-01-22 06:58
pmona wrote:
The patch was written for 1.4.4-pl4

Thx a lot pmona - I'll try that

 
Chanosfar

Joined: 2004-12-14
Posts: 7
Posted: Sat, 2005-01-22 07:08
pmona wrote:
The 3 column_*.inc files go in the gallery root.
There are 2 patches, 1 for albums.php and another for setup/config_data.inc
Paul

The 2 patches - what do I do with them ?
I can't figure out :)

 
AmberChalise

Joined: 2004-08-03
Posts: 6
Posted: Sat, 2005-01-22 07:15

Can anyone edit this albums php of mine to do this as I know little of php?

 
pmona

Joined: 2005-01-22
Posts: 9
Posted: Sat, 2005-01-22 16:33
Chanosfar wrote:
pmona wrote:
The 3 column_*.inc files go in the gallery root.
There are 2 patches, 1 for albums.php and another for setup/config_data.inc
Paul

The 2 patches - what do I do with them ?
I can't figure out :)

Steps I would do:
# cd /location/of/gallery
# tar zxvf /path/to/columns_patch.tar.gz
# cp albums.php albums.php.orig
# cp setup/config_data.inc setup/config_data.inc.orig
# patch -p1 < albums.patch
# cd setup
# patch -p1 < config_data.inc.patch

After that you can then use the Gallery configuration wizard and select the number of columns you want for the main page.

good luck
~paul

 
Dauthus

Joined: 2005-01-05
Posts: 7
Posted: Sun, 2005-01-23 17:18

I'm a little fuzzy here. When I tried to apply the patch, I got the following error:

[root@dedicated Gallery_Free]# patch -p1 < albums.patch
missing header for unified diff at line 3 of patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- albums.php 2005-01-21 16:41:12.000000000 -0800
|+++ albums.p1  2005-01-21 16:42:00.000000000 -0800
--------------------------

Would it make any difference what the file paths are? Also, my albums.php has been modified with a couple of lines of code. Would that make a difference?

 
pmona

Joined: 2005-01-22
Posts: 9
Posted: Sun, 2005-01-23 21:24
Dauthus wrote:
I'm a little fuzzy here. When I tried to apply the patch, I got the following error:

[root@dedicated Gallery_Free]# patch -p1 < albums.patch
missing header for unified diff at line 3 of patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- albums.php 2005-01-21 16:41:12.000000000 -0800
|+++ albums.p1  2005-01-21 16:42:00.000000000 -0800
--------------------------

Would it make any difference what the file paths are? Also, my albums.php has been modified with a couple of lines of code. Would that make a difference?

My apologies, I should have tested the patch before posting. I just re uploaded the file. Grab it again and see if it works for you.

I just ran it and aside from the missing header error it worked fine.

[root@crossfire gallery]# patch -p1 < albums.patch
missing header for unified diff at line 3 of patch
patching file albums.php
[root@crossfire setup]# patch -p1 < ../config_data.inc.patch
missing header for unified diff at line 3 of patch
patching file config_data.inc
[root@crossfire setup]#

I un tar'd the file to my gallery directory first.

~paul

 
Dauthus

Joined: 2005-01-05
Posts: 7
Posted: Mon, 2005-01-24 02:20

Thanks for the help pmona. The new version works fine. For some reason the tables are not correct, and the text goes off the page to the right in Firefox. The tables are broken somewhere, but that may be because I am embedded in PHPNuke.

I took a look at your first albums.php (albums.php V1.4.4pl4 2 column mod) in a prior post in this thread. That one works perfectly in IE, but still runs off the screen to the right on Firefox, but the tables look as they are supposed to. They just don't wrap with the page.

Any ideas on how to fix this in Firefox. I can't really post the web site here because it has several Adult images in the gallery. (Be happy to PM it to you if you want.)

EDIT: Let me rephrase this. The only time it runs off the screen is when I am in god mode. If I am logged on as a regular user, it looks fine. Something I missed somewhere?

 
Chanosfar

Joined: 2004-12-14
Posts: 7
Posted: Mon, 2005-01-24 10:39

I don't get it, sorry

But thanks for trying anyway.....

 
pmona

Joined: 2005-01-22
Posts: 9
Posted: Mon, 2005-01-24 17:24
Dauthus wrote:
Thanks for the help pmona. The new version works fine. For some reason the tables are not correct, and the text goes off the page to the right in Firefox. The tables are broken somewhere, but that may be because I am embedded in PHPNuke.

I took a look at your first albums.php (albums.php V1.4.4pl4 2 column mod) in a prior post in this thread. That one works perfectly in IE, but still runs off the screen to the right on Firefox, but the tables look as they are supposed to. They just don't wrap with the page.

Any ideas on how to fix this in Firefox. I can't really post the web site here because it has several Adult images in the gallery. (Be happy to PM it to you if you want.)

EDIT: Let me rephrase this. The only time it runs off the screen is when I am in god mode. If I am logged on as a regular user, it looks fine. Something I missed somewhere?

I see the same thing in IE6. I never worried about it while logged in since I only cared about what others would see. (no one else has logins).

 
maledictus

Joined: 2005-03-08
Posts: 23
Posted: Thu, 2005-04-07 14:41

This patch can make a four column display Gallery? or better is there a way to display x number of albums in the main page of the gallery??

THX

 
pmona

Joined: 2005-01-22
Posts: 9
Posted: Thu, 2005-04-07 14:57

The patch only does 1 to 3 columns, but you can easily modify it to do more.

 
maledictus

Joined: 2005-03-08
Posts: 23
Posted: Thu, 2005-04-07 15:06
pmona wrote:
The patch only does 1 to 3 columns, but you can easily modify it to do more.

OK, I will apply the patch and look at the code you made. Thx Pmona! 8)

Update:
Basically for what I read and understand what are you doing in the column_*.inc files is to copy two or three times the same code depending on the number of columns you wish to display. Isn't? :D

 
maledictus

Joined: 2005-03-08
Posts: 23
Posted: Thu, 2005-04-07 15:55
floridave wrote:
MelRayUS, All I did was follow the steps in this thread: http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&p=43101#43101

attached is albums.php for version 1.4.4pl4 that will have 2 columns

you will have to rename it to albums.php

if you want to change it to 3 columns change

<?php if (round($i/2,0) <= ($i/2)) { ?> 
</tr><tr valign="top"> 
<?php } ?>

to

<?php if ((round($i/3,0) > (($i/3)-0.01)) and (round($i/3,0) <= ($i/3))) { ?> 
</tr><tr valign="top"> 
<?php } ?>

Using this quote I fixed my problem, displaying the root albums in 4 columns.
Fixed. instead of:

<?php if ((round($i/3,0) > (($i/3)-0.01)) and (round($i/3,0) <= ($i/3))) { ?> 
</tr><tr valign="top"> 
<?php } ?>

I use:

<?php if ((round($i/4,0) > (($i/4)-0.01)) and (round($i/4,0) <= ($i/4))) { ?> 
</tr><tr valign="top"> 
<?php } ?>

Works fine for me on IE6 and Firefox.

 
lwclam
lwclam's picture

Joined: 2004-08-01
Posts: 19
Posted: Mon, 2005-04-11 08:46
floridave wrote:
two column with title and description under image.
you will have to keep the images the same height as it will look out of place. Not extensively tested with descriptions of varring lengths.

Dave

I've tried the 2 column with title and desc under image.
But I found that they are not aligned correctly.
Can you help? Many Thanks.

My URL: http://gallery.chuenhk.com

Sorry for the Chinese webpage :(

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2005-04-11 13:04

Like I said "Not extensively tested with descriptions of varring lengths."
One could look at the code and hardcode a height to the row I guess. Or force the descriptions the same height.

Dave

 
maledictus

Joined: 2005-03-08
Posts: 23
Posted: Mon, 2005-04-11 17:25

If you try to make the same size of thumbs you will fix that issue. So I could suggest if you try the square thumbs that rich made (works for 1.4.4-pl6 and below) http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=17627

Hope it helps!

 
lwclam
lwclam's picture

Joined: 2004-08-01
Posts: 19
Posted: Tue, 2005-04-12 02:54
floridave wrote:
Like I said "Not extensively tested with descriptions of varring lengths."
One could look at the code and hardcode a height to the row I guess. Or force the descriptions the same height.

Dave

Thanks. Any hint I can fix the height or the thumbnail area height?

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Tue, 2005-04-12 09:42

Open "albums.php" and find the table that deals with this and set its "height=" tag?

 
lwclam
lwclam's picture

Joined: 2004-08-01
Posts: 19
Posted: Wed, 2005-04-13 02:44

I got it! Many Thanks.

 
pmona

Joined: 2005-01-22
Posts: 9
Posted: Wed, 2005-06-15 00:03

I have updated to 1.5 and updated my patches as well. I also included an additional patch if you are using the embedded movie mod.

As before, this will allow you to configure the gallery main page to display 1, 2, or 3 columns. Configuration is set in the setup wizard.

These patches are intended to be run against the original gallery files (not the updated config_data.inc if you are using embedded movie)

Paul

 
MelRayUS

Joined: 2004-08-14
Posts: 4
Posted: Sun, 2006-11-05 02:22
floridave wrote:
MelRayUS, All I did was follow the steps in this thread: http://gallery.menalto.com/node/5114

attached is albums.php for version 1.4.4pl4 that will have 2 columns

you will have to rename it to albums.php

if you want to change it to 3 columns change

<?php if (round($i/2,0) <= ($i/2)) { ?> 
</tr><tr valign="top"> 
<?php } ?>

to

<?php if ((round($i/3,0) > (($i/3)-0.01)) and (round($i/3,0) <= ($i/3))) { ?> 
</tr><tr valign="top"> 
<?php } ?>

updated for 1.5:
http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&p=139070#139070

Here I go again. Bumping an old topic for the same purpose. I upgraded from 1.4 to 1.5.4 last week and am unable to implement a 2 column layout on the main page. The code above is not in the new albums.php. I have tried adding it to no avail. Any ideas now? I also tried the attached patch files to no avail. It seems this is more difficult than last time.

The link to updated for 1.5: is broken, it takes me to the news section and I can not find any reference to multi column layout help in that section. Help!

 
endosquid

Joined: 2007-06-17
Posts: 11
Posted: Sun, 2007-06-17 20:46

Anyone have an answer?

 
Sanfam

Joined: 2005-08-31
Posts: 7
Posted: Thu, 2007-08-16 00:56

I think this is worthy of a bump, as well. A multi-column gallery frontpage is exactly what I've been looking for to help remove some of that painful white space.