";
echo "";
$show_news_template="templates/showbook.html";
$date_format="d/m/Y";
include_once("inc/database.inc.php");
$getbookid = $_GET[book];
$theid = $_GET['frett'];
$data = fread(fopen($show_news_template, "r"), filesize($show_news_template));
$sql="select * from andspyrna_baekur where n_id=$getbookid";
$result=@mysql_query($sql,$db);
while ($myrow=mysql_fetch_array($result))
{
$n_id=$myrow["n_id"];
$n_date=date($date_format,$myrow["my_date"]);
$about=$myrow["n_about"];
$about_hold=explode("\n",$about);
$efni=$myrow["n_subject"];
$utgefandi=$myrow["n_publisher"];
$exerpt=$myrow["n_exerpt"];
$exerpt_hold=explode("\n",$exerpt);
$picture=$myrow["n_pic"];
$n_type=$myrow["n_type"];
$n_author=$myrow["n_author"];
$extrainfo=$myrow["n_extrainfo"];
$dagsetning=strftime("%e. %B %Y %a.", $myrow["my_date"]);;
$n_showhide=$myrow["n_showhide"];
$topic=$myrow["n_title"];
//---------------------------------------
for ($i=0;$i".$hold_aboutword[$n]."";
}
else if (substr($hold_aboutword[$n],0,4)=="www.")
{
$hold_aboutword[$n]="".$hold_aboutword[$n]."";
}
else if (strpos($hold_aboutword[$n],"@"))
{
$hold_aboutword[$n]="".$hold_aboutword[$n]."";
}
}
$about_hold[$i]=implode(" ",$hold_aboutword);
}
$about=implode("\n",$about_hold);
$about=nl2br($about);
//---------------------------------------
for ($i=0;$i".$hold_exerptword[$n]."";
}
else if (substr($hold_exerptword[$n],0,4)=="www.")
{
$hold_exerptword[$n]="".$hold_exerptword[$n]."";
}
else if (strpos($hold_exerptword[$n],"@"))
{
$hold_exerptword[$n]="".$hold_exerptword[$n]."";
}
}
$exerpt_hold[$i]=implode(" ",$hold_exerptword);
}
$exerpt=implode("\n",$exerpt_hold);
$exerpt=nl2br($exerpt);
//---------------------------------------
$hold=$data;
$hold=str_replace("{date}",$dagsetning,$hold);
$hold=str_replace("{about}"," ".$about." ",$hold);
$hold=str_replace("{id}",$n_id,$hold);
if ($extrainfo)
{
$hold=str_replace("{extra}","$extrainfo ",$hold);
}
else
{
$hold=str_replace("{extra}","",$hold);
}
if ($n_author)
{
$hold=str_replace("{hofundur}","Höfundur: $n_author ",$hold);
}
else
{
$hold=str_replace("{hofundur}"," ",$hold);
}
if ($exerpt)
{
$hold=str_replace("{exerpt}","“".$exerpt."” ",$hold);
}
else
{
$hold=str_replace("{exerpt}"," ",$hold);
}
if ($efni)
{
$hold=str_replace("{efni}","Efni: $efni ",$hold);
}
else
{
$hold=str_replace("{efni}"," ",$hold);
}
if ($utgefandi)
{
$hold=str_replace("{utgefandi}","Útgefandi: $utgefandi ",$hold);
}
else
{
$hold=str_replace("{utgefandi}"," ",$hold);
}
if ($topic)
{
$hold=str_replace("{topic}","$topic ",$hold);
}
else
{
$hold=str_replace("{topic}","(vantar titil) ",$hold);
}
if ($picture)
{
$hold=str_replace("{picture}","",$hold);
}
else
{
$hold=str_replace("{picture}","",$hold);
}
echo $hold;
}
echo " | ";
echo " |