/**
  * @param array $session_vars An array of values that set how the class functions.
  * 	-'cookie_path' _string_: The path where the cookie is to be stored
  * 	-'cookie_domain' _string_: The domain the that the cookie resides on
  * 	-'cookie_secure' _boolean_: Access the cookie only over an secure connection
  * 	-'cookie_httponly' _boolean_: Write to the cookie only over an http(s) connection
  * 	-'cookie_lifetime' _int_: The amount of time the cookie is active for
  * 	-'hash_cookie' _boolean_ :Hash the cookie to its value is not easily readable
  * 	-'hash_session' _boolean: Has a season so its value is not easily readable
  * 	-'session_name' _string_ : Name of the current session
  * 	-'session_lifetime' _int_: The life time of the session, in seconds
  * 	-'session_path' _string_: The path of the session.
  * 	-'session_domain' _string_: The domain of the session. Default is current.
  * 	-'session_secure'_boolean_: Access the session only over a secure connection
  * 	-'session_httponly' _boolean: Writes to the session only over an http connection
  * 	-'hash_storage_key' _boolean: Session/Cookie Storage key will be hashed.
  * 	-'storage_key' _string: Session/Cookie Key to Store Like Data
  */
 public function __construct($vars = array())
 {
     $defaults = array('cookie_path' => '/', 'cookie_domain' => $_SERVER['HTTP_HOST'], 'cookie_secure' => false, 'cookie_httponly' => false, 'cookie_lifetime' => time() + 30 * 24 * 60, 'hash_storage_key' => true, 'session_lifetime' => 2000, 'session_path' => '/', 'session_domain' => $_SERVER['HTTP_HOST'], 'session_secure' => false, 'session_httponly' => false, 'session_start' => true, 'storage_key' => 'social_like_locker_data');
     $vars += $defaults;
     self::$cookie_path = $vars['cookie_path'];
     self::$cookie_domain = $vars['cookie_domain'];
     self::$cookie_secure = $vars['cookie_secure'];
     self::$cookie_httponly = $vars['cookie_httponly'];
     self::$cookie_lifetime = $vars['cookie_lifetime'];
     self::$session_path = $vars['session_path'];
     self::$session_domain = $vars['session_domain'];
     self::$session_secure = $vars['session_secure'];
     self::$session_httponly = $vars['session_httponly'];
     self::$session_lifetime = $vars['session_lifetime'];
     self::$hash_storage_key = $vars['hash_storage_key'];
     $this->storage_key = $vars['storage_key'];
     $this->_initSession();
 }
Ejemplo n.º 2
0
<?php

ob_start();
require_once "lib/clsSocialLikeLocker.php";
$oLocker = new clsSocialLikeLocker();
$share_url = clsSocialLikeLocker::getCurrentURL();
$isLiked = $oLocker->isLiked($share_url);
?>
<!DOCTYPE HTML>

<head>

    <title>Theme by CssTemplateHeaven</title>
    <meta name="keywords" content="create from keywords">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    
<!-- Google Fonts -->

    <link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300' rel='stylesheet' type='text/css'>

<!-- CSS Files -->

    <link rel="stylesheet" type="text/css" media="screen" href="style.css">
    <link rel="stylesheet" type="text/css" media="screen" href="menu/css/simple_menu.css">
    <link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" media="screen"/>
    <link rel="stylesheet" href="css/nivo-slider.css" type="text/css" media="screen"/>
    <link rel="stylesheet" type="text/css" href="boxes/css/style6.css" />

<!-- JS Files -->

	<script type="text/javascript" src="js/jquery.min.js"></script>
Ejemplo n.º 3
0
<?php

function isAjax()
{
    return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest';
}
if (isAjax()) {
    include "lib/clsSocialLikeLocker.php";
    $url = urldecode($_GET['url']);
    $lock_again = (int) $_GET['lock'];
    $oclsSocialLikeLocker = new clsSocialLikeLocker();
    $array = array();
    if ($lock_again == 0) {
        if ($url != '') {
            $oclsSocialLikeLocker->markAsLiked($url);
            $array['code'] = 1;
            $array['url'] = $url;
        } else {
            $array['code'] = 0;
            $array['url'] = $url;
        }
    } else {
        $oclsSocialLikeLocker->markAsLocked($url);
        $array['code'] = 1;
        $array['url'] = $url;
    }
    echo json_encode($array);
}