Esempio n. 1
0
function _adRenderBuildFileUrl($aBanner, $useAlt = false, $params = '')
{
    $conf = $GLOBALS['_MAX']['CONF'];
    $fileUrl = '';
    if ($aBanner['type'] == 'url') {
        $fileUrl = $useAlt ? $aBanner['alt_imageurl'] : $aBanner['imageurl'];
        if (!empty($params)) {
            $fileUrl .= "?{$params}";
        }
    } else {
        $fileName = $useAlt ? $aBanner['alt_filename'] : $aBanner['filename'];
        $params = !empty($params) ? $params : '';
        if (!empty($fileName)) {
            if ($aBanner['type'] == 'web') {
                $fileUrl = _adRenderBuildImageUrlPrefix() . "/{$fileName}";
                if (!empty($params)) {
                    $fileUrl .= "?{$params}";
                }
            } elseif ($aBanner['type'] == 'sql') {
                $fileUrl = MAX_commonGetDeliveryUrl($conf['file']['image']) . "?filename={$fileName}&contenttype={$aBanner['contenttype']}";
                if (!empty($params)) {
                    $fileUrl .= "&{$params}";
                }
            }
        }
    }
    return $fileUrl;
}
function MAX_layerGetHtml($output, $uniqid)
{
    global $target;
    global $align, $collapsetime, $padding, $closetext;
    $conf = $GLOBALS['_MAX']['CONF'];
    // Register input variables
    MAX_commonRegisterGlobalsArray(array('align', 'collapsetime', 'padding', 'closetext'));
    if (!isset($padding)) {
        $padding = '2';
    }
    // Calculate layer size (inc. borders)
    $layer_width = $output['width'] + 4 + $padding * 2;
    $layer_height = $output['height'] + 30 + $padding * 2;
    // Create imagepath
    $imagepath = _adRenderBuildImageUrlPrefix() . '/layerstyles/geocities/';
    // return HTML code
    return '
<div id="MAX_c' . $uniqid . '" style="position:absolute; width:' . $layer_width . 'px; height:' . $layer_height . 'px; z-index:98; left: 0px; top: 0px; visibility: hidden">
	<table width="100%" border="1" cellspacing="0" cellpadding="0" style="border-style: ridge; border-color: #ffffff">
		<tr>
			<td bordercolor="#DDDDDD" bgcolor="#000099" align="right" style="padding: 3px 3px 2px">' . '<img src="' . $imagepath . 'expand.gif" alt="" style="width:12px;height:12px;margin: 0 3px;" onclick="MAX_geopop(\'expand\', \'' . $uniqid . '\')" />' . '<img src="' . $imagepath . 'close.gif" alt="" style="width:12px;height:12px;" onclick="MAX_geopop(\'close\', \'' . $uniqid . '\')" />' . '</td>
		</tr>
' . (strlen($output['url']) && strlen($output['alt']) ? '		<tr>
			<td bgcolor="#FFFFCC" align="center" style="font-family: Arial, helvetica, sans-serif; font-size: 11px; padding: 2px"><a href="' . $output['url'] . '" ' . (isset($target) ? 'target="' . $target . '"' : '') . 'style="color: #0000ff">' . $output['alt'] . '</a></td>
		</tr>
' : '') . '	</table>
</div>
<div id="MAX_o' . $uniqid . '" style="position:absolute; width:' . $layer_width . 'px; height:' . $layer_height . 'px; z-index:99; left: 0px; top: 0px; visibility: hidden">
	<table width="100%" border="1" cellspacing="0" cellpadding="0" style="border-style: outset; border-color: #ffffff">
		<tr>
			<td bordercolor="#DDDDDD" bgcolor="#000099" align="right" style="padding: 3px 3px 2px">' . '<img src="' . $imagepath . 'expand-d.gif" alt="" style="width:12px;height:12px;margin: 0 3px;" />' . '<img src="' . $imagepath . 'collapse.gif" alt="" style="width:12px;height:12px;" onclick="MAX_geopop(\'collapse\', \'' . $uniqid . '\')" />' . '</td>
		</tr>
		<tr>
			<td>
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td align="center">
							<table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
								<tr>
									<td width="' . $output['width'] . '" height="' . $output['height'] . '" align="center" valign="middle" style="padding: ' . $padding . 'px">' . $output['html'] . '</td>
								</tr>
							</table>
						</td>
					</tr>' . (strlen($closetext) ? '
					<tr>
						<td align="center" bgcolor="#FFFFFF" style="font-family: Arial, helvetica, sans-serif; font-size: 9px; padding: 1px">' . '<a href="#" onclick="MAX_geopop(\'collapse\', \'' . $uniqid . '\');return!1;" style="color:#0000ff">' . $closetext . '</a>' . '</td>
					</tr>' : '') . '
				</table>
			</td>
		</tr>
	</table>
</div>
';
}
function getImageUrlFromFilename($filename)
{
    return _adRenderBuildImageUrlPrefix() . "/" . $filename;
}
 /**
  * build an image URL prefix
  *
  */
 function test_adRenderBuildImageUrlPrefix()
 {
     $this->sendMessage('test_adGetImageUrlPrefix');
     $GLOBALS['_MAX']['CONF']['webpath']['images'] = 'www.max.net/www/images';
     $ret = _adRenderBuildImageUrlPrefix();
     $this->assertEqual($ret, 'http://www.max.net/www/images');
 }
function MAX_layerGetHtml($output, $uniqid)
{
    global $target;
    global $align, $padding, $closebutton;
    global $backcolor, $bordercolor;
    global $nobg, $noborder;
    $conf = $GLOBALS['_MAX']['CONF'];
    // Register input variables
    MAX_commonRegisterGlobalsArray(array('align', 'padding', 'closebutton', 'backcolor', 'bordercolor', 'nobg', 'noborder'));
    if (!isset($padding)) {
        $padding = '2';
    }
    if (!isset($closebutton)) {
        $closebutton = 'f';
    }
    if (!isset($backcolor)) {
        $backcolor = 'FFFFFF';
    }
    if (!isset($bordercolor)) {
        $bordercolor = '000000';
    }
    if (!isset($nobg)) {
        $nobg = 'f';
    }
    if (!isset($noborder)) {
        $noborder = 'f';
    }
    // Calculate layer size (inc. borders)
    $layer_width = $output['width'] + 2 + $padding * 2;
    $layer_height = $output['height'] + 2 + ($closebutton == 't' ? 11 : 0) + $padding * 2;
    // Create imagepath
    $imagepath = _adRenderBuildImageUrlPrefix() . '/layerstyles/simple/';
    // return HTML code
    return '
<div id="MAX_' . $uniqid . '" style="position:absolute; width:' . $layer_width . 'px; height:' . $layer_height . 'px; z-index:99; left: 0px; top: 0px; visibility: hidden">
	<table cellspacing="0" cellpadding="0"' . ($noborder == 't' ? '' : ' style="border-style: solid; border-width: 1px; border-color: #' . $bordercolor . '"') . '>
' . ($closebutton == 't' ? '		<tr>
			<td' . ($nobg == 't' ? '' : ' bgcolor="#' . $backcolor . '"') . ' align="right" style="padding: 2px"><a href="javascript:;" onClick="MAX_simplepop_' . $uniqid . '(\'close\'); return false;" style="color:#0000ff"><img src="' . $imagepath . 'close.gif" width="7" height="7" alt="Close" border="0"></a></td>
		</tr>
' : '') . '		<tr>
			<td ' . ($nobg == 't' ? '' : ' bgcolor="#' . $backcolor . '"') . ' align="center">
				<table border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td width="' . $output['width'] . '" height="' . $output['height'] . '" align="center" valign="middle" style="padding: ' . $padding . 'px">' . $output['html'] . '</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</div>
';
}