before the hack I've posted the code for this...unfortunetly it was lost...
I'll try to restore it, but I must warn, I will not test it, so use it on your own risk:
Step 1In member.php find:
if ($action == "showprofile") {
Insert below:
if (isset($HTTP_GET_VARS['user_name']) || isset($HTTP_POST_VARS['user_name'])) {
$user_name = (isset($HTTP_POST_VARS['user_name'])) ? $HTTP_POST_VARS['user_name'] : $HTTP_GET_VARS['user_name'];
}
else {
$user_name = "";
}
Step 1.2A few lines below find:
if ($user_row = get_user_info($user_id)) {
(make sure its in the "showprofile" section!)
Replace it with:
if ($user_row = get_user_info($user_id, $user_name)) {
Step 2In includes/functions.php find:
function get_user_info($user_id = 0) {
global $site_db, $user_table_fields;
$user_info = 0;
if ($user_id != 0 && $user_id != GUEST) {
$sql = "SELECT *
FROM ".USERS_TABLE."
WHERE ".get_user_table_field("", "user_id")." = $user_id";
Replace it with:
function get_user_info($user_id = 0, $user_name = "") {
global $site_db, $user_table_fields;
$user_info = 0;
if (($user_id != 0 && $user_id != GUEST) || $user_name) {
$sql = "SELECT *
FROM ".USERS_TABLE."
WHERE ".(($user_name) ? get_user_table_field("", "user_name")." LIKE '".addslashes($user_name)."'" : get_user_table_field("", "user_id")." = $user_id");
From there you can use urls like:
member.php?action=showprofile&user_name=adminNow is the tricky part to adopt the already existing code to create such urls.
because there are many places which conteins urls to view members profiles, I'll only explain what needs to be changed
In the files where links to members profiles are being created (functions.php - for image owners, details.php - comment owners, memberlist.php - list of members, etc)
search for:
showprofilethen in the same line u should see something like this:
ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$image_row['user_id']
the part in red will be replaced by word
user_id in the url, so u need replace it with
user_namethe part in green will be replaced by the user id (number), u need replace with
$image_row['user_name']so, the end result should looks like:
ROOT_PATH."member.php?action=showprofile&user_name=".$image_row['user_name']
(btw, this example was taken from includes/functions.php
)
But dont get too existed, it might not work just like that, without modifying other parts of code and in each case it might be different.
For example, in details.php the url part looks different:
ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$comment_user_id
As u can see, the part in green color is different, but fortunetly it will work without any extra modifications by replacing the code in red the same way as discribed in previous example and part in green with
$comment_user_name (that's just luck!)
So, in this example the end result should looks like this:
ROOT_PATH."member.php?action=showprofile&user_name=".$comment_user_name
In some cases (mostly in the mods) there parts in red might looks simple as
user_id (lowercase and without quotes), dont panic, just replace it with
user_name
Confused enough yet?
Good luck.