$result = mysql_query("SELECT * FROM spill_nyheter where id = '$nid' AND public = 'ja' AND type = '$type' LIMIT 1",$db);
while ($obj = mysql_fetch_object($result))
{
$skribent = $obj->skribent;
$oppdatert = $obj->oppdatert;
$dato = $obj->dato;
$nid = $obj->id;
echo "
";
if ($type == 'nyhet') { $path = "images/news"; }
if ($type == 'artikkel') { $path = "images/artikkel"; }
if (file_exists($path."/".$nid.".jpg"))
{
$image = $path."/".$nid.".jpg";
echo "
";
}
else
{
echo "
";
}
echo "
";
echo "
";
echo "$obj->overskrift
";
echo "$obj->konsoll
";
echo "$obj->ingress";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
{
$writer = mysql_query("select spill_nyheter.skribent, fulltnavn, adresse from skribenter right join spill_nyheter on spill_nyheter.skribent=skribenter.id where skribent='$skribent' LIMIT 1",$db);
while ($object = mysql_fetch_object($writer))
{
$name=$object->fulltnavn;
$email=$object->adresse;
}
}
echo "Skrevet av
$name - ".strftime("%d. %B %Y, kl. %R",$dato)."";
if ($user->data['user_id'] == '2') { echo " - [Lest: $teller]"; }
echo "
";
echo "
";
echo "
";
echo "".nl2br($obj->tekst)."";
echo "
";
echo "
";
?>
echo "";
echo "
";
echo "
";
// FLERE BILDER START
echo "
";
if ($type == 'nyhet') { $path = "images/sma/"; $bigPath = "images/store/"; }
if ($type == 'artikkel') { $path = "images/artikkel/sma/"; $bigPath = "images/artikkel/store/"; }
if (file_exists($path."".$nid.".1.jpg"))
{
echo "
Flere bilder
";
echo "
";
}
$i = 1;
while ($i <= 20)
{
if (!file_exists($path."".$nid.".".$i.".jpg")) { echo ""; }
else
{
$image = $path."".$nid.".".$i.".jpg";
$bigImage = $bigPath."".$nid.".".$i.".jpg";
echo "
overskrift - $obj->ingress\" href=\"$bigImage\">";
}
$i++;
}
if (file_exists($path."".$nid.".1.jpg")) { echo "
"; }
echo "
";
// TIPS EN VENN
echo "
";
echo "
";
echo "
";
echo "
";
// Legger til kommentarer
include "inc/kommentarer.php";
}
?>
echo "".$konsoll.""; ?>
if ($konsoll == 'Artikkel')
{
$result = mysql_query("SELECT * FROM spill_nyheter WHERE konsoll='$konsoll' AND id != '$nid' AND public = 'ja' ORDER BY dato DESC LIMIT 4",$db);
}
else
{
$result = mysql_query("SELECT * FROM spill_nyheter WHERE konsoll='$konsoll' AND id != '$nid' AND public = 'ja' ORDER BY dato DESC LIMIT 8",$db);
}
while ($obj = mysql_fetch_object($result))
{
$type = $obj->type;
$rest = substr("$obj->ingress", 0, 100);
if ($type == 'nyhet') { $path = "images/news"; }
if ($type == 'artikkel') { $path = "images/artikkel"; }
if (file_exists($path."/".$obj->id.".jpg"))
{
$image = $path."/".$obj->id.".jpg";
echo "
id&type=nyhet\">overskrift\" title=\"$obj->overskrift\" border=\"0\">";
}
echo "
id&type=nyhet\">$obj->overskrift";
echo "
$rest...(".strftime("%d.%m.%y",$obj->dato).")";
echo "
id&type=nyhet\">Les saken...";
}
?>