PageRenderTime 72ms CodeModel.GetById 35ms RepoModel.GetById 1ms app.codeStats 0ms

/config.php

https://github.com/CN-TripleZ/BitcoinExchange
PHP | 50 lines | 42 code | 6 blank | 2 comment | 5 complexity | 5106d9e84de13829bddb8fefb03477f2 MD5 | raw file
  1. <?php
  2. error_reporting(0);
  3. require'database.php';
  4. // this file is to update online status and log if guest user or bot also log location
  5. // get_tag and is_bot functions are from tzine rest of the script by zelles
  6. function get_tag($tag,$xml) {
  7. preg_match_all('/<'.$tag.'>(.*)<\/'.$tag.'>$/imU',$xml,$match);
  8. return $match[1];
  9. }
  10. function is_bot() {
  11. $botlist = array("Teoma", "alexa", "froogle", "Gigabot", "inktomi",
  12. "looksmart", "URL_Spider_SQL", "Firefly", "NationalDirectory",
  13. "Ask Jeeves", "TECNOSEEK", "InfoSeek", "WebFindBot", "girafabot",
  14. "crawler", "www.galaxy.com", "Googlebot", "Scooter", "Slurp",
  15. "msnbot", "appie", "FAST", "WebBug", "Spade", "ZyBorg", "rabaz",
  16. "Baiduspider", "Feedfetcher-Google", "TechnoratiSnoop", "Rankivabot",
  17. "Mediapartners-Google", "Sogou web spider", "WebAlta Crawler","TweetmemeBot",
  18. "Butterfly","Twitturls","Me.dium","Twiceler");
  19. foreach($botlist as $bot) {
  20. if(strpos($_SERVER['HTTP_USER_AGENT'],$bot)!==false)
  21. return strpos($_SERVER['HTTP_USER_AGENT'],$bot);
  22. }
  23. return false;
  24. }
  25. $link = @mysql_connect($dbdb_host,$dbdb_user,$dbdb_pass) or die('Server error');
  26. mysql_set_charset('utf8');
  27. mysql_select_db($dbdb_database,$link);
  28. $isuser = "2";
  29. $isguest = "2";
  30. $isbot = "2";
  31. $user_session = $_SESSION['user_session'];
  32. if(is_bot()) {
  33. $botname = is_bot();
  34. $isbot = "1";
  35. } else {
  36. if(!$user_session) {
  37. $isguest = "1";
  38. $toolbar_username = "";
  39. } else {
  40. $isuser = "1";
  41. $toolbar_username = $user_session;
  42. }
  43. }
  44. ?>