-
Notifications
You must be signed in to change notification settings - Fork 2
/
editBoardSettingsExecute.php
67 lines (61 loc) · 2.04 KB
/
editBoardSettingsExecute.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
if (trim(stripslashes($_POST['name'])) == "")
{
header("Location: editBoardSettings.php?error=1");
exit();
}
if (trim(stripslashes($_POST['description'])) == "")
{
header("Location: editBoardSettings.php?error=2");
exit();
}
if (!(trim(stripslashes($_POST['topics'])) >= 1))
{
header("Location: editBoardSettings.php?error=3");
exit();
}
file_put_contents("db/boardname.dat",stripslashes($_POST['name']));
file_put_contents("db/boarddescription.dat",stripslashes($_POST['description']));
file_put_contents("db/topicsperpage.dat",$_POST['topics']);
if ($_POST['smiley'] == 'yes')
{
$folderArr = array();
if ($handle = opendir('tiny_mce/plugins/emotions/img'))
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..") {
array_push($folderArr, $file);
}
}
closedir($handle);
}
$str = "";
$str2 = "";
foreach ($folderArr as $key => $folder)
{
$str .= "str[".$key."] = \"";
if ($handle = opendir('tiny_mce/plugins/emotions/img/'.$folder))
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..") {
$str .= $file.",";
}
}
closedir($handle);
$str = substr($str,0,strlen($str)-1); //remove last comma
$str .= "\";\n";
}
$temp = "";
if (($key+1) % 3 == 0)
{
$temp = "<br />";
}
$str2 .= "<input type=\"button\" onClick='load(\"".$folder."/\",".$key.");' id=\"but".$key."\" value=\"".$folder."\" />".$temp."\n";
}
//echo "<xmp>".file_get_contents("tiny_mce/plugins/emotions/part1.txt").$str.file_get_contents("tiny_mce/plugins/emotions/part3.txt").$str2.file_get_contents("tiny_mce/plugins/emotions/part5.txt")."</xmp>";
file_put_contents("tiny_mce/plugins/emotions/emotions.htm",file_get_contents("tiny_mce/plugins/emotions/part1.txt").$str.file_get_contents("tiny_mce/plugins/emotions/part3.txt").$str2.file_get_contents("tiny_mce/plugins/emotions/part5.txt"));
}
header("Location: editBoardSettings.php");
?>