group_contact.inc.php 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. $language_file = array('registration','messages','userInfo','admin');
  3. require ('../inc/global.inc.php');
  4. require_once (api_get_path(CONFIGURATION_PATH).'profile.conf.php');
  5. include_once (api_get_path(LIBRARY_PATH).'fileManage.lib.php');
  6. include_once (api_get_path(LIBRARY_PATH).'fileUpload.lib.php');
  7. include_once (api_get_path(LIBRARY_PATH).'image.lib.php');
  8. require_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php');
  9. require_once '../inc/lib/social.lib.php';
  10. $this_section = SECTION_MYPROFILE;
  11. $_SESSION['this_section']=$this_section;
  12. $list_path_friends=array();
  13. $list_groups=array();
  14. ?>
  15. <div id="id" class="actions">
  16. <?php echo '&nbsp;&nbsp;'.utf8_encode(get_lang('ContactsGroupsComment')); ?>
  17. </div>
  18. <?php
  19. $user_id=api_get_user_id();
  20. $list_groups=UserFriend::show_list_type_friends();
  21. for ($p=0;$p<count($list_groups);$p++) {
  22. $list_path_friends=UserFriend::get_list_path_web_by_user_id ($user_id,$list_groups[$p]['id']);
  23. ?>
  24. <table width="100%" border="0" cellpadding="0" cellspacing="0" class="social-align-box">
  25. <tr>
  26. <td id="<?php echo 'td_'.$list_groups[$p]['id']; ?>" width="100%" height="20" valign="top" onclick="toogle_function(this)">
  27. <table width="100%" border="0" cellpadding="0" cellspacing="0" class="social-title">
  28. <tr>
  29. <td width="100%" height="22" valign="top" style="cursor:pointer">&nbsp;&nbsp;<?php echo get_lang($list_groups[$p]['title']); ?>
  30. <img id="<?php echo 'btn_'.$list_groups[$p]['id']; ?>" style="float:right;margin-top:-15px" src="../img/visible.gif" /><input type="hidden" class="hidden" id="id_hd_dame" name="hd_dame" value="0" /></td>
  31. </tr>
  32. </table></td>
  33. </tr>
  34. <tr>
  35. <td valign="top">
  36. <div align="center" id="<?php echo 'div_group_'.$list_groups[$p]['id']; ?>" >
  37. <?php
  38. $friend_html='';
  39. $number_of_images=10;
  40. $number_friends=0;
  41. $list_friends_id=array();
  42. $list_friends_dir=array();
  43. $list_friends_file=array();
  44. if (count($list_path_friends)!=0) {
  45. for ($z=0;$z<count($list_path_friends['id_friend']);$z++) {
  46. $list_friends_id[] = $list_path_friends['id_friend'][$z]['friend_user_id'];
  47. $list_friends_dir[] = $list_path_friends['path_friend'][$z]['dir'];
  48. $list_friends_file[]= $list_path_friends['path_friend'][$z]['file'];
  49. }
  50. $number_friends= count($list_friends_dir);
  51. $number_loop = ($number_friends/$number_of_images);
  52. $loop_friends = ceil($number_loop);
  53. $j=0;//<div id="div_groupid_"'.$list_groups[$p]['id'].'">
  54. $friend_html.= '<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFC" style="border-left:1px #B8C8DC solid;border-bottom:1px #B8C8DC solid;border-right:1px #B8C8DC solid;">';
  55. for ($k=0;$k<$loop_friends;$k++) {
  56. $friend_html.='<tr><td valign="top">';
  57. if ($j==$number_of_images) {
  58. $number_of_images=$number_of_images*2;
  59. }
  60. while ($j<$number_of_images) {
  61. if ($list_friends_file[$j]<>"") {
  62. $user_info=api_get_user_info($list_friends_id[$j]);
  63. $name_user=$user_info['firstName'].' '.$user_info['lastName'];
  64. if($list_friends_file[$j]==='unknown.jpg') {
  65. $big='';
  66. } else {
  67. $big='big_';
  68. }
  69. $friend_html.='&nbsp;<div class="image-social-content" id=div_'.$list_friends_id[$j].' style="float:left" ><a href="javascript:void(0)" onclick=load_thick("'.$list_friends_dir[$j].$big.$list_friends_file[$j].'","'.urlencode($name_user).'") title="" class="thickbox"><img src="'.$list_friends_dir[$j].$list_friends_file[$j].'" width="90" height="110" style="margin-left:3px ;margin-rigth:3px;margin-top:10px;margin-bottom:3px;" id="imgfriend_'.$list_friends_id[$j].'" title="'.$name_user.'" /></a></div>&nbsp;';
  70. }
  71. $j++;
  72. }
  73. $friend_html.='</td></tr>';
  74. }
  75. $friend_html.='<br/></table>&nbsp;';
  76. echo $friend_html;
  77. } else {
  78. $friend_html.= '<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFC" style="border-left:1px #B8C8DC solid;border-bottom:1px #B8C8DC solid;border-right:1px #B8C8DC solid;text-align:left">';
  79. $friend_html.='<tr><td valign="top">&nbsp;&nbsp;&nbsp;'.utf8_encode(get_lang('YouDontHaveContactsInThisGroup'));
  80. $friend_html.='<br/><br/></td></tr>';
  81. $friend_html.='</table>&nbsp;';//</div>
  82. echo $friend_html;
  83. echo '</br>';
  84. }
  85. ?>
  86. </td><br/>
  87. </tr>
  88. </table></td>
  89. </tr>
  90. </table><br/>
  91. <?php
  92. }
  93. ?>
  94. </div>