Coppermine Userpics

Started by JayBachatero, September 07, 2006, 12:40:32 AM

Previous topic - Next topic

JayBachatero

Link to Mod
Rate this Mod

This mod will add the last x amount of images that a user has uploaded to their Coppermine Gallery.

http://www.kevmundial.com/board/index.php?action=profile;u=3141

WARNING: You must have Coppermine installed in the same database as SMF.  You can get it to work on another database by altering the $modSettings['cpgPrefix'] on the Profile.php file.

Don't show private albums - Thanks for markd for posting the query.
In Profile.php find

// Select the images
                $requestImages = db_query("
                        SELECT pid, filepath, filename, owner_id, owner_name
                        FROM {$modSettings['cpgPrefix']}pictures
                        WHERE owner_id = $memID                                                                               
                                AND approved = 'YES'
                                $extensions
                        ORDER BY pid DESC
                        LIMIT $modSettings[cpgMaxPictures]", __FILE__, __LINE__);


Replace with

// Select the images
                $requestImages = db_query("
                        SELECT p.pid, p.filepath, p.filename, p.owner_id, p.owner_name
                        FROM ({$modSettings['cpgPrefix']}pictures AS p, {$modSettings['cpgPrefix']}albums AS a)
                        WHERE owner_id = $memID
                                AND a.aid = p.pictures.aid
                                AND a.visibility = 0
                                AND approved = 'YES'
                                $extensions
                        ORDER BY pid DESC
                        LIMIT $modSettings[cpgMaxPictures]", __FILE__, __LINE__);
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Saku

I get an error when I click on the profile link

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 'AND approved = 'YES'
AND (filename LIKE '%.jpg' OR filename LIKE '%.gif' OR ' at line 4
Fichier: smf/Sources/Profile.php
Ligne: 1585

JayBachatero

Did you fill out the information as mentioned before?
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Dazzler

hi jay.. sorry to be a pain in the ass...

i am being stupid.. but what do you mean my coppermine prefix? which part of my coppermine do i need to put in that section..

Thanks dude

Daz

SMF 1.1.3 + TP .983 + Copperminie

kegobeer

Does your SMF forum and Coppermine gallery share the same database?
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

JayBachatero

You put in the prefix that you setup for your coppermine gallery.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Dazzler

do you mean the database prefix?

SMF 1.1.3 + TP .983 + Copperminie

Dazzler

#7
hey guys.. sorry to be a pain..

ok so i have my coppermine msql prefix in place..

i also have what i think is my thumb prefix (thumb_)

i have the url right

but all i am getting is a link to the pictures not the display also if i click the link it brings up no image

example: http://minidirectory.co.uk/forum/index.php?action=profile;u=8

Thanks

Daz

SMF 1.1.3 + TP .983 + Copperminie

Dazzler

Quote from: kegobeer on September 10, 2006, 08:08:27 PM
Does your SMF forum and Coppermine gallery share the same database?

yes i did the bridge ages ago

SMF 1.1.3 + TP .983 + Copperminie

JayBachatero

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Dazzler

#10
user:        *****
password: *****

SMF 1.1.3 + TP .983 + Copperminie

JayBachatero

Forgot the .co.uk on the domain :P.
http://www.minidirectory/coppermine/albums/userpics/10008/thumb_RATS_FINAL.jpg
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Dazzler

Thanks.. i have sat looking at it for ages and missed the sillyest thing.... great mod... works a treat now...

A star as always Jay

SMF 1.1.3 + TP .983 + Copperminie

Tanks

#13
i get this error

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/default/Profile.template.php on line 395

386: <td class="windowbg" valign="middle" align="center" width="150">
387: ', $context['member']['avatar']['image'], '<br /><br />
388: ', $context['member']['blurb'], '
389: </td>
390: </tr>';
391:
392: // Finally, if applicable, span the bottom of the table with links to other useful member functions.
393: echo '
394: // Check to see if they have images
395: if (!empty($context['member']['pictures']) && empty($modSettings['cpg_disable']))
396: {
397:   echo '
398: <tr class="titlebg">
399: <td>', $txt['cpg_pictures'], '</td>


im using 1.1 RC2 with TP

Saku

Quote from: Jay The Code Monkey on September 10, 2006, 05:19:16 PM
Did you fill out the information as mentioned before?
yes

Coppermine table prefix     cpg135_
Allowed image extentions      jpg,gif,png,bmp
Coppermine URL w/o trailing slash   http://www.site.com/coppermine
Max images to show on profile    3
Prefix for thumbnails   thumb_

kegobeer

"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

JayBachatero

Sakuragi can you please post your Profile.php file?
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Tanks

Quote from: kegobeer on September 11, 2006, 11:53:41 AM
@Knat:

Mod details
Compatible With: 1.1 RC3

Uhmm okey so no way to get it to work with RC2 ?  :o

JayBachatero

It *should* work on RC2 but you might have to do a manually edit Profile.template.php.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Tanks

Thats what i did.. i have all the code.. but when i put in the code in the last file.. namely profile.template.php i get the parse error as shown in the other post.. when i remove the code from that file everything is fine again.. i even have the admin settings showing correct  >:(

Advertisement: