Example #1
0
function get_vars()
{
    global $SECRET_KEY;
    $cookie = urldecode($_COOKIE['session']);
    if (!isset($_COOKIE['session'])) {
        $sess = array('logged_in' => false, 'name' => '');
        $sess_str = arr_to_str($sess);
        setcookie('session', urlencode($sess_str));
        setcookie('hash', md5($SECRET_KEY . $sess_str));
        return $sess;
    }
    if (md5($SECRET_KEY . $cookie) !== $_COOKIE['hash']) {
        throw new Exception('Hash does not match!');
    }
    $a = str_to_arr($cookie);
    if (isset($_GET['debug'])) {
        echo "<!--\n";
        print_r($a);
        echo "-->\n";
    }
    return $a;
}
Example #2
0
                ?>
" data-user-profile="1"><?php 
                echo $share['user_nickname'];
                ?>
:</a>
						<?php 
                echo sysSubStr(parse_plain_message($share['intro']), 1000, true);
                ?>
						
					</div>
		 		<?php 
            } else {
                ?>
					<div class="share_img">
						<?php 
                $img_pro = str_to_arr($share['img_pro'], ',');
                $height = 220 / $img_pro['width'] * $img_pro['height'];
                ?>
						<a target="_blank" href="<?php 
                echo host_url(spUrl("detail", "index", array("share_id" => $share['share_id'])));
                ?>
" class="image <?php 
                echo $height > 800 ? 'long' : '';
                ?>
" id="<?php 
                echo $share['share_id'];
                ?>
_image"><img class="s_image" src="<?php 
                echo base_url_r($share['image_path'] . '_middle.jpg?' . $hash);
                ?>
" orgin_src="<?php