Home Private Messages Search
CPG Dragonfly™ CMS stopsoftwarepatents.eu petition banner
Toggle Content
 
Forums ⇒ DragonflyCMS ⇒ Coppermine ⇒ Last Picture Block - 2 rows


Last Picture Block - 2 rows
Please post bugs in the Projects Module.
Post anything and everything else about Coppermine in this forum.

Go to page 1, 2  Next
Post new topic    Reply to topic    Printer Friendly Page     Forum Index ⇒  Add-Ons & BlocksCoppermine

View previous topic :: View next topic  
Author Message
WebSiteGuru
1000+ Posts Club
1000+ Posts Club

Offline Offline
Joined: Jun 09, 2005
Posts: 2318

PostPosted: Fri Sep 14, 2007 3:11 pm
Post subject: Last Picture Block - 2 rows

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
View user's profile Visit poster's website Yahoo Messenger
NanoCaiordo
Developer
Developer

Offline Offline
Joined: Jun 29, 2004
Posts: 3878
Location: Melbourne, AU
PostPosted: Fri Sep 14, 2007 4:16 pm
Post subject: Re: Last Picture Block - 2 rows

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! ::.

Linux 64bit / Apache 2.2 / PHP 5.4 / MySQL 5.5.22 / v9, v10
Linux 32bit / Apache 2.2 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10
Windows 64bit / IIS 7.5 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10


NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
mixed
Back to top
View user's profile Visit poster's website Photo Gallery
WebSiteGuru
1000+ Posts Club
1000+ Posts Club

Offline Offline
Joined: Jun 09, 2005
Posts: 2318

PostPosted: Fri Sep 14, 2007 5:44 pm
Post subject: Re: Last Picture Block - 2 rows

I am talking about file-block inside blocks/ directory. Thanks for responding pretty fast. Very Happy

_________________
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
View user's profile Visit poster's website Yahoo Messenger
NanoCaiordo
Developer
Developer

Offline Offline
Joined: Jun 29, 2004
Posts: 3878
Location: Melbourne, AU
PostPosted: Sat Sep 15, 2007 2:33 am
Post subject: Re: Last Picture Block - 2 rows

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! ::.

Linux 64bit / Apache 2.2 / PHP 5.4 / MySQL 5.5.22 / v9, v10
Linux 32bit / Apache 2.2 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10
Windows 64bit / IIS 7.5 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10


NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
mixed
Back to top
View user's profile Visit poster's website Photo Gallery
WebSiteGuru
1000+ Posts Club
1000+ Posts Club

Offline Offline
Joined: Jun 09, 2005
Posts: 2318

PostPosted: Tue Sep 18, 2007 3:46 pm
Post subject: Re: Last Picture Block - 2 rows

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 . '&amp;file=displayimage&amp;meta=lastup&amp;cat=0&amp;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! Big grin

_________________
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
View user's profile Visit poster's website Yahoo Messenger
NanoCaiordo
Developer
Developer

Offline Offline
Joined: Jun 29, 2004
Posts: 3878
Location: Melbourne, AU
PostPosted: Tue Sep 18, 2007 3:56 pm
Post subject: Re: Last Picture Block - 2 rows

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! ::.

Linux 64bit / Apache 2.2 / PHP 5.4 / MySQL 5.5.22 / v9, v10
Linux 32bit / Apache 2.2 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10
Windows 64bit / IIS 7.5 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10


NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
mixed
Back to top
View user's profile Visit poster's website Photo Gallery
WebSiteGuru
1000+ Posts Club
1000+ Posts Club

Offline Offline
Joined: Jun 09, 2005
Posts: 2318

PostPosted: Tue Sep 18, 2007 4:53 pm
Post subject: Re: Last Picture Block - 2 rows

Oh! OKKIE! Thanks! Big grin Embarassed Now I feel stupid. Wink Shocked

_________________
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
View user's profile Visit poster's website Yahoo Messenger
NanoCaiordo
Developer
Developer

Offline Offline
Joined: Jun 29, 2004
Posts: 3878
Location: Melbourne, AU
PostPosted: Tue Sep 18, 2007 4:56 pm
Post subject: Re: Last Picture Block - 2 rows

My bad, instructions were not that clear, but at least we got it working Smile

_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Linux 64bit / Apache 2.2 / PHP 5.4 / MySQL 5.5.22 / v9, v10
Linux 32bit / Apache 2.2 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10
Windows 64bit / IIS 7.5 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10


NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
mixed
Back to top
View user's profile Visit poster's website Photo Gallery
WebSiteGuru
1000+ Posts Club
1000+ Posts Club

Offline Offline
Joined: Jun 09, 2005
Posts: 2318

PostPosted: Tue Sep 18, 2007 5:01 pm
Post subject: Re: Last Picture Block - 2 rows

I still have to try it tonight when I get home, since I dont have access to the server from work. Wink I'll come back with the results. Very Happy

_________________
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
View user's profile Visit poster's website Yahoo Messenger
WebSiteGuru
1000+ Posts Club
1000+ Posts Club

Offline Offline
Joined: Jun 09, 2005
Posts: 2318

PostPosted: Wed Sep 19, 2007 4:48 am
Post subject: Re: Last Picture Block - 2 rows

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
View user's profile Visit poster's website Yahoo Messenger
WebSiteGuru
1000+ Posts Club
1000+ Posts Club

Offline Offline
Joined: Jun 09, 2005
Posts: 2318

PostPosted: Wed Sep 19, 2007 2:28 pm
Post subject: Re: Last Picture Block - 2 rows

All Done Thanks Nano. Very Happy Kudos for you. Wink

_________________
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
View user's profile Visit poster's website Yahoo Messenger
3DdesktopsUK
Silver Supporter
Silver Supporter

Offline Offline
Joined: Mar 22, 2005
Posts: 195
Location: Surrey - UK
PostPosted: Sat Apr 12, 2008 9:07 am
Post subject: Re: Last Picture Block - 2 rows

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 . '&amp;file=displayimage&amp;meta=lastup&amp;cat=0&amp;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
View user's profile Visit poster's website
rlgura
1000+ Posts Club
1000+ Posts Club

Offline Offline
Joined: Mar 27, 2006
Posts: 1146
Location: Cleveland, OH USA
PostPosted: Sat Apr 12, 2008 4:43 pm
Post subject: Re: Last Picture Block - 2 rows

$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
View user's profile Visit poster's website
3DdesktopsUK
Silver Supporter
Silver Supporter

Offline Offline
Joined: Mar 22, 2005
Posts: 195
Location: Surrey - UK
PostPosted: Sat Apr 12, 2008 9:53 pm
Post subject: Re: Last Picture Block - 2 rows

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
View user's profile Visit poster's website
3DdesktopsUK
Silver Supporter
Silver Supporter

Offline Offline
Joined: Mar 22, 2005
Posts: 195
Location: Surrey - UK
PostPosted: Mon Jun 09, 2008 8:21 am
Post subject: Re: Last Picture Block - 2 rows

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
View user's profile Visit poster's website
Display posts from previous:   
Post new topic    Reply to topic    Printer Friendly Page    Forum Index ⇒  Add-Ons & BlocksCoppermine
Page 1 of 2
All times are GMT
Go to page 1, 2  Next



Jump to:  


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


 
   Toggle Content User Info

Welcome Anonymous

Nickname
Password
(Register)

   Toggle Content Last CVS commits
· Fixed .ico Expires header.
· Removed domain name from cookies so subdomains wont access them anymore.
· CSS and JS, case insensitives.
· CSS and JS, send correct HTTP 1.1 headers and fixed issues where themes and...
· Further security class improvements.
· 301 redirects on LEO changes
· Option to force 3xx http status codes
· Validate googlebot.com and google.com crawlers.
· CCBot
· Rss with etag and atom.

Aiheesta Lisää...

   Toggle Content Community

Support for DragonflyCMS in a other languages:

Deutsch
Español

   Toggle Content X-links
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
Interactive software released under GNU GPL, Code Credits, Privacy Policy