<?php

/*
*	Copyright VeryIDE,2007-2010
*	http://www.veryide.com/
*
*	$Id: ,v1 10:39 2008-9-19 Lay $
*/

require '../../include/loader.php';

html_start("广告位列表 - VeryIDE");
?>

<!--body start-->
<?php

	//module
	require("config.php");
	require("function.php");
	
	Cached :: loader($appid,"table.adsarea");
	
	$id = getnum('id',0);
	
	$row = $_CACHE['adsview']['adsarea'][$id];
        
	//访问目录
	$http = Module::get_index( $appid );
	
	//缓存目录
	$base = VI_HOST.'static/adsview/';

?>
    <script type="text/javascript">
        Mo.reader(function(){
			
			/*绑定选项卡*/
			
			var TO = new Mo.TabMenu("click");
			
			TO.TabClass("active","");
			
			var Sel = Mo("#subtab li");
			var Box = Mo("#box div");
			
			for(var i=0;i<=Sel.size();i++){
				TO.Add(Sel.item(i),Box.item(i));
			}
		 
			TO.Play(0);	
			
        });
        
    </script>
    
    <div id="box">

        <ul id="subtab">
            <li>标准投放</li>
            <li>简洁投放</li>
            <li>参数说明</li>
            <li>备注&amp;预览</li>
        </ul>
    
        <div id="tab-0">
    
            <table width="100%" border="0" cellpadding="1" cellspacing="1" class="table">
                <tr class="title">
                    <td><strong>Step 1: &lt;head&gt;&lt;/head&gt;</strong> <span class="text-no">核心代码</span> 区域必须包含以下代码</td>
                </tr>
                <tr class="line">
                    <td>
                        <textarea rows="2" style=" width:98%;"  onmouseover="this.select();" class="text-no"><?php echo '<script type="text/javascript" src="'.$http.'adsview.js"></script>';?></textarea>
                    </td>
                </tr>
            </table>
        
            <table width="100%" border="0" cellpadding="1" cellspacing="1" class="table">
                <tr class="title">
                    <td colspan="2"><strong>Step 2: &lt;body&gt;&lt;/body&gt;</strong> <span class="text-no">投放代码</span> 根据投放位置，选择合适的投放代码，以下方式任选其一</td>
                </tr>
                <tr class="line">
                    <td>
                        标准引用方式： <br />                        
                        <textarea rows="6" style=" width:98%;" onmouseover="this.select();" class="text-yes"><?php echo '<script type="text/javascript" src="'.$http.'?action=proxy&key='.strtolower($row["key"]).'&charset='.$_G['product']['charset'].'"><!--Name:'.$row['name'].' Key:'.$row["key"].' Date:'.date("Y-m-d H:i:s",time()).'--></script>';?></textarea>
                    </td>
                    <td>
                        搜索广告方式： <br />
                        <textarea rows="6" style=" width:98%;" onmouseover="this.select();" class="text-yes"><?php echo '<script type="text/javascript" src="'.$http.'?action=search&key='.strtolower($row["key"]).'&charset='.$_G['product']['charset'].'&tag="><!--Name:'.$row['name'].' Key:'.$row["key"].' Date:'.date("Y-m-d H:i:s",time()).'--></script>';?></textarea>
                    </td>
                </tr>
                <tr class="line">
                    <td>
                        静态缓存方式： <br />
                        <textarea rows="6" style=" width:98%;" onmouseover="this.select();" class="text-yes"><?php echo '<script type="text/javascript" src="'.$base.strtolower($row["key"]).'.js"><!--Name:'.$row['name'].' Key:'.$row["key"].' Date:'.date("Y-m-d H:i:s",time()).'--></script>';?></textarea>
                    </td>
                    <td>
                        动态脚本方式（<span class="text-key">推荐使用</span>）： <br />
                        <textarea rows="6" style=" width:98%;" onmouseover="this.select();" class="text-yes"><?php echo '<script type="text/javascript">VAD.addProxy("'.$row["key"].'",{"charset": "'.$_G['product']['charset'].'"});'.'<!--Name:'.$row['name'].' Key:'.$row["key"].' Date:'.date("Y-m-d H:i:s",time()).'-->'.'</script>';?></textarea>
                    </td>
                </tr>
            </table>
            
            <p id="saving">
                <?php echo loader_image("icon/light.png"); ?>
                此投放方式比较合适多页面多网站统一投放
            </p>
        
        </div>
        
        <div id="tab-1">
    
            <table width="100%" border="0" cellpadding="1" cellspacing="1" class="table">
                <tr class="title">
                    <td colspan="2"><strong>Step 1: &lt;body&gt;&lt;/body&gt;</strong> <span class="text-no">简单投放</span> 单文件投放方式，不需要 <span class="text-no">adsview.js</span> 支持，注意以下方式只支持普通广告类型</td>
                </tr>
                <tr class="line">
                    <td>
                        IFrame 投放： <br />
                        <textarea rows="6" style=" width:98%;" onmouseover="this.select();" class="text-yes"><?php echo '<iframe width="'.$row["width"].'" height="'.$row["height"].'" scrolling="no" frameborder="0" src="'.$http.'proxy.html?key='.strtolower($row["key"]).'&charset='.$_G['product']['charset'].'"><!--Name:'.$row['name'].' Key:'.$row["key"].' Date:'.date("Y-m-d H:i:s",time()).'--></iframe>';?></textarea>
                    </td>
                    <td>
                        单文件（JS）： <br />
                        <textarea rows="6" style=" width:98%;" onmouseover="this.select();" class="text-yes"><?php echo '<script type="text/javascript" src="'.$http.'?action=single&key='.strtolower($row["key"]).'&charset='.$_G['product']['charset'].'"><!--Name:'.$row['name'].' Key:'.$row["key"].' Date:'.date("Y-m-d H:i:s",time()).'--></script>';?></textarea>
                    </td>
                </tr>
            </table>
            
            <p id="saving">
            	<?php echo loader_image("icon/light.png"); ?>
                <strong class="text-no">注意：</strong>此投放方式比较合适少数页面单独投放，因为引用文件可能会偏大，比较适合较少页面投放
            </p>
        
        </div>

		<div id="tab-2">
        <table width="100%" border="0" cellpadding="1" cellspacing="1" class="table">
            <tr class="title">
                <td><strong>广告核心 参数</strong></td>
                <td><strong>广告代码 参数</strong></td>
            </tr>
            <tr class="line">
                <td width="50%">
                    <p>
                        <span class="text-key">&lt;script type='text/javascript'&gt; VAD.debug = true; &lt;/script&gt;</span>
                        <br />
                        启用广告位调试模式，空广告位将会突出显示
                    </p>
                    <p>
                        <span class="text-key">&lt;script type='text/javascript'&gt; VAD.model = 'iframe'; &lt;/script&gt;</span>
                        <br />
                        广告IFrame引用模式，将以普通广告形式显示
                    </p>                    
                    <p>
                        <span class="text-key">&lt;script type='text/javascript'&gt; VAD.merge = true; &lt;/script&gt;</span>
                        <br />
                        合并广告请求，代码广告不适用
                    </p>
                </td>
                <td>
                    <ul>
                        <li><span class="text-key">charset=utf-8</span> 输出代码为 UTF-8 编码</li>
                        <li><span class="text-key">charset=gbk</span> 输出代码为 GBK 编码</li>
                        <li><span class="text-key">charset=big5</span> 输出代码为 Big5 编码</li>
                        <li><span class="text-key">tag=key</span> 输出关键字为key的广告</li>
                    </ul>
                </td>
            </tr>
        </table>
        
		</div>

        <div id="tab-3">
            <table width="100%" border="0" cellpadding="1" cellspacing="1" class="table">
                <tr class="title">
                    <td><strong>广告位备注</strong></td>
                </tr>
                <tr class="line">
                    <td>
                        <?php echo chrToHTML($row["description"]);?>
                    </td>
                </tr>
            </table>
            
            <table width="100%" border="0" cellpadding="1" cellspacing="1" class="table">
                <tr class="title">
                    <td><strong>广告位预览</strong></td>
                </tr>
                <tr class="line">
                    <td>
                        <iframe id="iframe" src="adsview.preview.php?action=channel&key=<?php echo $row["key"];?>&show=<?php echo $row["show"];?>" frameborder="0" style="width:100%; height:<?php echo ($row["height"]+200);?>px;"></iframe>
                    </td>
                </tr>
            </table>
        </div>
    
    </div>
	
<!--body end-->

<?php html_close();?>