示例#1
0
        ?>
",
            photo: "<?php 
        jsecho($sublet['photo']);
        ?>
",
            summary: "<?php 
        jsecho($sublet['summary']);
        ?>
",
            price: "<?php 
        jsecho($sublet['price']);
        ?>
",
            pricetype: "<?php 
        jsecho($sublet['pricetype']);
        ?>
",
            latitude: <?php 
        echo $sublet['latitude'];
        ?>
,
            longitude: <?php 
        echo $sublet['longitude'];
        ?>
          },
        <?php 
    }
    ?>
      ];
示例#2
0
if (file_exists($cachefile) && $timestamp - filemtime($cachefile) < $paramarr['cachetime']) {
    $jsmessage = '';
    if (@($fp = fopen($cachefile, 'r'))) {
        $jsmessage = fread($fp, filesize($cachefile));
        fclose($fp);
    }
    jsecho($jsmessage);
} else {
    block($blocktype, $param);
    ob_out();
    obclean();
    $jsmessage = $_SGLOBAL['content'];
    if (!empty($jsmessage)) {
        writefile($cachefile, $jsmessage, 'text', 'w', 0);
    }
    jsecho($jsmessage);
}
function jsecho($message, $exit = 1)
{
    $jsmessage = '';
    $message = str_replace(">\r", '>', $message);
    $message = str_replace(">\n", '>', $message);
    preg_match("/\\<script\\>(.+?)\\<\\/script\\>/is", $message, $mathes);
    if (!empty($mathes[1])) {
        $jsmessage = str_replace(array('<!--', '//-->'), '', $mathes[1]);
        $message = preg_replace("/\\<script\\>(.+?)\\<\\/script\\>/is", '', $message);
    }
    $message = preg_replace("/(\r|\n)/s", '', $message);
    echo 'document.write(\'' . addcslashes($message, '\'\\') . '\');';
    echo $jsmessage;
    if ($exit) {