133 |
if ($numrows == 5) $numrows = 5; |
if ($numrows == 5) $numrows = 5; |
134 |
while ($numrows--) { |
while ($numrows--) { |
135 |
list($did,$aid,$title,$time,$bodytext) = mysql_fetch_row($result); |
list($did,$aid,$title,$time,$bodytext) = mysql_fetch_row($result); |
136 |
themearticle($aid,$aid,$time,$title,$bodytext,0,"Dagbok","diary.png","Dagbok"); |
themearticle($aid,$aid,$time,$title,wordlinks($bodytext),0,"Dagbok","diary.png","Dagbok"); |
137 |
if ($loggeduser == $aid) { |
if ($loggeduser == $aid) { |
138 |
echo "<a href=\"diary.php?op=edit&did=$did\">Redigera</a> | "; |
echo "<a href=\"diary.php?op=edit&did=$did\">Redigera</a> | "; |
139 |
echo "<a href=\"diary.php?op=del&did=$did\">Radera</a><br>\n"; |
echo "<a href=\"diary.php?op=del&did=$did\">Radera</a><br>\n"; |
158 |
if ($numrows) { |
if ($numrows) { |
159 |
while ($numrows--) { |
while ($numrows--) { |
160 |
list($did,$aid,$title,$time,$bodytext) = mysql_fetch_row($result); |
list($did,$aid,$title,$time,$bodytext) = mysql_fetch_row($result); |
161 |
themearticle($aid,$aid,$time,$title,$bodytext,0,"Dagbok","diary.png","Dagbok"); |
themearticle($aid,$aid,$time,$title,wordlinks($bodytext),0,"Dagbok","diary.png","Dagbok"); |
162 |
echo "<br /><br />\n"; |
echo "<br /><br />\n"; |
163 |
} |
} |
164 |
} else { |
} else { |
173 |
global $did,$loggeduser,$diary,$REQUEST_METHOD,$action,$op; |
global $did,$loggeduser,$diary,$REQUEST_METHOD,$action,$op; |
174 |
dbconnect(); |
dbconnect(); |
175 |
$diary['title'] = strip_tags($diary['title']); |
$diary['title'] = strip_tags($diary['title']); |
176 |
$diary['bodytext'] = wordlinks(diary_strip_tags($diary['bodytext'])); |
$diary['bodytext'] = diary_strip_tags($diary['bodytext']); |
177 |
if (($op == "add") or ($did == 0)) { |
if (($op == "add") or ($did == 0)) { |
178 |
$result = mysql_query("SELECT did,NOW()-time FROM diary WHERE aid='$loggeduser' ORDER BY did DESC LIMIT 1"); |
$result = mysql_query("SELECT did,NOW()-time FROM diary WHERE aid='$loggeduser' ORDER BY did DESC LIMIT 1"); |
179 |
list($yourdid,$secs) = @mysql_fetch_row($result); |
list($yourdid,$secs) = @mysql_fetch_row($result); |
207 |
if ($REQUEST_METHOD == "POST") $diary = stripslashes_array($diary); |
if ($REQUEST_METHOD == "POST") $diary = stripslashes_array($diary); |
208 |
include('header.php'); |
include('header.php'); |
209 |
if ($diary['title'] or $diary['bodytext']) { |
if ($diary['title'] or $diary['bodytext']) { |
210 |
themearticle($loggeduser,$loggeduser,"<inget datum ännu>",$diary['title'],$diary['bodytext'],0,"Dabok","diary.png","Dagbok"); |
themearticle($loggeduser,$loggeduser,"<inget datum ännu>",$diary['title'],wordlinks($diary['bodytext']),0,"Dabok","diary.png","Dagbok"); |
211 |
echo "<br />\n"; |
echo "<br />\n"; |
212 |
} |
} |
213 |
diary_form($diary); |
diary_form($diary); |