Show Profile Link MOD for 1.2.20
With this little modification you can * view profiles of other users as admin * and view your own profile.
It adds a link to the profile header line..
Installation
Open profile.php and edit the following:
Find:
if ($pun_user['id'] != $id && ($pun_user['g_id'] > PUN_MOD || ($pun_user['g_id'] == PUN_MOD && $pun_config['p_mod_edit_users'] == '0') || ($pun_user['g_id'] == PUN_MOD && $user['g_id'] < PUN_GUEST))) {
Replace with:
if ( ($pun_user['id'] != $id && ($pun_user['g_id'] > PUN_MOD || ($pun_user['g_id'] == PUN_MOD && $pun_config['p_mod_edit_users'] == '0') || ($pun_user['g_id'] == PUN_MOD && $user['g_id'] < PUN_GUEST))) || ($_GET['phack'] == "true") ) {
Find:
<h2><span><?php echo $lang_common['Profile'] ?></span></h2>
Replace with:
<h2><span><?php echo $lang_common['Profile'] ?></span> <?php if($_GET['phack'] == "true"){ print("<span>[<a href=\"./profile.php?id=".$id."&phack=false\">edit</a>]</span>"); } ?></h2>
Find:
else { if (!$section || $section == 'essentials')
Replace with:
else { if ( ($pun_user['id'] == $id) || ($pun_user['g_id'] == PUN_ADMIN) ) { $phackable = true; } if (!$section || $section == 'essentials')
Find:
<h2><span><?php echo pun_htmlspecialchars($user['username']).' - '.$lang_profile['Section essentials'] ?></span></h2>
Replace with:
<h2><span><?php echo pun_htmlspecialchars($user['username']).' - '.$lang_profile['Section essentials'] ?></span> <?php if($phackable == "true"){ print("<span>[<a href=\"./profile.php?id=".$id."&phack=true\">view</a>]</span>"); } ?></h2>
Diff
Heres the diff:
--- old/profile.php 2008-07-11 11:14:40.000000000 +0200 +++ new/profile.php 2008-11-15 20:49:06.000000000 +0100 @@ -918,11 +918,15 @@ // View or edit? -if ($pun_user['id'] != $id && +if ( + ($pun_user['id'] != $id && ($pun_user['g_id'] > PUN_MOD || ($pun_user['g_id'] == PUN_MOD && $pun_config['p_mod_edit_users'] == '0') || ($pun_user['g_id'] == PUN_MOD && $user['g_id'] < PUN_GUEST))) + || ($_GET['phack'] == "true") +) { + if ($user['email_setting'] == '0' && !$pun_user['is_guest']) $email_field = '<a href="mailto:'.$user['email'].'">'.$user['email'].'</a>'; else if ($user['email_setting'] == '1' && !$pun_user['is_guest']) @@ -973,7 +977,7 @@ ?> <div id="viewprofile" class="block"> - <h2><span><?php echo $lang_common['Profile'] ?></span></h2> + <h2><span><?php echo $lang_common['Profile'] ?></span> <?php if($_GET['phack'] == "true"){ print("<span>[<a href=\"./profile.php?id=".$id."&phack=false\">edit</a>]</span>"); } ?></h2> <div class="box"> <div class="fakeform"> <div class="inform"> @@ -1058,6 +1062,13 @@ } else { + +if ( + ($pun_user['id'] == $id) || + ($pun_user['g_id'] == PUN_ADMIN) +) +{ $phackable = true; } + if (!$section || $section == 'essentials') { if ($pun_user['g_id'] < PUN_GUEST) @@ -1094,7 +1105,7 @@ ?> <div class="blockform"> - <h2><span><?php echo pun_htmlspecialchars($user['username']).' - '.$lang_profile['Section essentials'] ?></span></h2> + <h2><span><?php echo pun_htmlspecialchars($user['username']).' - '.$lang_profile['Section essentials'] ?></span> <?php if($phackable == "true"){ print("<span>[<a href=\"./profile.php?id=".$id."&phack=true\">view</a>]</span>"); } ?></h2> <div class="box"> <form id="profile1" method="post" action="profile.php?section=essentials&id=<?php echo $id ?>" onsubmit="return process_form(this)"> <div class="inform">