function show_links($site_id) { global $db_con, $mysql_table_prefix, $debug; $sql_query = "SELECT site_id, url, title, short_desc, indexdate from " . $mysql_table_prefix . "sites where site_id={$site_id}"; $result = $db_con->query($sql_query); if ($debug && $db_con->errno) { $err_row = __LINE__ - 2; printf("<p><span class='red'> MySQL failure: %s \n<br /></span></p>", $db_con->error); if (__FUNCTION__) { printf("<p><span class='red'> Found in script: " . __FILE__ . " row: {$err_row} in function(): " . __FUNCTION__ . " <br /></span></p>"); } else { printf("<p><span class='red'> Found in script: " . __FILE__ . " row: {$err_row} <br /></span></p>"); } printf("<p><span class='red'> Script execution aborted. <br /></span>"); printf("<p><strong>Invalid query string, which caused the SQL error:</strong></p>"); echo "<p> {$sql_query} </p>"; exit; } $row = $result->fetch_array(MYSQLI_ASSOC); $result->free_result; $url = replace_ampersand($row['url']); // Headline for Show links echo "<div class='submenu cntr'>| Show all Pages of Url ' {$url} ' |</div>\n "; // Get all links of this Url. $sql_query = "SELECT * from " . $mysql_table_prefix . "links where site_id = '{$site_id}'"; $res = $db_con->query($sql_query); if ($debug && $db_con->errno) { $err_row = __LINE__ - 2; printf("<p><span class='red'> MySQL failure: %s \n<br /></span></p>", $db_con->error); if (__FUNCTION__) { printf("<p><span class='red'> Found in script: " . __FILE__ . " row: {$err_row} in function(): " . __FUNCTION__ . " <br /></span></p>"); } else { printf("<p><span class='red'> Found in script: " . __FILE__ . " row: {$err_row} <br /></span></p>"); } printf("<p><span class='red'> Script execution aborted. <br /></span>"); printf("<p><strong>Invalid query string, which caused the SQL error:</strong></p>"); echo "<p> {$sql_query} </p>"; exit; } $num_rows = $res->num_rows; if ($num_rows) { while ($this_link = $res->fetch_array(MYSQLI_ASSOC)) { $links[] = $this_link; } } $class = "evrow"; if (!$num_rows) { print "<br /><div id =\"result_report\" class='cntr'>The search didn't match any indexed links</div>"; } else { // Display header row and all results echo "<div class='panel'>\n <table width='90%' class='cntr'>\n <tr>\n <td class='headline'>Count</td>\n <td class='headline'>Page Url</td>\n <td class='headline'>Last indexed</td>\n <td class='headline'>Page size</td>\n </tr>\n "; for ($i = 0; $i < $num_rows; $i++) { $url2 = $links[$i]['url']; $indexed = $links[$i]['indexdate']; $page_size = $links[$i]['size']; $count = $i + 1; if ($class == "evrow") { $class = "odrow"; } else { $class = "evrow"; } echo "<tr class='{$class}'>\n <td>{$count}</td>\n <td><a href='{$url2}' target='_blank' title='Visit in new window'>{$url2}</a></td>\n <td>{$indexed}</td>\n <td>{$page_size} kB</td>\n </tr>\n "; } echo "</table>\n <a class='bkbtn' href='admin.php?f=20&site_id={$site_id}' title='Go back to Site Options'>Back</a>\n "; } }
function show_links($site_id) { $result = mysql_query("SELECT site_id, url, title, short_desc, indexdate from " . TABLE_PREFIX . "sites where site_id={$site_id}"); if (DEBUG > '0') { echo mysql_error(); } $row = mysql_fetch_array($result); $url = replace_ampersand($row[url]); // Headline for Show links echo "<div class='submenu cntr'>\r\n\t\t\t\t<ul>\r\n\t\t\t\t\t<li>Show all Pages of Url ' {$url} '</li>\r\n\t\t\t\t\t<li><a class='bkbtn' href='" . WEBROOT_DIR . "/admin/?f=20&site_id={$site_id}' title='Go back to Site Options'>Back</a></li>\r\n\t\t\t\t</ul>\r\n\t\t\t</div>\n"; // Get all links of this Url. $res = mysql_query("select * from " . TABLE_PREFIX . "links where site_id = '{$site_id}'"); if (DEBUG > '0') { echo mysql_error(); } $num_rows = mysql_num_rows($res); $class = "evrow"; if ($num_rows == 0) { print "<br /><div id =\"result_report\" class='cntr'>The search didn't match any indexed links</div>"; } if ($num_rows > 0) { // Display header row and all results echo "<div class='panel'>\r\n\t\t\t<table width='90%' class='cntr'>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class='headline'>Count</td>\r\n\t\t\t\t\t<td class='headline'>Page Url</td>\r\n\t\t\t\t\t<td class='headline'>Last indexed</td>\r\n\t\t\t\t\t<td class='headline'>Page size</td>\r\n\t\t\t\t</tr>\r\n\t\t"; for ($i = 0; $i < $num_rows; $i++) { $url2 = mysql_result($res, $i, "url"); $indexed = mysql_result($res, $i, "indexdate"); $page_size = mysql_result($res, $i, "size"); $count = $i + 1; if ($class == "evrow") { $class = "odrow"; } else { $class = "evrow"; } echo "<tr class='{$class}'>\r\n <td>{$count}</td> \r\n <td><a href='{$url2}' target='_blank' title='Visit in new window'>{$url2}</a></td> \r\n <td>{$indexed}</td> \r\n <td>{$page_size} kB</td> \r\n </tr>\r\n "; } echo "</table>\r\n "; } }
function siteScreen($site_id, $message) { global $mysql_table_prefix; $result = mysql_query("SELECT site_id, url, title, short_desc, indexdate from " . $mysql_table_prefix . "sites where site_id={$site_id}"); echo mysql_error(); $row = mysql_fetch_array($result); $url = replace_ampersand($row[url]); if ($row['indexdate'] == '') { $indexstatus = "<font color=\"red\">Not indexed</font>"; $indexoption = "<a href=\"admin.php?f=index&url={$url}\">Index</a>"; } else { $site_id = $row['site_id']; $result2 = mysql_query("SELECT site_id from " . $mysql_table_prefix . "pending where site_id ={$site_id}"); echo mysql_error(); $row2 = mysql_fetch_array($result2); if ($row2['site_id'] == $row['site_id']) { $indexstatus = "Unfinished"; $indexoption = "<a href=\"admin.php?f=index&url={$url}\">Continue indexing</a>"; } else { $indexstatus = $row['indexdate']; $indexoption = "<a href=\"admin.php?f=index&url={$url}&reindex=1\">Re-index</a>"; } } ?> <div id="submenu"> </div> <?php print $message; ?> <br/> <center> <div style="width:755px;"> <div style="float:left; margin-right:0px;"> <div class="darkgrey"> <table cellpadding="3" cellspacing="0"> <table cellpadding="5" cellspacing="1" width="640"> <tr > <td class="grey" valign="top" width="20%" align="left">URL:</td> <td class="white" align="left"><a href="<?php print $row['url']; print "\">"; print $row['url']; ?> </a></td> </tr> <tr> <td class="grey" valign="top" align="left">Title:</td> <td class="white" align="left"><b><?php print stripslashes($row['title']); ?> </b></td> </tr> <tr> <td class="grey" valign="top" align="left">Description:</td> <td width="80%" class="white" align="left"><?php print stripslashes($row['short_desc']); ?> </td> </tr> <tr> <td class="grey" valign="top" align="left">Last indexed:</td> <td class="white" align="left"><?php print $indexstatus; ?> </td> </tr> </table> </div> </div> <div id= "vertmenu"> <ul> <li><a href=admin.php?f=edit_site&site_id=<?php print $row['site_id']; ?> >Edit</a></li> <li><?php print $indexoption; ?> </li> <li><a href=admin.php?f=21&site_id=<?php print $row['site_id']; ?> >Browse pages</a></li> <li><a href=admin.php?f=5&site_id=<?php print $row['site_id']; ?> onclick="return confirm('Are you sure you want to delete? Index will be lost.')">Delete</a></li> <li><a href=admin.php?f=19&site_id=<?php print $row['site_id']; ?> >Stats</a></li> </div> </ul> </div> </center> <div class="clear"> </div> <br/> <?php }
function siteScreen($site_id, $message) { global $mysql_table_prefix; $result = mysql_query("SELECT site_id, url, title, short_desc, indexdate from " . $mysql_table_prefix . "sites where site_id={$site_id}"); echo mysql_error(); $row = mysql_fetch_array($result); $url = replace_ampersand($row[url]); if ($row['indexdate'] == '') { $indexstatus = "<font color=\"red\">没有索引</font>"; $indexoption = "<a href=\"admin.php?f=index&url={$url}\">索引</a>"; } else { $site_id = $row['site_id']; $result2 = mysql_query("SELECT site_id from " . $mysql_table_prefix . "pending where site_id ={$site_id}"); echo mysql_error(); $row2 = mysql_fetch_array($result2); if ($row2['site_id'] == $row['site_id']) { $indexstatus = "Unfinished"; $indexoption = "<a href=\"admin.php?f=index&url={$url}\">继续索引</a>"; } else { $indexstatus = $row['indexdate']; $indexoption = "<a href=\"admin.php?f=index&url={$url}&reindex=1\">重新索引</a>"; } } ?> <div id="submenu"> </div> <?php print $message; ?> <br/> <center> <div style="width:755px;"> <div style="float:left; margin-right:0px;"> <div class="darkgrey"> <table cellpadding="3" cellspacing="0"> <table cellpadding="5" cellspacing="1" width="640"> <tr > <td class="grey" valign="top" width="20%" align="left">网址:</td> <td class="white" align="left"><a href="<?php print $row['url']; print "\">"; print $row['url']; ?> </a></td> </tr> <tr> <td class="grey" valign="top" align="left">标题:</td> <td class="white" align="left"><b><?php print stripslashes($row['title']); ?> </b></td> </tr> <tr> <td class="grey" valign="top" align="left">简介:</td> <td width="80%" class="white" align="left"><?php print stripslashes($row['short_desc']); ?> </td> </tr> <tr> <td class="grey" valign="top" align="left">上次索引:</td> <td class="white" align="left"><?php print $indexstatus; ?> </td> </tr> </table> </div> </div> <div id= "vertmenu"> <ul> <li><a href=admin.php?f=edit_site&site_id=<?php print $row['site_id']; ?> >编辑</a></li> <li><?php print $indexoption; ?> </li> <li><a href=admin.php?f=21&site_id=<?php print $row['site_id']; ?> >页面浏览</a></li> <li><a href=admin.php?f=5&site_id=<?php print $row['site_id']; ?> onclick="return confirm('你真的要删除? 索引将丢失。')">删除</a></li> <li><a href=admin.php?f=19&site_id=<?php print $row['site_id']; ?> >统计</a></li> </div> </ul> </div> </center> <div class="clear"> </div> <br/> <?php }