Ejemplo n.º 1
0
	<?php 
echo get_html_head();
?>
	<body>
	
		<div class="container">
		
			<?php 
echo get_body_header("digte");
?>

			<h1>Digte</h1>
			
			<?php 
$row = db()->get_single_row("SELECT d.id as did, d.titel, d.tekst, d.likes, u.username FROM digte as d, users as u WHERE d.uid = u.id and d.id = {$did}");
echo digt_row_to_html($row);
?>

			<h2>Kommenterer</h2>
			
			<?php 
$query = query("SELECT k.titel, k.tekst, k.created, u.username FROM digt_kommentarer as k, users as u WHERE k.uid = u.id and k.did = {$did}");
$str = "";
$antal_kommentarer = 0;
while ($row = $query->fetch_array()) {
    $antal_kommentarer++;
    $str .= "<pre>";
    if ($row['titel'] !== "") {
        $str .= "<b>" . html_escape($row['titel']) . "</b><br>";
    }
    $str .= html_escape($row['tekst']) . "<br>";
Ejemplo n.º 2
0
function digt_row_to_short_html($row)
{
    return digt_row_to_html($row, 3);
}