Fixed some bugs in my last checkin
This commit is contained in:
+4
-4
@@ -548,23 +548,23 @@ function message_contact_link($userid, $linktype='add', $return=false, $script="
|
||||
|
||||
switch ($linktype) {
|
||||
case 'block':
|
||||
$output = '<a target="message" href="'.$script.'&blockcontact='.$userid.
|
||||
$output = '<a href="'.$script.'&blockcontact='.$userid.
|
||||
'&sesskey='.$USER->sesskey.'" title="'.$str->blockcontact.'">'.
|
||||
'<img src="'.$CFG->pixpath.'/t/go.gif" height="11" width="11" border="0"></a>';
|
||||
break;
|
||||
case 'unblock':
|
||||
$output = '<a target="message" href="'.$script.'&unblockcontact='.$userid.
|
||||
$output = '<a href="'.$script.'&unblockcontact='.$userid.
|
||||
'&sesskey='.$USER->sesskey.'" title="'.$str->unblockcontact.'">'.
|
||||
'<img src="'.$CFG->pixpath.'/t/stop.gif" height="11" width="11" border="0"></a>';
|
||||
break;
|
||||
case 'remove':
|
||||
$output = '<a target="message" href="'.$script.'&removecontact='.$userid.
|
||||
$output = '<a href="'.$script.'&removecontact='.$userid.
|
||||
'&sesskey='.$USER->sesskey.'" title="'.$str->removecontact.'">'.
|
||||
'<img src="'.$CFG->pixpath.'/t/user.gif" height="11" width="11" border="0"></a>';
|
||||
break;
|
||||
case 'add':
|
||||
default:
|
||||
$output = '<a target="message" href="'.$script.'&addcontact='.$userid.
|
||||
$output = '<a href="'.$script.'&addcontact='.$userid.
|
||||
'&sesskey='.$USER->sesskey.'" title="'.$str->addcontact.'">'.
|
||||
'<img src="'.$CFG->pixpath.'/t/usernot.gif" height="11" width="11" border="0"></a>';
|
||||
|
||||
|
||||
+12
-6
@@ -88,15 +88,21 @@
|
||||
echo '<div class="message_users">';
|
||||
if ($contact = get_record('message_contacts', 'userid', $USER->id, 'contactid', $user->id)) {
|
||||
if ($contact->blocked) {
|
||||
message_contact_link($user->id, 'add', false, 'user.php?frame=info'); echo " ";
|
||||
message_contact_link($user->id, 'unblock', false, 'user.php?frame=info'); echo " ";
|
||||
message_contact_link($user->id, 'add', false, 'user.php?id='.$user->id.'&frame=info');
|
||||
echo " ";
|
||||
message_contact_link($user->id, 'unblock', false, 'user.php?id='.$user->id.'&frame=info');
|
||||
echo " ";
|
||||
} else {
|
||||
message_contact_link($user->id, 'remove', false, 'user.php?frame=info'); echo " ";
|
||||
message_contact_link($user->id, 'block', false, 'user.php?frame=info'); echo " ";
|
||||
message_contact_link($user->id, 'remove', false, 'user.php?id='.$user->id.'&frame=info');
|
||||
echo " ";
|
||||
message_contact_link($user->id, 'block', false, 'user.php?id='.$user->id.'&frame=info');
|
||||
echo " ";
|
||||
}
|
||||
} else {
|
||||
message_contact_link($user->id, 'add', false, 'user.php?frame=info'); echo " ";
|
||||
message_contact_link($user->id, 'block', false, 'user.php?frame=info'); echo " ";
|
||||
message_contact_link($user->id, 'add', false, 'user.php?id='.$user->id.'&frame=info');
|
||||
echo " ";
|
||||
message_contact_link($user->id, 'block', false, 'user.php?id='.$user->id.'&frame=info');
|
||||
echo " ";
|
||||
}
|
||||
message_history_link($user->id, 0, false, '', '', 'icon');
|
||||
echo '</div>';
|
||||
|
||||
Reference in New Issue
Block a user