 | |  | | | Photopost Pro How Do I...? Wondering how to do things in PhotoPost? |
July 8th, 2010, 12:42 PM
|
#1 (permalink)
| | Member Verified Customer
Join Date: Jun 2009 Location: Canada
Posts: 98
| Avatars in Photopost and SMF 2.x not synchronized
Hi Chuck,
I have a bit of an issue with avatars on my website. I am using Photopost 6.x, Photopost Classidfieds, Photopost Reviews and as a forum SMF 2.x.
I run all my registrations through SMF 2 (which works OK), and I also load member avatars through the same application (SMF) in the corresponding profile page. The avatars display correct in SMF member profile but they are messed up in all the others. I looked at the smf_attachments table (where the information related to avatars is stored), and the relevant fields for calling the avatars are id_attach (as primary key) and id_member. When calling the avatars from Photopost it looks like the application is using $uid to identify the member, but than it goes and retrieves form smf_attachments the avatar connected to the the same primary key (id_attach and not id_member). The problem is that, of course id_attach is in most cases different than id_member. As an example, for id_member 5 i may have id_attach 2. In such scenario Photopost will identify the right id_member (5), but the db querry will ask for id_attach 5 (and not 2), so it will display whatever is associated with that primary key. How do I fix this problem? I spent already few good hours trying to figure it out, and I finally gave up. Your help will be much appreciated.
Thank you.
|
| |
July 8th, 2010, 01:58 PM
|
#2 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 68,070
|
well the query looks fine. id_attach is the userid of that users attachment I dont think the attachments table has a id_member field which is why the query is this Code: Content visible to verified customers only.
You can send us access to see your database if you wish so I can see if they changed anything.
|
| |
July 8th, 2010, 03:02 PM
|
#3 (permalink)
| | Member Verified Customer
Join Date: Jun 2009 Location: Canada
Posts: 98
|
The attachments table definitely has a field called id_member and this is why it is getting confused (as I explained above) - it takes the userid and tries to match it with the id_attach (which is the primary key) in the wrong way. It should rather match it with the id_member, and than extract the corresponding id_attach and of course the related avatar.
|
| |
July 8th, 2010, 04:27 PM
|
#5 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 68,070
|
well our query is correct that I am seeing here Code: Content visible to verified customers only.
thats why I posted the query above for you to see as it looks right to me. we do not map any id_member to id_attach anywhere.
|
| |
July 8th, 2010, 04:44 PM
|
#6 (permalink)
| | Member Verified Customer
Join Date: Jun 2009 Location: Canada
Posts: 98
|
I understood that, but what I don't understand is why the results are not as expected?
The only instance when it returns the right avatar in all applications is if the image loaded (as avatar) comes from SMF folders (e.g. "Actors" or "Musicians"). If a user loads its own image it is all going down the drain. Any tips on this?
Thank you!
|
| |
July 8th, 2010, 04:51 PM
|
#7 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 68,070
|
The query is in smf2.php this line we pull the file hash and filename from the attachments table where attachment and members id_members are the same Code: Content visible to verified customers only.
we define the variables and then load the proper avatar Code: Content visible to verified customers only.
I would definately need explicit links examples because looking at the code it does not do what your saying it does. we dont match a userid to some type of attachment table id_attach because we dont check for that field anywhere in our code.
|
| |
July 8th, 2010, 05:36 PM
|
#8 (permalink)
| | Member Verified Customer
Join Date: Jun 2009 Location: Canada
Posts: 98
|
Hi Chuck,
I looked in the same file (smf2.php) trying to find some answers.
I checked again the search string for the avatars (using Firebug) and I got the following:
<img src="http://livefolio.com/liveforum/index.php?action=dlattach;attach=4;type=avatar">
"attach=4" is the important part here. For this specific example, the member with id=4 was used for testing (in both, Photopost and SMF).
For the same member, the avatar search in SMF looks similar, but "attach=4" it was replaced with "attach=7", and this one returns the right value.
This is were the problem lays - "4" is id_member value in the smf database attachments table, and for this member the id_attach value is "7". Again, it looks like the two applications work in very similar fashion but the query is different. They both try to call the image from the database using the primary key of the attachments table but Photopost seems to use the member id to do it. In my table I don't have any avatar with id_attach value=4, therefore no image is displayed. If I manually change it (when looking at the img src with Firebug) to an existing id_attach than I will have the corresponding avatars displayed. I am totally puzzled by this.
|
| |
July 8th, 2010, 05:41 PM
|
#9 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 68,070
|
try this making your get_profiledata function this Code: Content visible to verified customers only.
|
| |
July 8th, 2010, 06:08 PM
|
#10 (permalink)
| | Member Verified Customer
Join Date: Jun 2009 Location: Canada
Posts: 98
|
Hi Chuck,
It works like a charm. You're great!
Thank you very much!
|
| |
July 8th, 2010, 06:16 PM
|
#11 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 68,070
|
Have a good evening
|
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Rate This Thread | Linear Mode | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -5. The time now is 03:02 PM. | |