⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 functions.php

📁 一个函数
💻 PHP
📖 第 1 页 / 共 5 页
字号:
    $sql = $empire->query( "update {$dbtbpre}enewszt set ztname='{$add['ztname']}',ztnum={$add['ztnum']},listtempid={$add['listtempid']},ztpath='{$add['ztpath']}',zttype='{$add['zttype']}',newline={$add['newline']},newstrlen={$add['newstrlen']},newshowdate={$add['newshowdate']},zturl='{$add['zturl']}',hotline={$add['hotline']},hotstrlen={$add['hotstrlen']},hotshowdate={$add['hotshowdate']},goodline={$add['goodline']},goodstrlen={$add['goodstrlen']},goodshowdate={$add['goodshowdate']},classid={$add['classid']},hotplline={$add['hotplline']},hotplshowdate={$add['hotplshowdate']},hotplstrlen={$add['hotplstrlen']},firstline={$add['firstline']},firststrlen={$add['firststrlen']},firstshowdate={$add['firstshowdate']},indextext='{$indextext}',islist={$add['islist']},maxnum={$add['maxnum']},tid={$tabler['tid']},tbname='{$tabler['tbname']}',reorderf='{$add['reorderf']}',reorder='{$add['reorder']}',intro='{$add['intro']}',ztimg='{$add['ztimg']}',zcid={$zcid},jstempid={$jstempid},showzt={$showzt},ztpagekey='{$add['ztpagekey']}' where ztid='{$add['ztid']}'" );
    getclass( );
    if ( !$add[islist] )
    {
        newsbq( $add[ztid], $indextext, 3, 1 );
    }
    if ( $sql )
    {
        insert_dolog( "ztid=".$add[ztid]."<br>ztname=".$ztname );
        printerror( "EditZtSuccess", "ListZt.php" );
    }
    else
    {
        printerror( "DbError", "history.go(-1)" );
    }
}

function delzt( $ztid, $userid, $username )
{
    global $empire;
    global $dbtbpre;
    $ztid = ( integer )$ztid;
    if ( !$ztid )
    {
        printerror( "NotDelZtid", "history.go(-1)" );
    }
    checklevel( $userid, $username, $classid, "zt" );
    $r = $empire->fetch1( "select * from {$dbtbpre}enewszt where ztid='{$ztid}'" );
    if ( empty( $r[ztid] ) )
    {
        printerror( "NotDelZtid", "history.go(-1)" );
    }
    $sql = $empire->query( "delete from {$dbtbpre}enewszt where ztid='{$ztid}'" );
    $delpath = "../../s/".$r[ztpath];
    $del = delpath( $delpath );
    $nsql = $empire->query( "select id,ztid from {$dbtbpre}ecms_".$r[tbname]." where ztid like '%|".$ztid."|%'" );
    while ( $nr = $empire->fetch( $nsql ) )
    {
        $newztid = str_replace( "|".$ztid."|", "|", $nr[ztid] );
        $usql = $empire->query( "update {$dbtbpre}ecms_".$r[tbname]." set ztid='{$newztid}' where id='{$nr['id']}'" );
    }
    getclass( );
    if ( $sql )
    {
        insert_dolog( "ztid=".$ztid."<br>ztname=".$r[ztname] );
        printerror( "DelZtSuccess", "ListZt.php" );
    }
    else
    {
        printerror( "DbError", "history.go(-1)" );
    }
}

function delzt1( $ztid )
{
    global $empire;
    global $dbtbpre;
    $r = $empire->fetch1( "select * from {$dbtbpre}enewszt where ztid='{$ztid}'" );
    $sql = $empire->query( "delete from {$dbtbpre}enewszt where ztid='{$ztid}'" );
    $delpath = "../../s/".$r[ztpath];
    $del = delpath( $delpath );
    $nsql = $empire->query( "select id,ztid from {$dbtbpre}ecms_".$r[tbname]." where ztid like '%|".$ztid."|%'" );
    while ( $nr = $empire->fetch( $nsql ) )
    {
        $newztid = str_replace( "|".$ztid."|", "|", $nr[ztid] );
        $usql = $empire->query( "update {$dbtbpre}ecms_".$r[tbname]." set ztid='{$newztid}' where id='{$nr['id']}'" );
    }
}

function checkpath( $classpath )
{
    global $fun_r;
    if ( empty( $classpath ) )
    {
        echo $fun_r['EmptyPath'];
        exit( );
    }
    else if ( file_exists( "../../".$classpath ) )
    {
        echo $fun_r['RePath'];
        exit( );
    }
    else
    {
        echo $fun_r['PathNot'];
        exit( );
    }
}

function checkztpath( $classpath )
{
    global $fun_r;
    if ( empty( $classpath ) )
    {
        echo $fun_r['EmptyZtPath'];
        exit( );
    }
    else if ( file_exists( "../../s/".$classpath ) )
    {
        echo $fun_r['RePath'];
        exit( );
    }
    else
    {
        echo $fun_r['PathNot'];
        exit( );
    }
}

function returnclass( $sonclass )
{
    if ( $sonclass == "" || $sonclass == "|" )
    {
        return "classid=0";
    }
    $where = "classid in (".repsonclasssql( $sonclass ).")";
    return $where;
}

function repsonclasssql( $sonclass )
{
    if ( $sonclass == "" || $sonclass == "|" )
    {
        return 0;
    }
    $sonclass = substr( $sonclass, 1, strlen( $sonclass ) - 2 );
    $sonclass = str_replace( "|", ",", $sonclass );
    return $sonclass;
}

function dellistenews( )
{
    $file = "../data/fc/ListEnews.php";
    delfiletext( $file );
    $file1 = "../data/fc/ListClass0.php";
    delfiletext( $file1 );
    $file2 = "../data/fc/ListClass1.php";
    delfiletext( $file2 );
}

function addclass( $add, $userid, $username )
{
    global $empire;
    global $dbtbpre;
    $add[classpath] = trim( $add[classpath] );
    if ( !$add[classname] || !$add[classpath] )
    {
        printerror( "EmptyClass", "history.go(-1)" );
    }
    if ( $add[islast] && ( !$add[modid] || !$add[newstempid] || !$add[listtempid] || !$add[filetype] ) )
    {
        printerror( "LastMustChange", "history.go(-1)" );
    }
    if ( empty( $add[islast] ) && $add[islist] && !$add[blisttempid] )
    {
        printerror( "EmptyClass", "history.go(-1)" );
    }
    checklevel( $userid, $username, $classid, "class" );
    if ( strchr( $add[classpath], "." ) || strchr( $add[classpath], "/" ) || strchr( $add[classpath], "\\" ) )
    {
        printerror( "badpath", "history.go(-1)" );
    }
    $classpath = $add[pripath].$add[classpath];
    if ( file_exists( "../../".$classpath ) )
    {
        printerror( "ReClasspath", "history.go(-1)" );
    }
    $add[indextext] = repphpaspjspcode( $add[indextext] );
    $indextext = addslashes( $add[indextext] );
    $add[intro] = addslashes( repphpaspjspcode( $add[intro] ) );
    $add[classpagekey] = addslashes( repphpaspjspcode( $add[classpagekey] ) );
    if ( empty( $add[classtype] ) )
    {
        $add[classtype] = ".html";
    }
    $tabler = getmodtable( $add[modid] );
    $add[listorderf] = reppostvar( $add[listorderf] );
    $add[listorder] = reppostvar( $add[listorder] );
    $add[reorderf] = reppostvar( $add[reorderf] );
    $add[reorder] = reppostvar( $add[reorder] );
    $jstempid = ( integer )$add['jstempid'];
    $add[bclassid] = ( integer )$add[bclassid];
    $add[link_num] = ( integer )$add[link_num];
    $add[newstempid] = ( integer )$add[newstempid];
    $add[islast] = ( integer )$add[islast];
    $add[filename] = ( integer )$add[filename];
    $add[openpl] = ( integer )$add[openpl];
    $add[openadd] = ( integer )$add[openadd];
    $add[newline] = ( integer )$add[newline];
    $add[newstrlen] = ( integer )$add[newstrlen];
    $add[newshowdate] = ( integer )$add[newshowdate];
    $add[hotline] = ( integer )$add[hotline];
    $add[hotstrlen] = ( integer )$add[hotstrlen];
    $add[hotshowdate] = ( integer )$add[hotshowdate];
    $add[goodline] = ( integer )$add[goodline];
    $add[goodstrlen] = ( integer )$add[goodstrlen];
    $add[goodshowdate] = ( integer )$add[goodshowdate];
    $add[groupid] = ( integer )$add[groupid];
    $add[hotplline] = ( integer )$add[hotplline];
    $add[hotplshowdate] = ( integer )$add[hotplshowdate];
    $add[hotplstrlen] = ( integer )$add[hotplstrlen];
    $add[modid] = ( integer )$add[modid];
    $add[checked] = ( integer )$add[checked];
    $add[docheckuser] = ( integer )$add[docheckuser];
    $add[firstline] = ( integer )$add[firstline];
    $add[firststrlen] = ( integer )$add[firststrlen];
    $add[firstshowdate] = ( integer )$add[firstshowdate];
    $add[islist] = ( integer )$add[islist];
    $add[searchtempid] = ( integer )$add[searchtempid];
    $tabler[tid] = ( integer )$tabler[tid];
    $add[bmaxnum] = ( integer )$add[bmaxnum];
    $add[checkpl] = ( integer )$add[checkpl];
    $add[down_num] = ( integer )$add[down_num];
    $add[online_num] = ( integer )$add[online_num];
    $add[addinfofen] = ( integer )$add[addinfofen];
    $add[listdt] = ( integer )$add[listdt];
    $add[showdt] = ( integer )$add[showdt];
    $add[maxnum] = ( integer )$add[maxnum];
    $add[showclass] = ( integer )$add[showclass];
    $add[checkqadd] = ( integer )$add[checkqadd];
    $add[qaddlist] = ( integer )$add[qaddlist];
    $add[qaddgroupid] = ( integer )$add[qaddgroupid];
    $add[qaddshowkey] = ( integer )$add[qaddshowkey];
    $add[adminqinfo] = ( integer )$add[adminqinfo];
    $add[doctime] = ( integer )$add[doctime];
    if ( !$add[islast] )
    {
        if ( empty( $add[blencord] ) )
        {
            $add[blencord] = 25;
        }
        if ( empty( $add[bclassid] ) )
        {
            $sonclass = "";
            $featherclass = "";
        }
        else
        {
            $r = $empire->fetch1( "select featherclass,islast from {$dbtbpre}enewsclass where classid='{$add['bclassid']}'" );
            if ( $r[islast] )
            {
                printerror( "BclassNotLast", "history.go(-1)" );
            }
            if ( empty( $r[featherclass] ) )
            {
                $r[featherclass] = "|";
            }
            $featherclass = $r[featherclass].$add[bclassid]."|";
            $sonclass = "";
        }
        $createpath = "../../".$classpath;
        $mk = domkdir( $createpath );
        $createfilepath = "../../d/file/".$classpath;
        $mk1 = domkdir( $createfilepath );
        if ( $mk )
        {
            domkdir( $createpath."/js" );
        }
        $add[blencord] = ( integer )$add[blencord];
        $add[blisttempid] = ( integer )$add[blisttempid];
        $sql = $empire->query( "insert into {$dbtbpre}enewsclass(bclassid,classname,is_zt,sonclass,lencord,link_num,newstempid,indextext,onclick,listtempid,featherclass,islast,classpath,classtype,newspath,filename,filetype,openpl,openadd,newline,newstrlen,newshowdate,hotline,hotstrlen,hotshowdate,goodline,goodstrlen,goodshowdate,classurl,groupid,myorder,filename_qz,hotplline,hotplshowdate,hotplstrlen,modid,checked,docheckuser,checkuser,firstline,firststrlen,firstshowdate,bname,islist,searchtempid,tid,tbname,maxnum,checkpl,down_num,online_num,listorderf,listorder,reorderf,reorder,intro,classimg,jstempid,addinfofen,listdt,showclass,showdt,checkqadd,qaddlist,qaddgroupid,qaddshowkey,adminqinfo,doctime,classpagekey) values({$add['bclassid']},'{$add['classname']}',0,'{$sonclass}',{$add['blencord']},{$add['link_num']},{$add['newstempid']},'".$indextext."',0,{$add['blisttempid']},'{$featherclass}',{$add['islast']},'{$classpath}','{$add['classtype']}','{$add['newspath']}',{$add['filename']},'{$add['filetype']}',{$add['openpl']},{$add['openadd']},{$add['newline']},{$add['newstrlen']},{$add['newshowdate']},{$add['hotline']},{$add['hotstrlen']},{$add['hotshowdate']},{$add['goodline']},{$add['goodstrlen']},{$add['goodshowdate']},'{$add['classurl']}',{$add['groupid']},0,'{$add['filename_qz']}',{$add['hotplline']},{$add['hotplshowdate']},{$add['hotplstrlen']},{$add['modid']},{$add['checked']},{$add['docheckuser']},'{$add['checkuser']}',{$add['firstline']},{$add['firststrlen']},{$add['firstshowdate']},'{$add['bname']}',{$add['islist']},{$add['searchtempid']},{$tabler['tid']},'{$tabler['tbname']}',{$add['bmaxnum']},{$add['checkpl']},{$add['down_num']},{$add['online_num']},'{$add['listorderf']}','{$add['listorder']}','{$add['reorderf']}','{$add['reorder']}','{$add['intro']}','{$add['classimg']}',{$jstempid},{$add['addinfofen']},{$add['listdt']},{$add['showclass']},{$add['showdt']},{$add['checkqadd']},{$add['qaddlist']},{$add['qaddgroupid']},{$add['qaddshowkey']},{$add['adminqinfo']},{$add['doctime']},'{$add['classpagekey']}');" );
        $lastid = $empire->lastid( );
        getclass( );
        if ( $add[islist] )
        {
        }
        else
        {
            newsbq( $lastid, $indextext, 0, 1 );
        }
        dellistenews( );
        getsearch( $add[modid] );
        if ( $sql )
        {
            insert_dolog( "classid=".$lastid."<br>classname=".$classname );
            printerror( "AddClassSuccess", "AddClass.php?enews=AddClass&from={$add['from']}" );
        }
        else
        {
            printerror( "DbError", "history.go(-1)" );
        }
    }
    else
    {
        if ( empty( $add[lencord] ) )
        {
            $add[lencord] = 25;
        }
        if ( empty( $add[link_num] ) )
        {
            $add[link_num] = 10;
        }
        $add[filename_qz] = repfilenameqz( $add[filename_qz] );
        if ( empty( $add[bclassid] ) )
        {
            $sonclass = "";
            $featherclass = "";
        }
        else
        {
            $r = $empire->fetch1( "select featherclass,islast from {$dbtbpre}enewsclass where classid='{$add['bclassid']}'" );
            if ( $r[islast] )
            {
                printerror( "BclassNotLast", "history.go(-1)" );
            }
            if ( empty( $r[featherclass] ) )
            {
                $r[featherclass] = "|";
            }
            $featherclass = $r[featherclass].$add[bclassid]."|";

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -