AddLink.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?php
  2. define('EmpireCMSAdmin','1');
  3. require("../../class/connect.php");
  4. require("../../class/db_sql.php");
  5. require("../../class/functions.php");
  6. $link=db_connect();
  7. $empire=new mysqlquery();
  8. $editor=1;
  9. //验证用户
  10. $lur=is_login();
  11. $logininid=$lur['userid'];
  12. $loginin=$lur['username'];
  13. $loginrnd=$lur['rnd'];
  14. $loginlevel=$lur['groupid'];
  15. $loginadminstyleid=$lur['adminstyleid'];
  16. //ehash
  17. $ecms_hashur=hReturnEcmsHashStrAll();
  18. //验证权限
  19. CheckLevel($logininid,$loginin,$classid,"link");
  20. $enews=ehtmlspecialchars($_GET['enews']);
  21. $url="<a href='ListLink.php".$ecms_hashur['whehref']."'>管理友情链接</a> &gt; 增加友情链接";
  22. $r[lurl]="http://";
  23. $r[width]=88;
  24. $r[height]=31;
  25. $target0="";
  26. $target1="";
  27. $r[onclick]=0;
  28. $r[myorder]=0;
  29. $checked=" checked";
  30. $cid=(int)$_GET['cid'];
  31. if($enews=="EditLink")
  32. {
  33. $lid=(int)$_GET['lid'];
  34. $r=$empire->fetch1("select * from {$dbtbpre}enewslink where lid='$lid'");
  35. if($r[target]=="_parent")
  36. {$target1=" selected";}
  37. if(empty($r[checked]))
  38. {$checked="";}
  39. $url="<a href='ListLink.php".$ecms_hashur['whehref']."'>管理友情链接</a> &gt; 修改友情链接:<b>".$r[lname]."</b>";
  40. }
  41. //分类
  42. $cstr="";
  43. $csql=$empire->query("select classid,classname from {$dbtbpre}enewslinkclass order by classid");
  44. while($cr=$empire->fetch($csql))
  45. {
  46. $select="";
  47. if($cr[classid]==$r[classid])
  48. {
  49. $select=" selected";
  50. }
  51. $cstr.="<option value='".$cr[classid]."'".$select.">".$cr[classname]."</option>";
  52. }
  53. db_close();
  54. $empire=null;
  55. ?>
  56. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  57. <html>
  58. <head>
  59. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  60. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  61. <title>友情链接</title>
  62. </head>
  63. <body>
  64. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  65. <tr>
  66. <td>位置:<?=$url?></td>
  67. </tr>
  68. </table>
  69. <form name="form1" method="post" action="ListLink.php">
  70. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  71. <?=$ecms_hashur['form']?>
  72. <tr class="header">
  73. <td height="25" colspan="2">增加友情链接 <input name="enews" type="hidden" id="enews" value="<?=$enews?>">
  74. <input name="lid" type="hidden" id="lid" value="<?=$lid?>"> <input name="cid" type="hidden" id="cid" value="<?=$cid?>"></td>
  75. </tr>
  76. <tr bgcolor="#FFFFFF">
  77. <td width="26%" height="25">站点名称:(*)</td>
  78. <td width="74%" height="25"> <input name="lname" type="text" id="lname" value="<?=$r[lname]?>" size="42">
  79. <input name="checked" type="checkbox" id="checked" value="1"<?=$checked?>>
  80. 显示</td>
  81. </tr>
  82. <tr bgcolor="#FFFFFF">
  83. <td rowspan="2" valign="top">站点图标:</td>
  84. <td height="25"> <input name="lpic" type="text" id="lpic" value="<?=$r[lpic]?>" size="42">
  85. <a onclick="window.open('../ecmseditor/FileMain.php?modtype=5&type=1&classid=&doing=2&field=lpic<?=$ecms_hashur['ehref']?>','','width=700,height=550,scrollbars=yes');" title="选择已上传的图片"><img src="../../data/images/changeimg.gif" width="22" height="22" border="0" align="absbottom"></a>
  86. </td>
  87. </tr>
  88. <tr bgcolor="#FFFFFF">
  89. <td height="25">宽
  90. <input name="width" type="text" id="width" value="<?=$r[width]?>" size="6">
  91. * 高
  92. <input name="height" type="text" id="height" value="<?=$r[height]?>" size="6">
  93. (不选择图片为文字链接)</td>
  94. </tr>
  95. <tr bgcolor="#FFFFFF">
  96. <td height="25">站点地址:(*)</td>
  97. <td height="25"> <input name="lurl" type="text" id="lurl" value="<?=$r[lurl]?>" size="42">
  98. <select name=target>
  99. <option value="_blank"<?=$target0?>>在新窗口打开</option>
  100. <option value="_parent"<?=$target1?>>在原窗口打开</option>
  101. </select></td>
  102. </tr>
  103. <tr bgcolor="#FFFFFF">
  104. <td height="25">所属分类:</td>
  105. <td height="25"><select name="classid" id="classid">
  106. <option value="0">不隶属于任何分类</option>
  107. <?=$cstr?>
  108. </select>
  109. <input type="button" name="Submit3" value="管理分类" onclick="window.open('LinkClass.php<?=$ecms_hashur['whehref']?>');"></td>
  110. </tr>
  111. <tr bgcolor="#FFFFFF">
  112. <td height="25">点击:</td>
  113. <td height="25"><input name="onclick" type="text" id="onclick" value="<?=$r[onclick]?>" size="6"></td>
  114. </tr>
  115. <tr bgcolor="#FFFFFF">
  116. <td height="25">显示顺序:</td>
  117. <td height="25"><input name="myorder" type="text" id="myorder" value="<?=$r[myorder]?>" size="6">
  118. (越小越前面)</td>
  119. </tr>
  120. <tr bgcolor="#FFFFFF">
  121. <td height="25">站长Email:</td>
  122. <td height="25"><input name="email" type="text" id="email" value="<?=$r[email]?>" size="42"></td>
  123. </tr>
  124. <tr bgcolor="#FFFFFF">
  125. <td height="25">站点简介:</td>
  126. <td height="25"><textarea name="lsay" cols="60" rows="6" id="lsay"><?=ehtmlspecialchars($r[lsay])?></textarea></td>
  127. </tr>
  128. <tr bgcolor="#FFFFFF">
  129. <td height="25">&nbsp;</td>
  130. <td height="25"> <input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td>
  131. </tr>
  132. </table>
  133. </form>
  134. </body>
  135. </html>