<?php
$host="localhost"; //localhost or your sql server
$database=""; // Name of database
$user=""; //Login Data User
$pass=""; //pass for database
$prepend=""; // your prepend plus "_" No prepend->""
$trash="N";
$table=$prepend."phpwcms_article";
mysql_connect($host, $user, $pass)
or die("Databasefejl: " . mysql_error());
mysql_select_db($database);
$num=substr( $_SERVER['QUERY_STRING'],4,3);
if ($num=999) {$num=254; $trash="Y";}
$a=chr($num);
if (empty($a)) {$a='A';}
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";echo "<html>\n<head>\n<title>Alfabetisk artikeloversigt</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"phpwcms_template/inc_css/frontend.css\">\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n";
echo "</head>\n<body>\n\n\n";
echo "<a name=\"toppen\"></a>\n";
echo "<table style=\"border: 1px solid black;\">\n <tr>\n ";
//lister A B C D E F G H I J K L M N O P Q R S T U V W X Y Z uden ÆØÅ
for ($i=65;$i<91;$i++)
{
$ueber=chr($i);
echo "<td><a href=\"alfabetiskliste.php?a&p=$i\">".chr($i)."</a></td>";
if (($i-64)%10 == 0) echo "\n ";
};
//Start Æ Ø Å
for ($i=197;$i<199;$i++)
{
$ueber=$i;
echo "<td><a href=\"alfabetiskliste.php?a&p=$i\">".chr($i)."</a></td>";
if (($i-64)%10 == 0) echo "\n ";
};
for ($i=216;$i<217;$i++)
{
$ueber=($i);
echo "<td><a href=\"alfabetiskliste.php?a&p=$i\">".chr($i)."</a></td>";
//Slut Æ Ø Å
echo "<td><a href=\"alfabetiskliste.php?a&p=999\">Andre (numeriske etc incl æøå)</a></td>";
if (($i-64)%10 == 0) echo "\n ";
};
echo "\n </tr>\n</table>\n";
// 0=article_id 1=article_title 2=article_public 3=article_aktiv 4=article_deleted 5=article_cid
$result = mysql_query("SELECT article_id, article_title, article_public, article_aktiv, article_deleted, article_cid
FROM $table
ORDER BY article_title");
$inside="N";
echo "<br>";
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
$temp= substr($row[1],0,1);
//$row[2]!=0 -sat til ikke public
//$row[3]!=0 -sat til ikke aktiv
//$row[4]!=9 -sat til slettet
if ( $trash == "Y" )
{
if ( ( ($temp < 65) OR (($temp > 90) AND ($temp < 97)) OR ($temp > 122) ) AND ($row[2]!=0) AND ($row[3]!=0) AND ($row[4]!=9))
{
$inside= "Y";
printf ("<img src=\"img/symbole/text_1.gif\" align=\"absmiddle\" alt=\"\"><a href=\"pda.php?id=%s,%s,0,1,0,0\">%s</a><br>", $row[5], $row[0], $row[1]);
}
}
else if ( ( ($temp==$a) OR ($temp==strtolower($a)) ) AND ($row[2]!=0) AND ($row[3]!=0) AND ($row[4]!=9)) {
$inside= "Y";
printf ("<img src=\"img/symbole/text_1.gif\" align=\"absmiddle\" alt=\"\"><a href=\"pda.php?id=%s,%s,0,1,0,0\">%s</a><br>", $row[5], $row[0], $row[1]); }
}
if ($inside=="N") {echo "Pt. findes der ingen artikler der starter med: <strong>$a</strong><br />";}
mysql_free_result($result);
echo "<br /><a href=\"#toppen\">Gå til toppen</a>\n";
echo "\n\n\n</body>\n</html>"
?>