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

📄 functions.php

📁 一个函数
💻 PHP
📖 第 1 页 / 共 5 页
字号:
    }
    $sql = $empire->query( $query );
}

function alterclasspath( $classid, $islast, $oldclasspath, $classpath )
{
    global $empire;
    global $dbtbpre;
    if ( $oldclassname != $classpath )
    {
        @rename( "../../".$oldclasspath, "../../".$classpath );
        @rename( "../../d/file/".$oldclasspath, "../../d/file/".$classpath );
        if ( empty( $islast ) )
        {
            $sql = $empire->query( "update {$dbtbpre}enewsclass set classpath=REPLACE(classpath,'".$oldclasspath."/','".$classpath."/') where featherclass like '%|".$classid."|%'" );
        }
        dellistenews( );
    }
}

function editclass( $add, $userid, $username )
{
    global $empire;
    global $class_r;
    global $dbtbpre;
    $add[classid] = ( integer )$add[classid];
    $add[classpath] = trim( $add[classpath] );
    $checkclasspath = $add['classpath'];
    if ( $add['oldclasspath'] != $add['pripath'].$add['oldcpath'] )
    {
        $add[classpath] = $add['oldcpath'];
    }
    if ( !$add[classname] || !$add[classpath] || !$add[classid] )
    {
        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" );
    $classpath = $add[pripath].$add[classpath];
    if ( $add[oldclasspath] != $classpath && $checkclasspath == $add['oldcpath'] && file_exists( "../../".$classpath ) )
    {
        printerror( "ReClasspath", "history.go(-1)" );
    }
    if ( empty( $add[classtype] ) )
    {
        $add[classtype] = ".html";
    }
    $add[indextext] = repphpaspjspcode( $add[indextext] );
    $indextext = addslashes( $add[indextext] );
    $add[intro] = addslashes( repphpaspjspcode( $add[intro] ) );
    $add[classpagekey] = addslashes( repphpaspjspcode( $add[classpagekey] ) );
    $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[lencord] = ( integer )$add[lencord];
    $add[listtempid] = ( integer )$add[listtempid];
    $add[blencord] = ( integer )$add[blencord];
    $add[blisttempid] = ( integer )$add[blisttempid];
    $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 ( $add[bclassid] != $add[oldbclassid] )
        {
            if ( empty( $add[bclassid] ) )
            {
                $sonclass = "";
                $featherclass = "";
                $r = $empire->fetch1( "select sonclass,featherclass,classpath from {$dbtbpre}enewsclass where classid='{$add['classid']}'" );
                $where = returnclass( $r[featherclass] );
                if ( empty( $where ) )
                {
                    $where = "classid=0";
                }
                $osql = $empire->query( "select sonclass,classid from {$dbtbpre}enewsclass where ".$where );
                while ( $o = $empire->fetch( $osql ) )
                {
                    $newsonclass = str_replace( $r[sonclass], "|", $o[sonclass] );
                    $uosql = $empire->query( "update {$dbtbpre}enewsclass set sonclass='{$newsonclass}' where classid='{$o['classid']}'" );
                }
                $osql = $empire->query( "select featherclass,classid,classpath from {$dbtbpre}enewsclass where featherclass like '%|".$add[classid]."%|'" );
                while ( $o = $empire->fetch( $osql ) )
                {
                    $newclasspath = str_replace( $r[classpath]."/", $classpath."/", $o[classpath] );
                    $newfeatherclass = str_replace( $r[featherclass], "|", $o[featherclass] );
                    $uosql = $empire->query( "update {$dbtbpre}enewsclass set featherclass='{$newfeatherclass}',classpath='{$newclasspath}' where classid='{$o['classid']}'" );
                }
            }
            else
            {
                if ( $add[classid] == $add[bclassid] )
                {
                    printerror( "BclassIsself", "history.go(-1)" );
                }
                $b = $empire->fetch1( "select featherclass,sonclass,islast from {$dbtbpre}enewsclass where classid='{$add['bclassid']}'" );
                if ( $b[islast] )
                {
                    printerror( "BclassNotLast", "history.go(-1)" );
                }
                if ( $b[featherclass] )
                {
                    $c_nb_r = explode( "|".$add[classid]."|", $b[featherclass] );
                    if ( count( $c_nb_r ) != 1 )
                    {
                        printerror( "BclassIssmall", "history.go(-1)" );
                    }
                }
                if ( empty( $b[featherclass] ) )
                {
                    $b[featherclass] = "|";
                }
                $featherclass = $b[featherclass].$add[bclassid]."|";
                $o = $empire->fetch1( "select featherclass,sonclass,classpath from {$dbtbpre}enewsclass where classid='{$add['classid']}'" );
                $osql = $empire->query( "select featherclass,classid,classpath from {$dbtbpre}enewsclass where featherclass like '%|".$add[classid]."|%'" );
                while ( $or = $empire->fetch( $osql ) )
                {
                    $newclasspath = str_replace( $o[classpath]."/", $classpath."/", $or[classpath] );
                    if ( empty( $o[featherclass] ) )
                    {
                        $newfeatherclass = $b[featherclass].$add[bclassid].$or[featherclass];
                    }
                    else
                    {
                        $newfeatherclass = str_replace( $o[featherclass], $featherclass, $or[featherclass] );
                    }
                    $uosql = $empire->query( "update {$dbtbpre}enewsclass set featherclass='{$newfeatherclass}',classpath='{$newclasspath}' where classid='{$or['classid']}'" );
                }
                $owhere = returnclass( $o[featherclass] );
                if ( empty( $owhere ) )
                {
                    $owhere = "classid=0";
                }
                $oosql = $empire->query( "select sonclass,classid from {$dbtbpre}enewsclass where ".$owhere );
                while ( $oo = $empire->fetch( $oosql ) )
                {
                    $newsonclass = str_replace( $o[sonclass], "|", $oo[sonclass] );
                    $usql = $empire->query( "update {$dbtbpre}enewsclass set sonclass='{$newsonclass}' where classid='{$oo['classid']}'" );
                }
                $where = returnclass( $featherclass );
                if ( empty( $where ) )
                {
                    $where = "classid=0";
                }
                $nbsql = $empire->query( "select sonclass,classid from {$dbtbpre}enewsclass where ".$where );
                while ( $nb = $empire->fetch( $nbsql ) )
                {
                    if ( empty( $nb[sonclass] ) )
                    {
                        $nb[sonclass] = "|";
                    }
                    $newsonclass = $nb[sonclass].substr( $o[sonclass], 1 );
                    $usql = $empire->query( "update {$dbtbpre}enewsclass set sonclass='{$newsonclass}' where classid='{$nb['classid']}'" );
                }
            }
            $change = ",bclassid={$add['bclassid']},featherclass='{$featherclass}'";
        }
        if ( $add['UrlToSmall'] )
        {
            updatesmallclassdomain( $add['classid'], $add['classurl'], $classpath );
        }
        if ( empty( $add[bname] ) )
        {
            $add[bname] = $add[classname];
        }
        $sql = $empire->query( "update {$dbtbpre}enewsclass set classname='{$add['classname']}',indextext='".$indextext."',classpath='{$classpath}',classtype='{$add['classtype']}',newline={$add['newline']},newstrlen={$add['newstrlen']},newshowdate={$add['newshowdate']},hotline={$add['hotline']},hotstrlen={$add['hotstrlen']},hotshowdate={$add['hotshowdate']},goodline={$add['goodline']},goodstrlen={$add['goodstrlen']},goodshowdate={$add['goodshowdate']},classurl='{$add['classurl']}',groupid={$add['groupid']},filename_qz='{$add['filename_qz']}',hotplline={$add['hotplline']},hotplshowdate={$add['hotplshowdate']},hotplstrlen={$add['hotplstrlen']},modid={$add['modid']},checked={$add['checked']},docheckuser={$add['docheckuser']},checkuser='{$add['checkuser']}',firstline={$add['firstline']},firststrlen={$add['firststrlen']},firstshowdate={$add['firstshowdate']},bname='{$add['bname']}',islist={$add['islist']},listtempid={$add['blisttempid']},lencord={$add['blencord']},searchtempid={$add['searchtempid']},tid={$tabler['tid']},tbname='{$tabler['tbname']}',maxnum={$add['bmaxnum']},checkpl={$add['checkpl']},down_num={$add['down_num']},online_num={$add['online_num']},listorderf='{$add['listorderf']}',listorder='{$add['listorder']}',reorderf='{$add['reorderf']}',reorder='{$add['reorder']}',intro='{$add['intro']}',classimg='{$add['classimg']}',jstempid={$jstempid},listdt={$add['listdt']},showclass={$add['showclass']},showdt={$add['showdt']},qaddgroupid={$add['qaddgroupid']},qaddshowkey={$add['qaddshowkey']},adminqinfo={$add['adminqinfo']},doctime={$add['doctime']},classpagekey='{$add['classpagekey']}'".$change." where classid='{$add['classid']}'" );
        getclass( );
        if ( $add[islist] )
        {
        }
        else
        {
            newsbq( $add[classid], $indextext, 0, 1 );
        }
    }
    else
    {
        if ( $add[bclassid] != $add[oldbclassid] )
        {
            if ( empty( $add[bclassid] ) )
            {
                $sonclass = "";
                $featherclass = "";
                $r = $empire->fetch1( "select featherclass,classpath from {$dbtbpre}enewsclass where classid='{$add['classid']}'" );
                $where = returnclass( $r[featherclass] );
                if ( empty( $where ) )
                {
                    $where = "classid=0";
                }
                $bsql = $empire->query( "select classid,sonclass from {$dbtbpre}enewsclass where ".$where );
                while ( $br = $empire->fetch( $bsql ) )
                {
                    $newsonclass = str_replace( "|".$add[classid]."|", "|", $br[sonclass] );
                    $usql = $empire->query( "update {$dbtbpre}enewsclass set sonclass='{$newsonclass}' where classid='{$br['classid']}'" );
                }
            }
            else
            {
                $b = $empire->fetch1( "select featherclass,islast from {$dbtbpre}enewsclass where classid='{$add['bclassid']}'" );
                if ( $b[islast] )
                {
                    printerror( "BclassNotLast", "history.go(-1)" );
                }
                if ( empty( $b[featherclass] ) )
                {
                    $b[featherclass] = "|";
                }
                $featherclass = $b[featherclass].$add[bclassid]."|";
                $where = returnclass( $featherclass );
                if ( empty( $where ) )
                {
                    $where = "classid=0";
                }
                $bsql = $empire->query( "select sonclass,classid from {$dbtbpre}enewsclass where ".$where );
                while ( $nb = $empire->fetch( $bsql ) )
                {
                    if ( empty( $nb[sonclass] ) )
                    {
                        $nb[sonclass] = "|";
                    }
                    $newsonclass = $nb[sonclass].$add[classid]."|";
                    $usql = $empire->query( "update {$dbtbpre}enewsclass set sonclass='{$newsonclass}' where classid='{$nb['classid']}'" );
                }
                $o = $empire->fetch1( "select sonclass,featherclass from {$dbtbpre}enewsclass where classid='{$add['classid']}'" );
                $where = returnclass( $o[featherclass] );
                if ( empty( $where ) )
                {
                    $where = "classid=0";
                }
                $osql = $empire->query( "select sonclass,classid from {$dbtbpre}enewsclass where ".$where );
                while ( $ob = $empire->fetch( $osql ) )
                {
                    $newsonclass = str_replace( "|".$add[classid]."|", "|", $ob[sonclass] );
                    $usql = $empire->query( "update {$dbtbpre}enewsclass set sonclass='{$newsonclass}' where classid='{$ob['classid']}'" );
                }
            }
            $change = ",bclassid={$add['bclassid']},featherclass='{$featherclass}'";
        }
        if ( $add['tobetempinfo'] )
        {
            $upsql = $empire->query( "update {$dbtbpre}ecms_".$tabler[tbname]." set newstempid={$add['newstempid']} where classid='{$add['classid']}'" );
        }
        $add[filename_qz] = repfilenameqz( $add[filename_qz] );
        $sql = $empire->query( "update {$dbtbpre}enewsclass set classname='{$add['classname']}',classpath='{$classpath}',classtype='{$add['classtype']}',link_num={$add['link_num']},lencord={$add['lencord']},newstempid={$add['newstempid']},listtempid={$add['listtempid']},newspath='{$add['newspath']}',filename={$add['filename']},filetype='{$add['filetype']}',openpl={$add['openpl']},openadd={$add['openadd']},newline={$add['newline']},newstrlen={$add['newstrlen']},newshowdate={$add['newshowdate']},hotline={$add['hotline']},hotstrlen={$add['hotstrlen']},hotshowdate={$add['hotshowdate']},goodline={$add['goodline']},goodstrlen={$add['goodstrlen']},goodshowdate={$add['goodshowdate']},classurl='{$add['classurl']}',groupid={$add['groupid']},filename_qz='{$add['filename_qz']}',hotplline={$add['hotplline']},hotplshowdate={$add['hotplshowdate']},hotplstrlen={$add['hotplstrlen']},modid={$add['modid']},checked={$add['checked']},docheckuser={$add['docheckuser']},checkuser='{$add['checkuser']}',firstline={$add['firstline']},firststrlen={$add['firststrlen']},firstshowdate={$add['firstshowdate']},bname='{$add['bname']}',searchtempid={$add['searchtempid']},tid={$tabler['tid']},tbname='{$tabler['tbname']}',maxnum={$add['maxnum']},checkpl={$add['checkpl']},down_num={$add['down_num']},online_num={$add['online_num']},listorderf='{$add['listorderf']}',listorder='{$add['listorder']}',reorderf='{$add['reorderf']}',reorder='{$add['reorder']}',intro='{$add['intro']}',classimg='{$add['classimg']}',jstempid={$jstempid},addinfofen={$add['addinfofen']},listdt={$add['listdt']},showclass={$add['showclass']},showdt={$add['showdt']},checkqadd={$add['checkqadd']},qaddlist={$add['qaddlist']},qaddgroupid={$add['qaddgroupid']},qaddshowkey={$add['qaddshowkey']},adminqinfo={$add['adminqinfo']},doctime={$add['doctime']},classpagekey='{$add['classpagekey']}'".$change." where classid='{$add['classid']}'" );
        getclass( );
    }
    if ( $add[bclassid] != $add[oldbclassid] )
    {
        $opath = "../../".$add[oldclasspath];
        $newpath = "../../".$classpath;
        movepath( $opath, $newpath );
        $opath = "../../d/file/".$add[oldclasspath];
        $npath = "../../d/file/".$classpath;
        copypath( $opath, $npath );
    }
    else if ( $add['oldcpath'] != $add['classpath'] )
    {
        alterclasspath( $add['classid'], $add['islast'], $add['oldclasspath'], $classpath );
        getclass( );

⌨️ 快捷键说明

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