📄 plus.inc.php
字号:
<?php
function changelable( )
{
global $strPlusNotice6;
global $msql;
global $tbl_menu;
$plustype = $_GET['plustype'];
$pluslocat = $_GET['pluslocat'];
$tempfile = $_GET['tempfile'];
$oldlable = $_GET['oldlable'];
$newlable = $_GET['newlable'];
$menuid = $_GET['menuid'];
$msql->query( "select skin from {$tbl_menu} where menuid='{$menuid}'" );
if ( $msql->next_record( ) )
{
$skin = $msql->f( "skin" );
}
$fd = fopen( "../templates/".$skin."/".$tempfile, r );
$oldbody = fread( $fd, 100000 );
fclose( $fd );
if ( strstr( $oldbody, "{#".$newlable."#}" ) )
{
$i = 1;
for ( ; $i <= 30; $i++ )
{
if ( !strstr( $oldbody, "{#".$newlable."-".$i."#}" ) )
{
$newlable = $newlable."-".$i;
break;
}
}
}
$oldbody = str_replace( "{#".$oldlable."#}", "{#".$newlable."#}", $oldbody );
$fp = fopen( "../templates/".$skin."/".$tempfile, w );
fwrite( $fp, $oldbody, 100000 );
fclose( $fp );
}
function pageedittemp( $plustype, $pluslocat, $tempfile, $menuid )
{
global $SiteUrl;
global $msql;
global $fsql;
global $tbl_plus;
global $tbl_plus_set;
global $strPlusNotice5;
global $strPlusName;
global $strEdit;
global $strPlusSelType;
global $strPlusSelSetup;
global $strPlusLable;
global $tbl_menu;
$msql->query( "select skin from {$tbl_menu} where menuid='{$menuid}'" );
if ( $msql->next_record( ) )
{
$skin = $msql->f( "skin" );
}
if ( file_exists( "../templates/".$skin."/".$tempfile ) )
{
$fd = fopen( "../templates/".$skin."/".$tempfile, r );
$oldbody = fread( $fd, 100000 );
fclose( $fd );
}
else
{
err( $strPlusNotice5, "", "" );
}
$oldbody = str_replace( "images/", $SiteUrl."templates/".$skin."/images/", $oldbody );
$array = explode( "{#", $oldbody );
$EditCon = $array[0];
$t = 1;
for ( ; $t < sizeof( $array ); $t++ )
{
$xuhao = $t;
$arrayx = explode( "#}", $array[$t] );
if ( substr( $arrayx[0], 0, 3 ) == "mod" )
{
$ModArr = explode( "-", $arrayx[0] );
$ModLable = $ModArr[0];
$ModNo = $ModArr[1];
$msql->query( "select * from {$tbl_plus_set} where pluslable='{$ModLable}' " );
if ( $msql->next_record( ) )
{
$id = $msql->f( "id" );
$plusname = $msql->f( "plusname" );
$pluslable = $msql->f( "pluslable" );
$moveable = $msql->f( "moveable" );
if ( $moveable == "0" )
{
$saylock = " disabled";
}
else
{
$saylock = " ";
}
$ChangeStr = "<select style='font-size:12px;width:175px' name=list onChange=\"self.location=this.form.list.options[this.form.list.selectedIndex].value\">";
$fsql->query( "select * from {$tbl_plus_set} where (plustype='{$plustype}' or plustype='all') and (pluslocat='{$pluslocat}' or pluslocat='all') and moveable='1' order by plusname" );
while ( $fsql->next_record( ) )
{
$lplusname = $fsql->f( "plusname" );
$lpluslable = $fsql->f( "pluslable" );
if ( $pluslable == $lpluslable )
{
$ChangeStr .= "<option value=plusedit.php?step=changelable&menuid={$menuid}&tempfile={$tempfile}&oldlable={$arrayx['0']}&newlable={$lpluslable}&plustype={$plustype}&pluslocat={$pluslocat} selected>".$lplusname."</option>";
}
else
{
$ChangeStr .= "<option value=plusedit.php?step=changelable&menuid={$menuid}&tempfile={$tempfile}&oldlable={$arrayx['0']}&newlable={$lpluslable}&plustype={$plustype}&pluslocat={$pluslocat}>".$lplusname."</option>";
}
}
$ChangeStr .= "</select>";
$ChangeButton = "<input type=button style='cursor:hand;font-size:12px;width:175px;height:20px;border:1px #d4d0c8 solid;background-color:#d4d0c8' value='".$strPlusSelType."' onClick='CHtd".$xuhao.".style.display=\"block\";CBtd".$xuhao.".style.display=\"none\"' ".$saylock.">";
if ( substr( $ModLable, 0, 7 ) == "modEdit" )
{
$ClickStr = " onClick=\" DWin('plusset_frame.php?menuid={$menuid}&plustype={$plustype}&pluslocat={$pluslocat}&pluslable={$pluslable}&modno={$ModNo}','480','500')\"";
$SetBt = "<input type=button style='cursor:hand;font-size:12px;width:38px;height:20px;border:1px #eeeeee solid;background-color:#d4d0c8' id='bt".$xuhao."' value='".$strEdit."' ".$ClickStr.">";
}
else if ( substr( $ModLable, 0, 7 ) == "modLogo" )
{
$ClickStr = " onClick=\"self.location='logo.php?menuid=".$menuid."'\"";
$SetBt = "<input type=button style='cursor:hand;font-size:12px;width:38px;height:20px;border:1px #eeeeee solid;background-color:#d4d0c8' id='bt".$xuhao."' value='".$strPlusSelSetup."' ".$ClickStr.">";
}
else if ( $ModLable == "modShowCount" )
{
$ClickStr = " onClick=\"self.location='stat_set.php'\"";
$SetBt = "<input type=button style='cursor:hand;font-size:12px;width:38px;height:20px;border:1px #eeeeee solid;background-color:#d4d0c8' id='bt".$xuhao."' value='".$strPlusSelSetup."' ".$ClickStr.">";
}
else if ( $ModLable == "modForm" )
{
$ClickStr = " onClick=\"self.location='form.php?menuid=".$menuid."'\"";
$SetBt = "<input type=button style='cursor:hand;font-size:12px;width:38px;height:20px;border:1px #eeeeee solid;background-color:#d4d0c8' id='bt".$xuhao."' value='".$strPlusSelSetup."' ".$ClickStr.">";
}
else if ( $ModLable == "modButtomInfo" )
{
$ClickStr = " onClick=\" DWin('plusset_frame.php?menuid=1&plustype=index&pluslocat=index&pluslable={$pluslable}&modno={$ModNo}','480','500')\"";
$SetBt = "<input type=button style='cursor:hand;font-size:12px;width:38px;height:20px;border:1px #eeeeee solid;background-color:#d4d0c8' id='bt".$xuhao."' value='".$strEdit."' ".$ClickStr.">";
}
else
{
$ClickStr = " onClick=\" Dpop('plusset_frame.php?menuid={$menuid}&plustype={$plustype}&pluslocat={$pluslocat}&pluslable={$pluslable}&modno={$ModNo}','380','500')\"";
$SetBt = "<input type=button style='cursor:hand;font-size:12px;width:38px;height:20px;border:1px #eeeeee solid;background-color:#d4d0c8' id='bt".$xuhao."' value='".$strPlusSelSetup."' ".$ClickStr.">";
}
$ColInfo = "<table style='border:3px #d4d0c8 solid;filter:progid:DXImageTransform.Microsoft.Shadow(Color=#333333,Direction=120,strength=3);' bgcolor=#ffffff width=215 cellspacing=1 cellpadding=3><td><table><tr><td valign=top style='color:#333333' >".$strPlusName.":</td><td style='color:#333333'>".$plusname."</td></tr><tr><td valign=top style='color:#333333'>".$strPlusLable.":</td><td style='color:#333333'>{#".$arrayx[0]."#}</td></tr></table></td></tr></table>";
$bodstr = "<table width=100% height=100% style='border:1px #cccccc dashed'><tr><form name='bodyfm".$xuhao."'><td valign=top id='tr".$xuhao."' onMouseover='tc".$xuhao.".style.display=\"block\";tr".$xuhao.".bgColor=\"#eeeeee\";' onMouseOut='tc".$xuhao.".style.display=\"none\";tr".$xuhao.".bgColor=\"\";' ><div id='tc".$xuhao."' style='position:absolute;width:190;height:100%;display:none'><table cellpadding=0 cellspacing=0><tr><td id='CBtd".$xuhao."' >".$ChangeButton."</td><td id='CHtd".$xuhao."' style='display:none' >".$ChangeStr."</td><td id='Htd".$xuhao."' style='display:none'>".$Huan."</td><td id='Std".$xuhao."'>".$HuanButton."</td><td>".$SetBt."</td></tr></table>".$ColInfo."</div>".$SetEdit.$PreViewStr."<font color=#999999>{#".$arrayx[0]."#}</td></form></tr></table>";
}
else
{
$bodstr = "{#".$arrayx[0]."#}";
}
}
else
{
$bodstr = "{#".$arrayx[0]."#}";
}
$EditCon .= $bodstr;
$EditCon .= $arrayx[1];
}
echo $EditCon;
}
function plussetsel( $var )
{
if ( $var == "1" )
{
return "block";
}
else
{
return "none";
}
}
function plusvalsel( $var )
{
if ( !isset( $var ) || $var == "" || $var == "0" )
{
return "0";
}
else
{
return $var;
}
}
function plusvaldef( $var )
{
if ( !isset( $var ) || $var == "" || $var == "0" )
{
return "0";
}
else if ( $var == "-1" )
{
return "-1";
}
else
{
return "1";
}
}
function plusinputdis( $var, $iname )
{
if ( !isset( $var ) || $var == "" || $var == "0" || $var == "-1" )
{
return " style='visibility:hidden' ";
}
else
{
return " ";
}
}
function plustrdis( $trname )
{
if ( !isset( $trname ) || $trname == "" || $trname == "0" )
{
return " style='display:none' ";
}
else
{
return " style='display:block' ";
}
}
function pageplustree( $ctype, $treename )
{
global $msql;
global $fsql;
global $tbl_pageset;
global $tbl_menu;
global $strSelmenu;
$FormString = "";
$FormString .= "<table width=100% border=0 cellspacing=3 cellpadding=0><tr><td class=dtree>";
$FormString .= "<script type=text/javascript src=js/dirtree.js></script>";
$FormString .= "<script type=text/javascript> <!-- \n";
$FormString .= "function dtree(){";
$FormString .= "d = new dTree('d');";
if ( $ctype != "" )
{
$addsql = " and coltype='{$ctype}' ";
}
if ( $ctype == "page" || $ctype == "form" )
{
$FormString .= "d.add(0,-1,'{$strSelmenu}','0.htm'); \n";
}
$p = 0;
$fsql->query( "select * from {$tbl_menu} where coltype!='url' {$addsql} order by menuid" );
while ( $fsql->next_record( ) )
{
$menu = $fsql->f( "menu" );
$menuid = $fsql->f( "menuid" );
$openindex = $fsql->f( "openindex" );
if ( $ctype != "page" && $ctype != "form" )
{
$FormString .= "d.add({$menuid},-1,'{$menu}','0.htm'); \n";
}
if ( $ctype != "member" && $openindex == "0" )
{
$addpsql = " and pagename!='main' ";
}
else
{
$addpsql = " ";
}
$msql->query( "select * from {$tbl_pageset} where menuid='{$menuid}' {$addpsql} order by xuhao" );
while ( $msql->next_record( ) )
{
$id = $msql->f( "id" );
$name = $msql->f( "name" );
$coltype = $msql->f( "coltype" );
$pagename = $msql->f( "pagename" );
$tempfile = $msql->f( "tempfile" );
$nowid = $id + 10000;
if ( $ctype == "page" || $ctype == "form" )
{
$FormString .= "d.add({$menuid},0,'{$menu}','plusedit.php?menuid={$menuid}&plustype={$coltype}&pluslocat={$pagename}&tempfile={$tempfile}'); \n";
}
else
{
$FormString .= "d.add({$nowid},{$menuid},'{$name}','plusedit.php?menuid={$menuid}&plustype={$coltype}&pluslocat={$pagename}&tempfile={$tempfile}'); \n";
}
if ( $p == 0 )
{
echo "<script>parent.con.location='plusedit.php?menuid={$menuid}&plustype={$coltype}&pluslocat={$pagename}&tempfile={$tempfile}'</script>";
}
$p++;
}
}
$FormString .= "document.write(d); } \n //--></script><script>dtree();</script>";
$FormString .= "</td></tr></table>";
echo $FormString;
}
function pagesettree( $ctype, $treename )
{
global $msql;
global $fsql;
global $tbl_pageset;
global $tbl_menu;
global $strSelmenu;
$FormString = "";
$FormString .= "<table width=100% border=0 cellspacing=3 cellpadding=0><tr><td class=dtree>";
$FormString .= "<script type=text/javascript src=js/dirtree.js></script>";
$FormString .= "<script type=text/javascript> <!-- \n";
$FormString .= "function dtree(){";
$FormString .= "d = new dTree('d');";
if ( $ctype != "" )
{
$addsql = " and coltype='{$ctype}' ";
}
if ( $ctype == "page" || $ctype == "form" )
{
$FormString .= "d.add(0,-1,'{$strSelmenu}','0.htm'); \n";
}
$p = 0;
$fsql->query( "select * from {$tbl_menu} where coltype!='url' {$addsql} order by menuid" );
while ( $fsql->next_record( ) )
{
$menu = $fsql->f( "menu" );
$menuid = $fsql->f( "menuid" );
if ( $ctype != "page" && $ctype != "form" )
{
$FormString .= "d.add({$menuid},-1,'{$menu}','0.htm'); \n";
}
$msql->query( "select * from {$tbl_pageset} where menuid='{$menuid}' order by xuhao" );
while ( $msql->next_record( ) )
{
$id = $msql->f( "id" );
$name = $msql->f( "name" );
$coltype = $msql->f( "coltype" );
$pagename = $msql->f( "pagename" );
$tempfile = $msql->f( "tempfile" );
$nowid = $id + 10000;
if ( $ctype == "page" || $ctype == "form" )
{
$FormString .= "d.add({$menuid},0,'{$menu}','pset.php?menuid={$menuid}&coltype={$coltype}&pagename={$pagename}'); \n";
}
else
{
$FormString .= "d.add({$nowid},{$menuid},'{$name}','pset.php?menuid={$menuid}&coltype={$coltype}&pagename={$pagename}'); \n";
}
if ( $p == 0 )
{
echo "<script>parent.con.location='pset.php?menuid={$menuid}&coltype={$coltype}&pagename={$pagename}'</script>";
}
$p++;
}
}
$FormString .= "document.write(d); } \n //--></script><script>dtree();</script>";
$FormString .= "</td></tr></table>";
return $FormString;
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -