function showColumnstructure($columnid, $classindex = 0) { $query = "select childcolumn from I_column where id={$columnid}"; $result = getresult($query); $count = getresultNumrows($result); if ($count > 0) { $childColumnId = getresultData($result, 0, "childcolumn"); //没有子栏目即返回 //echo $childColumnId."<br>"; if ($childColumnId == NULL || $childColumnId == 0 || $childColumnId == "") { if ($classindex == 0) { echo "<tr style=\"height:24px;\">\n"; echo "<td align='center' colspan='3'>" . gettext_r("haveNot") . gettext_r("column") . "</td>"; echo "</tr>\n"; } return false; } $childId = explode("|", $childColumnId); foreach ($childId as $id) { echo "<tr class='list'>\n"; $getchildcolumnQuery = "select columnname,childcount from I_column where id={$id}"; $childColumn = getresult($getchildcolumnQuery); $childColumnname = getresultData($childColumn, 0, "columnname"); $childCount = getresultData($childColumn, 0, "childcount"); echo "<td> " . $id . "</td>\n"; echo "<td> " . space($classindex) . $childColumnname . "</td>\n"; echo "<td align='center'>"; echo " "; //如果为大栏目调整,不出现添子栏目菜单 if ($columnid != 0) { echo "<a href=\"admin_column.php?action=add&columnid=" . $id . "\">" . gettext_r("add") . gettext_r("child") . gettext_r("column") . "</a>"; echo " | "; } echo "<a href=\"javascript:jump('admin_column.php','modify'," . $id . ")\">" . gettext_r("update") . gettext_r("column") . gettext_r("attribute") . "</a>"; echo " | "; if ($columnid != 0) { echo "<a href=\"admin_article.php?action=add&columnid=" . $id . "\">" . gettext_r("add") . gettext_r("article") . "</a>"; echo " | "; } echo "<a href=\"javascript:if(confirm('" . gettext_r("deleteColumnTip") . "'))jump('admin_column.php','delete'," . $id . ")\">" . gettext_r("delete") . "</a>"; //echo " | "; //如果有子栏目则显示管理子栏目 /* if($childCount > 0) echo "<a href=\"admin_column.php?columnid=".$id."\">管理子栏目($childCount)</a>\n"; else echo "<a href=\"#\">管理子栏目($childCount)</a>\n";*/ echo "</tr>\n"; //如果为大栏目调整,则不递归显示子栏目 if ($columnid != 0) { showColumnstructure($id, $classindex + 1); } } } else { return false; } }
function translatemylabel($mylabel) { $result = getresult("select * from I_mylabel where labelname='{$mylabel}'"); //echo "select * from I_mylabel where labelname='$mylabel'"; if (getresultNumrows($result) < 1) { return $mylabel; } else { return getresultData($result, 0, "labelcontent"); } }
function showpowerlist($adminid = 0) { if ($adminid != 0) { $tempresult = getresult("select * from I_admin where id={$adminid}"); $functioncode = getresultData($tempresult, 0, "functioncode"); $functionarray = translatefunctioncode($functioncode); $result = getresult("select * from I_column where parentid=0"); while ($row = getresultArray($result)) { if ($functionarray[$row["id"]] === "1") { echo "<tr>\n"; echo "<td><input checked=\"true\" type=\"checkbox\" name=\"columnid\" value=\"" . $row["id"] . "\" />" . $row["columnname"] . "</td>"; echo "<td><input checked=\"checked\" type=\"radio\" name=\"" . $row["id"] . "\" value=\"1\" />" . gettext_r("editer") . "<input type=\"radio\" name=\"" . $row["id"] . "\" value=\"2\" />" . gettext_r("column") . gettext_r("manager") . "</td>"; echo "</tr>"; echo "<tr class='segmentline'><td colspan='2'></td></tr>"; } elseif ($functionarray[$row["id"]] === "2") { echo "<tr>\n"; echo "<td><input checked=\"true\" type=\"checkbox\" name=\"columnid\" value=\"" . $row["id"] . "\" />" . $row["columnname"] . "</td>"; echo "<td><input type=\"radio\" name=\"" . $row["id"] . "\" value=\"1\" />" . gettext_r("editer") . "<input checked=\"checked\" type=\"radio\" name=\"" . $row["id"] . "\" value=\"2\" />" . gettext_r("column") . gettext_r("manager") . "</td>"; echo "</tr>"; echo "<tr class='segmentline'><td colspan='2'></td></tr>"; } else { echo "<tr>\n"; echo "<td><input type=\"checkbox\" name=\"columnid\" value=\"" . $row["id"] . "\" />" . $row["columnname"] . "</td>"; echo "<td><input type=\"radio\" name=\"" . $row["id"] . "\" value=\"1\" />" . gettext_r("editer") . "<input type=\"radio\" name=\"" . $row["id"] . "\" value=\"2\" />" . gettext_r("column") . gettext_r("manager") . "</td>"; echo "</tr>"; echo "<tr class='segmentline'><td colspan='2'></td></tr>"; } } if ($functionarray["vote"] === "1") { echo " <tr>"; echo " <td colspan=\"2\"><input type=\"checkbox\" checked=\"true\" name=\"voteadmin\" value=\"1\" />" . gettext_r("vote") . gettext_r("manage") . "</td>"; echo " </tr>"; } else { echo " <tr>"; echo " <td colspan=\"2\"><input type=\"checkbox\" name=\"voteadmin\" value=\"1\" />" . gettext_r("vote") . gettext_r("manage") . "</td>"; echo " </tr>"; } return; } $result = getresult("select * from I_column where parentid=0"); while ($row = getresultArray($result)) { echo "<tr>\n"; echo "<td><input type=\"checkbox\" name=\"columnid\" value=\"" . $row["id"] . "\" />" . $row["columnnamezh"] . "</td>"; echo "<td><input type=\"radio\" name=\"" . $row["id"] . "\" value=\"1\" />" . gettext_r("editer") . "<input type=\"radio\" name=\"" . $row["id"] . "\" value=\"2\" />" . gettext_r("column") . gettext_r("manager") . "</td>"; echo "</tr>"; echo "<tr class='segmentline'><td colspan='2'></td></tr>"; } echo " <tr>"; echo " <td colspan=\"2\"><input type=\"checkbox\" name=\"voteadmin\" value=\"1\" />" . gettext_r("vote") . gettext_r("manage") . "</td>"; echo " </tr>"; }
function showtemplatelist($type) { $tempresult = getresult("select count(*) as countoftemplate from I_template where templatetype={$type}"); $countoftemplate = getresultData($tempresult, 0, "countoftemplate"); if ($countoftemplate < 1) { echo "<tr class='list'>\n"; echo "<td colspan='4' align='center'>" . gettext_r("haveNot") . gettext_r("template") . "</td>\n"; echo "</tr>"; return; } $query = "select * from I_template where templatetype={$type}"; $result = getresult($query); while ($row = getresultArray($result)) { echo "<tr class='list'>\n"; echo "<td> " . $row["id"] . "</td>"; echo "<td> " . $row["templatename"] . "</td>"; echo "<td> " . $row["path"] . "</td>"; echo "<td align='center'>"; echo "<a href=\"admin_template.php?type={$type}&action=modify&id=" . $row["id"] . "\">" . gettext_r("update") . "</a> | <a href=\"javascript:if(confirm('" . gettext_r("ifDelete") . "'))jump('admin_template.php','delete'," . $row["id"] . ")\">" . gettext_r("delete") . "</a>"; echo "</td>"; echo "</tr>\n"; } }
function translatecolumnlist($template) { //匹配自定义文章列表标签正则 $flag = "/【columnlist】([\\s\\S]*?)【\\/columnlist】/"; preg_match_all($flag, $template, $matches, PREG_SET_ORDER); //替换所有articlelist标签 $html = $template; //echo $template."<br>".$flag; //得到需要循环的部分 $str = $matches[0][1]; //echo $str ; //得到子栏目id数组 $columnid = $_GET["columnid"]; $query = "select childcolumn,columnname from I_column where id={$columnid}"; $result = getresult($query); if (getresultNumrows($result) < 1) { //没有才此栏目 return str_replace($str, "No such column!", $html); return; } $columnname = getresultData($result, 0, "columnname"); $childColumnId = getresultData($result, 0, "childcolumn"); if ($childColumnId == NULL || $childColumnId == 0 || $childColumnId == "") { //没有子栏目 return str_replace($str, "No child column!", $html); return; } $temphtml = ""; $childId = explode("|", $childColumnId); foreach ($childId as $id) { $tempstr = str_replace("【#columnid】", "{$id}", $str); $tempstr = str_replace("【#columnname】", getcolumnformationBycolumnid($id, "columnname"), $tempstr); $temphtml .= $tempstr; } $html = str_replace($matches[0][0], $temphtml, $html); return $html; }
} } ?> <form action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="type" value="<?php echo $type; ?> " /> <table width="100%"> <tr> <td class='label' width="150px"><?php echo gettext_r("template") . gettext_r("name"); ?> :</td> <td><input type="text" name="templatename" value="<?php echo getresultData($template, 0, "templatename"); ?> " /></td> </tr> <tr> <td class='label'><?php echo gettext_r("template") . gettext_r("file"); ?> :</td> <td><input type="file" name="templatefile" /></td> </tr> <tr> <td></td> <td><input type="submit" name="submit" value="<?php echo gettext_r("submit"); ?>
FB::log('Log message'); FB::info('Info message'); FB::warn('Warn message'); FB::error('Error message'); readcache(); $siteconfig = getresult("SELECT * FROM I_siteconfig LIMIT 0 , 1"); //如果没有网站配置项 if (getresultNumrows($siteconfig) < 1) { die("<script type='text/javascript'>window.location='error.html'</script>"); } $templateid = getresultData($siteconfig, 0, "indextemplate"); $templateinfo = getresult("select * from I_template where id={$templateid} limit 0,1"); if (getresultNumrows($templateinfo) < 1) { die("<script type='text/javascript'>window.location='error.html'</script>"); } $templatepath = getresultData($templateinfo, 0, "path"); $templatefile = getroot() . "/templates/" . $templatepath; //echo $templatefile; if (!file_exists($templatefile)) { die("The template file doesn'n exit!"); } $template = file_get_contents($templatefile); //如果模板被删除 if (!$template) { die("<script type='text/javascript'>alert('The template doesn't exists!')window.location='error.html'</script>"); } $template = translatelabel($template); $template = translateArticlelist($template); $template = translateCommonlabel($template); echo $template; ob_flush();
<td class='label' width="150px"><?php echo gettext_r("selfDefineTip"); ?> :</td> <td><input type="text" name="labelname" disabled="disabled" value="<?php echo getresultData($label, 0, "labelname"); ?> " /></td> </tr> <tr> <td class='label'><?php echo gettext_r("selfDefineTip") . gettext_r("contents"); ?> :</td> <td><textarea name="labelcontent" style="width:95%; height:500px;"><?php echo getresultData($label, 0, "labelcontent"); ?> </textarea></td> </tr> <tr> <td></td> <td><input type="submit" name="submit" value="<?php echo gettext_r("submit"); ?> " /><input type="button" onclick="history.back(-1)" value="<?php echo gettext_r("back"); ?> " /></td> </tr> </table> </form>
return true; } </script> </head> <body> <form id="form1" name="form1" method="post" action="" onsubmit="return Check();"> <!--第一部分图片&单位开始--> <div id="main1"> <table align="center"> <tr> <td id="m1_pic"></td> <td id="m1_text" valign="top"> <div id="m1_text_user"><span><?php $siteconfig = getresult("select * from I_siteconfig limit 0,1"); echo getresultData($siteconfig, 0, "sitename"); ?> </span></div> <div id="m1_text_login"><span><?php echo gettext_r("login"); ?> </span></div> </td> </tr> </table> </div> <!--第一部分图片&单位结束--> <!--第二部登录表单开始--> <div id="main2"> <table align="center">
session_start(); include_once "conn.php"; $username = $_GET["username"]; $password = md5($_GET["password"]); if ($username == NULL || $username == "" || $password == NULL || $password == "") { if ($_COOKIE["username"] == NULL || $_COOKIE["username"] == "") { die("notlogin"); } } try { $query = "select * from I_user where username = '******' and password = '******'"; //echo $query; $result = getresult($query); if (getresultNumrows($result) < 1) { throw new Exception("登录失败!"); } else { if (getresultData($result, 0, "iflock") === "1") { die("locked"); } setcookie("username", getresultData($result, 0, "username")); setcookie("userid", getresultData($result, 0, "id")); $_SESSION["username"] = getresultData($result, 0, "username"); $_SESSION["userid"] = getresultData($result, 0, "id"); getresult("update I_user set logintimes=logintimes+1 where id=" . getresultData($result, 0, "id")); //echo "update I_admin set logintimes=logintimes+1,lastip=".$_SERVER["REMOTE_ADDR"].",lasttime=CURRENT_TIMESTAMP where id=$id"; //echo getlogininfo("adminname"); echo "logined"; } } catch (Exception $e) { //die ( "notlogin" ); }
function getchildcolumnid_improveed($columnid, $index = 0) { global $childcolumnString; if ($index == 0) { $childcolumnString = $columnid; } $query = "select childcolumn from I_column where id={$columnid}"; //echo $query."<br>"; $result = getresult($query); $count = getresultNumrows($result); //echo $count."<br>"; if ($count > 0) { $childColumnId = getresultData($result, 0, "childcolumn"); //没有子栏目即返回 //echo $childColumnId."<br>"; if ($childColumnId == NULL || $childColumnId == 0 || $childColumnId == "") { return false; } $childId = explode("|", $childColumnId); foreach ($childId as $id) { $childcolumnString .= "," . $id; getchildcolumnid_improveed($id, $index + 1); } } else { return false; } }
$countOfAll += getresultData($result, 0, "count" . $i); } echo "<tr><td height='46px' style='background:url(images/vote_fg2.png) repeat-y' valign='top' id='vote_title'>" . gettext_r("title") . ":" . getresultData($result, 0, "title") . "</td></tr>"; echo "<tr>"; echo "<td height='19px' style='background:url(images/vote_fg3.png) no-repeat'></td>"; echo "</tr>"; echo "<tr>"; echo "<td style='background:url(images/vote_fg4.png) repeat-y'>"; echo "<table width='820px' border='0' cellspacing='0' cellpadding='0' style='margin-left:70px'>"; for ($i = 1; $i < $countOfOption; $i++) { //echo $countOfAll; $percent = round($countOfAll > 0 ? getresultData($result, 0, "count" . $i) * 100 / $countOfAll : 0, 2); echo "<tr>"; echo " <td class='vote_main_td1'>" . getresultData($result, 0, "option" . $i) . ":</td>"; echo " <td class='vote_main_td2'><div style='width:{$percent}%'>{$percent}%</div></td>"; echo " <td class='vote_main_td3'><span>" . getresultData($result, 0, "count" . $i) . "</span>/" . $countOfAll . gettext_r("ticket") . "</td>"; echo "</tr>"; } echo "</table>\n"; ?> </td> </tr> <tr> <td height="20px" style="background:url(images/vote_fg5.png) no-repeat"></td> </tr> <tr> <td height="30px" style="background:url(images/vote_fg2.png) repeat-y" align="center" valign="bottom" id="vote_a"><a href="javascript:window.close()">关闭窗口</a> | <a href="/cms">返回首页</a></td> </tr> <tr> <td height="30px" style="background:url(images/vote_fg6.png) no-repeat"></td> </tr>
function showcolumnlist($columnid, $columnofarticleid = -1, $classindex = 0) { $query = "select childcolumn from I_column where id={$columnid}"; $result = getresult($query); $count = getresultNumrows($result); if ($classindex == 0) { $tempresult = getresult("select * from I_column where id={$columnid}"); $columnname = getresultData($tempresult, 0, "columnname"); //echo $columnname; if ($columnid == $columnofarticleid) { echo "<option selected=\"true\" value='" . $columnid . "'>\n"; } else { echo "<option value='" . $columnid . "'>\n"; } echo "{$columnname}</option>"; } if ($count > 0) { $childColumnId = getresultData($result, 0, "childcolumn"); //没有子栏目即返回 //echo $childColumnId."<br>"; if ($childColumnId == NULL || $childColumnId == 0 || $childColumnId == "") { if ($classindex == 0) { //echo "<option value='-1'>暂无栏目</option>"; } return false; } $childId = explode("|", $childColumnId); foreach ($childId as $id) { $getchildcolumnQuery = "select columnname,childcount from I_column where id={$id}"; $childColumn = getresult($getchildcolumnQuery); $childColumnname = getresultData($childColumn, 0, "columnname"); $childCount = getresultData($childColumn, 0, "childcount"); if ($id == $columnofarticleid) { echo "<option selected=\"true\" value='" . $id . "'>\n"; } else { echo "<option value='" . $id . "'>\n"; } echo space($classindex + 1) . $childColumnname . "</option>\n"; //如果为大栏目调整,则不递归显示子栏目 if ($columnid != 0) { showcolumnlist($id, $columnofarticleid, $classindex + 1); } } } else { return false; } }
</tr> <tr> <td class='label'>修改时间:</td> <td class='attributeinput'><input type="text" name="modifytime" value="<?php echo date("Y-m-d H:i:s"); ?> " /></td> </tr> <!--自定义字段--> <tr> <td class='label'>属性:</td> <td class='attributeinput'> <?php $sdef_fields = getresult("select * from I_field where columnid=" . getChanelidByColumnid($columnid)); while ($row = getresultarray($sdef_fields)) { echo $row["info"] . ":<input type='text' name='" . $row["fieldname"] . "' value='" . getresultData($result, 0, $row["fieldname"]) . "'><br>"; } ?> </td> </tr> <!--自定义字段--> <tr> <td class='label'>简介:</td> <td class='attributeinput'><textarea name="notes"><?php echo $notes; ?> </textarea></td> </tr> <tr> <td class='label'>正文:<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />缩略图预览:<br /> <img height="88" width="126" id="preview" name="preview" src="<?php
function getsearchPage($pagesize) { $columnid = $_GET["columnid"]; //页面导航字符串 $Page = ""; //从url得到参数 $currentpage = $_GET["currentpage"] == NULL || $_GET["currentpage"] <= 0 ? 1 : $_GET["currentpage"]; $searchSql = "select count(*) as countofarticle from I_article where ifpass=1"; if ($_GET["title"] != NULL && $_GET["title"] != "") { $searchSql .= " and title like '%" . $_GET["title"] . "%'"; } if ($_GET["columnid"] != NULL && $_GET["columnid"] > 0) { $sdef_fields = getresult("select * from I_field where columnid=" . getChanelidByColumnid($_GET["columnid"])); while ($row = getresultarray($sdef_fields)) { if ($_GET[$row["fieldname"]] == NULL || $_GET[$row["fieldname"]] == "") { continue; } if ($row["datatype"] == "double") { $searchSql .= " and " . $row["fieldname"] . " " . $_GET[$row["fieldname"] . "ctype"] . $_GET[$row["fieldname"]]; //echo $_GET[$row["fieldname"]."ctype"]."测试"; } else { $searchSql .= " and " . $row["fieldname"] . " like '" . $_GET[$row["fieldname"]] . "'"; } } //在所有子栏目中搜索 $childcolumnStr = ""; getchildcolumnid($_GET["columnid"], $childcolumnStr); $searchSql .= " and columnid in (" . $childcolumnStr . ")"; //echo "Iron".$searchSql; } $searchSql .= " " . $sortstr; //echo $searchSql; $tempresult = getresult($searchSql); $countofarticle = getresultData($tempresult, 0, "countofarticle"); //echo "|".$countofarticle; if ($countofarticle % $pagesize == 0) { $allpage = $countofarticle / $pagesize; } else { $allpage = floor($countofarticle / $pagesize) + 1; } //消除文章数为零时显示下一页链接的bug if ($countofarticle == 0) { $allpage += 1; } //echo $countofarticle%$pagesize." ".$currentpage; //链接前缀 $searchresultUrl = $_SERVER['PHP_SELF'] . "?"; foreach ($_GET as $key => $value) { if ($key != "currentpage") { $searchresultUrl .= $key . "=" . $value . "&"; } } $Page .= gettext_r("total") . " <b> " . $allpage . " </b> " . gettext_r("page") . " "; if ($currentpage == 1) { $Page .= gettext_r("firstPage") . " | " . gettext_r("prePage") . " | "; } else { $Page .= "<a href='" . $searchresultUrl . "currentpage=1'>" . gettext_r("firstPage") . "</a> | <a href='" . $searchresultUrl . "currentpage=" . ($currentpage - 1) . "'>" . gettext_r("prePage") . "</a> | "; } $temppage = 1; if ($currentpage - 1 < 5) { while ($temppage <= $currentpage) { if ($currentpage == $temppage) { $Page .= "<b>" . $temppage . "</b> "; $temppage++; continue; } $Page .= "<a href='" . $searchresultUrl . "currentpage={$temppage}'>" . $temppage . "</a> "; $temppage++; } } else { while ($temppage <= $currentpage) { if ($currentpage == $temppage) { $Page .= "<b>" . $temppage . "</b> "; $temppage++; continue; } if ($temppage == 1) { $Page .= "<a href='" . $searchresultUrl . "currentpage={$temppage}'>" . $temppage . "</a> … "; $temppage++; continue; } if ($currentpage - $temppage > 3) { $temppage++; continue; } $Page .= "<a href='" . $searchresultUrl . "currentpage={$temppage}'>" . $temppage . "</a> "; $temppage++; } } if ($allpage - $currentpage < 5) { while ($temppage <= $allpage) { if ($temppage == 1) { $Page .= "<a href='" . $searchresultUrl . "currentpage={$temppage}'>" . $temppage . "</a> "; $temppage++; continue; } $Page .= "<a href='" . $searchresultUrl . "currentpage={$temppage}'>" . $temppage . "</a> "; $temppage++; } } else { while ($temppage <= $allpage) { if ($temppage == $allpage) { $Page .= " … <a href='" . $searchresultUrl . "currentpage={$temppage}'>" . $temppage . "</a> "; $temppage++; continue; } if ($temppage - $currentpage > 3) { $temppage++; continue; } $Page .= "<a href='" . $searchresultUrl . "currentpage={$temppage}'>" . $temppage . "</a> "; $temppage++; } } if ($currentpage == $allpage) { $Page .= "| " . gettext_r("nextPage") . " | " . gettext_r("lastPage"); } else { $Page .= "| <a href='" . $searchresultUrl . "currentpage=" . ($currentpage + 1) . "'>" . gettext_r("nextPage") . "</a> | <a href='" . $searchresultUrl . "currentpage={$allpage}'>" . gettext_r("lastPage") . "</a>"; } //echo $Page."好".$pagesize; return $Page; }
<?php include '../conn.php'; $voteid = $_GET["voteid"]; $result = getresult("select * from I_vote where id={$voteid}"); //如果调查不存在则不显示调查 if ($result == NULL || getresultNumrows($result) < 1) { die(""); } echo "<div id='vote'>"; echo "<form name='voteform' target='_blank' method='post' action='showvoteresult.php?voteid=" . $voteid . "'>\n"; $title = getresultData($result, 0, "title"); echo "<div id='votetitle'>{$title}</div>"; $attrcount = getresultData($result, 0, "attrcount"); $type = getresultData($result, 0, "type"); //Form表单 for ($i = 1; $i < $attrcount + 1; $i++) { echo "<div class='voteoption'>"; echo "<input type='hidden' name='votetype' value='" . $type . "'>"; if ($type == 0) { echo "<span><input type='radio' name='option' value='{$i}'/></span>"; } else { echo "<span><input type='checkbox' name='option[]' value='{$i}'/></span>"; } echo "<span class='optionvalue'>" . getresultData($result, 0, "option" . $i) . "</span>"; echo "</div>"; } echo "<input type='submit' id='votebutton' value='Vote'>\n"; echo "</form>"; echo "</div>";
function showletersearch($firstletter, $currentpage, $pagesize = 10) { echo "<table width='100%' cellpadding='0' cellspacing='0' border='0' style='font-size:12px;'>"; $tempresult = getresult("select count(*) as countofarticle from I_article where left(title,1)='" . $firstletter . "' and ifpass=1"); //echo $tempresult; $countofarticle = getresultData($tempresult, 0, "countofarticle"); if ($countofarticle < 1) { echo "<tr class='list'>\n"; echo "<td align='center'>No article</td>\n"; echo "</tr>"; echo "</table>"; return; } //echo $countofarticle."|"; //分页显示 $query = "select * from I_article where left(title,1)='" . $firstletter . "' and ifpass=1 order by id desc limit " . ($currentpage - 1) * $pagesize . ",{$pagesize}"; //echo $query; $result = getresult($query); if (getresultNumrows($result) < 1) { return; } echo "<tr class='articlesegline'>\n"; echo "<td colspan='3'></td>"; echo "</tr>"; while ($row = getresultArray($result)) { echo "<tr class='list'>\n"; echo "<td><a href=\"javascript:parent.location='showarticle.php?articleid=" . $row["id"] . "'\";')\">" . $row["title"] . "</a></td>"; echo "<td width='60'>" . $row["author"] . "</td>"; echo "<td width='150' align='right'>" . $row["addtime"] . "</td>"; echo "</tr>"; echo "<tr class='articlesegline'>\n"; echo "<td colspan='3'></td>"; echo "</tr>"; } echo "</table>"; //分页 echo "<div class='showpage'>"; if ($countofarticle % $pagesize == 0) { $allpage = $countofarticle / $pagesize; } else { $allpage = floor($countofarticle / $pagesize) + 1; } //消除文章数为零时显示下一页链接的bug if ($countofarticle == 0) { $allpage += 1; } //echo $countofarticle%$pagesize." ".$currentpage; echo "<b> " . $allpage . " </b> Pages "; if ($currentpage == 1) { echo "First | pre | "; } else { echo "<a href='articlelist.php?firstletter={$firstletter}¤tpage=1'>First</a> | <a href='articlelist.php?firstletter={$firstletter}¤tpage=" . ($currentpage - 1) . "'>Pre</a> | "; } $temppage = 1; if ($currentpage - 1 < 5) { while ($temppage <= $currentpage) { if ($currentpage == $temppage) { echo "<b>" . $temppage . "</b> "; $temppage++; continue; } echo "<a href='articlelist.php?firstletter={$firstletter}¤tpage={$temppage}'>" . $temppage . "</a> "; $temppage++; } } else { while ($temppage <= $currentpage) { if ($currentpage == $temppage) { echo "<b>" . $temppage . "</b> "; $temppage++; continue; } if ($temppage == 1) { echo "<a href='articlelist.php?firstletter={$firstletter}¤tpage={$temppage}'>" . $temppage . "</a> … "; $temppage++; continue; } if ($currentpage - $temppage > 3) { $temppage++; continue; } echo "<a href='articlelist.php?firstletter={$firstletter}¤tpage={$temppage}'>" . $temppage . "</a> "; $temppage++; } } if ($allpage - $currentpage < 5) { while ($temppage <= $allpage) { if ($temppage == 1) { echo "<a href='articlelist.php?firstletter={$firstletter}¤tpage={$temppage}'>" . $temppage . "</a> "; $temppage++; continue; } echo "<a href='articlelist.php?firstletter={$firstletter}¤tpage={$temppage}'>" . $temppage . "</a> "; $temppage++; } } else { while ($temppage <= $allpage) { if ($temppage == $allpage) { echo " … <a href='articlelist.php?firstletter={$firstletter}¤tpage={$temppage}'>" . $temppage . "</a> "; $temppage++; continue; } if ($temppage - $currentpage > 3) { $temppage++; continue; } echo "<a href='articlelist.php?firstletter={$firstletter}¤tpage={$temppage} '>" . $temppage . "</a> "; $temppage++; } } if ($currentpage == $allpage) { echo "| Next | Last"; } else { echo "| <a href='articlelist.php?firstletter={$firstletter}¤tpage=" . ($currentpage + 1) . "'>Next</a> | <a href='articlelist.php?firstletter={$firstletter}¤tpage={$allpage}'>Last</a>"; } echo "</div>"; }
echo "<td>"; if (getresultData($result, 0, "type") == "0") { echo "<input type='radio' disabled='disabled' checked='true' value='0' name='type'>" . gettext_r("singleChoice") . " <input type='radio' disabled='disabled' name='type' value='1'>" . gettext_r("multipleChoice"); } else { echo "<input type='radio' value='0' disabled='disabled' name='type'>" . gettext_r("singleChoice") . " <input type='radio' checked='true' name='type' disabled='disabled' value='1'>" . gettext_r("multipleChoice"); } echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td class='label' width='80px'>" . gettext_r("vote") . gettext_r("title") . ":</td>"; echo "<td><input type='text' name='title' value='" . getresultData($result, 0, "title") . "' style='width:260px'/></td>"; echo "</tr>"; for ($i = 1; $i < $attrcount + 1; $i++) { echo "<tr id='list{$i}'>"; echo "<td class='label'>" . gettext_r("choice") . "{$i} :</td>"; echo "<td><input disabled='disabled' type='text' name='option{$i}' value='" . getresultData($result, 0, "option" . $i) . "' style='width:260px'/> " . gettext_r("ticket") . gettext_r("count") . ":<b>" . getresultData($result, 0, "count" . $i) . "</b></td>"; echo "</tr>"; } echo "<tr>"; echo "<td cosplan='2'><input type='button' onclick='history.back(-1)' value='" . gettext_r("back") . "'/></td>"; echo "</tr>"; echo "</table>"; break; default: echo "<div id='navigation'>" . gettext_r("quickLink") . ":"; echo "<a href=\"admin_vote.php?action=add\">" . gettext_r("add") . gettext_r("vote") . "</a>\n"; echo "</div>"; echo "<table width='100%' border='0' cellpadding='0' cellspacing='1' class='function'>\n"; echo "<tr class='header'>\n"; echo "<td align='center' width='40'>" . gettext_r("checkIn") . "</td>\n"; echo "<td align='center' width='40'>" . gettext_r("serialNumber") . "</td>\n";
<td class='label'><?php echo gettext_r("field") . gettext_r("explain"); ?> :</td> <td><input type="text" name="info" value="<?php echo getresultData($field, 0, "info"); ?> " /></td> </tr> <tr> <td class='label'><?php echo gettext_r("data") . gettext_r("type"); ?> :</td> <td><select name="datatype"><option><?php echo getresultData($field, 0, "datatype") == "double" ? gettext_r("float") : gettext_r("text"); ?> </option></select></td> </tr> <tr> <td></td> <td><input type="submit" name="submit" value="<?php echo gettext_r("submit"); ?> " /><input type="button" onclick="history.back(-1)" value="<?php echo gettext_r("back"); ?> " /></td> </tr> </table> </form>
function showLogpage($currentpage, $pagesize = 10, $logtype = 0) { $tempresult = getresult("select count(*) as countoflog from I_log where logtype={$logtype}"); $countoflog = getresultData($tempresult, 0, "countoflog"); if ($countoflog % $pagesize == 0) { $allpage = $countoflog / $pagesize; } else { $allpage = floor($countoflog / $pagesize) + 1; } //消除文章数为零时显示下一页链接的bug if ($countoflog == 0) { $allpage += 1; } //echo $countofcomment%$pagesize." ".$currentpage; echo gettext_r("total") . "<b> " . $allpage . " </b>" . gettext_r("page") . "(" . $pagesize . " " . gettext_r("piece") . gettext_r("article") . gettext_r("per") . gettext_r("page") . ") "; if ($currentpage == 1) { echo gettext_r("firstPage") . " | " . gettext_r("prePage") . " | "; } else { echo "<a href='admin_log.php?logtype={$logtype}¤tpage=1'>" . gettext_r("firstPage") . "</a> | <a href='admin_log.php?logtype={$logtype}¤tpage=" . ($currentpage - 1) . "'>" . gettext_r("prePage") . "</a> | "; } $temppage = 1; if ($currentpage - 1 < 5) { while ($temppage <= $currentpage) { if ($currentpage == $temppage) { echo "<b>" . $temppage . "</b> "; $temppage++; continue; } echo "<a href='admin_log.php?logtype={$logtype}¤tpage={$temppage}'>" . $temppage . "</a> "; $temppage++; } } else { while ($temppage <= $currentpage) { if ($currentpage == $temppage) { echo "<b>" . $temppage . "</b> "; $temppage++; continue; } if ($temppage == 1) { echo "<a href='admin_log.php?logtype={$logtype}¤tpage={$temppage}'>" . $temppage . "</a> … "; $temppage++; continue; } if ($currentpage - $temppage > 3) { $temppage++; continue; } echo "<a href='admin_log.php?logtype={$logtype}¤tpage={$temppage}'>" . $temppage . "</a> "; $temppage++; } } if ($allpage - $currentpage < 5) { while ($temppage <= $allpage) { if ($temppage == 1) { echo "<a href='admin_log.php?logtype={$logtype}¤tpage={$temppage}'>" . $temppage . "</a> "; $temppage++; continue; } echo "<a href='admin_log.php?logtype={$logtype}¤tpage={$temppage}'>" . $temppage . "</a> "; $temppage++; } } else { while ($temppage <= $allpage) { if ($temppage == $allpage) { echo " … <a href='admin_log.php?logtype={$logtype}¤tpage={$temppage}'>" . $temppage . "</a> "; $temppage++; continue; } if ($temppage - $currentpage > 3) { $temppage++; continue; } echo "<a href='admin_log.php?logtype={$logtype}¤tpage={$temppage}'>" . $temppage . "</a> "; $temppage++; } } if ($currentpage == $allpage) { echo "| " . gettext_r("nextPage") . " | " . gettext_r("lastPage"); } else { echo "| <a href='admin_log.php?logtype={$logtype}¤tpage=" . ($currentpage + 1) . "'>" . gettext_r("nextPage") . "</a> | <a href='admin_log.php?logtype={$logtype}¤tpage={$allpage}'>" . gettext_r("lastPage") . "</a>"; } }
function translateSdefFeildlabel($template) { global $id; //文章id $id = $_GET["articleid"] != NULL ? $_GET["articleid"] : $id; $columnid = $_GET["columnid"] != NULL ? $_GET["columnid"] : getarticleinfo($_GET["articleid"], "columnid"); if ($columnid == NULL && $id != NULL) { $columnid = getarticleinfo($id, "columnid"); } if ($columnid != NULL && $columnid > 0 || $id != NULL && $id > 0) { //如果栏目id为空或者小于1,则不对模板进行处理 $sdef_fields = getresult("select * from I_field where columnid in (" . getChanelidByColumnid($columnid) . ")"); //echo "select * from I_field where columnid in (".getChanelidByColumnid($columnid).")"; $fieldname = ""; $fieldvalue = ""; while ($row = getresultarray($sdef_fields)) { $fieldname = $row["fieldname"]; $temparticle = getresult("select * from I_article where id={$id}"); if (!$temparticle) { continue; } $fieldvalue = getresultData($temparticle, 0, $fieldname); //如果值为空,则替换为空串 if ($fieldvalue == NULL) { $fieldvalue = ""; } $template = str_replace("【#" . $fieldname . "】", $fieldvalue, $template); } } return $template; }
echo gettext_r("submit"); ?> " /> <input type="reset" value="<?php echo gettext_r("cancle"); ?> " /> </form> <?php break; case "modify": $result = getresult("select * from I_admin where id={$adminid}"); //echo $_SESSION["adminname"]; $adminname = getresultData($result, 0, "adminname"); //echo $_SESSION["adminname"]; $pwd = getresultData($result, 0, "password"); $adminrole = getresultData($result, 0, "adminrole"); if ($_POST["submmit"] == gettext_r("submit")) { $adminname = trim($_POST["adminname"]); $pwd = md5(trim($_POST["pwd"])); if ($_POST["adminrole"] != 1) { //是超级管理员 $query = "update I_admin set adminname='{$adminname}',password='******',adminrole=0 where id={$adminid}"; getresult($query); echo "<script type=\"text/javascript\">alert('" . gettext_r("update") . gettext_r("success") . "');window.location='admin_admin.php';</script>"; die; } $result = getresult("select * from I_column where parentid=0"); $functioncode = ""; $index = 0; while ($row = getresultArray($result)) { if ($index == 0) {
function showpage($currentpage, $pagesize = 10) { $tempresult = getresult("select count(*) as countofuser from I_user"); $countofuser = getresultData($tempresult, 0, "countofuser"); if ($countofuser % $pagesize == 0) { $allpage = $countofuser / $pagesize; } else { $allpage = floor($countofuser / $pagesize) + 1; } //消除文章数为零时显示下一页链接的bug if ($countofuser == 0) { $allpage += 1; } echo gettext_r("total") . "<b> " . $allpage . " </b>" . gettext_r("page") . "(" . $pagesize . " " . gettext_r("piece") . gettext_r("user") . gettext_r("per") . gettext_r("page") . ") "; if ($currentpage == 1) { echo gettext_r("firstPage") . " | " . gettext_r("prePage") . " | "; } else { echo "<a href='admin_user.php?columnid={$columnid}¤tpage=1'>" . gettext_r("firstPage") . "</a> | <a href='admin_user.php?columnid={$columnid}¤tpage=" . ($currentpage - 1) . "'>" . gettext_r("prePage") . "</a> | "; } $temppage = 1; if ($currentpage - 1 < 5) { while ($temppage <= $currentpage) { if ($currentpage == $temppage) { echo "<b>" . $temppage . "</b> "; $temppage++; continue; } echo "<a href='admin_user.php?columnid={$columnid}¤tpage={$temppage}'>" . $temppage . "</a> "; $temppage++; } } else { while ($temppage <= $currentpage) { if ($currentpage == $temppage) { echo "<b>" . $temppage . "</b> "; $temppage++; continue; } if ($temppage == 1) { echo "<a href='admin_user.php?columnid={$columnid}¤tpage={$temppage}'>" . $temppage . "</a> … "; $temppage++; continue; } if ($currentpage - $temppage > 3) { $temppage++; continue; } echo "<a href='admin_user.php?columnid={$columnid}¤tpage={$temppage}'>" . $temppage . "</a> "; $temppage++; } } if ($allpage - $currentpage < 5) { while ($temppage <= $allpage) { if ($temppage == 1) { echo "<a href='admin_user.php?columnid={$columnid}¤tpage={$temppage}'>" . $temppage . "</a> "; $temppage++; continue; } echo "<a href='admin_user.php?columnid={$columnid}¤tpage={$temppage}'>" . $temppage . "</a> "; $temppage++; } } else { while ($temppage <= $allpage) { if ($temppage == $allpage) { echo " … <a href='admin_user.php?columnid={$columnid}¤tpage={$temppage}'>" . $temppage . "</a> "; $temppage++; continue; } if ($temppage - $currentpage > 3) { $temppage++; continue; } echo "<a href='admin_user.php?columnid={$columnid}¤tpage={$temppage}'>" . $temppage . "</a> "; $temppage++; } } if ($currentpage == $allpage) { echo "| " . gettext_r("nextPage") . " | " . gettext_r("lastPage"); } else { echo "| <a href='admin_user.php?columnid={$columnid}¤tpage=" . ($currentpage + 1) . "'>" . gettext_r("nextPage") . "</a> | <a href='admin_user.php?columnid={$columnid}¤tpage={$allpage}'>" . gettext_r("lastPage") . "</a>"; } }
<head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>修改密码</title> <link rel="stylesheet" type="text/css" href="css/functionstyle.css"> <script type="text/javascript" src="../js/jquery.js"></script> <script type="text/javascript" src="../js/adminmainFunction.js"></script> </head> <body style="padding:20px;" bgcolor="#f3f9ff"> <?php if ($_POST["submit"] == "提交") { include '../conn.php'; include '../library/basefunction.php'; $adminid = getlogininfo("adminid"); $result = getresult("select * from I_admin where id = {$adminid}"); if (md5($_POST["oldpassword"]) != getresultData($result, 0, "password")) { die("<script type='text/javascript'>alert('旧密码错误');history.back(-1);</script>"); } if ($_POST["newpwd"] != $_POST["newpwd1"]) { die("<script type='text/javascript'>alert('两次密码输入不一致');history.back(-1);</script>"); } if (getresult("update I_admin set password='******' where id={$adminid}")) { die("<script type='text/javascript'>alert('密码修改成功\\n请重新登录');parent.location='logout.php';</script>"); } } ?> <div> <form action="" method="post" onSubmit="return chpasswordcheck();"> <table cellspacing="0" cellpadding="3" border="1" bordercolor="#FFFFFF" style="border-collapse:collapse"> <tr> <td class="label" width="100px">密码:</td>
$return = getresult("update I_column set columnname='{$columnname}',keywords='{$keywords}',isopen={$isopen},columntemplate={$columntemplate},articletemplate={$articletemplate},searchtemplate={$searchtemplate},lang='{$lang}' where id={$columnid}"); if ($return) { echo "<script type='text/javascript'>alert('" . gettext_r("update") . gettext_r("success") . "');window.location=\"" . $preurl . "\";</script>\n"; } else { echo "<script type='text/javascript'>alert('" . gettext_r("update") . gettext_r("fail") . "');history.back('-1');</script>\n"; } } //显示填写表单 $result = getresult("select * from I_column where id=" . $columnid); $columnname = getresultData($result, 0, "columnname"); $keywords = getresultData($result, 0, "keywords"); $columntemplateid = getresultData($result, 0, "columntemplate"); $articletemplateid = getresultData($result, 0, "articletemplate"); $searchtemplateid = getresultData($result, 0, "searchtemplate"); $isopen = getresultData($result, 0, "isopen"); $lang = getresultData($result, 0, "lang"); echo "<form id=\"form1\" name=\"form1\" method=\"post\" action=\"\">\n"; echo "<table>\n"; echo "\t<tr><td class='label'>" . gettext_r("columnName") . ":</td><td class='attributeinput'><input value='" . $columnname . "' type=\"text\" name=\"columnname\" /></td></tr>\n"; echo "\t<tr><td class='label'>" . gettext_r("keywords") . ":</td><td class='attributeinput'><input value='" . $keywords . "' type=\"text\" name=\"keywords\" /></td></tr>\n"; echo "\t<tr><td class='label'>" . gettext_r("lang") . ":</td><td class='attributeinput'><input value='" . $lang . "' type=\"text\" name=\"lang\" /></td></tr>\n"; echo "\t<tr><td class='label'>" . gettext_r("column") . gettext_r("template") . ":</td><td class='attributeinput'><select name=\"columntemplate\">\n"; //栏目模板列表 $columntemplatelist = getresult("select id,templatename from I_template where templatetype=1"); while (list($id, $templatename) = getresultRow($columntemplatelist)) { if ($id == $columntemplateid) { echo "<option selected=\"selected\" value='{$id}'>{$templatename}</option>\n"; } else { echo "<option value='{$id}'>{$templatename}</option>\n"; } }
<?php session_start(); include_once 'conn.php'; include_once 'library/basefunction.php'; include_once 'lang/envinit.php'; include_once 'templatefunction/Iron.article.php'; include_once 'templatefunction/Iron.column.php'; include_once 'templatefunction/Iron.label.php'; include_once 'templatefunction/Iron.search.php'; $columnid = $_GET["columnid"]; $templatefile = getroot() . "/templates/searchresult.html"; if ($columnid != NULL && $columnid != '') { $templateid = getcolumnformationBycolumnid($columnid, "searchtemplate"); $templatepath = getresultData(getresult("select * from I_template where id={$templateid}"), 0, "path"); $templatefile = getroot() . "/templates/" . $templatepath; } //echo $templatefile; if (!file_exists($templatefile)) { die("The template file doesn'n exit!"); } $template = file_get_contents($templatefile); //如果模板被删除 if (!$template) { die("<script type='text/javascript'>alert('The template doesn't exists!')window.location='error.html'</script>"); } $template = translatelabel($template); $template = translateSearchlist($template); $template = translateArticlelist($template); $template = translateCommonlabel($template); echo $template;
$iflock = $_GET["iflock"]; $currentpage = $_GET["currentpage"] == NULL || $_GET["currentpage"] <= 0 ? 1 : $_GET["currentpage"]; if (getlogininfo("adminrole") == NULL || getlogininfo("adminrole") != "0") { die(gettext_r("noRight")); } switch ($action) { case "details": $result = getresult("select * from I_user where id = {$userid}"); $username = getresultData($result, 0, "username"); $realname = getresultData($result, 0, "realname"); $email = getresultData($result, 0, "email"); $qq = getresultData($result, 0, "qq"); $sex = getresultData($result, 0, "sex") == 0 ? gettext_r("male") : gettext_r("female"); $tel = getresultData($result, 0, "tel"); $address = getresultData($result, 0, "address"); $logintimes = getresultData($result, 0, "logintimes"); echo "<table class='poweredit' width='300' border='0' cellspacing='1' cellpadding='0'>"; echo "<tr>"; echo "<td>" . gettext_r("userName") . "(" . gettext_r("login") . gettext_r("times") . "):</td>"; echo "<td>{$username}({$logintimes})</td>"; echo "</tr>"; echo "<tr class=\"segmentline\"><td colspan=\"2\"/></tr>"; echo "<tr>"; echo "<td>" . gettext_r("name") . ":</td>"; echo "<td>{$realname}</td>"; echo "</tr>"; echo "<tr class=\"segmentline\"><td colspan=\"2\"/></tr>"; echo "<tr>"; echo "<td>email:</td>"; echo "<td>{$email}</td>"; echo "</tr>";