Exemplo n.º 1
0
<?php

$map_id = isset($_GET['map']) ? intval($_GET['map']) : false;
if (!$map_id) {
    $map_id = isset($_GET['id']) ? intval($_GET['id']) : false;
}
$height = isset($_GET['height']) ? intval($_GET['height']) : false;
$width = isset($_GET['width']) ? intval($_GET['width']) : false;
if (!$map_id) {
    exit;
}
require_once 'AMP/BaseDB.php';
require_once "AMP/Geo/Maps.php";
$map = new Maps(AMP_Registry::getDbcon(), $map_id);
if ($height) {
    $map->P['map_height'] = $height;
}
if ($width) {
    $map->P['map_width'] = $width;
}
$result = $map->flash_map();
print AMP_js_write($result);
Exemplo n.º 2
0
$pattern = '/src\s?=\s?\'((?!http)[\w\d\.\/?= -]*)\'/i';
$replace = 'src="'.$url.'/$1"';
$data =  preg_replace($pattern, $replace, $data);

$pattern = '/background\s?=\s?"((?!http)[\w\d\.\/?= -]*)"/i';
$replace = 'background="'.$url.'/$1"';
$data =  preg_replace($pattern, $replace, $data);

$pattern = '/action\s?=\s?"((?!http)[\w\d\.\/?= -]*)"/i';
$replace = 'action="'.$url.'/$1"';
$data =  preg_replace($pattern, $replace, $data);

$pattern = '/,\'\',\'((?!http)[\w\d\.\/?= -]*)\'/i';
$replace = ',\'\',\''.$url.'/$1\'';
$data =  preg_replace($pattern, $replace, $data);

$pattern = array( "\r", "\n" );
$finalPageHtml =  str_replace($pattern, '', $data);
*/
$finalPageHtml = AMP_absolute_urls($nav_output);
if ($format == 'js') {
    $nav_id = $position . mt_rand(1000, 10000);
    $finalPageHtml = AMP_js_write($finalPageHtml, $nav_id);
    //$finalPageHtml = 'var '.$nav_id.'=  { value: \''. str_replace( "'", "\'", $finalPageHtml ) . "'};\ndocument.write( ".$nav_id.".value );";
}
print $finalPageHtml;
if (AMP_is_cacheable_url()) {
    $cache_key = AMP_CACHE_TOKEN_URL_CONTENT . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
    $user_id = defined('AMP_SYSTEM_USER_ID') && AMP_SYSTEM_USER_ID ? AMP_SYSTEM_USER_ID : null;
    AMP_cache_set($cache_key, $finalPageHtml, $user_id);
}
Exemplo n.º 3
0
    print $cached_output;
    exit;
}
$badge_id = isset($_GET['id']) && $_GET['id'] ? intval($_GET['id']) : false;
if (!$badge_id) {
    $badge_id = isset($_GET['badge']) && $_GET['badge'] ? intval($_GET['badge']) : false;
}
$format = isset($_GET['format']) && $_GET['format'] ? $_GET['format'] : false;
if (!$badge_id) {
    trigger_error('no badge requested for ' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
    exit;
}
require_once 'AMP/Content/Badge/ComponentMap.inc.php';
$map = new ComponentMap_Badge();
$badge = $map->getComponent('source');
$badge->readData($badge_id);
if (!($badge->hasData() && $badge->isLive())) {
    trigger_error(AMP_TEXT_ERROR_OPEN_FAILED, 'Badge ' . $badge_id);
    exit;
}
$result = $badge->execute();
$finalPageHtml = AMP_absolute_urls($result);
if ($format != 'xml') {
    $finalPageHtml = AMP_js_write($finalPageHtml);
}
print $finalPageHtml;
if (AMP_is_cacheable_url()) {
    $cache_key = AMP_CACHE_TOKEN_URL_CONTENT . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
    $user_id = defined('AMP_SYSTEM_USER_ID') && AMP_SYSTEM_USER_ID ? AMP_SYSTEM_USER_ID : null;
    AMP_cache_set($cache_key, $finalPageHtml, $user_id);
}