Author Topic: Showprofile only User  (Read 6986 times)

0 Members and 1 Guest are viewing this topic.

Offline bacterio

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
Showprofile only User
« on: December 27, 2007, 07:34:52 PM »
As can be done to ensure that the profile (showprofile in member.php) is visible only to registered users?

* Search by the forums but not encounter  :?

Greetings

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Showprofile only User
« Reply #1 on: December 27, 2007, 08:11:49 PM »
In member.php file,

find:

Code: [Select]
if ($action == "showprofile") {

add after:

Code: [Select]
if ($user_info['user_level'] < USER) {
   redirect($url);
}
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline bacterio

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
Re: Showprofile only User
« Reply #2 on: December 27, 2007, 11:20:54 PM »
No is ok......  :?

Quote
if ($action == "showprofile") {

if ($user_info['user_level'] < USER) {
   redirect($url);
}

  $txt_clickstream = $lang['profile'];
  if (isset($HTTP_GET_VARS[URL_USER_ID]) || isset($HTTP_POST_VARS[URL_USER_ID])) {
    $user_id = (isset($HTTP_GET_VARS[URL_USER_ID])) ? intval($HTTP_GET_VARS[URL_USER_ID]) : intval($HTTP_POST_VARS[URL_USER_ID]);
    if (!$user_id) {
      $user_id = GUEST;
    }
  }
  else {
    $user_id = GUEST;
  }

Fatal error: Call to undefined function: redirect() in /home/miweb.com/data/htdocs/galeria/member.php on line 1074

Offline bacterio

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
Re: Showprofile only User
« Reply #3 on: December 27, 2007, 11:26:07 PM »
Hello again, this is ok:

Quote
if ($action == "showprofile") {


if ($user_info['user_level'] < USER) {
  show_error_page($lang['no_permission']);
  exit;
}

Many thanks Thunderstrike  :wink:

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Showprofile only User
« Reply #4 on: December 28, 2007, 01:56:04 AM »
If no ok for redirect - you no use last version of 4images.
Thank for posting.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline bacterio

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
Re: Showprofile only User
« Reply #5 on: December 28, 2007, 07:08:06 AM »
Hello again.

My versión is 1.71. whit many MOD  :D

Thank you forr all !!!

Offline ProDez

  • Pre-Newbie
  • Posts: 9
    • View Profile
    • MultiMedia Center
Re: Showprofile only User
« Reply #6 on: March 18, 2008, 12:46:15 PM »
This works fine!
Hello again, this is ok:

Quote
if ($action == "showprofile") {


if ($user_info['user_level'] < USER) {
  show_error_page($lang['no_permission']);
  exit;
}

Many thanks Thunderstrike  :wink:
This works fine!
THANK YOU ALL!
Glauben ist nicht "Wissen". Aber, ich glaube das weiss jeder.