📄 indexcontroller.php
字号:
<?php
/*
秀影EasyFramework框架
qq:24498936
msn:jdzcn_net@hotmail.com
website:http://www.vodcms.com
*/
class IndexController extends Easy_Controller_Action {
public function Init(){
$this->_View->skin = $this->config['template'];
$this->_View->Template = new Template();
$this->_View->moviearea = $this->mconf['area'];
$this->_View->config = $this->config;
$this->_View->location = _('首页');
$this->_View->current = _('首页');
}
public function IndexAction(){ //站点首页
$this->_View->title = '';
$hash = 'index';
if ($this->config['cache']){
if (Easy_Cache::isCache($hash)){
Easy_Cache::getCache($hash);
}else{
$contents = $this->_View->render($this->_View->skin.'/index');
Easy_Cache::set($hash, $contents);
}
//fwrite(fopen('sql.log', 'w'), $DB->querys);
exit($contents);
}else{
$DB = $GLOBALS['DB'];
$this->_View->querys = &$DB->querys;
exit($this->_View->render($this->_View->skin.'/index'));
}
}
public function FlashAction(){
header('Content-type: application/x-javascript');
$hash = md5($_SERVER['REQUEST_URI']).'flash';
if (Easy_Cache::isCache($hash)){
Easy_Cache::getCache($hash);
}else{
$flash = new FlashModel();
$size = strtolower($this->_Request->getParam('size'));
$size = explode('x', $size);
foreach ($flash->getAll() as $row){
$pic[] = $this->config['basedir'].$row['picture'];
$text[] = $row['title'];
$link[] = $row['link'];
}
$contents = '
var swf_width, swf_height,stop_time,bgcolor;
bgcolor = "#FFFFFF";
stop_time = 3500;
swf_width = '.intval($size[0]).';
swf_height = '.(int)$size[1].';
var files = "'.implode('|', $pic).'";
var texts = "'.implode('|', $text).'";
var links = "'.implode('|', $link).'";
var swf = new FlashObject("'.$this->config['basedir'].'images/flash.swf", "bigflash1", swf_width, swf_height, 7, "#FFFFFF");
swf.addParam("menu", "false");
swf.addParam("FlashVars", "bcastr_file="+encodeURIComponent(files)+"&bcastr_link="+encodeURIComponent(links)+"&bcastr_title="+encodeURIComponent(texts)+"&bcastr_config=0xEDEDED|2|0x0066ff|0|0xffffff|0x0066ff|0x000033|4|2|1|_blank");
swf.write("flashbanner")';
Easy_Cache::set($hash, $contents);
echo trim($contents);
unset($contents);
}
exit;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -