UBB.Dev
Posted By: Basil Fawlty Photopost PPClassifieds Integration MOD - 03/04/2007 4:42 PM
I run version 2.6 of Photopost classifieds integrated with my Threads7. However, one issue I found is that they pull user info from the threads USER table. So, when someone clicks on Contact Seller on an ad in PP-Classifieds (or a photo is uploaded to a category someone is subscribed to in Photopost), it pulls USER_REGISTRATION_EMAIL from the USER Table. This is fine as long as the person NEVER changes their email address after they register on your forum. But many times, a member will change their "USER_REAL_EMAIL" but Photopost and Classifieds will still use their old email they registered with. SOLUTION: Until the folks at Photopost fix this, here is what you can do (same for both programs):

1. In the file Threads7.php (in the forums directory in your photopost and classifieds installs) Look for the function:


PHP Code

function get_userinfo( $authuser, $userid=0 )



Then find this query:
PHP Code

if ( $userid != 0 ) $query = "SELECT u.USER_ID,u.USER_DISPLAY_NAME,u.USER_REGISTRATION_EMAIL,u.USER_PASSWORD, u.USER_SESSION_ID,u.USER_LOGIN_NAME,p.USER_STYLE,p.USER_TIME_OFFSET,p.USER_TEMPORARY_PASSWORD
FROM
{$Globals['dprefix']}USERS u LEFT JOIN {$Globals['dprefix']}USER_PROFILE p ON p.USER_ID=u.USER_ID
WHERE u.USER_ID=
$userid";


Change u.USER_REGISTRATION_EMAIL to p.USER_REAL_EMAIL


Then also, find this query:
PHP Code

else {
$tuser = addslashes( $authuser );
$query = "SELECT u.USER_ID,u.USER_DISPLAY_NAME,u.USER_REGISTRATION_EMAIL,u.USER_PASSWORD,
u.USER_SESSION_ID,u.USER_LOGIN_NAME,p.USER_STYLE,p.USER_TIME_OFFSET,p.USER_TEMPORARY_PASSWORD FROM
{$Globals['dprefix']}USERS u
LEFT JOIN
{$Globals['dprefix']}USER_PROFILE p ON p.USER_ID=u.USER_ID
WHERE u.USER_LOGIN_NAME='
$tuser'";
}


Again, change u.USER_REGISTRATION_EMAIL to p.USER_REAL_EMAIL

One last thing. Just below these queries, find:

PHP Code

$queryv
= ppmysql_query($query,$db_link);
$results = mysql_fetch_array($queryv);

$username[0] = $results['USER_ID']; // userid
$username[1] = $results['USER_DISPLAY_NAME']; // username
$username[2] = $results['USER_REGISTRATION_EMAIL']; // set email


and set
PHP Code

$username
[2] = $results['USER_REAL_EMAIL'];


That's it. Now, when a member clicks the Contact Seller link in an ad (or Phphoto notifies some one of an upload to a subscribed category), two things will happen: First, their "real" email address will fill into the "From field" and then when they send their email it will go to the seller's current "REAL" email address and not the email they registered with (in case thay have changed it)

Hope you find this useful,

Basil
Thanks for sharing basil smile Sounds like a bug in ppclassifieds. wink
© UBB.Developers