Social tool: Showing the user image in all pages

skala
Julio Montoya 16 years ago
parent 68ea30988a
commit b57147904a
  1. 12
      main/social/friends.php
  2. 11
      main/social/group_add.php
  3. 11
      main/social/group_edit.php
  4. 14
      main/social/group_invitation.php
  5. 14
      main/social/group_members.php
  6. 12
      main/social/group_waiting_list.php
  7. 14
      main/social/groups.php
  8. 56
      main/social/home.php
  9. 12
      main/social/invitations.php
  10. 62
      main/social/profile.php
  11. 13
      main/social/search.php

@ -79,6 +79,18 @@ function clear_form () {
$("div#div_qualify_image").html("");
$("div#div_info_user").html("");
}
function show_icon_edit(element_html) {
ident="#edit_image";
$(ident).show();
}
function hide_icon_edit(element_html) {
ident="#edit_image";
$(ident).hide();
}
</script>';
$interbreadcrumb[]= array ('url' =>'profile.php','name' => get_lang('Social'));

@ -31,7 +31,16 @@ function text_longitud(){
}else{
textarea = document.forms[0].description.value;
}
}
}
function show_icon_edit(element_html) {
ident="#edit_image";
$(ident).show();
}
function hide_icon_edit(element_html) {
ident="#edit_image";
$(ident).hide();
}
</script>';
$table_message = Database::get_main_table(TABLE_MESSAGE);

@ -31,7 +31,16 @@ function textarea_maxlength(){
}else{
textarea = document.forms[0].description.value;
}
}
}
function show_icon_edit(element_html) {
ident="#edit_image";
$(ident).show();
}
function hide_icon_edit(element_html) {
ident="#edit_image";
$(ident).hide();
}
</script>';
$group_id = isset($_GET['id']) ? intval($_GET['id']) : intval($_POST['id']);

@ -20,7 +20,19 @@ api_block_anonymous_users();
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.js" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.css" type="text/css" media="projection, screen">';
$htmlHeadXtra[] = '<script type="text/javascript">
function show_icon_edit(element_html) {
ident="#edit_image";
$(ident).show();
}
function hide_icon_edit(element_html) {
ident="#edit_image";
$(ident).hide();
}
</script>';
$xajax = new xajax();
//$xajax->debugOn();
$xajax -> registerFunction ('search_users');

@ -15,7 +15,19 @@ require_once api_get_path(LIBRARY_PATH).'social.lib.php';
$htmlHeadXtra[] = '<script type="text/javascript" src="/main/inc/lib/javascript/jquery.js"></script>';
$htmlHeadXtra[] = '<script type="text/javascript" src="/main/inc/lib/javascript/thickbox.js"></script>';
$htmlHeadXtra[] = '<link rel="stylesheet" href="/main/inc/lib/javascript/thickbox.css" type="text/css" media="projection, screen">';
$htmlHeadXtra[] = '<script type="text/javascript">
function show_icon_edit(element_html) {
ident="#edit_image";
$(ident).show();
}
function hide_icon_edit(element_html) {
ident="#edit_image";
$(ident).hide();
}
</script>';
$this_section = SECTION_SOCIAL;
$interbreadcrumb[]= array ('url' =>'home.php','name' => get_lang('Social'));

@ -14,7 +14,19 @@ require_once api_get_path(LIBRARY_PATH).'social.lib.php';
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.js" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.css" type="text/css" media="projection, screen">';
$htmlHeadXtra[] = '<script type="text/javascript">
function show_icon_edit(element_html) {
ident="#edit_image";
$(ident).show();
}
function hide_icon_edit(element_html) {
ident="#edit_image";
$(ident).hide();
}
</script>';
$this_section = SECTION_SOCIAL;
$interbreadcrumb[]= array ('url' =>'home.php','name' => get_lang('Social'));
$interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));

@ -112,7 +112,19 @@ jQuery(document).ready(function() {
}
});
</script>';
function show_icon_edit(element_html) {
ident="#edit_image";
$(ident).show();
}
function hide_icon_edit(element_html) {
ident="#edit_image";
$(ident).hide();
}
</script>';
$allowed_views = array('mygroups','newest','pop');
$interbreadcrumb[]= array ('url' =>'home.php','name' => get_lang('Social'));

@ -25,7 +25,19 @@ api_block_anonymous_users();
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.js" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.css" type="text/css" media="projection, screen">';
$htmlHeadXtra[] = '<script type="text/javascript">
function show_icon_edit(element_html) {
ident="#edit_image";
$(ident).show();
}
function hide_icon_edit(element_html) {
ident="#edit_image";
$(ident).hide();
}
</script>';
//fast upload image
if (api_get_setting('profile', 'picture') == 'true') {
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
@ -68,55 +80,13 @@ echo '<div id="social-content">';
echo '<div id="social-content-right">';
echo '<div class="social-box-main1">';
echo '<div class="social-box-left">';
$user_image_array = UserManager::get_picture_user(api_get_user_id(), $user_info['picture_uri'], 400, USER_IMAGE_SIZE_ORIGINAL);
//@todo fix this aswell as in main/auth/profile.php
//User picture size is calculated from SYSTEM path
$image_syspath = UserManager::get_user_picture_path_by_id(api_get_user_id(), 'system', false, true);
$image_syspath['dir'].$image_syspath['file'];
$image_size = @getimagesize($image_syspath['dir'].$image_syspath['file']);
//Web path
$image_path = UserManager::get_user_picture_path_by_id(api_get_user_id(), 'web', false, true);
$image_dir = $image_path['dir'];
$image = $image_path['file'];
$image_file = $image_dir.$image;
$img_attributes = ' hspace="6" height="90" align="left" width="80" src="'.$image_file.'?rand='.time().'" '
.'alt="'.api_get_person_name($user_data['firstname'], $user_data['lastname']).'" ';
if ($image_size[0] > 80) {
//limit display width to 80px
$img_attributes .= 'width="80" ';
}
// get the path,width and height from original picture
$big_image = $image_dir.'big_'.$image;
$big_image_size = api_getimagesize($big_image);
$big_image_width = $big_image_size[0];
$big_image_height = $big_image_size[1];
$url_big_image = $big_image.'?rnd='.time();
if ($image == 'unknown.jpg') {
$image = '<a href="'.api_get_path(WEB_CODE_PATH).'auth/profile.php"><img '.$img_attributes.' /></a>';
/*if (api_get_setting('profile', 'picture') == 'true') {
$form->display();
}*/
} else {
$big_image = UserManager::get_picture_user(api_get_user_id(), $user_info['picture_uri'],'',USER_IMAGE_SIZE_BIG);
$big_image = $big_image['file'].$big_image['dir'];
$image = '<a class="thickbox" href="'.$big_image.'"><img '.$img_attributes.' /> </a>';
//$image = '<input type="image" '.$img_attributes.' onclick="javascript: return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/>';
}
// information current user
echo '<div class="social-box-container1">
<div>'.Display::return_icon('boxmygroups.jpg').'</div>
<div class="social-box-content1">';
//echo '<div><img hspace="6" height="90" align="left" width="80" src="'.$user_image_array['dir'].$user_image_array['file'].'"/></div>';
echo '<div>'.$image.'</div>';
echo '<div><p><strong>'.get_lang('Name').'</strong><br /><span class="social-groups-text4">'.api_get_person_name($user_info['firstname'], $user_info['lastname']).'</span></p></div>

@ -61,6 +61,18 @@ function register_friend(element_input) {
});
}
}
function show_icon_edit(element_html) {
ident="#edit_image";
$(ident).show();
}
function hide_icon_edit(element_html) {
ident="#edit_image";
$(ident).hide();
}
</script>';
api_block_anonymous_users();

@ -177,6 +177,7 @@ function register_friend(element_input) {
});
}
}
function show_icon_edit(element_html) {
ident="#edit_image";
@ -268,35 +269,42 @@ echo '<div id="social-content-right">';
echo '<div class="social-box-left">';
echo '<div>'.Display::return_icon('boxmygroups.jpg').'</div>';
echo '<div class="social-box-content1">';
if (!empty($user_info['firstname']) || !empty($user_info['lastname'])) {
echo '<div><h3>'.api_get_person_name($user_info['firstname'], $user_info['lastname']).'</h3></div>';
} else {
//--- Basic Information
echo '<div><h3>'.get_lang('Information').'</h3></div>';
if ($show_full_profile) {
echo '<div class="social-profile-info" >';
echo '<dt>'.get_lang('UserName').'</dt>
<dd>'. $user_info['username'].' </dd>';
if (!empty($user_info['firstname']) || !empty($user_info['lastname']))
echo '<dt>'.get_lang('Name').'</dt>
<dd>'. api_get_person_name($user_info['firstname'], $user_info['lastname']).'</dd>';
if (!empty($user_info['official_code']))
echo '<dt>'.get_lang('OfficialCode').'</dt>
<dd>'.$user_info['official_code'].'</dd>';
if (!empty($user_info['email']))
if (api_get_setting('show_email_addresses')=='true')
echo '<dt>'.get_lang('Email').'</dt>
<dd>'.$user_info['email'].'</dd>';
if (!empty($user_info['phone']))
echo '<dt>'.get_lang('Phone').'</dt>
<dd>'. $user_info['phone'].'</dd>';
echo '</dl>';
echo '</div>';
} else {
echo '<div class="social-profile-info" >';
echo '<dl>';
if (!empty($user_info['firstname']) || !empty($user_info['lastname']))
echo '<div><h3>'.get_lang('Information').'</h3></div>';
}
if ($show_full_profile) {
echo '<div class="social-profile-info" >';
echo '<dt>'.get_lang('UserName').'</dt>
<dd>'. $user_info['username'].' </dd>';
/* if (!empty($user_info['firstname']) || !empty($user_info['lastname']))
echo '<dt>'.get_lang('Name').'</dt>
<dd>'. api_get_person_name($user_info['firstname'], $user_info['lastname']).'</dd>';
echo '</div>';
}
<dd>'. api_get_person_name($user_info['firstname'], $user_info['lastname']).'</dd>';*/
if (!empty($user_info['official_code']))
echo '<dt>'.get_lang('OfficialCode').'</dt>
<dd>'.$user_info['official_code'].'</dd>';
if (!empty($user_info['email']))
if (api_get_setting('show_email_addresses')=='true')
echo '<dt>'.get_lang('Email').'</dt>
<dd>'.$user_info['email'].'</dd>';
if (!empty($user_info['phone']))
echo '<dt>'.get_lang('Phone').'</dt>
<dd>'. $user_info['phone'].'</dd>';
echo '</dl>';
echo '</div>';
} else {
echo '<div class="social-profile-info" >';
echo '<dl>';
if (!empty($user_info['firstname']) || !empty($user_info['lastname']))
echo '<dt>'.get_lang('Name').'</dt>
<dd>'. api_get_person_name($user_info['firstname'], $user_info['lastname']).'</dd>';
echo '</div>';
}
echo '<div class="clear"></div>';

@ -18,6 +18,19 @@ api_block_anonymous_users();
$this_section = SECTION_SOCIAL;
$tool_name = get_lang('Search');
$interbreadcrumb[]= array ('url' =>'profile.php','name' => get_lang('Social'));
$htmlHeadXtra[] = '<script type="text/javascript">
function show_icon_edit(element_html) {
ident="#edit_image";
$(ident).show();
}
function hide_icon_edit(element_html) {
ident="#edit_image";
$(ident).hide();
}
</script>';
Display :: display_header($tool_name);

Loading…
Cancel
Save