News:

Wondering if this will always be free?  See why free is better.

Main Menu

Coppermine Userpics

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

Previous topic - Next topic

taucher

Yes, they are correct, i ve checked them more than once.
I dont know what could be the reason, that there ar no images shown.

Aravot

Great mod, was looking for something like this however I have a request more like a is this possible.

I have Joomla+SMF+CPG all bridged together CPG bridged to SMF and SMF bridged to Joomla, both SMF and CPG wrapped in Joomla, when a user clicks on the image in SMF profile it redirects the user to CPG unwrapped version is it possible to open CPG in Joomla wrapped.

see example use test/test
http://orstio.armeniancollegeofcalcutta.com

Thanks for the mod.

JayBachatero

Well I don't know much about Joomla nor Mambo so I really don't know how to link to wrapped.  Shouldn't be too hard though.
Follow me on Twitter

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

fishbone

This is a great mod, Juan!
Me and my members do like it a lot.

I've got one question:
The mod shows the pictures last uploaded by the member. However, I would prefer it to show the standard user gallery. We have a big gallery besides the user galleries where everybody is allowed to upload to. Those "public" pictures should not be displayed in the profile.
What alterations to the mod would be necessary to achieve this?


JayBachatero

I'm not really sure.  I would have to look at coppermine to do this.
Follow me on Twitter

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

markd

Would you mind if I tweaked your mod a bit?  1/3 of my members love the mod, another 1/3 say its okay but wish they could select the pictures that appear in their profile, and the remaining 1/3 are ******ing up a storm because it's pulling pics from their private galleries (which are apparently the last uploaded pics to their gallery).

So I'd like to add a little more customability to your mod.. I think the easist way to do this is to have members put four or five pictures in a folder in their gallery called "for_profile" or something, then have the mod look for, then only pull from that gallery.  if the "for_profile" gallery doesn't exist, then do the normal routine and if someone ******es I can tell them that they should have followed the directions I game them.  :)

Anyway, I'm gonna tweak with your code and see if I can get it to do what I want.  If so, I'll send it to you and you can add it to your next release or tell me to screw off or whatever. 

-mark



JayBachatero

Yea if you're able to code it up then be my guest.  This was just a quick mod that I did.
Follow me on Twitter

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

n1kki6

#87
Here is mine, i change the link code a bit so I could run coppermine wrapped and have it bring it to the user gallery wrapped.

http://www.mnsportscentral.com/component/option,com_smf/Itemid,32/action,profile/u,3

The code I added to my profile if your running coppermine wrapped is this.  Make sure to use the correct item id.

// Check to see if they have images
if (!empty($context['member']['pictures']) && empty($modSettings['cpg_disable']))
{
  echo '
<tr class="titlebg">
<td>', $txt['cpg_pictures'], '</td>
<td align="right">(<a href="' . $mosConfig_live_site . '/index.php?option=com_wrapper&Itemid=34&cat=', $context['member']['id']+10000, '">', $txt['cpg_see_more'], '</a>)</td>
</tr>
<tr>
<td class="windowbg2" colspan="2">';

foreach ($context['member']['pictures'] as $picture)
      // Add for personal gallery
            echo '
                            ', '<a href="' . $mosConfig_live_site . '/index.php?option=com_wrapper&Itemid=34&cat=', $context['member']['id']+10000, '"/><img src="', $picture['path'], '" alt="', $picture['filename'], '" /></a>';

echo '
</td>
</tr>';
}

markd

Okay, this quick code addendum will check first to see if the picture is in a private gallery before loading it into the array, and if it is, dump it and go to the next one.

In the following statement in Profile.php in the Coppermine Userpics section:

// 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__);


change the mysql query to this:

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


where I added a JOIN so that it looks in both the Pictures table and the Albums table, and matches the album ID (aid) in both tables (to make sure it's in the right album) and then checks to see if the album it's gonna pull the picture from is not marked as private (albums.visibility = 0).  Albums marked as private have the user's ID code in the albums.visibility field, every picture other than that is marked as 0.

:)

-mark

JayBachatero

Thanks for posting that markd.  I'll update the first post to reflect this.
Follow me on Twitter

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

verbalkent

#90
This doesnt show in my template (Themis *Current*) how can I add this to the member profile ? thx

Example hxxp:soltiz.com/forum/index.php?action=profile [nonactive]

Also, which file and what line is this being added?

Quote from: n1kki6 on October 02, 2006, 10:49:55 PM
Here is mine, i change the link code a bit so I could run coppermine wrapped and have it bring it to the user gallery wrapped.

hxxp:www.mnsportscentral.com/component/option,com_smf/Itemid,32/action,profile/u,3 [nonactive]

The code I added to my profile if your running coppermine wrapped is this.  Make sure to use the correct item id.

// Check to see if they have images
if (!empty($context['member']['pictures']) && empty($modSettings['cpg_disable']))
{
  echo '
<tr class="titlebg">
<td>', $txt['cpg_pictures'], '</td>
<td align="right">(<a href="' . $mosConfig_live_site . '/index.php?option=com_wrapper&Itemid=34&cat=', $context['member']['id']+10000, '">', $txt['cpg_see_more'], '</a>)</td>
</tr>
<tr>
<td class="windowbg2" colspan="2">';

foreach ($context['member']['pictures'] as $picture)
      // Add for personal gallery
            echo '
                            ', '<a href="' . $mosConfig_live_site . '/index.php?option=com_wrapper&Itemid=34&cat=', $context['member']['id']+10000, '"/><img src="', $picture['path'], '" alt="', $picture['filename'], '" /></a>';

echo '
</td>
</tr>';
}



Thx,



found the file to edit in /themes/your theme/Profile.template.php    but now i have text and no image,

HEMI

#91
AWESOME MOD!!!

It encourages gallery use which for us is a good thing.

I'm running 1.0.8... Mambo... and CPG all are wrapped together.
My ModSetting.php failed and Profile.Template failed but the coding was easy enough to drop in.

To solve the issue of the link going to the unwrapped version, I just put a target="u_blank" on the url.

Thanks for the mod
http://www.csramotorsports.com [nofollow]
profile link: http://www.csramotorsports.com/index.php?option=com_smf&Itemid=74&action=profile;u=4 [nofollow]

JayBachatero

verbalkent did you fill out the information on Admin > Features and Options?
Follow me on Twitter

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

Aravot


JayBachatero

I'll look into it when I get a chance.
Follow me on Twitter

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

TANDIONO.COM

I get this error on profiles :

Database Error
Table 'xx_smf1.cpg_pictures' doesn't exist
File: /home/xx/public_html/forum/Sources/Profile.php
Line: 1383

JayBachatero

if you are going to use this mod in another database you need to do this in the prefix field.  `databaseName`.prefix_
Follow me on Twitter

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

TANDIONO.COM

#97
Quote from: JayBachatero on November 08, 2006, 08:29:28 AM
if you are going to use this mod in another database you need to do this in the prefix field.  `databaseName`.prefix_

I've try it, but still fail.. Here's my current setting :


[b]Coppermine table prefix :[/b] `xx_smf1`.cpg_
[b]Allowed image extentions :[/b] jpg,jpeg,gif,png
[b]Coppermine URL w/o trailing slash :[/b] http://www.xx.com/gallery
[b]Max images to show on profile :[/b] 4
[b]Prefix for thumbnails :[/b]      thumb_




it shows this error :

Database Error
SELECT command denied to user 'xx_smf1'@'localhost' for table 'cpg_pictures'
File: /home/xx/public_html/forum/Sources/Profile.php
Line: 1383


Please kindly advice me. Thanks :)








JayBachatero

You need to make the same user for both database or add the smf1 user to the coppermine database.
Follow me on Twitter

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

Assistance

#99
ya I got it to work

awesome mod

thank you

1 question, how do I remove the links from the thumbs and the See More...

??
~playing poker~

Advertisement: