Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
<?php // Passwort $p = ''; // Datei in der die Daten gespeichert werden $f = 'd.php'; $t = array( // Datums-Format (wie bei http://php.net/strftime) '%x', // Eintrags-Template (%1$s = Titel, %2$s = Datum, %3$s = Text) '<h1>%1$s</h1><em>%2$s</em><p>%3$s</p>', // Formular-Template '<form action="" method="post"><input type="text" name="n[h]"><textarea name="n[c]"></textarea><input type="submit"></form>', // Layout-Template '<!DOCTYPE html><html><head><meta http-equiv="content-type" content="text/html;charset=utf-8"></head><body>%1$s</body></html>' ); $c = ''; $d = is_array($d = @include $f) ? $d : array(); if ($p && @$_GET['p'] === $p){ if ($n = @$_POST['n']) { $d[] = $n + array('d'=>time()); file_put_contents($f,'<?return '.var_export($d,1).';'); } $c .= $t[2]; } foreach (array_reverse($d) as $i){ $c .= sprintf($t[1],$i['h'],strftime($t[0],$i['d']),$i['c']); } printf($t[3], $c); ?>
This paste will be private.
From the Design Piracy series on my blog: