(no commit message)
[wiki] / wishlist.mdwn
index c042f4d..f143a5e 100644 (file)
@@ -1,5 +1,73 @@
-# Wishlist
+<?php
+# Shoutbox 1.0
+# by Andreas Beder
+# codejungle.org
+# mod for tinc wiki
+# by wopot
+# Licence GNU GPL 2
+# http://www.codejungle.org/site/Shoutbox+mit+PHP+und+Ajax.html
 
-###Drop oyur Ideas into this Box
+//config
+$filename="wishlist.txt";
+
+// be sure the file have write permissions
+$url="http://tinc-vpn.org/wishlist/";
+
+//function 
+
+function get_content(){
+global $filename;
+      $lines = file ($filename);
+      $start = count($lines)-12;
+      if ($start < 1) $start = 1;
+      for ($i = $start; $i < count ($lines); $i++){
+      $somecontent.=stripslashes($lines[$i]);
+      }
+return $somecontent;
+}
+
+function add_content(){
+global $filename;
+if($_POST[submit] and $_POST[nick] and $_POST[content]){
+//check content
+//add content
+ $_SESSION["nick"]=$_POST[nick];
+ $somecontent=strip_tags($_POST[nick]).": ".strip_tags($_POST[content])."<br/>n";
+ $handle = fopen($filename, 'a+');
+ fwrite($handle, $somecontent);
+}
+}
+
+function output_form(){
+
+echo '
+<form action="" method="post">
+Name:';
+if($_SESSION[nick]){
+       echo $_SESSION[nick].'<input type="hidden" name="nick" value="'.$_SESSION[nick].'"><br>';
+}
+else { 
+       echo '<br><input name="nick" type="text" value="'.$_SESSION[nick].'"><br>'; 
+}
+echo'
+Your Wish/Idea for the tinc Project:<br>
+<textarea rows="5" cols="100" name="content"></textarea><br>
+<input type="submit" name="submit" value="save">
+</form>
+';
+
+}
+
+if($_GET[content]=="true"){
+echo get_content();
+die();
+}
+?>
+
+#Wislist
+##Drop your Ideas into this Box
 ####(The Idea will stay for a while and will check form the dev. Team)
-danm no  form
+<br />
+<?php add_content(); ?>
+<div style="border:1px solid #ccc; width:500px; height:300px; max-height:300px; overflow:auto;" name="shoutbox" id="shoutbox"></div>
+<?php output_form(); ?>