group_contact.inc.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. /* For licensing terms, see /dokeos_license.txt */
  3. $language_file = array('registration','messages','userInfo','admin');
  4. require '../inc/global.inc.php';
  5. require_once api_get_path(CONFIGURATION_PATH).'profile.conf.php';
  6. require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
  7. require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php';
  8. require_once api_get_path(LIBRARY_PATH).'image.lib.php';
  9. require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
  10. require_once '../inc/lib/social.lib.php';
  11. $this_section = SECTION_MYPROFILE;
  12. $_SESSION['this_section']=$this_section;
  13. $list_path_friends=array();
  14. $list_groups=array();
  15. $request=api_is_xml_http_request();
  16. $language_variable=api_xml_http_response_encode(get_lang('ContactsGroups'));
  17. //api_display_tool_title($language_variable);
  18. $user_id=api_get_user_id();
  19. $list_groups=UserFriend::show_list_type_friends();
  20. for ($p=0;$p<count($list_groups);$p++) {
  21. $list_path_friends=UserFriend::get_list_path_web_by_user_id ($user_id,$list_groups[$p]['id']);
  22. ?>
  23. <table width="100%" border="0" cellpadding="0" cellspacing="0" class="data_table">
  24. <tr>
  25. <th align="left" id="<?php echo 'td_'.$list_groups[$p]['id']; ?>" style="cursor:pointer" valign="top" onclick="toogle_function(this)">
  26. <?php echo api_xml_http_response_encode(get_lang($list_groups[$p]['title'])); ?>
  27. </th>
  28. <th width="30" align="center">
  29. <?php Display::display_icon('visible.gif',api_xml_http_response_encode(get_lang('ChangeVisibility')), array('id'=>'btn_'.$list_groups[$p]['id'])); ?>
  30. <input type="hidden" class="hidden" id="id_hd_dame" name="hd_dame" value="0" />
  31. </th>
  32. </tr>
  33. <tr>
  34. <td colspan="2">
  35. <div align="center" id="<?php echo 'div_group_'.$list_groups[$p]['id']; ?>" >
  36. <?php
  37. $friend_html='';
  38. $number_of_images=10;
  39. $number_friends=0;
  40. $list_friends_id=array();
  41. $list_friends_dir=array();
  42. $list_friends_file=array();
  43. if (count($list_path_friends)!=0) {
  44. for ($z=0;$z<count($list_path_friends['id_friend']);$z++) {
  45. $list_friends_id[] = $list_path_friends['id_friend'][$z]['friend_user_id'];
  46. $list_friends_dir[] = $list_path_friends['path_friend'][$z]['dir'];
  47. $list_friends_file[]= $list_path_friends['path_friend'][$z]['file'];
  48. }
  49. $number_friends= count($list_friends_dir);
  50. $number_loop = ($number_friends/$number_of_images);
  51. $loop_friends = ceil($number_loop);
  52. $j=0;//<div id="div_groupid_"'.$list_groups[$p]['id'].'">
  53. for ($k=0;$k<$loop_friends;$k++) {
  54. if ($j==$number_of_images) {
  55. $number_of_images=$number_of_images*2;
  56. }
  57. while ($j<$number_of_images) {
  58. if ($list_friends_file[$j]<>"") {
  59. $user_info=api_get_user_info($list_friends_id[$j]);
  60. $user_name=api_xml_http_response_encode(api_get_person_name($user_info['firstName'], $user_info['lastName']));
  61. if($list_friends_file[$j]==='unknown.jpg') {
  62. $big='';
  63. } else {
  64. $big='big_';
  65. }
  66. $friends_profile = UserFriend::get_picture_user($list_friends_id[$j], $list_friends_file[$j], 92);
  67. $friend_html.='<div id="div_'.$list_friends_id[$j].'" class="image_friend_network">' .
  68. '<a href="javascript:void(0)" onclick=load_thick("'.$list_friends_dir[$j].$big.$list_friends_file[$j].'","") title="" class="thickbox">' .
  69. '<span><center><img src="'.$friends_profile['file'].'" '.$friends_profile['style'].' id="imgfriend_'.$list_friends_id[$j].'" title="'.api_xml_http_response_encode($user_name).'" /></center></span>'.
  70. '<center class="friend">'.api_xml_http_response_encode($user_name).'</center>'.
  71. '</a></div>';
  72. }
  73. $j++;
  74. }
  75. }
  76. echo $friend_html;
  77. }
  78. else {
  79. echo api_xml_http_response_encode(get_lang('YouDontHaveContactsInThisGroup'));
  80. }
  81. ?>
  82. </div>
  83. </td>
  84. </tr>
  85. </table>
  86. <?php
  87. }
  88. ?>