Page 1 of 3

[BETA] Coppermine Latest Pics In Profile 0.0.3

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

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

Posted: Tue Aug 22, 2006 5:40 pm
by DeViAnThans3
Very nice done :D
This can be a usefull mod :wink:

Posted: Tue Aug 22, 2006 6:39 pm
by RMcGirr83
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.

Posted: Wed Aug 23, 2006 7:55 am
by amir abbas
is there any demo page ?

Posted: Wed Aug 23, 2006 10:57 am
by Joe Belmaati
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.

Posted: Wed Aug 23, 2006 11:05 am
by RMcGirr83
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. :(

Posted: Thu Aug 24, 2006 1:41 pm
by RMcGirr83
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.

Posted: Thu Aug 24, 2006 3:33 pm
by Joe Belmaati
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...)

Posted: Fri Aug 25, 2006 11:01 am
by Joe Belmaati
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.

Posted: Fri Aug 25, 2006 5:34 pm
by Joe Belmaati
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.

Posted: Fri Aug 25, 2006 5:58 pm
by RMcGirr83
Seems to be working very well Joe.

Congrats!!

Posted: Fri Sep 08, 2006 12:42 pm
by Klimashkin Paul
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.

Posted: Wed Oct 04, 2006 9:47 pm
by JaymeS
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

Posted: Sun Oct 22, 2006 12:24 pm
by RMcGirr83
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)

Posted: Sun Oct 22, 2006 9:18 pm
by z28cave
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