Created
May 27, 2010 19:37
-
-
Save anonymous/416246 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
script type="text/javascript" language="javascript"> | |
<!-- Smilies invoegen | |
function addSmilie(code) | |
{ | |
document.form1.inhoud.value+=code; | |
document.form1.inhoud.focus(); | |
} | |
--> | |
</script> <?php | |
//checken of map "alle" bestaat | |
//Zo nee, maak dan de map aan | |
if (!is_dir("alle")) { | |
mkdir("alle", 0777); | |
} | |
//checken of nieuwsteller bestaat | |
//Zo nee, maak dan de teller aan met stand 0 | |
if (!file_exists("../nieuwsteller.txt")) { | |
$file = fopen("../nieuwsteller.txt", "w"); | |
fwrite($file, "0"); | |
fclose($file); | |
} | |
//Counter openen | |
$file = fopen("../nieuwsteller.txt", "r"); | |
$num = fgets($file, 4096); | |
fclose($file); | |
$ornum = $num + 1; | |
//Nummer + 1 | |
$num = $num + 1; | |
if ($_POST['submit']) { | |
//Maak map aan afhankelijk van het id dat gegeven wordt (id = $num) | |
mkdir("../alle/".$num, 0777); | |
//Maak bestand aan met als inhoud de titel | |
$file = fopen("../alle/".$num."/titel.txt", "w"); | |
fwrite($file, stripslashes($_POST['titel'])); | |
fclose($file); | |
//Maak bestand aan met als inhoud de naam | |
$file = fopen("../alle/".$num."/naam.txt", "w"); | |
fwrite($file, stripslashes($_POST['naam'])); | |
fclose($file); | |
$bericht=$_POST['inhoud']; | |
$smiles = array( | |
':)'=>'blij', | |
'8)'=>'cool', | |
':('=>'droevig', | |
';)'=>'knipoog', | |
':o'=>'omg', | |
':D'=>'tanden', | |
':p'=>'tong', | |
':s'=>'verward'); | |
$bericht = strip_tags($bericht); | |
foreach($smiles as $smile=>$image){ | |
$bericht = str_replace($smile,"<img src=afb/smilies/".$image.".gif>", $bericht);# de map waar de smilies instaan | |
} | |
//Maak bestand aan met als inhoud de tekst | |
$file = fopen("../alle/".$num."/inhoud.txt", "w"); | |
fwrite($file, $bericht); | |
fclose($file); | |
//Maak bestand aan met als inhoud de datum | |
$file = fopen("../alle/".$num."/datum.txt", "w"); | |
fwrite($file, date("d.m.Y")); | |
fclose($file); | |
//CHMODDEN | |
chmod("../alle/".$num."/titel.txt", 0777); | |
chmod("../alle/".$num."/naam.txt", 0777); | |
chmod("../alle/".$num."/inhoud.txt", 0777); | |
chmod("../alle/".$num."/datum.txt", 0777); | |
//Als laatste de Teller updaten | |
$file = fopen("../nieuwsteller.txt", "w"); | |
fwrite($file, $ornum); | |
fclose($file); | |
echo "Toegevoegd!"; | |
} else { | |
echo "<form name=\"form1\" method=\"post\" action=\"#\">"; | |
echo "<b>Titel:</b><br>"; | |
echo "<input name=\"titel\" type=\"text\"><br><br>"; | |
echo "<b>Naam:</b><br>"; | |
echo "<input name=\"naam\" type=\"text\"><br><br>"; | |
echo "<b>Inhoud:</b><br>"; | |
echo "<img src=\"../../afb/smilies/blij.gif\" alt=\":)\" onclick=\"javascript:addSmilie(':)')\">" ; | |
echo "<img src=\"../../afb/smilies/cool.gif\" alt=\"8)\" title=\"8)\" onclick=\"javascript:addSmilie('8)')\">" ; | |
echo "<img src=\"../../afb/smilies/droevig.gif\" alt=\":(\" title=\":(\" onclick=\"javascript:addSmilie(':(')\" >" ; | |
echo "<img src=\"../../afb/smilies/knipoog.gif\" alt=\";)\" title=\";)\" onclick=\"javascript:addSmilie(';)')\"> "; | |
echo "<img src=\"../../afb/smilies/omg.gif\" alt=\":o\" title=\":o\" onclick=\"javascript:addSmilie(':o')\">"; | |
echo "<img src=\"../../afb/smilies/tanden.gif\" alt=\":D\" title=\":D\" onclick=\"javascript:addSmilie(':D')\" >" ; | |
echo "<img src=\"../../afb/smilies/tong.gif\" alt=\":p\" title=\":p\" onclick=\"javascript:addSmilie(':p')\" > "; | |
echo "<img src=\"../../afb/smilies/verward.gif\" alt=\":s\" title=\":s\" onclick=\"javascript:addSmilie(':s')\"><br>" ; | |
echo "<textarea style=\"width: 400px; height: 200px;\" name=\"inhoud\"></textarea><br><br>"; | |
echo "<input type=\"submit\" name=\"submit\" value=\"Toevoegen!\">"; | |
echo "</form>"; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = fopen("pages/nieuwsteller.txt", "r"); | |
$counter = fgets($file, 4096); | |
fclose($file); | |
for ($i = $counter; $i > 0; $i--) | |
{ | |
//Kijken of map waar het bericht instaat bestaat... | |
if (is_dir("pages/alle/".$i)) { | |
echo "<div class=item>"; | |
echo "<h2>"; | |
echo "<a href=\"\index.php?page=5&id=".$i."\">"; | |
include("pages/alle/".$i."/titel.txt"); | |
echo "</a>"; | |
echo "</h2>"; | |
echo "<small>Geplaatst door: "; | |
include("pages/alle/".$i."/naam.txt"); | |
echo " op: "; | |
include("pages/alle/".$i."/datum.txt"); | |
echo "</small>"; | |
echo "<br>"; | |
include("pages/alle/".$i."/inhoud.txt"); | |
echo ""; | |
} | |
} | |
echo "</div><br>"; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$id = $_GET['id']; | |
if (!is_dir("pages/alle/".$id)) { | |
echo "<h4>Dit nieuwsbericht bestaat niet, mogelijk heeft u een verkeerd ID ingevuld.</h4>"; | |
} else { | |
echo "<h3>"; | |
include("pages/alle/".$i."/titel.txt"); | |
echo "</h3>"; | |
echo "<h2>Geschreven op: "; | |
include("pages/alle/".$i."/datum.txt"); | |
echo " Door: "; | |
include("pages/alle/".$i."/naam.txt"); | |
echo "</h2>"; | |
echo "<br><p>"; | |
include("pages/alle/".$i."/inhoud.txt"); | |
echo "</p>"; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$Titel = "Sander"; | |
$keywords = "2"; | |
$css = "/css/3.css"; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php include("config.php"); ?> | |
<html> | |
<head> | |
<link href="<?php echo $css;?>" rel="stylesheet" type="text/css" /> | |
<title><?php echo $Titel;?></title> | |
</head> | |
<body> | |
<div> | |
<div><?php include("header.php"); ?></div> | |
<div class="navigation"><?php include("menu.php"); ?></div> | |
<div><?php include("main.php"); ?></div> | |
<div class="footer"><?php include("footer.php"); ?></div> | |
</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$id = $_GET['id']; | |
switch (strtolower($_GET['page'])) | |
{ | |
case "1": | |
include("pages/alleberichten.php"); | |
break; | |
case "2": | |
include("pages/Home2.php"); | |
break; | |
case "3": | |
include("pages/Home3.php"); | |
break; | |
case "4": | |
include("pages/Home4.php"); | |
break; | |
case "5": | |
include("pages/bekijken.php?id=$id"); | |
break; | |
default: | |
include("pages/alleberichten.php"); | |
break; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment