show_search_image.inc.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2009 Dokeos SPRL
  6. Copyright (c) Julio Montoya Armas
  7. For a full list of contributors, see "credits.txt".
  8. The full license can be read in "license.txt".
  9. This program is free software; you can redistribute it and/or
  10. modify it under the terms of the GNU General Public License
  11. as published by the Free Software Foundation; either version 2
  12. of the License, or (at your option) any later version.
  13. See the GNU General Public License for more details.
  14. Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
  15. Mail: info@dokeos.com
  16. ==============================================================================
  17. */
  18. $cidReset = true;
  19. require '../inc/global.inc.php';
  20. $language_file = array('registration','messages','userInfo','admin');
  21. require_once api_get_path(CONFIGURATION_PATH).'profile.conf.php';
  22. require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
  23. require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php';
  24. require_once api_get_path(LIBRARY_PATH).'image.lib.php';
  25. require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
  26. require_once '../inc/lib/social.lib.php';
  27. $list_path_friends=array();
  28. $user_id=api_get_user_id();
  29. $name_search=Security::remove_XSS($_POST['search_name_q']);
  30. if (isset($name_search) && $name_search!='undefined') {
  31. $list_path_friends=UserFriend::get_list_path_web_by_user_id($user_id,null,$name_search);
  32. } else {
  33. $list_path_friends=UserFriend::get_list_path_web_by_user_id($user_id);
  34. }
  35. $friend_html='';
  36. $number_of_images=8;
  37. $number_friends=0;
  38. $list_friends_id=array();
  39. $list_friends_dir=array();
  40. $list_friends_file=array();
  41. if (count($list_path_friends)!=0) {
  42. for ($z=0;$z<count($list_path_friends['id_friend']);$z++) {
  43. $list_friends_id[] = $list_path_friends['id_friend'][$z]['friend_user_id'];
  44. $list_friends_dir[] = $list_path_friends['path_friend'][$z]['dir'];
  45. $list_friends_file[]= $list_path_friends['path_friend'][$z]['file'];
  46. }
  47. $number_friends= count($list_friends_dir);
  48. $number_loop = ($number_friends/$number_of_images);
  49. $loop_friends = ceil($number_loop);
  50. $j=0;
  51. $friend_html.= '<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFC" >';
  52. for ($k=0;$k<$loop_friends;$k++) {
  53. $friend_html.='<tr><td valign="top">';
  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. $friends_profile = UserFriend::get_picture_user($list_friends_id[$j], $list_friends_file[$j], 92);
  62. $friend_html.='<div onMouseover="show_icon_delete(this)" onMouseout="hide_icon_delete(this)" class="image-social-content" id=div_'.$list_friends_id[$j].' >
  63. <span><center><img src="'.$friends_profile['file'].'" '.$friends_profile['style'].' id="imgfriend_'.$list_friends_id[$j].'" title="'.$user_name.'" onclick=load_thick(\'qualify_contact.inc.php?path_user="'.urlencode($list_friends_dir[$j].$list_friends_file[$j]).'&amp;id_user="'.$list_friends_id[$j].'"\',"") /></center></span>
  64. <img onclick="delete_friend (this)" id=img_'.$list_friends_id[$j].' src="../img/blank.gif" alt="" title="" class="image-delete" /> <center class="friend">'.$user_name.'</center></div>';
  65. /*
  66. * $friend_html.='&nbsp;<div onMouseover="show_icon_delete(this)" onMouseout="hide_icon_delete(this)" class="image-social-content" id=div_'.$list_friends_id[$j].' style="float:left" >
  67. * <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="'.$user_name.'" onclick="qualify_friend(this)"/>
  68. * <img onclick="delete_friend (this)" id=img_'.$list_friends_id[$j].' src="../img/blank.gif" alt="" title="" class="image-delete" /></div>&nbsp;';
  69. */
  70. }
  71. $j++;
  72. }
  73. $friend_html.='</td></tr>';
  74. }
  75. $friend_html.='<br/></table>';
  76. }
  77. echo $friend_html;
  78. ?>