UBB.Dev
Posted By: Bill B Gallery formatting - 03/13/2017 3:04 AM
When I build the "external" Gallery page (per the instructions on "Portal Layout / External Use)", it displays all images in a single column.

How do I get the "Included" Island to display the images in 3 or 4 columns per line?

Here's the code that it says to post in a separate PHP page:

PHP Code


<?php
if (!defined('UBB_MAIN_PROGRAM')) define('UBB_MAIN_PROGRAM',1);
$style_side="";$tbopen="";$tbclose="";
echo
"<table width="100%">";
include(
"/var/www/vhosts/vcca.org/httpdocs/forum/languages/english/portal_islands.php");
include(
"/var/www/vhosts/vcca.org/httpdocs/forum/languages/english/generic.php");
include(
"/var/www/vhosts/vcca.org/httpdocs/forum/cache/gallery_island_27.php");
echo
"</table>";
?>

Posted By: isaac Re: Gallery formatting - 03/13/2017 3:22 AM
You'll need to edit your tamplates/default/gallery_island.tpl template so that it custom displays the way you want it to display.

Right now it is displaying each image in its own table ROW

PHP Code

{section name=item loop=$items}
<
tr>
<
td class="{$style_side}alt-1" align="center">
<
a href="{ubb url="ubb=showgallery&Number=`$items[item].POST_ID`"}"><img alt="{$items[item].TOPIC_SUBJECT}" title="{$items[item].TOPIC_SUBJECT}" {$items[item].WIDTH_HEIGHT} src="{$config.BASE_URL}/gallery/{$items[item].TOPIC_THUMBNAIL}" /></a>
</
td>
</
tr>
{/
section}


Maybe update it to something like:
PHP Code

<tr>
<
td class="{$style_side}alt-1" align="center">
{
section name=item loop=$items}
<
a href="{ubb url="ubb=showgallery&Number=`$items[item].POST_ID`"}"><img alt="{$items[item].TOPIC_SUBJECT}" title="{$items[item].TOPIC_SUBJECT}" {$items[item].WIDTH_HEIGHT} src="{$config.BASE_URL}/gallery/{$items[item].TOPIC_THUMBNAIL}" /></a>
{/
section}
</
td>
</
tr>


This will make the change for all Gallery Islands.

You could add some margin to your image elements. Put a custom border around each image -- or make them round by using "border-radius: 50%;" in your image style.

Customize the code so that it works the way you want it to.
Posted By: Bill B Re: Gallery formatting - 03/13/2017 5:30 AM
Many thanks for the quick response.
So - the issue is that I currently use two Gallery's on my Forum Homepage. They are the normal single column style (template). Works good.

I wouldn't really want to mess those up -- don't have the room for a different shape. So I need to continue to use the generic template.

If I built a new gallery template with 5 columns (for example), can you think of any way that I could modify something else to point to the NEW template for just his one use?

I assume that this
PHP Code

if (!defined('UBB_MAIN_PROGRAM')) define('UBB_MAIN_PROGRAM',1);
$style_side="";$tbopen="";$tbclose="";
is what locks me into the original Gallery Template.


For Reference: I sure wish we could bridge between UBB and Coppermine.
Here's what I was playing with 3 years ago. http://vcca.org/gallery

Posted By: Gizmo Re: Gallery formatting - 03/13/2017 7:04 PM
You would have to "inject" an entry for the new cache_builder file into the PORTAL_BOXES table.
Posted By: Bill B Re: Gallery formatting - 03/13/2017 7:49 PM
Thanks... I will dig into that tonight.
© UBB.Developers