Avoiding message table in front page

skala
Julio Montoya 15 years ago
parent eb87720e04
commit 93a6b61e33
  1. 46
      user_portal.php

@ -1212,53 +1212,7 @@ if (isset($toolsList) and is_array($toolsList) and isset($digest)) {
if ($show_menu) {
echo '<div class="menusection">';
echo '<span class="menusectioncaption">'.get_lang('MenuUser').'</span>';
//user image
// @todo add a platform setting to add the user image
if (api_get_setting('allow_social_tool')=='true' && api_get_setting('allow_message_tool') == 'true') {
$img_array= UserManager::get_user_picture_path_by_id(api_get_user_id(),'web',true,true);
$no_image =false;
if ($img_array['file'] == 'unknown.jpg') {
$no_image =true;
}
$img_array = UserManager::get_picture_user(api_get_user_id(), $img_array['file'], 92, 'medium_', ' width="90" height="90" ');
echo '<div id="social_widget" style="">';
if ($no_image == false)
echo '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php"><img src="'.$img_array['file'].'" '.$img_array['style'].' border="1"></a>';
else
echo '<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php"><img title="'.get_lang('EditProfile').'" src="'.$img_array['file'].'" '.$img_array['style'].' border="1"></a>';
require_once api_get_path(LIBRARY_PATH).'message.lib.php';
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
$number_of_new_messages = MessageManager::get_new_messages();
$number_of_new_messages_of_friend = SocialManager::get_message_number_invitation_by_user_id(api_get_user_id());
$cant_msg = '';
if ($number_of_new_messages > 0)
$cant_msg = ' ('.$number_of_new_messages.')';
echo '<div class="message-content">
<h2 class="message-title">'.get_lang('Messages').'</h2>
<p>';
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php" class="message-body">'.get_lang('Inbox').$cant_msg.' </a><br />';
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php" class="message-body">'.get_lang('Comppose').' </a><br />';
if ($number_of_new_messages_of_friend > 0) {
echo '<a href="'.api_get_path(WEB_PATH).'main/social/invitations.php" class="message-body">'.get_lang('PendingInvitations').' ('.$number_of_new_messages_of_friend.') </a><br />';
}
echo '</p>';
echo '</div>';
echo '</div><br />';
}
echo '<ul class="menulist">';
if ($show_create_link) {
display_create_course_link();

Loading…
Cancel
Save