www.gusucode.com > 网猫影视系统NetMao Movie 4.6.6 开源版源码程序 > upload/templates/default/index.ctrl.php

    <?php
if(!defined('IN_NetMao')) exit('Access Denied');
require_once NetMao_ROOT.'./mdata/cache/cache_announces.php';
require_once NetMao_ROOT.'./mdata/cache/cache_friendlinks.php';

//plugin
$plugin=$_NCACHE['plugins'][$pluginid];

//indexs
$indexs='';
$result=$db->query("SELECT * FROM {$tablepre}movies where isshow>0 and isindex>0 order by addtime desc limit 0,12");
while($r=$db->fetch_array($result)){
    $r[category]=$_NCACHE['categorys'][$r[cid]];
    $r[movieurl]=movieurl($r[mid]);
    $r[picture]=moviepic($r[picture]);
    $r[srun]=movierun($r[isrun]);
    $r[stime]=date("Y-m-d",$r[addtime]);
    $r[sname]=cutstr($r[name],15);
    $r[sdesc]=cutstr($r[description],55);
    $indexs[]=$r;
}

//runs
$isruns='';
$result=$db->query("SELECT * FROM {$tablepre}movies where isshow>0 and isrun>0 and isrun<999 order by addtime desc limit 0,13");
while($r=$db->fetch_array($result)){
    $r[category]=$_NCACHE['categorys'][$r[cid]];
    $r[movieurl]=movieurl($r[mid]);
    $r[picture]=moviepic($r[picture]);
    $r[srun]=movierun($r[isrun]);
    $r[stime]=date("Y-m-d",$r[addtime]);
    $r[sname]=cutstr($r[name],20);
    $r[sdesc]=cutstr($r[description],55);
    $isruns[]=$r;
}

//catlists
$catlists='';
if(is_array($_NCACHE['categorys'])) foreach($_NCACHE['categorys'] as $category){ 
    $result=$db->query("SELECT * FROM {$tablepre}movies where isshow>0 and cid='$category[cid]' order by addtime desc limit 0,1");
    $mlistjs='';
    while($r=$db->fetch_array($result)){
        $r[category]=$_NCACHE['categorys'][$r[cid]];
        $r[movieurl]=movieurl($r[mid]);
        $r[picture]=moviepic($r[picture]);
        $r[srun]=movierun($r[isrun]);
        $r[stime]=date("Y-m-d",$r[addtime]);
        $r[sname]=cutstr($r[name],14);
        $r[sdesc]=cutstr($r[description],55);
        $mlistjs[]=$r;
    }
    $result=$db->query("SELECT * FROM {$tablepre}movies where isshow>0 and cid='$category[cid]' order by addtime desc limit 0,12");
    $mlists='';
    while($r=$db->fetch_array($result)){
        $r[category]=$_NCACHE['categorys'][$r[cid]];
        $r[movieurl]=movieurl($r[mid]);
        $r[picture]=moviepic($r[picture]);
        $r[srun]=movierun($r[isrun]);
        $r[stime]=date("Y-m-d",$r[addtime]);
        $r[sname]=cutstr($r[name],14);
        $r[sdesc]=cutstr($r[description],55);
        $mlists[]=$r;
    }
    $catlist[mlistj]=$mlistjs;
    $catlist[mlist]=$mlists;
    $catlist[name]=$category[name];
    $catlist[content]=$category[content];
    $catlists[]=$catlist;
}

//count
$count='';
$cm = $db->fetch_array($db->query("SELECT count(*) AS num FROM {$tablepre}movies where 1"));
$count[movies] = $cm[num];
$cf = $db->fetch_array($db->query("select count(*) as num from {$tablepre}files where 1"));
$count[files] = $cf[num];

//don't modify the content below
$navtitle = ''; $navtitle = $plugin[name];
$metakeywords = ''; $metakeywords = $plugin[keyword];

//tohtml
$filename=NetMao_ROOT.'./index.htm';
nmtohtml($filename,'index');
?>