############# #index. php######################
<?session_start ();
Require "./inc/func.php";
Mscon ();
Require "./inc/header.inc";
?>
<script language= "JavaScript" >
function Opwin (filename)
{window.open ("read_article.php?id=" +filename, "", "Height=500,width=585,resizable=no,scrollbars=yes,status=no, Toolbar=no,menubar=no,location=no ");
}
</script>
<body bgcolor= "#FFFFFF" text= "#000000" leftmargin= "0" topmargin= "0" >
<table width= "100%" border= "0" cellspacing= "0" cellpadding= "0" bgcolor= "#003399" height= ">"
<tr>
<TD width= ">"
<div id= "Layer2" style= "Position:absolute; left:7px; top:17px; width:43px; Height:44px;z-index:2 "><objectclassid=" clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 "codebase="/HTTP/ download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0 "width=" "height=" >
<param name=movievalue= "images/logo.swf" >
<param name=quality value=high>
<param name= "wmode" value= "Transparent" >
<embed src= "images/logo.swf" Quality=high pluginspage= "http://www.macromedia.com/shockwave/download/index.cgi? P1_prod_version=shockwaveflash "type=" Application/x-shockwave-flash "width=" "height=" wmode= "Transparent" >
</embed>
</object></div>
<div id= "Layer1" style= "Position:absolute; left:-5px; top:61px; width:49px; Height:37px;z-index:1 "></div>
</td>
<TD width= "539" > <objectclassid= "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase= "http// download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0 "width=" 468 "height=" >
<param name=movievalue= "images/ti1.swf" >
<param name=quality value=high>
<param name= "wmode" value= "Transparent" >
<embed src= "images/ti1.swf" quality=highpluginspage= "http://www.macromedia.com/shockwave/download/index.cgi? P1_prod_version=shockwaveflash "type=" Application/x-shockwave-flash "width=" 468 "height=" wmode= "Transparent" >
</embed>
</object> </td>
</tr>
</table>
<table width= "100%" border= "0" cellspacing= "0" cellpadding= "0" >
<tr>
<TD background= "Images/211.gif" height= "2" > </td>
</tr>
</table>
<table><form name=form1action=search.php method=post target=_blank>
<table width= "80%" border= "0" cellspacing= "0" cellpadding= "0" bgcolor= "#009933" align= "Center" >
<tr>
<TD align= "center" >
<input type= "text" name= "key" >
<select name= "Type" >
<option value=> all category </option>
<? $typ =file ("List.txt");
$num =count ($typ);
for ($i =2; $i <= $num; $i + +)
{
echo "<optionvalue= $typ [$i]> $typ [$i]</option>";}
?>
</select>
<select name= "whe" >
<option value=> All content </option>
<option value=1> article content </option>
<option value=2> article title </option>
<option value=3> Join Time </option>
</select>
<input type= "hidden" name= "Submit" value= "1" >
<input type= "Submit" name= "Submit" value= "Submission Enquiry" >
</td>
</tr>
</table>
</FORM></table>
<?
$type =trim ($type);
if ($comm)
{
$sec = "and Comm=1";
$fir = "where comm=1";
}
if (!empty ($type))
$query = "SELECT count (*) from $table wheretype= ' $type ' $sec";
Else
$query = "SELECT count (*) from $table $fir";
$res =mysql_db_query ("$database", $query);
if (@mysql_num_rows ($res) >0)
$tot =mysql_fetch_array ($res);
$total = $tot [0];
$total _page=ceil ($total/$pagenum);
echo "<table width=" 80% "border=" 0 "cellspacing=" 0 "cellpadding=" 0 "align=center>";
echo "<tr><td> total:". $total. " Article ". $total _page." Page </td></tr> ";
if (empty ($page))
$page = 0;
if (empty ($offset))
$offset = 0;
$offset = $pagenum * $page;
if (!empty ($type))
$query = "SELECT * from $table wheretype= ' $type ' $sec the ORDER by id desc limit $offset, $pagenum";
Else
$query = "SELECT * from $table $fir order Byid desc limit $offset, $pagenum";
$res =mysql_db_query ("$database", $query);
if (@mysql_num_rows ($res) >0)
while ($topic =mysql_fetch_array ($res))
{
if (strlen ($topic [title]) >40)
{
$topic [Title]=substr ($topic [title],0,40];
$topic [title]= $topic [title]. " .....";
}
if (Trim ($topic [TIME]) ==date (y years m D Day))
$topic [time]= "<fontcolor= #FF9900 > $topic [time]</font>";
echo "<tr><td>[$topic [type]]<a href= #onClick =" Opwin ($topic [id]) ";> $topic [title]</a>< Fontsize=1> ($topic [time]) </font> ";
if ($topic [comm]==1)
echo "if ($topic [locked]==1)
echo "echo "</td>
<td> read: $topic [hits] times; comments: $topic [p_num] times </td>
</tr> ";
}
Else
echo "Linked fields, there is no article!!!";
echo "</table>";
?>
<br>
<table width= "80%" border= "0" cellspacing= "0" cellpadding= "0" align= "center" >
<tr>
<td>
<?
$pre = $page-1;
$next = $page +1;
if ($page >0)
echo "<ahref=" $php _self?page= $pre &type= $type "> Prev </a><br><br>";
Else
echo "Prev <br><br>";? ></td>
<td><?if ($page < $total _page-1)
echo "<ahref=" $php _self?page= $next &type= $type "> Next </a><br><br>";
else echo "next page <br><br>";? ></td>
<td>
<form> Jump to:
<select name= "page" onchange= "top.location= ' <? echo$php_self;? >?page= ' +document.forms[1].elements[0].value+ ' &type=<?echo$type;? > '; "class=" Border ">
<?
for ($i =0; $i < $total _page; $i + +)
{
$p = $i +1;
echo "<option value= $i";
if ($page = = $i) echo "selected";
echo ">". $p. " Page </option>n ";
}
?>
</select> </form>
</td>
<td>
<form > select linked fields:
<select name= "type" onchange= "top.location= ' <? echo$php_self;? >?type= ' +document.forms[2].elements[0].value<?if ($comm) echo "+ ' &comm=1 '";? >; ">
<? $typ =file ("List.txt");
$num =count ($typ);
for ($i =0; $i < $num; $i + +)
{
echo "<option value= $typ [$i]", if (Trim ($typ [$i]) = = $type) {echo "Selected";} echo "> $typ [$i]</option>";}
?>
</select>
</form>
</td><td><formmethod= "POST" ACTION=<? echo $PHP _self;? >?type=<?echo$type;? > target= "_balnk" ><input type= "Submit" Name= "Comm" value= "boutique article" class=border></form></td>
</tr>
</table>
<?require "./inc/footer.inc";? >
#################### #read_article. php#########################
<?
Require "./inc/func.php";
if (! $id)
{
echo "<script>window.close ();</script>";
Exit ();
}
Mscon ();
$query = "SELECT * from $table whereid= ' $id '";
$res =mysql_db_query ("$database", $query);
if (! $res)
{
echo "This article have been deleted or nothis article!!";
Exit ();
}
$data =mysql_fetch_array ($res);
Add_hits ($data [id]);
$pre = $data [Id]-1;
$next = $data [id]+1;
?>
<HTML>
<HEAD>
<TITLE>
<? echo "$data [title]--[$data [Type]]";? >
</TITLE>
<meta http-equiv=content-typecontent= "text/html; charset=gb2312 ">
<style type=text/css>
<!--
Body,table,td,input,textarea {font-family: "detail"; font-size:9pt}
Select {font-family: "detail"; font-size:9pt}
Code {font-family: "Courier"; font-size:10pt}
A {color: #005500}
a:hover {color: #CC0000}
. border {border:1px #000000 solid;background-color:transparent; list-style-position:inside; List-style-type:square}
-
</style>
<script language= "JavaScript" >
Function name ()
{
var theresult = true;
var elem4 = null;
if (Document.forms[0].elements[0].value = = "" | | document.forms[0].elements[0].value = = "Undefined" | | Document.forms[0].elements[0].value = = "NULL")
{
Elem4 = Prompt ("Please enter your name:", "");
Theresult = false;
Document.forms[0].elements[0].value = ELEM4;
}
return theresult;
}
function mail ()
{
var theresult = true;
var elem1 = null
if (Document.forms[0].elements[1].value.indexof (' @ ') = =-1 | | document.forms[0].elements[1].value== "" | | Document.forms[0].elements[1].value.indexof ('. ') = = =-1))
{
Elem1 = Prompt ("Please enter your correct email address."} Thank you!! ","");
Theresult = false;
Document.forms[0].elements[1].value = elem1;
}
return theresult;
}
function Go ()
{
var theresult=true;
Theresult = name () &&mail ();
return theresult;
}
</script>
</HEAD>
<body text= #000000 bgcolor= #ffffff >
<table bordercolor= #339933 cellspacing=0bordercolordark= #ffffff
cellpadding=0 align=centerbordercolorlight= #000000 border=1 width=545>
<TBODY>
<TR valign=center bgcolor= #009900 >
<TD background=images/third-back3.gif>
<table cellspacing=0 cellpadding=0 width=100%border=0>
<TBODY>
<TR>
<TD width=17> </td>
<TD width=590>
<table width= "36%" align=centerborder=0>
<TBODY>
<TR>
<TD bgcolor= "#009900" >
<div align=center><fontface= "Verdana, Arial, Helvetica, Sans-serif" color= #ffffff ><b>
<? echo $data [title];? >
</b></FONT></DIV>
</TD></TR></TBODY></TABLE></TD>
<TD width=19>
<div align=center><ahref= "Javascript:window.close ()" >Src= "Images/third-close.gif" Width=17align=absmiddle
Border=0name=content_r03_c28></a></div>
</TD></TR></TBODY></TABLE></TD></TR>
<TR valign=center align=leftbgcolor= #cccccc >
<TD>
<table cellspacing=0 cellpadding=0 border=0 align= "center" width= "100%" >
<TBODY>
<TR>
<TD>
<div align=left><a class= "Whitetxt"
Href= "READ_ARTICLE.PHP?ID=<? Echo$pre;? > "></A></DIV>
</TD>
<TD>
<div align=left><a class= "Whitetxt"
Href= "READ_ARTICLE.PHP?ID=<? Echo$next;? > "></a></DIV>
</TD>
<td>Height=16 src= "Images/mail.gif" width=16></td>
<TD class= "myfont" ><a class= "Redtxt"
Href= "COMMEND.PHP?ID=<? echo "$data [id]&title= $data [title]";? > > Recommended to Friends </A></TD>
<TD> timing:
<? Echo $data [TIME];? >
Read the number of times:
<? echo $data [hits];? >
</TD>
<TD> </TD>
</TR>
</TBODY>
</TABLE>
</TD></TR>
<tr valign=top>
<TD class= "TENPT" >
<?
if ($data [locked]<>0)
{
echo "! This article has been locked by the manager! ";
}
Else
if ($data [html]==1)
Highlight_string ($data [cont]);
Else
Echo nl2br ($data [cont]);
?>
</TD>
</TR>
</TBODY></TABLE>
<table bordercolor= #339933 cellspacing=0bordercolordark= #ffffff
cellpadding=0 align=center bordercolorlight= #000000border =1 width=545>
<tbody>
<tr bgcolor= #cccccc >
<th>
<div align=center> Reviews </DIV>
</th>
</TR>
<tr>
<td>
<form name= "Form1" method= "Post" action= "ping.php" onsubmit= "Returngo ()" >
Your name:
<input type= "text" name= "name" class= "Border" >
Your email:
<input type= "text" name= "Mail" size=20 class= "Border" >
Only standing to see: <input type= "checkbox" Name= "Pub" value= "<? echo $data [title];? > ">
<input type= "hidden" name= "p_id" value= "<? echo $id;? > ">
<br>
Comment:
<textarea name= "cont" rows= "8" cols= "></textarea>"
<br>
<br>
<center>
<input type= "Submit" name= "Submit" value= "commit" class= "border" >
<input type= "reset" name= "Submit2" value= "re-write" class= "border" >
</center></form>
</td>
</tr>
<tr bgcolor= #cccccc >
<th>
<div align=center> Reviews </DIV>
</th>
</TR>
<tr>
<td>
<? $query = "SELECT * from $ping _tab wherep_id= ' $id ' ORDER by time Desc";
$res =mysql_db_query ("$database", $query);
if (mysql_num_rows ($res) >0)
{$i = 1;
while ($ping =mysql_fetch_array ($res))
echo "critic: $ping [name] Email: $ping [mail]<br> ". NL2BR ($ping [P_cont]). " <br> time: $ping [Time] From: $ping [ip]}
Else
echo "does not have a review of this article in the meantime!";
?>
</td>
</tr>
<tr bgcolor= #cccccc >
<td>
<div Align=center><a
Href= "Javascript:window.close ()" > Close window </a></div>
</td>
</tr>
</tbody>
</table>
<?require "./inc/footer.inc";? >.
PHP article Management (2)