示例#1
0
$time = time();
// время отправки
$interval = $time - $_GET['ctime'];
if ($interval < 1) {
    // интервал отправки (сек)
    $result = "error";
    $cls = "c_error";
    $time = "";
    $message = "Сообщение уже было отправлено.";
} else {
    if (strlen($_GET['cname']) > 2 && strlen($_GET['cphone']) > 5) {
        $phone = gf("cphone");
        $ref = gf("ref");
        $name = gf("cname");
        $comment = gf("ccmnt");
        $url = gf("url");
        $mess = "";
        // get city
        $ip = $_SERVER['REMOTE_ADDR'];
        $geo = file_get_contents('http://freegeoip.net/json/' . $ip);
        $geo = json_decode($geo, true);
        function addToMess($c, $o)
        {
            global $mess;
            if (strlen($o) > 2) {
                $mess = $mess . "<b>" . $c . "</b>:<br>" . $o . "<br><br>";
            }
        }
        $title = "CallMe: обратный звонок";
        addToMess("Телефон", $phone);
        addToMess("Имя", $name);
示例#2
0
 /**
  * Give some info on browser
  * @param	string	$property [optional default ''] : Name of the property (case in-sensitive) to retrieve. '' for browser array instead as returend by browscap.
  * @return	mixed	Value of property or browser array that was returned by Browscap
  */
 public static function gb($property = '')
 {
     $property = strtolower($property);
     static $cached_browscap = null;
     // will either be cached array OR the object itself if it was loaded
     static $cached_js_detect = null;
     switch ($property) {
         // Properties that are not returned by Browscap
         //case 'Accept' : return explode(",", strtolower( $_SERVER["HTTP_ACCEPT_LANGUAGE"])); break;	// useless since IE always return */*
         case 'languages':
             return isset($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? explode(",", strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"])) : array();
         case 'country':
             throw new exception('TODO : Not available yet');
         case 'javascript_detected':
             return isset($_SESSION['BF_' . BF::gc('project_id') . '_cached_js_detect']);
         case 'js_browser':
         case 'js_browser_version':
         case 'js_flash':
         case 'js_resolution':
             if (!isset($_SESSION['BF_' . BF::gc('project_id') . '_cached_js_detect'])) {
                 return null;
             }
             if (!isset($cached_js_detect)) {
                 $cached_js_detect = array_combine(array('js_browser', 'js_browser_version', 'js_flash', 'js_resolution'), explode('|', $_SESSION['BF_' . BF::gc('project_id') . '_cached_js_detect']));
             }
             return $cached_js_detect[$property];
             // Properties that are returned by Browscap
             // cached properties
         // Properties that are returned by Browscap
         // cached properties
         case 'browser':
         case 'version':
         case 'platform':
         case 'win32':
         case 'majorver':
         case 'wap':
         case 'ismobiledevice':
         case 'crawler':
             if ($cached_browscap) {
                 return is_array($cached_browscap) ? $cached_browscap[$property] : $cached_browscap->{$property};
             } elseif (isset($_SESSION['BF_' . BF::gc('project_id') . 'cached_browscap'])) {
                 $cached_browscap = array_combine(array('browser', 'version', 'platform', 'win32', 'majorver', 'wap', 'ismobiledevice', 'crawler'), explode('|', $_SESSION['BF_' . BF::gc('project_id') . '_cached_browscap']));
                 return $cached_browscap[$property];
             }
             // not cached properties
         // not cached properties
         default:
             if (!$cached_browscap || !is_object($cached_browscap)) {
                 if (!BF::gf('browscap')) {
                     throw new exception('Invalid config entry for browscap folder path');
                 }
                 BF::load_module('Browscap');
                 $previous_error_reporting = error_reporting();
                 error_reporting($previous_error_reporting ^ E_STRICT ^ E_NOTICE);
                 // shut off notices
                 $bc = new Browscap(gf('browscap')->path);
                 $cached_browscap = array_change_key_case($bc->getBrowser(null, true), CASE_LOWER);
                 error_reporting($previous_error_reporting);
                 if (!isset($_SESSION['BF_' . BF::gc('project_id') . '_cached_browscap'])) {
                     $_SESSION['BF_' . BF::gc('project_id') . '_cached_browscap'] = implode('|', array($cached_browscap['browser'], $cached_browscap['version'], $cached_browscap['platform'], $cached_browscap['win32'], $cached_browscap['majorver'], $cached_browscap['wap'], $cached_browscap['ismobiledevice'], $cached_browscap['crawler']));
                 }
             }
             if ($property) {
                 return $cached_browscap[$property];
             } else {
                 return $cached_browscap;
             }
     }
 }