Er der en venlig sjæl der kan strikke kategorier med ind i denne link samling ?? Og gerne så de givne kategorier vises som links i menuen.
Det er ikke nødvendigt med koder til at oprette dem, det kan gøres i phpmyadmin, sammen med fordelingen af linkene.
Links.php
<?php
require($_SERVER["DOCUMENT_ROOT"].'/php/links_boot.php');
include($_SERVER["DOCUMENT_ROOT"].'/php/links_functions.php');
$thisfile = $PHP_SELF;
// linkstrenge til de tre funktioner.
//$linkadd = "<strong>» <a href=\\"$thisfile?addurl=yes\\">Tilføj webside / URL</a></strong> ";
//$linkshowtop = "<strong>» <a href=\\"$thisfile\\">Top links</a></strong> ";
//$linkshowall = "<strong>» <a href=\\"$thisfile?show=all\\">Vis alle</a></strong> ";
if (strtolower($show) == "all") {
$where = "";
} else {
$where = " having point >= 0";
}
$count = query("select sum(hits) as cnt from links");
$hitcount = $count[0]->cnt;
$result = query("select id,title,date,rating,hits,url, (hits*rating-(to_days(curdate())-to_days(date))) as point ".
"from links$where order by top desc, point DESC");
page_start("");
//echo $linkshowtop;
//echo $linkshowall;
//echo $linkadd;
if (!isset($addurl)) {
echo "<table width='600' border=0 cellpadding=2 cellspacing=0>\\n";
echo "<tr>
<td width=\\"400\\"><strong>Webside</strong></td>
<td width=\\"50\\" align=\\"center\\"><strong>Karakter</strong></td>
<td width=\\"50\\" align=\\"right\\"><strong>Hits</strong></td>
<td width=\\"100\\" align=\\"right\\"><strong>Point i alt</strong></td>
</tr>\\n";
for ($i=0;$i<sizeof($result);$i++) {
if ($result[$i]->point >= 0) {
$point = $result[$i]->point;
} else {
$point = "-";
}
echo "<tr><td width=\\"400\\"><p title='".$result[$i]->url."'>".
"<a href='/links/golink.php?id=".$result[$i]->id."' target='_blank'>".
stripslashes($result[$i]->title)."</a><a href='".$result[$i]->url."'>".
"</a></p></td>".
"<td width=\\"50\\" align=\\"center\\"><img src=\\"/img/links/".$result[$i]->rating.".gif\\" ".
"alt='".stars($result[$i]->rating)."' width='40' height='16'></td>".
"<td width=\\"50\\" align=\\"right\\">".$result[$i]->hits."</td>";
echo "<td width=\\"100\\" align=\\"right\\">$point</td>";
echo "</tr>\\n";
}
echo "</table>";
} else {
?>
<form action='/links/addlink.php' method='post' target='_blank'>
<table width=600 border=0 align=center>
<tr>
<td align="right">Websidens navn : <input type='text' name='title' value='' size='30' id='t300'></td>
</tr>
<tr>
<td align="right">http:// : <input type='text' name='url' value='' size='30' id='t300'></td>
</tr>
<tr>
<td align='center'><br><br><input type='submit' value='Tilføj' id='submit' name="submit"></td>
</tr>
</table>
</form>
<?php
}
echo "<strong>Total hits : $hitcount\\n</strong>";
echo mysql_error();
page_end();
?>
Hilsen Frank