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

📄 news_conadd.php

📁 学校网站源码http://您的网址/admin/admin_login.asp 默认登录用户:admin 默认登录密码:admin
💻 PHP
字号:
<?php


include( "../config.inc.php" );
include( "../includes/SysGlobal.php" );
include( "language/".$aLan."_".$charset.".php" );
include( "../includes/version.php" );
include( "../includes/pro.php" );
include( "func/adm.inc.php" );
include( "func/common.inc.php" );
include( "func/db.inc.php" );
include( "func/nocatch.php" );
needauth( 21 );
$pid = $_REQUEST['pid'];
if ( !isset( $pid ) || $pid == "" )
{
	$pid = 0;
}
echo "<html>\r\n<head >\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=";
echo $charset;
echo "\">\r\n<link id=\"style_sheet\" href=\"css/commonstyle.css\" type=\"text/css\" rel=\"stylesheet\">\r\n<title>";
echo $strAdminTitle;
echo "</title>\r\n</head>\r\n\r\n<body  class=\"NormalPage\">\r\n\r\n";
$step = $_POST['step'];
if ( $step == "add" )
{
	trylimit( $tbl_news_con, "50" );
	$body = $_POST['body'];
	$title = $_POST['title'];
	$catid = $_POST['catid'];
	$dtime = $_POST['dtime'];
	$author = $_POST['author'];
	$source = $_POST['source'];
	$secure = $_POST['secure'];
	$memo = $_POST['memo'];
	$pic = $_FILES['jpg'];
	$spe_selec = $_POST['spe_selec'];
	$menuid = catid2menuid( $tbl_news_cat, $catid );
	$fold = menufold( $menuid );
	if ( 65000 < strlen( $body ) )
	{
		err( $strNewsNotice5, "", "" );
	}
	if ( $title == "" )
	{
		err( $strNewsNotice6, "", "" );
	}
	if ( 200 < strlen( $title ) )
	{
		err( $strNewsNotice7, "", "" );
	}
	$title = htmlspecialchars( $title );
	$msql->query( "select catpath from {$tbl_news_cat} where catid='{$catid}'" );
	if ( $msql->next_record( ) )
	{
		$catpath = $msql->f( "catpath" );
	}
	if ( 0 < $pic['size'] )
	{
		$arr = uploadimage( $pic['tmp_name'], $pic['type'], $pic['size'], $fold."/html/images" );
	}
	$count_pro = count( $spe_selec );
	$i = 0;
	for ( ;	$i < $count_pro;	$i++	)
	{
		$projid = $spe_selec[$i];
		$projpath .= $projid.":";
	}
	$body = url2path( $body );
	$msql->query( "insert into {$tbl_news_con} values(\r\n\t\t0,\r\n\t\t'{$menuid}',\r\n\t\t'{$catid}',\r\n\t\t'{$catpath}',\r\n\t\t'{$title}',\r\n\t\t'{$body}',\r\n\t\t'{$dtime}',\r\n\t\t'1',\r\n\t\t'0',\r\n\t\t'0',\r\n\t\t'1',\r\n\t\t'0',\r\n\t\t'0',\r\n\t\t'{$arr['2']}',\r\n\t\t'{$arr['3']}',\r\n\t\t'{$dtime}',\r\n\t\t'{$author}',\r\n\t\t'{$source}',\r\n\t\t'0',\r\n\t\t'{$projpath}',\r\n\t\t'{$secure}',\r\n\t\t'{$memo}'\r\n\t\t)" );
	$id = $msql->instid( );
	addcatnums( $tbl_news_cat, $catpath );
	echo "<script>top.buildhtml.location='../".$fold."/html/?".$id.".html'</script>";
	echo "<script>self.location='news_con.php?menuid={$menuid}&pid={$catid}'</script>";
}
echo "<s";
echo "cript>\r\nfunction checkform(theform)\r\n{\r\n  var letters = \"abcdefghijklmnopqrstuvwxyz_0123456789\" +\r\n                \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\r\n  var letter =  \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\r\n\r\n  var allword = letters + \"~!@#\$%^&*()+|/?;:'[{]}`\"\r\n  var errletter = \"\"\r\n\r\n\r\n \r\n\r\n  if(theform.title.value.length < 1)\r\n  {\r\n    alert(\"";
echo $strNewsNotice6;
echo "\")\r\n    theform.title.focus()\r\n    return false\r\n  }  \r\n\r\n\r\n  return SelectAll('spe_selec[]', 'select[]');\r\n}  \r\n</script>\r\n<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\r\n \r\n    <form><tr> \r\n      <td>";
$dtime = time( );
$ntime = date( "Y-n-j H:i:s", $dtime );
$oldbody = " ";
echo " </td>\r\n    </tr></form>\r\n\r\n</table>\r\n<table width=\"100%\" cellpadding=\"2\" align=\"center\"  style=\"border-collapse: collapse\" border=\"0\" cellspacing=\"1\">\r\n  <form name=\"form\" action=\"news_conadd.php\" method=\"post\" enctype=\"multipart/form-data\" onSubmit=\"return checkform(this)\">\r\n    <tr> \r\n      <td height=\"30\" width=\"100\" align=\"center\" class=\"title\">";
echo $strNewsCatTitle;
echo "</td>\r\n      <td height=\"30\" class=con> \r\n        ";
echo "<s";
echo "elect name='catid' style='WIDTH: 399;font-size:12px;' >\r\n          ";
$msql->query( "select * from {$tbl_menu} where coltype='news'" );
while ( $msql->next_record( ) )
{
	$menu = $msql->f( "menu" );
	$menuid = $msql->f( "menuid" );
	$fsql->query( "select * from {$tbl_news_cat} where menuid='{$menuid}' order by catpath" );
	while ( $fsql->next_record( ) )
	{
		$lpid = $fsql->f( "pid" );
		$lcatid = $fsql->f( "catid" );
		$cat = $fsql->f( "cat" );
		$catpath = $fsql->f( "catpath" );
		$lcatpath = explode( ":", $catpath );
		$tsql->query( "select catid from {$tbl_news_cat} where pid='{$lcatid}'" );
		if ( $tsql->next_record( ) )
		{
			$ifson = "yes";
		}
		else
		{
			$ifson = "no";
		}
		if ( $ifson == "no" )
		{
			$i = 0;
			for ( ;	$i < sizeof( $lcatpath ) - 2;	$i++	)
			{
				$tsql->query( "select catid,cat from {$tbl_news_cat} where catid='{$lcatpath[$i]}'" );
				if ( $tsql->next_record( ) )
				{
					$ncatid = $tsql->f( "cat" );
					$ncat = $tsql->f( "cat" );
					$ppcat .= $ncat."/";
				}
			}
			if ( $pid == $lcatid )
			{
				echo "<option value='".$lcatid."' selected>".$menu." |- ".$ppcat.$cat."</option>";
			}
			else
			{
				echo "<option value='".$lcatid."'>".$menu." |- ".$ppcat.$cat."</option>";
			}
			$ppcat = "";
		}
	}
}
echo " \r\n        </select>\r\n        <font color=\"#FF0000\">*</font> </td>\r\n    </tr>\r\n    <tr> \r\n      <td height=\"30\" width=\"100\" align=\"center\" class=\"title\">";
echo $strNewsAddTitle;
echo "</td>\r\n      <td height=\"30\" class=con> \r\n        <input type=\"text\" name=\"title\" style='WIDTH: 399;font-size:12px;' maxlength=\"200\" class=input>\r\n        <font color=\"#FF0000\">*</font> </td>\r\n    </tr>\r\n    <tr>\r\n      <td height=\"30\" align=\"center\" class=\"title\">";
echo $strCpAddMemo;
echo "</td>\r\n      <td height=\"30\" class=con><textarea name=\"memo\" style=\"WIDTH: 399;font-size:12px;\" class=\"input1\" rows=\"3\"></textarea>\r\n      </td>\r\n    </tr>\r\n    <tr> \r\n      <td height=\"30\" width=\"100\" align=\"center\" class=\"title\">";
echo $strNewsAddImg;
echo "</td>\r\n      <td height=\"30\" class=con> \r\n        <input type=\"file\" name=\"jpg\" class=input style='WIDTH: 399;font-size:12px;'>\r\n      </td>\r\n    </tr>\r\n    <tr> \r\n      <td height=\"30\" width=\"100\" align=\"center\" class=\"title\">";
echo $strNewsAddCon;
echo "</td>\r\n      <td height=\"30\" class=con> \r\n        <input  name=body type=hidden>\r\n        <input type=\"hidden\" name=\"step\" value=\"add\">\r\n        ";
include( "edithtml/index1.php" );
echo " \r\n        <input type=\"hidden\" name=\"dtime\" value=\"";
echo $dtime;
echo "\">\r\n        <input type=\"hidden\" name=\"pid\" value=\"";
echo $pid;
echo "\">\r\n      </td>\r\n    </tr>\r\n    <tr> \r\n      <td height=\"30\" width=\"100\" align=\"center\" class=\"title\">";
echo $strNewsAddAuthor;
echo "</td>\r\n      <td height=\"30\" class=con> \r\n        <input type=\"text\" name=\"author\" style='WIDTH: 399px;font-size:12px;' maxlength=\"100\" class=input value=\"";
echo $_COOKIE['SYSNAME'];
echo "\">\r\n      </td>\r\n    </tr>\r\n    <tr> \r\n      <td height=\"30\" width=\"100\" align=\"center\" class=\"title\">";
echo $strNewsAddSource;
echo "</td>\r\n      <td height=\"30\" class=con> \r\n        <input type=\"text\" name=\"source\" style='WIDTH: 399;font-size:12px;' maxlength=\"100\" class=input value=\"\">\r\n      </td>\r\n    </tr>\r\n    <tr>\r\n      <td height=\"30\" width=\"100\" align=\"center\" class=\"title\">";
echo $strSecure1;
echo "</td>\r\n      <td height=\"30\" class=con>\r\n        <input type=\"text\" name=\"secure\" style=\"width:25px\" value=\"0\" class=input maxlength=\"1\">\r\n      </td>\r\n    </tr>\r\n    <tr> \r\n      <td height=\"30\" width=\"100\" align=\"center\" class=\"title\">";
echo $strNewsAddProj;
echo "</td>\r\n      <td height=\"30\" class=con>";
$catstr .= "<SCRIPT language=javascript src='js/multicat.js'></SCRIPT>";
$catstr .= "<table cellspacing=0 cellpadding=0><tr><td ><select style='WIDTH: 190px;font-size:12px;' multiple size=5 name=spe_funct>";
$fsql->query( "select * from {$tbl_proj} order by id desc" );
while ( $fsql->next_record( ) )
{
	$projid = $fsql->f( "id" );
	$project = $fsql->f( "project" );
	$NowPath = fmpath( $projid );
	$catstr .= "<option value=".$NowPath.">".$project."</option>";
	$ppcat = "";
}
$catstr .= "</select></td><td width=20>\r\n<input style='width:20px;height=37px;font-size:12px;border:1px outset;' onClick=\"JavaScript:AddItem('spe_funct', 'spe_selec[]')\" type=button value='+' name='Input'>\r\n<input style='width:20px;height=37px;font-size:12px;border:1px outset;' onClick=\"JavaScript:DelItem('spe_selec[]')\" type=button value='-' name='Input'>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td>\r\n\t\t\t\t  <select  style='WIDTH: 190px;font-size:12px' multiple size=5 name=spe_selec[]>";
$catstr .= "</select></td><td valign=bottom></td><td width=20 align=center  valign=bottom><font color=red>*</font></td></tr></table>";
echo $catstr;
echo "</td>\r\n    </tr>\r\n    <tr> \r\n      <td align=\"center\"  colspan=\"2\" height=\"40\" class=title> \r\n        <input type=\"submit\" name=\"submit\"  onClick=\"save();\" value=\"";
echo $strSubmit;
echo "\" class=button>\r\n      </td>\r\n    </tr>\r\n  </form>\r\n</table>\r\n</body>\r\n</html>\r\n";
?>

⌨️ 快捷键说明

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