Source for file search.php

Documentation is available at search.php

  1. <?php
  2. /**
  3.  * R.E. Login 2.0 - Felhasználó kereső - includes/search.php
  4.  *
  5.  * Felhasználók keresése. Egyelőre csak felhasználónév szerint.<br />
  6.  * <br />
  7.  * <b>Dátum:</b> 2010.04.02.
  8.  *
  9.  * <b>Szerző weboldala:</b> {@link http://rimelek.hu/}<br />
  10.  * <b>Login weblapja:</b> {@link http://rimelek.hu/meghivos-loginrendszer-r-e-login-v2-0 R.E. Login v2.0}
  11.  *
  12.  * @author Takács Ákos (Rimelek), programmer [at] rimelek [dot] hu
  13.  * @copyright Copyright (C) 2010, Takács Ákos
  14.  * @license http://www.gnu.org/licenses/gpl.html
  15.  * @package RELogin
  16.  * @version 2.0
  17.  */
  18.  
  19. if(!class_exists('System'))
  20. {
  21.     exit('Ez a fajl nem erheto el kozvetlenul. Reszletek a readme.txt-ben.');
  22. }
  23.  
  24. /**
  25.  * @ignore
  26.  */
  27. require_once System::getIncLoginDir().'classes/UserList.class.php';
  28.  
  29. /**
  30.  * @ignore
  31.  */
  32. require_once System::getIncLoginDir().'classes/Ranks.class.php';
  33.  
  34. /**
  35.  * @ignore
  36.  */
  37. require_once System::getIncLoginDir().'classes/UserFilter.class.php';
  38.  
  39.  
  40. $users array();
  41. $pageLinks "";
  42. $usearch_action Url::set(array(
  43.     'page'=>1
  44. ));
  45. if (isset($_POST['usearch'])and trim($_POST['usearch']['username']))
  46. {
  47.     $usearch &$_POST['usearch'];
  48.  
  49.     $serialized mysql_real_escape_string(serialize($usearch));
  50.  
  51.     mysql_query(
  52.         "insert into ".Config::DBPREF."searchlog
  53.         (userid,logtext,logtime) values
  54.         ('".System::$user->T_users_userid."','$serialized','".System::getTimeStamp()."')");
  55.     $site Url::set(array(
  56.         'searchid'=>mysql_insert_id()
  57.     )null'&');
  58.  
  59.     /* Felesleges logok törlése */
  60.  
  61.     $limit 100;
  62.     $userid System::$user->T_users_userid;
  63.     $sql "select searchid from ".
  64.         Config::DBPREF."searchlog where userid=$userid order by searchid desc limit $limit, 1";
  65.     $row mysql_fetch_row(mysql_query($sql));
  66.     if ($row)
  67.     {
  68.         $id $row[0];
  69.         mysql_query("delete from ".Config::DBPREF."searchlog where ".
  70.                     "userid = $userid and searchid <= $id");
  71.     }
  72.  
  73.     /****************************/
  74.  
  75.  
  76.  
  77.     System::redirect($site);
  78. }
  79. else
  80. if (isset($_GET['searchid']))
  81. {
  82.     $sid = (int)$_GET['searchid'];
  83.  
  84.     $query mysql_query(
  85.         "select logtext from ".Config::DBPREF."searchlog
  86.         where searchid = $sid and userid = ".System::$user->T_users_userid);
  87.  
  88.     $row mysql_fetch_row($query);
  89.     if ($row)
  90.     {
  91.         $filter new UserFilter();
  92.         $usearch unserialize($row[0]);
  93.  
  94.         if (isset($usearch['username']))
  95.         {
  96.             $filter->addLikeFilter('username'$usearch['username']);
  97.         }
  98.         $users new UserList(null$filter);
  99.         $pageLinks $users->pageLinks(10);
  100.     }
  101. }
  102.  
  103. $profile_tpl_url ADBListClass::setUrl(array(
  104.     'uid'=>'{id}'
  105. ),Config::FILE_PROFILE);
  106.  
  107. ?>

Documentation generated on Sun, 04 Apr 2010 22:43:51 +0200 by phpDocumentor 1.4.1