forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: fersauce on September 11, 2011, 11:39:54 am
-
Hy there everybody.
In need to show two or three colums of sub categories whitout liks of archives and pages because I have a lot of sub categories and its page is very large.
these is my gallery in 1.4 http://www.fotoserver.es/server/index.php
and this is in 1.5 http://www.fotoserver.es/server2/index.php
Thanks a lot
-
Nobody replies?
What I meen is this: Now I see this
Categories
Subcat
Subcat
Subcat
...
And I need this
Categories
Subcat Subcat Subcat
Subcat Subcat Subcat
Subcat Subcat Subcat
....
In this link http://www.fotoserver.es/server2/index.php you can register like User: invitado Pass: invitado
Thanks
-
<!--Coppermine Photo Gallery 1.5.12 (stable)-->
You should upgrade to cpg1.5.16.
The following code is maybe not the final solution, but for a start copy it to your theme's theme.php file:
/******************************************************************************
** Section <<<$template_cat_list>>> - START
******************************************************************************/
// HTML template for the category list
$template_cat_list = <<<EOT
<!-- BEGIN header -->
<tr>
<td class="tableh1" width="100%" align="left" colspan="3">{CATEGORY}</td>
</tr>
<!-- END header -->
<!-- BEGIN catrow_noalb -->
<td class="catrow_noalb"><table border="0"><tr><td align="left">{CAT_THUMB}</td><td align="left"><span class="catlink">{CAT_TITLE}</span>{CAT_DESC}</td></tr></table></td>
<!-- END catrow_noalb -->
<!-- BEGIN catrow -->
<td class="catrow" align="left"><table border="0"><tr><td>{CAT_THUMB}</td><td><span class="catlink">{CAT_TITLE}</span>{CAT_DESC}</td></tr></table></td>
<!-- END catrow -->
<!-- BEGIN footer -->
<tr>
<td colspan="3" class="tableh1" align="center"><span class="statlink">{STATISTICS}</span></td>
</tr>
<!-- END footer -->
<!-- BEGIN spacer -->
<img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->
EOT;
/******************************************************************************
** Section <<<$template_cat_list>>> - END
******************************************************************************/
/******************************************************************************
** Section <<<theme_display_cat_list>>> - START
******************************************************************************/
function theme_display_cat_list($breadcrumb, &$cat_data, $statistics)
{
global $template_cat_list, $lang_cat_list;
if (count($cat_data) > 0) {
starttable('100%');
$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_noalb = template_extract_block($template_cat_list, 'catrow_noalb');
$template = template_extract_block($template_cat_list, 'catrow');
$count = 0;
echo "<tr>";
foreach($cat_data as $category) {
if ($count%3 == 0) {
echo "</tr><tr>";
}
$count++;
if (!isset($category['cat_thumb'])) { $category['cat_thumb'] = ''; }
if (count($category) == 3) {
$params = array(
'{CAT_TITLE}' => $category[0],
'{CAT_THUMB}' => $category['cat_thumb'],
'{CAT_DESC}' => $category[1],
);
echo template_eval($template_noalb, $params);
} elseif (isset($category['cat_albums']) && ($category['cat_albums'] != '')) {
$params = array(
'{CAT_TITLE}' => $category[0],
'{CAT_THUMB}' => $category['cat_thumb'],
'{CAT_DESC}' => $category[1],
'{CAT_ALBUMS}' => $category['cat_albums'],
'{ALB_COUNT}' => cpg_float2decimal($category[2]),
'{PIC_COUNT}' => cpg_float2decimal($category[3]),
);
echo template_eval($template, $params);
} else {
$params = array(
'{CAT_TITLE}' => $category[0],
'{CAT_THUMB}' => $category['cat_thumb'],
'{CAT_DESC}' => $category[1],
'{CAT_ALBUMS}' => '',
'{ALB_COUNT}' => cpg_float2decimal($category[2]),
'{PIC_COUNT}' => cpg_float2decimal($category[3]),
);
echo template_eval($template, $params);
}
}
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);
}
if (count($cat_data) > 0)
endtable();
echo template_extract_block($template_cat_list, 'spacer');
}
/******************************************************************************
** Section <<<theme_display_cat_list>>> - END
******************************************************************************/
-
THAKS A LOT ANDRÉ!!!
Its almost perfect.
May I ask you two more things?
1.- Cat_title and cat_description just behind the cat_thum (not it is on the right)
2.- A break before each category name
it's posible?
You can see yor mods here http://www.fotoserver.es/server2/index.php
user: invitado
pass: invitado
Thaks.
-
1.- Cat_title and cat_description just behind the cat_thum (not it is on the right)
Do you mean "below" the thumbnail?
2.- A break before each category name
What do you mean with a "break"?
-
I´sorry
of course I meant below de thumnail, centered.
Now with your mod i see these
Cat sub
-
I'm so sorry
of course I meant below de thumnail, and centered.
Now with your mod i see these
Cat subcat subcat
subcat subcat subcat
subcat Cat subcat
subcat subcat
An I need these
Cat
subcat subcat subcat
subcat subcat subcat
Cat
subcat subcat subcat
etc
-
Try this updated code:
/******************************************************************************
** Section <<<$template_cat_list>>> - START
******************************************************************************/
// HTML template for the category list
$template_cat_list = <<<EOT
<!-- BEGIN header -->
<tr>
<td class="tableh1" width="100%" align="left" colspan="3">{CATEGORY}</td>
</tr>
<!-- END header -->
<!-- BEGIN catrow_noalb -->
<td class="catrow_noalb" align="left"><table border="0"><tr><td align="center">{CAT_THUMB}<span class="catlink">{CAT_TITLE}</span>{CAT_DESC}</td></tr></table></td>
<!-- END catrow_noalb -->
<!-- BEGIN catrow -->
<td class="catrow" align="left"><table border="0"><tr><td align="center">{CAT_THUMB}<span class="catlink">{CAT_TITLE}</span>{CAT_DESC}</td></tr></table></td>
<!-- END catrow -->
<!-- BEGIN footer -->
<tr>
<td colspan="3" class="tableh1" align="center"><span class="statlink">{STATISTICS}</span></td>
</tr>
<!-- END footer -->
<!-- BEGIN spacer -->
<img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->
EOT;
/******************************************************************************
** Section <<<$template_cat_list>>> - END
******************************************************************************/
/******************************************************************************
** Section <<<theme_display_cat_list>>> - START
******************************************************************************/
function theme_display_cat_list($breadcrumb, &$cat_data, $statistics)
{
global $template_cat_list, $lang_cat_list;
if (count($cat_data) > 0) {
starttable('100%');
$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_noalb = template_extract_block($template_cat_list, 'catrow_noalb');
$template = template_extract_block($template_cat_list, 'catrow');
$cols = 3;
$count = 0;
echo "<tr>";
foreach($cat_data as $category) {
if ($count%$cols == 0) {
echo "</tr><tr>";
}
$count++;
if (!isset($category['cat_thumb'])) { $category['cat_thumb'] = ''; }
if (count($category) == 3) {
$params = array(
'{CAT_TITLE}' => $category[0],
'{CAT_THUMB}' => $category['cat_thumb'],
'{CAT_DESC}' => $category[1],
);
$cell = template_eval($template_noalb, $params);
} elseif (isset($category['cat_albums']) && ($category['cat_albums'] != '')) {
$params = array(
'{CAT_TITLE}' => $category[0],
'{CAT_THUMB}' => $category['cat_thumb'],
'{CAT_DESC}' => $category[1],
'{CAT_ALBUMS}' => $category['cat_albums'],
'{ALB_COUNT}' => cpg_float2decimal($category[2]),
'{PIC_COUNT}' => cpg_float2decimal($category[3]),
);
$cell = template_eval($template, $params);
} else {
$params = array(
'{CAT_TITLE}' => $category[0],
'{CAT_THUMB}' => $category['cat_thumb'],
'{CAT_DESC}' => $category[1],
'{CAT_ALBUMS}' => '',
'{ALB_COUNT}' => cpg_float2decimal($category[2]),
'{PIC_COUNT}' => cpg_float2decimal($category[3]),
);
$cell = template_eval($template, $params);
}
if (!strpos($category['cat_thumb'], '<img src="images/spacer.gif"')) {
$cell = str_replace('<td class', '<td colspan="'.$cols.'" class', $cell);
echo $cell;
echo "</tr><tr>";
$count = 0;
} else {
echo $cell;
}
}
while ($count++%$cols != 0) {
echo "<td class=\"catrow_noalb\"></td>";
}
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);
}
if (count($cat_data) > 0)
endtable();
echo template_extract_block($template_cat_list, 'spacer');
}
/******************************************************************************
** Section <<<theme_display_cat_list>>> - END
******************************************************************************/
-
Hello Andre.
Now its perfect, than you a lot.
-
Then please
tag your answer as "solved" by clicking on the "Topic Solved" button on the bar at the left hand side at the bottom of your thread.
-
Then please
Hi André,
I know this post has been closed months ago and I apologize for coming back to it, but I need some help with a problem that I have with the modification you made.
The problem is not with the "category" section you programmed, but with the subsequent pages. When choosing a "category" and entering into the "albums" page, this page appears out of order. These disorders are clearly visible especially at the "header" and the "footer" of the page. We can find the same mess when entering into an album, in that case the page of "thumbnails" is also out of order. Same alteration occurs when the system asks for the password of an album (for instance http://www.informagen.es/server/thumbnails.php?album=149)
This is my gallery http://www.informagen.es/server/login.php.
You can use this web access:
Usuario: invitado
Password: invitado
Many thanks in advance for your help.
Best regards,
-
Please attach your whole theme as zip file, as it doesn't happen in my testbed.
-
Here it is.
-
Try this updated code:
/******************************************************************************
** Section <<<$template_cat_list>>> - START
******************************************************************************/
// HTML template for the category list
$template_cat_list = <<<EOT
<!-- BEGIN header -->
<tr>
<td class="tableh1" width="100%" align="left" colspan="3">{CATEGORY}</td>
</tr>
<!-- END header -->
<!-- BEGIN catrow_noalb -->
<td class="catrow_noalb"><table border="0"><tr><td align="left">{CAT_THUMB}</td><td align="left"><span class="catlink">{CAT_TITLE}</span>{CAT_DESC}</td></tr></table></td>
<!-- END catrow_noalb -->
<!-- BEGIN catrow -->
<td class="catrow" align="left"><table border="0"><tr><td>{CAT_THUMB}</td><td><span class="catlink">{CAT_TITLE}</span>{CAT_DESC}</td></tr></table></td>
<!-- END catrow -->
<!-- BEGIN footer -->
<tr>
<td colspan="3" class="tableh1" align="center"><span class="statlink">{STATISTICS}</span></td>
</tr>
<!-- END footer -->
<!-- BEGIN spacer -->
<img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->
EOT;
/******************************************************************************
** Section <<<$template_cat_list>>> - END
******************************************************************************/
/******************************************************************************
** Section <<<theme_display_cat_list>>> - START
******************************************************************************/
function theme_display_cat_list($breadcrumb, &$cat_data, $statistics)
{
global $template_cat_list, $lang_cat_list;
if (count($cat_data) > 0) {
starttable('100%');
$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_noalb = template_extract_block($template_cat_list, 'catrow_noalb');
$template = template_extract_block($template_cat_list, 'catrow');
$count = 0;
if (count($cat_data)) {
echo "<tr>";
foreach($cat_data as $category) {
if ($count%3 == 0) {
echo "</tr><tr>";
}
$count++;
if (!isset($category['cat_thumb'])) { $category['cat_thumb'] = ''; }
if (count($category) == 3) {
$params = array(
'{CAT_TITLE}' => $category[0],
'{CAT_THUMB}' => $category['cat_thumb'],
'{CAT_DESC}' => $category[1],
);
echo template_eval($template_noalb, $params);
} elseif (isset($category['cat_albums']) && ($category['cat_albums'] != '')) {
$params = array(
'{CAT_TITLE}' => $category[0],
'{CAT_THUMB}' => $category['cat_thumb'],
'{CAT_DESC}' => $category[1],
'{CAT_ALBUMS}' => $category['cat_albums'],
'{ALB_COUNT}' => cpg_float2decimal($category[2]),
'{PIC_COUNT}' => cpg_float2decimal($category[3]),
);
echo template_eval($template, $params);
} else {
$params = array(
'{CAT_TITLE}' => $category[0],
'{CAT_THUMB}' => $category['cat_thumb'],
'{CAT_DESC}' => $category[1],
'{CAT_ALBUMS}' => '',
'{ALB_COUNT}' => cpg_float2decimal($category[2]),
'{PIC_COUNT}' => cpg_float2decimal($category[3]),
);
echo template_eval($template, $params);
}
}
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);
}
if (count($cat_data) > 0)
endtable();
echo template_extract_block($template_cat_list, 'spacer');
}
/******************************************************************************
** Section <<<theme_display_cat_list>>> - END
******************************************************************************/
-
Great. It´s ok. But now I need a "break" before each category name. it´s possible?
-
I´m so sorry. I meant "after" each categoryes name
-
.... and the "catlink" under the thumnail. ;D
-
Where do you need a break? Which catlink under which thumbnail? Please post screenshots.
-
Now I see this:
CategorieName thumb catlink thumb catlink
thumb catlink thumb catlink thumb catlink
thumb catlink CategorieName thumb catlink
thumb catlink thumb catlink thumb catlink
An I need this:
CategorieName
Thumb Thumb Thumb
Catlink Catlink Catlink
Thumb Thumb Thumb
Catlink Catlink Catlink
Thumb Thumb
Catlink Catlink
CategorieName
Thumb Thumb Thumb
Catlink Catlink Catlink
CategorieName
Thumb Thumb Thumb
Catlink Catlink Catlink
Please, if it's possible, the thumbs and the catlink centered in each row. Really, you made it in your first mod. (see previous post)
Thank you André.
-
Now I see this:
CategorieName thumb catlink thumb catlink
thumb catlink thumb catlink thumb catlink
thumb catlink CategorieName thumb catlink
thumb catlink thumb catlink thumb catlink
An I need this:
CategorieName
Thumb Thumb Thumb
Catlink Catlink Catlink
Thumb Thumb Thumb
Catlink Catlink Catlink
Thumb Thumb
Catlink Catlink
CategorieName
Thumb Thumb Thumb
Catlink Catlink Catlink
CategorieName
Thumb Thumb Thumb
Catlink Catlink Catlink
Please, if it's possible, the thumbs and the catlink centered in each row. Really, you made it in your first mod. (see previous post)
Thank you André.