Advertisement
Guest User

Untitled

a guest
May 20th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.63 KB | None | 0 0
  1. ?php
  2.  
  3. /*
  4.  
  5. Comet Chat
  6.  
  7. Version: 1.1
  8.  
  9. */
  10.  
  11. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  12. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  13. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  14.  
  15. // Path to CometChat (default: cometchat/) [must have trailing /]
  16. define('BASE_URL','cometchat/');
  17.  
  18. // Set your character set (default: ISO-8859-1)
  19. define('CHARSET','ISO-8859-1');
  20.  
  21. // Set the time in seconds after which the users buddylist is refreshed (default: 60)
  22. define('REFRESH_BUDDYLIST','60');
  23.  
  24. // Set the time in seconds after which a user is considered offline if no response is received (default: 120)
  25. define('ONLINE_TIMEOUT','30');
  26.  
  27. // Smileys
  28. $smileys = array(
  29.  
  30. ':)'    =>  'smiley',
  31. ':-)'   =>  'smiley',
  32. ':('    =>  'smiley-sad',
  33. ':-('   =>  'smiley-sad',
  34. ':D'    =>  'smiley-lol',
  35. ';-)'   =>  'smiley-wink',
  36. ';)'    =>  'smiley-wink',
  37. ':o'    =>  'smiley-surprise',
  38. ':-o'   =>  'smiley-surprise',
  39. '8-)'   =>  'smiley-cool',
  40. '8)'    =>  'smiley-cool',
  41. ':|'    =>  'smiley-neutral',
  42. ':-|'   =>  'smiley-neutral',
  43. ":'("   =>  'smiley-cry',
  44. ":'-("  =>  'smiley-cry',
  45. ":p"    =>  'smiley-razz',
  46. ":-p"   =>  'smiley-razz',
  47. ":s"    =>  'smiley-confuse',
  48. ":-s"   =>  'smiley-confuse',
  49. ":x"    =>  'smiley-mad',
  50. ":-x"   =>  'smiley-mad',
  51.  
  52. );
  53.  
  54. // Set to 1 if you want to disable smileys (default: 0)
  55. define('DISABLE_SMILEYS','0');
  56.  
  57. // Set to 1 if you want to disable auto linking (default: 0)
  58. define('DISABLE_LINKING','0');
  59.  
  60. // Set banned words here
  61. $bannedWords = array();
  62.  
  63. // Mysql configuration
  64. $SERVERNAME = 'localhost';
  65. $SERVERPORT %3Proxy-Connection: keep-alive
  66. Cache-Control: max-age=0
  67.  
  68. '3306';
  69. $USERNAME = '';
  70. $PASSWORD = '';
  71. $DBNAME = 'tdg_foro';
  72.  
  73. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  74. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  75. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  76.  
  77. include_once "JSON.php";
  78.  
  79. error_reporting(E_ALL);
  80. ini_set('display_errors','Off');
  81. ini_set('log_errors', 'On');
  82. ini_set('error_log', 'error.log');
  83.  
  84. session_start();
  85.  
  86. function stripSlashesDeep($value) {
  87.     $value = is_array($value) ? array_map('stripSlashesDeep', $value) : stripslashes($value);
  88.     return $value;
  89. }
  90.  
  91. if ( get_magic_quotes_gpc() ) {
  92.     $_GET    = stripSlashesDeep($_GET   );
  93.     $_POST   = stripSlashesDeep($_POST  );
  94.     $_COOKIE = stripSlashesDeep($_COOKIE);
  95. }
  96.  
  97.  
  98.  
  99. $dbh = mysql_connect($SERVERNAME.':'.$SERVERPORT,$USERNAME,$PASSWORD);
  100. mysql_selectdb($DBNAME,$dbh);
  101. // mysql_set_charset('latin5');
  102.  
  103. define('TABLE_PREFIX', 'phpbb_');
  104.  
  105. $userid = 0;
  106.  
  107. // Please update the following logic below to return the userid of the logged in user
  108. // We assume you will be using some sort of session/cookie to fetch those details
  109. // For example we use a cookie called sessionhash and store it in table called session
  110. //
  111. // Session table
  112. // ---------------------------------
  113. // userid   sessionhash
  114. // ---------------------------------
  115. // 1        afgbdsfbsdfklbnlern34
  116. //
  117. // Or you can use something as simple as $userid = $_SESSION['userid'];
  118.  
  119. //$sql = ("select userid from ".TABLE_PREFIX."session where sessionhash = '".mysql_real_escape_string($_COOKIE['sessionhash'])."'");
  120. $sql = ("select user_id from ".TABLE_PREFIX."users where user_id = '".mysql_real_escape_string($_COOKIE['tdgteam_u'])."' and user_id > '1'");
  121. $query = mysql_query($sql);
  122. $session = mysql_fetch_array($query);
  123. $userid = $session['user_id'];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement