| Author |
Message |
WebSiteGuru


Joined: Jun 09, 2005 Posts: 2321
|
Post subject: Last Picture Block - 2 rows Posted: Fri Sep 14, 2007 3:11 pm |
|
How can I make it to where the Last picture block will show 2 rows instead of 1?
_________________ Lead Theme Designer - WebSiteGuru Designs
WebSiteGuru's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux 2.6.9 / Apache 2.2.6 / MySQL 5.0.27 / PHP 5 / DF Version 9.2.1 |
|
| Back to top |
|
 |
NanoCaiordo


Joined: Jun 29, 2004 Posts: 3677 Location: Melbourne, AU
|
Post subject: Re: Last Picture Block - 2 rows Posted: Fri Sep 14, 2007 4:16 pm |
|
Are you talking about the Last Picture block at the bottom of coppermine index page or a file-block inside blocks/ directory?
_________________ .:: I met php the 03 December 2003 :: Unforgettable day! ::.
NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) MySQL 5.1 / PHP 5.3 / NextGen() |
|
| Back to top |
|
 |
WebSiteGuru


Joined: Jun 09, 2005 Posts: 2321
|
Post subject: Re: Last Picture Block - 2 rows Posted: Fri Sep 14, 2007 5:44 pm |
|
I am talking about file-block inside blocks/ directory. Thanks for responding pretty fast.
_________________ Lead Theme Designer - WebSiteGuru Designs
WebSiteGuru's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux 2.6.9 / Apache 2.2.6 / MySQL 5.0.27 / PHP 5 / DF Version 9.2.1 |
|
| Back to top |
|
 |
NanoCaiordo


Joined: Jun 29, 2004 Posts: 3677 Location: Melbourne, AU
|
Post subject: Re: Last Picture Block - 2 rows Posted: Sat Sep 15, 2007 2:33 am |
|
If you are talking about block-CPG-center-Last_pictures_thumb.php the number of pictures is coming from a coppermine wide configuration $CONFIG['thumbcols'] "number of thumbnails for row".
However if you only want to modify the block and not the entire coppermine then you can try the following inside the block:
$length = 8;
$rows = 2;
.....
$pic++;
if ($length/$rows == $pic) $content .= '</tr><tr>';
_________________ .:: I met php the 03 December 2003 :: Unforgettable day! ::.
NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) MySQL 5.1 / PHP 5.3 / NextGen() |
|
| Back to top |
|
 |
WebSiteGuru


Joined: Jun 09, 2005 Posts: 2321
|
Post subject: Re: Last Picture Block - 2 rows Posted: Tue Sep 18, 2007 3:46 pm |
|
NanoCaiordo wrote:
However if you only want to modify the block and not the entire coppermine then you can try the following inside the block:
$length = 8;
$rows = 2;
.....
$pic++;
if ($length/$rows == $pic) $content .= '</tr><tr>';
OK! I understand that I have to edit the block add the bold in red info in. But I am confused to where it goes. I had tried to put it in the area indicated below in bold red, it it still not showing 2 rows in the blocks.
Quote:
if (!defined('CPG_NUKE')) { exit; }
global $prefix, $db, $CONFIG, $cpg_dir;
$cpg_dir = "coppermine";
if (!is_active($cpg_dir)) {
$content = 'ERROR';
return trigger_error($cpg_dir.' module is inactive', E_USER_WARNING);
}
$cpg_block = true;
require("modules/" . $cpg_dir . "/include/load.inc");
$cpg_block = false;
$length = $CONFIG['thumbcols']; //number of thumbs
// $length=4; //number of thumbs
$length = 8;
$rows = 2;
$content = $thumb_title = '';
$result = $db->sql_query("SELECT pid, filepath, filename, p.aid, p.title FROM ".$cpg_prefix."pictures AS p INNER JOIN ".$cpg_prefix."albums AS a ON (p.aid = a.aid AND ".VIS_GROUPS.") WHERE approved=1 GROUP BY pid ORDER BY pid DESC LIMIT $length");
$content .= '<br /><table width="100%" border="0" cellpadding="0" cellspacing="0" align="center"><tr align="center">';
$pic = 0;
while ($row = $db->sql_fetchrow($result)) {
if ($CONFIG['seo_alts'] == 0) {
$thumb_title = $row['filename'];
} else {
if ($row['title'] != '') {
$thumb_title = $row['title'];
} else {
$thumb_title = substr($row['filename'], 0, -4);
}
}
$content .= '<td align="center" valign="baseline"><a href="' . getlink($cpg_dir . '&file=displayimage&meta=lastup&cat=0&pos=' . $pic) . '"><img src="' . get_pic_url($row, 'thumb') . '" border="0" alt="' . $thumb_title . '" title="' . $thumb_title . '" /><br />' . truncate_stringblocks($thumb_title) . '</a></td>';
$pic++;
}
if ($length/$rows == $pic) $content .= '</tr><tr align="center"><td colspan="' . $length . '" valign="baseline"><a href="' . getlink($cpg_dir) . '">' . _coppermineLANG . '</a><br /></td></tr></table>';
Can you explain more on this? Thanks!
_________________ Lead Theme Designer - WebSiteGuru Designs
WebSiteGuru's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux 2.6.9 / Apache 2.2.6 / MySQL 5.0.27 / PHP 5 / DF Version 9.2.1 |
|
| Back to top |
|
 |
NanoCaiordo


Joined: Jun 29, 2004 Posts: 3677 Location: Melbourne, AU
|
Post subject: Re: Last Picture Block - 2 rows Posted: Tue Sep 18, 2007 3:56 pm |
|
PHP:
$pic++; } if ($length/$rows == $pic) $content .= '</tr><tr align="center"><td colspan="' . $length . '" valign="baseline"><a href="' .
wrong
PHP:
$pic++; if ($length/$rows == $pic) $content .= '</tr><tr>'; } $content .= '</tr><tr> ...the original code...';
correct
_________________ .:: I met php the 03 December 2003 :: Unforgettable day! ::.
NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) MySQL 5.1 / PHP 5.3 / NextGen() |
|
| Back to top |
|
 |
WebSiteGuru


Joined: Jun 09, 2005 Posts: 2321
|
Post subject: Re: Last Picture Block - 2 rows Posted: Tue Sep 18, 2007 4:53 pm |
|
Oh! OKKIE! Thanks! Now I feel stupid.
_________________ Lead Theme Designer - WebSiteGuru Designs
WebSiteGuru's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux 2.6.9 / Apache 2.2.6 / MySQL 5.0.27 / PHP 5 / DF Version 9.2.1 |
|
| Back to top |
|
 |
NanoCaiordo


Joined: Jun 29, 2004 Posts: 3677 Location: Melbourne, AU
|
Post subject: Re: Last Picture Block - 2 rows Posted: Tue Sep 18, 2007 4:56 pm |
|
My bad, instructions were not that clear, but at least we got it working
_________________ .:: I met php the 03 December 2003 :: Unforgettable day! ::.
NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) MySQL 5.1 / PHP 5.3 / NextGen() |
|
| Back to top |
|
 |
WebSiteGuru


Joined: Jun 09, 2005 Posts: 2321
|
Post subject: Re: Last Picture Block - 2 rows Posted: Tue Sep 18, 2007 5:01 pm |
|
I still have to try it tonight when I get home, since I dont have access to the server from work. I'll come back with the results.
_________________ Lead Theme Designer - WebSiteGuru Designs
WebSiteGuru's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux 2.6.9 / Apache 2.2.6 / MySQL 5.0.27 / PHP 5 / DF Version 9.2.1 |
|
| Back to top |
|
 |
WebSiteGuru


Joined: Jun 09, 2005 Posts: 2321
|
Post subject: Re: Last Picture Block - 2 rows Posted: Wed Sep 19, 2007 4:48 am |
|
OK! It works now, with minor detail spacing. I'll try to figure that one out.
_________________ Lead Theme Designer - WebSiteGuru Designs
WebSiteGuru's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux 2.6.9 / Apache 2.2.6 / MySQL 5.0.27 / PHP 5 / DF Version 9.2.1 |
|
| Back to top |
|
 |
WebSiteGuru


Joined: Jun 09, 2005 Posts: 2321
|
Post subject: Re: Last Picture Block - 2 rows Posted: Wed Sep 19, 2007 2:28 pm |
|
All Done Thanks Nano. Kudos for you.
_________________ Lead Theme Designer - WebSiteGuru Designs
WebSiteGuru's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux 2.6.9 / Apache 2.2.6 / MySQL 5.0.27 / PHP 5 / DF Version 9.2.1 |
|
| Back to top |
|
 |
3DdesktopsUK


Joined: Mar 22, 2005 Posts: 195 Location: Surrey - UK
|
Post subject: Re: Last Picture Block - 2 rows Posted: Sat Apr 12, 2008 9:07 am |
|
Hi guys, just copied the code to impliment on my site but the second row is not showing - any ideas what I have done wrong?
Many thanks in advance...
PHP:
<?php /********************************************* CPG Dragonfly™ CMS ******************************************** Copyright © 2004 - 2005 by CPG-Nuke Dev Team www.dragonflycms.com
Dragonfly is released under the terms and conditions of the GNU GPL version 2 or any later version
$Source: /cvs/html/blocks/block-CPG-Last_pictures_thumb.php,v $ $Revision: 9.6 $ $Author: djmaze $ $Date: 2006/01/16 12:19:32 $ Encoding test: n-array summation ? latin ae w/ acute ? ********************************************************/ if (!defined('CPG_NUKE')) { exit; } global $prefix, $db, $CONFIG, $cpg_dir; $cpg_dir = "coppermine";
if (!is_active($cpg_dir)) { $content = 'ERROR'; return trigger_error($cpg_dir.' module is inactive', E_USER_WARNING); }
$cpg_block = true; require("modules/" . $cpg_dir . "/include/load.inc"); $cpg_block = false; $length = $CONFIG['thumbcols']; //number of thumbs // $length=4; //number of thumbs $length=3; $rows=2; $content = $thumb_title = ''; $result = $db->sql_query("SELECT pid, filepath, filename, p.aid, p.title FROM ".$cpg_prefix."pictures AS p INNER JOIN ".$cpg_prefix."albums AS a ON (p.aid = a.aid AND ".VIS_GROUPS.") WHERE approved=1 GROUP BY pid ORDER BY pid DESC LIMIT $length"); $content .= '<br /><table width="100%" border="0" cellpadding="0" cellspacing="0" align="center"><tr align="center">'; $pic = 0; while ($row = $db->sql_fetchrow($result)) { if ($CONFIG['seo_alts'] == 0) { $thumb_title = $row['filename']; } else { if ($row['title'] != '') { $thumb_title = $row['title']; } else { $thumb_title = substr($row['filename'], 0, -4); } } $content .= '<td align="center" valign="baseline"><a href="' . getlink($cpg_dir . '&file=displayimage&meta=lastup&cat=0&pos=' . $pic) . '"><img src="' . get_pic_url($row, 'thumb') . '" border="0" alt="' . $thumb_title . '" title="' . $thumb_title . '" /><br />' . truncate_stringblocks($thumb_title) . '</a></td>'; $pic++; if ($length/$rows == $pic) $content .= '</tr><tr>'; } $content .= '</tr><tr><tr align="center"></td></tr></table>';
The first row still shows -
>> My Test Site
_________________ Need a new 3D Desktop wallpaper? 3D Wallpapers UK - Original 3D Digital Wallpapers
3DdesktopsUK's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Windows 2003 Server / Apache / MySQL 5.0.41 / PHP Version 4.4.7 / CMS Version 9.1.2.1 |
|
| Back to top |
|
 |
rlgura


Joined: Mar 27, 2006 Posts: 1148 Location: Cleveland, OH USA
|
Post subject: Re: Last Picture Block - 2 rows Posted: Sat Apr 12, 2008 4:43 pm |
|
$length is the total number of pictures - in your case it should be 6
_________________ Admin - Great Lakes Web Designs
Theme Designer - WebSite Guru Designs
Site Admin - Families with Food Allergies
rlgura's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux 2.6.27-grsec/Apache 2.2.11/MySQL 5.0.67-community-log/PHP 5.2.8/DF 9.2.1 |
|
| Back to top |
|
 |
3DdesktopsUK


Joined: Mar 22, 2005 Posts: 195 Location: Surrey - UK
|
Post subject: Re: Last Picture Block - 2 rows Posted: Sat Apr 12, 2008 9:53 pm |
|
that's great!! o der me lol!!!
Thanks rlgura
_________________ Need a new 3D Desktop wallpaper? 3D Wallpapers UK - Original 3D Digital Wallpapers
3DdesktopsUK's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Windows 2003 Server / Apache / MySQL 5.0.41 / PHP Version 4.4.7 / CMS Version 9.1.2.1 |
|
| Back to top |
|
 |
3DdesktopsUK


Joined: Mar 22, 2005 Posts: 195 Location: Surrey - UK
|
Post subject: Re: Last Picture Block - 2 rows Posted: Mon Jun 09, 2008 8:21 am |
|
hi, just playing around with this again and tried to display 12 thumbs (3 wide / 4 deep) and although it does display the 12, it doesn't wrap on the second line. like so:
xxx
xxxxxxxxx
opposed to
xxx
xxx
xxx
xxx
is there something I am missing again. Thanks in advance.
_________________ Need a new 3D Desktop wallpaper? 3D Wallpapers UK - Original 3D Digital Wallpapers
3DdesktopsUK's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Windows 2003 Server / Apache / MySQL 5.0.41 / PHP Version 4.4.7 / CMS Version 9.1.2.1 |
|
| Back to top |
|
 |