"; # choose what to seperate each post with #################################### # end varaible edit # #################################### if ($func == "admin"){ if ($_POST[password] == $adminpass){ $password = md5($password); setcookie ("password", $password); } } elseif ($func == "logout"){ setcookie ("password", ""); $password = ""; } $adminpass = md5($adminpass); ?> Norske Geriatriske Snowboardere

 

Kommentarer - Her kan DU som medlem skrive om hva du vil!

Dette er NGS' "Chatte" spalte. Her skriver du alt om vær- føre og andre forhold i din omgivelse. For å poste meldinger på denne siden må man være medlem i NGS, og ha brukernavn/passord.

Innlogging:
Brukernavn:
Passord:



Se alle kommentarer"; if ($password == $adminpass){ echo " - Logout"; } echo $post_breaker; ############################################ # no need to edit anything below this line # ############################################ $lines = file($gbfile); switch ($func){ default: foreach ($lines as $key => $value){ $line = explode("|", $value); if ($key > $max_entries){ echo "Arkiv"; break 2; } else { echo "\n$line[1] - ".date($date_format, $line[0])."
$line[2]$post_breaker"; } } break; case sign: if(trim($name) && trim($message)){ $name = strip_chars($name); $message = strip_chars($message); $line2 = explode("|", $lines[0]); if (strlen($name) > $maxnamesize || strlen($message) > $maxpostsize){ echo "Din melding er ikke lagt til
\nNavn eller meldingen din er for lang. (max $maxpostsize tegn)
\nVennligst prøv igjen ved å klikk her for å komme tilbake."; } elseif ($REMOTE_ADDR == $line2[3] && time() < $line2[0]+$posttime){ echo "Din melding har ikke blitt lagt til
\nVennligst prøv igjen senere.
\n Du kan også gå tilbake hit og prøve igjen."; } else { echo "Din melding har blitt lagt til.
\nGå tilbake ved å klikke her for å se din melding"; $file = join("", file($gbfile)); $fp = fopen($gbfile, "w"); fputs($fp, time()."|$name|$message|$REMOTE_ADDR|\n"); fputs($fp, $file); fclose($fp); } } else { echo "
\n

Navn:

\nMelding:

\n\n

"; } break; case archive: echo "Archive".$post_breaker; foreach ($lines as $key => $value){ if ($key > $max_entries){ $line = explode("|", $value); echo "\n$line[1] - ".date($date_format, $line[0])."
$line[2]$post_breaker"; } } break; case admin: if ($password == $adminpass){ if ($d){ if ($c){ foreach ($lines as $key => $value){ $line = explode("|", $value); if ($line[0] == $d){ echo "Message has been deleted.
\n Go back to the admin page"; $lines[$key] = ''; $data = implode($lines, ""); $fp = fopen($gbfile, "w"); fwrite($fp, $data); fclose($fp); break 2; } } echo "There was an error deleting this post, it doesnt seem to exist
Go back to the admin page and try again"; } else { foreach ($lines as $key => $value){ $line = explode("|", $value); if ($line[0] == $d){ echo "Are you sure you want to delete this entry?
[Yes] - [No]
"; echo "$line[1] - ".date($date_format, $line[0])." - $line[3]
$line[2]
"; break 2; } } echo "There was an error finding this post, it doesnt seem to exist
Go back to the admin page and try again"; } } elseif ($e){ if ($c && trim($name) && time($message)){ $name = strip_chars($name); $message = strip_chars($message); foreach ($lines as $key => $value){ $line = explode("|", $value); if ($line[0] == $e){ $lines[$key] = "$line[0]|$name|$message|$line[3]|\n"; $data = implode($lines, ""); $fp = fopen($gbfile, "w"); fwrite($fp, $data); fclose($fp); echo "Message has been edited.
\n Go back to the admin page"; break 2; } } echo "There was an error editing this post, it doesnt seem to exist
Go back to the admin page and try again"; } else { foreach ($lines as $key => $value){ $line = explode("|", $value); if ($line[0] == $e){ $lineinf = explode ("|", $value); $lineinf = str_replace("
", "\n", $lineinf); echo "
\n

Edit:

\n
\n

\n
"; break 2; } } } } else { echo "Post count: ".count($lines).$post_breaker; foreach ($lines as $key => $value){ $line = explode("|", $value); echo "[Delete]
\n[Edit]\n
$line[1] - ".date($date_format, $line[0])." - $line[3]
$line[2]$post_breaker"; } } } else { if ($submit){ echo "Sorry wrong password
\n"; } echo "
\n

\n
"; } break; } function strip_chars($var){ global $wrap_at; $wrap_at = ($wrap_at == 0) ? 9999999 : $wrap_at; $var = trim($var); $var = htmlspecialchars($var); $var = stripslashes($var); $var = str_replace("\n", "
", $var); $var = str_replace("\r", "", $var); $var = str_replace("|", "", $var); $var = wordwrap($var, $wrap_at, "
", 1); return $var; } ?>

Design og utvikling: First Media Ans