I thought that when I used to click on a username when in CPG it would take me to their SMF profile with the bridge. However, now it displays their info within CPG. Did I change something? I would like it when a username is clicked that it takes you to their SMF profile.
Site - http://www.eliterides.com
CPG - http://www.eliterides.com/rides
user: test
pass: test
After reviewing a few others' sites I guess I'm just imagining things. How could I accomplish this though? I found this chunk of code that retrieves the information in the smf bridge fle file. Instead of retrieving the info below I would rather it simply link to their SMF profile.
// Get user information
function udb_get_user_infos($uid)
{
global $CONFIG, $UDB_DB_NAME_PREFIX, $UDB_DB_LINK_ID;
global $lang_register_php;
$sql = "SELECT realName as user_name, ID_GROUP as mgroup, ID_POST_GROUP, emailAddress as user_email, dateRegistered as user_regdate, " . "websiteURL as user_website " . "FROM " . $UDB_DB_NAME_PREFIX . SMF_TABLE_PREFIX . SMF_USER_TABLE . " " . "WHERE ID_MEMBER = '$uid'";
$result = db_query($sql, $UDB_DB_LINK_ID);
if (!mysql_num_rows($result)) cpg_die(ERROR, $lang_register_php['err_unk_user'], __FILE__, __LINE__);
$user_data = mysql_fetch_array($result);
mysql_free_result($result);
$user_data['user_occupation'] = '';
$user_data['user_location'] = '';
$user_data['user_interests'] = '';
if (!$user_data['mgroup'] && defined('USE_POST_GROUPS')) {
$user_data['mgroup'] = $user_data['ID_POST_GROUP'];
}
$sql = "SELECT groupName " . "FROM " . $UDB_DB_NAME_PREFIX . SMF_TABLE_PREFIX . SMF_GROUP_TABLE . " " . "WHERE ID_GROUP = '{$user_data['mgroup']}' ";
$result = db_query($sql, $UDB_DB_LINK_ID);
if (mysql_num_rows($result)) {
$row = mysql_fetch_array($result);
$user_data['group_name'] = $row['groupName'];
} else {
$user_data['group_name'] = CM_MEMBERS_GROUP_NAME;
}
mysql_free_result($result);
return $user_data;
}
// Edit user profile
function udb_edit_profile($uid)
{
$target = 'index.php?action=profile;u=' . USER_ID;
udb_redirect($target);
}
I'm guessing I need to edit the code that is similar to the last bit of what is above. Instead I need
$target = '../forums/index.php?action=profile;u=' . USER_ID;
The only other place I can find something similar is in the theme.php file.
// HTML template for the USER info box in the user list view
$template_user_list_info_box = <<<EOT
<table cellspacing="1" cellpadding="0" border="0" width="100%" class="user_thumb_infobox">
<tr>
<th><a href="profile.php?uid={USER_ID}">{USER_NAME}</a></th>
</tr>
<tr>
<td>{ALBUMS}</td>
</tr>
<tr>
<td>{PICTURES}</td>
</tr>
</table>
EOT;
What file do I change this in though?
profile.php
find:
$user_data = udb_get_user_infos($uid);
Change to:
udb_edit_profile($uid);
Thanks. Tried it, but if I am viewing as a guest it goest to user=0 and just goest to the forum index. If I am logged in it just takes me to my profile (of whoever I am logged in as).
OK, change this function too in the bridge file
// Edit user profile
function udb_edit_profile($uid)
{
$target = 'index.php?action=profile;u=' . USER_ID;
udb_redirect($target);
}
to
// Edit user profile
function udb_edit_profile($uid)
{
$target = 'index.php?action=profile;u=' . $uid;
udb_redirect($target);
}
Perfect. Thank you very much for your help. :)