
<?php include("dh.php"); 
include("../sql/conn.php");
include("yz.php"); 
$llym = $_SERVER["HTTP_REFERER"];
?>

<style type="text/css">

#fw {
	width: 888px;
	background-position: left;
}
#lj {
	width: 168px;
	height: 23px;
	float: left;
	background-color: #FFFFFF;
	padding-top: 6px;
}

#lj2 {
	width: 8px;
	height: 18px;
	padding-top: 3px;
	float: left;
}

#bgbg {
	width: 196px;
	height: 30px;
	float: left;
	text-align: center;
	margin: 5px;
	overflow: hidden;
	text-align: center;
	white-space:nowrap;
	padding: 5px;
	background-color: #333333;
}

</style>


<?php
if ($_GET['q']=="q")
{
$oldid = $_GET['id'];
$newid = $_GET['id'] + 1 ;
$midid = 9999;
mysql_query("UPDATE other SET id = '".$midid."' WHERE id = '".$newid."'");
mysql_query("UPDATE other SET id = '".$newid."' WHERE id = '".$oldid."'");
mysql_query("UPDATE other SET id = '".$oldid."' WHERE id = '".$midid."'");
?>
<script language="javascript">setTimeout(function (){location.href='<?php echo $llym; ?>';},2);</script>
<?
}
?>

<?php
if ($_GET['t']=="t")
{
$oldid = $_GET['id'];
$newid = $_GET['id'] - 1 ;
$midid = 9999;
mysql_query("UPDATE other SET id = '".$midid."' WHERE id = '".$newid."'");
mysql_query("UPDATE other SET id = '".$newid."' WHERE id = '".$oldid."'");
mysql_query("UPDATE other SET id = '".$oldid."' WHERE id = '".$midid."'");
?>
<script language="javascript">setTimeout(function (){location.href='<?php echo $llym; ?>';},2);</script>
<?
}
?>

<?php
if ($_GET['id']=="other")
{
mysql_query("INSERT INTO other (name, url, title) VALUES ('$_POST[name]','$_POST[url]','$_POST[title]')");
mysql_query("INSERT INTO text (name, time, ip, ing, f, bz) 
VALUES ('".$_SESSION['name']."', '".$noww."', '".$iipp."', '添加常链', '0', '')");
?>
<script language="javascript">setTimeout(function (){location.href='<?php echo $llym; ?>';},2);</script>
<?
}
?>

<?php
if ($_GET['s']=="fok")
{
mysql_query("DELETE FROM  other  WHERE id='".$_GET['id']."'");
mysql_query("INSERT INTO text (name, time, ip, ing, f, bz) 
VALUES ('".$_SESSION['name']."', '".$noww."', '".$iipp."', '删除常链".$_GET['id']."', '0', '')");
?>
<script language="javascript">setTimeout(function (){location.href='<?php echo $llym; ?>';},2);</script>
<?
}
?>

<?php

if ($_GET['id']=="xg")
{
mysql_query("UPDATE other SET name = '".$_POST['name']."' WHERE id = '".$_POST['id']."'");
mysql_query("UPDATE other SET url = '".$_POST['url']."' WHERE id = '".$_POST['id']."'");
mysql_query("UPDATE other SET title = '".$_POST['title']."' WHERE id = '".$_POST['id']."'");

mysql_query("INSERT INTO text (name, time, ip, ing, f, bz) 
VALUES ('".$_SESSION['name']."', '".$noww."', '".$iipp."', '修改常链".$_GET['id']."', '0', '')");
?>
<script language="javascript">setTimeout(function (){location.href='<?php echo $llym; ?>';},2);</script>
<?
}

?>



其它常用链接列表<br />
<div id=fw>
<?php
$result = mysql_query("SELECT * FROM other ORDER BY id DESC ");
while($row = mysql_fetch_array($result))
  {
  echo "<div id=bgbg><a title=向前调 href=other.php?id=".$row['id']."&q=q><div id=lj2>●</div></a>";
  echo "<a ";
  
$urlqian = substr($row['url'],0,7);
if ($urlqian=='http://'){
echo "target=_blank";}

  echo " href=".$row['url']." title=".$row['title']." ><div id=lj> ";
  echo "[".$row['name']."]".$row['id']."</div></a>";
  echo "<a href=other.php?id=".$row['id']."&t=t title=向后调><div id=lj2>●</div></a>";
  echo "</div> ";
  }
?>
</div>


<div class="clear"></div>

<hr>
<DIV>

<table height="48" >
  <tr>
    <form action="other.php?id=other" method="post">
    <td>标题:</td>
    <td><input name="name" type="text" value="" size="8" /></td>
    <td>地址:</td>
    <td><input name="url" type="text" value="http://" size="8" /></td>
    <td>文字:</td>
    <td><input name="title" type="text" value="" size="8" /></td>
    <td><input name="submit" type="submit" value="增加" /></td>
	</form>
	
	
    <form action="other.php?id=xg" method="post">
    <td>ID:</td>
    <td><input name="id" type="text" value="" size="3" /></td>
    <td>标题:</td>
    <td><input name="name" type="text" value="" size="8" /></td>
    <td>地址:</td>
    <td><input name="url" type="text" value="http://" size="8" /></td>
    <td>文字:</td>
    <td><input name="title" type="text" value="" size="8" /></td>
    <td><input name="submit" type="submit" value="修改" /></td>
	</form>
  </tr>
</table>
</DIV>

<p align="left">

<?php
$result = mysql_query("SELECT * FROM other ORDER BY id DESC ");
while($row = mysql_fetch_array($result))
  {
echo "　<a ";
?>onClick="return confirm('删除要小心！？')"<?php
echo " href=other.php?id=".$row['id']."&s=fok >删".$row['id']."</a>";
  }
?>
</p>

<hr>

<textarea cols="88" rows="3">常用链接保存</textarea>


<?php include("../sql/close.php"); ?>