[BETA] Coppermine Latest Pics In Profile 0.0.3

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Joe Belmaati
Registered User
Posts: 2110
Joined: Sun Sep 28, 2003 7:35 pm
Location: Denmark

[BETA] Coppermine Latest Pics In Profile 0.0.3

Post by Joe Belmaati » Tue Aug 22, 2006 5:00 pm

Code: Select all

##############################################################
## MOD Title: Coppermine Latest Pics In Profile
## MOD Author: Joe Belmaati < belmaati@gmail.com > (Joe Belmaati) N/A
## MOD Description: An add on for those folks who are running phpBB
## and Coppermine Photo Gallery in tandem. This MOD will show the
## latest x number of pictures by a user when their profile is viewed
## MOD Version: BETA 0.0.3
##
## Installation Level: Easy
## Installation Time: 3 Minutes
## Files To Edit: 3,
##		includes/usercp_viewprofile.php
##		language/lang_english/lang_main.php
##		templates/subSilver/profile_view_body.tpl
## Included Files: N/A
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes: change the constants (define...blah) to reflect
## your table names, file paths, and number of pics to show
##############################################################
## MOD History:
##
##   2006-08-25 - BETA 0.0.3
##      - bugfix
##
##   2006-08-25 - BETA 0.0.2
##      - bugfix
##
##   2006-08-21 - BETA 0.0.1
##      - initial BETA
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

Link to code

An add on for those folks who are running phpBB and Coppermine Photo Gallery in tandem. This MOD will show the latest x number of pictures by a user when their profile is viewed
Last edited by Joe Belmaati on Fri Aug 25, 2006 6:18 pm, edited 4 times in total.
Image

User avatar
DeViAnThans3
Registered User
Posts: 877
Joined: Sat Oct 08, 2005 10:39 pm
Location: Belgium

Post by DeViAnThans3 » Tue Aug 22, 2006 5:40 pm

Very nice done :D
This can be a usefull mod :wink:
I only provide support via the appropriate topics! Please no PM or mails! :)
My MODs :: [BETA] Facebook Connect

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Post by RMcGirr83 » Tue Aug 22, 2006 6:39 pm

Got an error if a user is allowed to change their name on the forum...but don't in CPG.

Other than that it works well.


Joe Belmaati
Registered User
Posts: 2110
Joined: Sun Sep 28, 2003 7:35 pm
Location: Denmark

Post by Joe Belmaati » Wed Aug 23, 2006 10:57 am

RMcGirr83 wrote: Got an error if a user is allowed to change their name on the forum...but don't in CPG.

Other than that it works well.
Sounds like you don't have a proper bridge for Coppermine/phpBB set up? This MOD only works when phpBB and Coppermine are bridged so that Coppermine uses the users information from phpBB.
Image

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Post by RMcGirr83 » Wed Aug 23, 2006 11:05 am

It is bridged.

I have the error saved at another computer and will post it on here...probably won't be til Friday though.

Work keeps getting in the way of my fun. :(

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Post by RMcGirr83 » Thu Aug 24, 2006 1:41 pm

As promised...here's the error
General Error Message:

Could not obtain picture information<br /><br /><b><u>DEBUG MODE</u></b><br /><br />SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2<br /><br />SELECT pid FROM cpg135_pictures
WHERE aid = </br /><br />Line : 525<br />File : usercp_viewprofile.php


I didn't get any such error when viewing my profile fwiw.

Joe Belmaati
Registered User
Posts: 2110
Joined: Sun Sep 28, 2003 7:35 pm
Location: Denmark

Post by Joe Belmaati » Thu Aug 24, 2006 3:33 pm

OK I need a favor in order to work this out. Please PM the user_id of the user on your site whose profile causes this problem. I will then write you a small program that you will need to run and PM me the results back..(it sounds like there is a picture that does not belong to an album - how that may be possible I don't know...)
Image

Joe Belmaati
Registered User
Posts: 2110
Joined: Sun Sep 28, 2003 7:35 pm
Location: Denmark

Post by Joe Belmaati » Fri Aug 25, 2006 11:01 am

MOD updated to BETA 0.0.2

Bugfix: Fixed SQL error if a user had fewer pictures posted than what admin wants to show in their profile.
Image

Joe Belmaati
Registered User
Posts: 2110
Joined: Sun Sep 28, 2003 7:35 pm
Location: Denmark

Post by Joe Belmaati » Fri Aug 25, 2006 5:34 pm

MOD updated to BETA 0.0.3

One more bugfix. If user was called with username i.e u=gary instead of u=53 there would be an SQL error. Error fixed.
Image

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Post by RMcGirr83 » Fri Aug 25, 2006 5:58 pm

Seems to be working very well Joe.

Congrats!!

Klimashkin Paul
Registered User
Posts: 2
Joined: Fri Sep 08, 2006 12:37 pm
Location: Russia/Moscow

Post by Klimashkin Paul » Fri Sep 08, 2006 12:42 pm

Joe Belmaati, good!

But One thing: if filename not in english, browser don't understand it and pictures not display.

Therefore

Code: Select all

$filename = $pictures[$i]['filename'];
Raplace:

Code: Select all

$filename = rawurlencode($pictures[$i]['filename']);
Thanks.

JaymeS
Registered User
Posts: 10
Joined: Sat Mar 11, 2006 2:42 pm

Post by JaymeS » Wed Oct 04, 2006 9:47 pm

Perhaps Joe can help me.
This Mod is great Joe. Installed it but I have a lil problem. Got it set to display 4 (latest images). Well it display the First 4 images instead, out of 36 I have in my Album. I never changed your code Joe. All I did was Copy/Past and changed the constants (define... blah blah) as you said, lol.
Any ideas that can help?
Thanks
Jayme

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Post by RMcGirr83 » Sun Oct 22, 2006 12:24 pm

Uhmmm, I don't believe that to be possible

From the mod

Code: Select all

$sql = "SELECT p.filename, p.filepath, p.aid, p.pid, p.title as p_title, p.caption, p.pic_rating, p.ctime, a.* FROM " . PICTURES_TABLE . " p, " . ALBUMS_TABLE . " a
WHERE a.aid = p.aid
AND owner_id = " . $profiledata['user_id'] . "
AND approved = 'YES'
AND visibility = 0
ORDER BY pid DESC
LIMIT " . NUM_PICS;
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not obtain pictures information', '', __LINE__, __FILE__, $sql);
}
ORDER BY pid DESC tells how to sort the pictures (pid = picture id)

z28cave
Registered User
Posts: 27
Joined: Thu Feb 09, 2006 1:37 am
Location: Bay Area, CA
Contact:

Post by z28cave » Sun Oct 22, 2006 9:18 pm

Seems like my Picture Position is a lil off by 3 positions. If you click the image you'll see what I mean. Brings me to the wrong image.

How do I fix this??

Profile:
http://www.forum.z28cave.com/profile.ph ... rofile&u=2

Post Reply

Return to “[2.0.x] MODs in Development”