169 |
|
|
170 |
|
|
171 |
function diary_edit ($did=0) { |
function diary_edit ($did=0) { |
172 |
|
include('config.php'); |
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']); |
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); |
180 |
if ($secs < 86400 and @mysql_num_rows($result)) { |
if ($secs < $diaryseconds and @mysql_num_rows($result)) { |
181 |
include ('header.php'); |
include ('header.php'); |
182 |
echo "<h1>Generalfel</h1>\n"; |
echo "<h1>Generalfel</h1>\n"; |
183 |
echo "Man får bara göra ett dagboksinlägg per dag.<br>\n"; |
echo "Man får bara göra ett dagboksinlägg per dag.<br>\n"; |