Author Topic: how to remove "added by" name when is added by the admin  (Read 3481 times)

0 Members and 1 Guest are viewing this topic.

Offline Fking

  • Pre-Newbie
  • Posts: 5
    • View Profile
    • http://BucksMania.com
how to remove "added by" name when is added by the admin
« on: June 24, 2003, 11:36:32 PM »
Under the thumb of the image is always shown the name of the user who added it.

But I want nothing to appear there when the image is added by the administrator
how to do that?

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
how to remove "added by" name when is added by the
« Reply #1 on: June 25, 2003, 11:44:57 AM »
Open includes/functions.php and change
Code: [Select]
$user_name = $image_row[$user_table_fields['user_name']];
   
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $image_row['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$image_row['user_id'];
$user_name_link = "<a href=\"".$site_sess->url($user_profile_link)."\">".$user_name."</a>";

to
Code: [Select]
$user_name = $image_row[$user_table_fields['user_name']];
   
if ($user_name == '<admin_username>') {
  $user_name = '';
  $user_name_link = '';
} else {
  $user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $image_row['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$image_row['user_id'];
  $user_name_link = "<a href=\"".$site_sess->url($user_profile_link)."\">".$user_name."</a>";
}

Replace <admin_username> with username of the administrator

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Fking

  • Pre-Newbie
  • Posts: 5
    • View Profile
    • http://BucksMania.com
how to remove "added by" name when is added by the
« Reply #2 on: June 25, 2003, 06:09:08 PM »
Works just fine

Thanks!

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: how to remove "added by" name when is added by the admin
« Reply #3 on: December 25, 2005, 10:34:05 PM »
A weakness has been discovered with the $user_profile_link string.

From your includes/functions.php file,

find :

Quote

$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $image_row['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$image_row['user_id'];


with :

Code: [Select]

$user_profile_link = (!empty($url_show_profile)) ? str_replace("{user_id}", $image_row['user_id'], $url_show_profile) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$image_row['user_id']);


Merry Christmas.