예제 #1
0
      fwrite($fp,'DirectoryIndex index.html');
      fclose($fp);
      }
     require 'page_elements.php';
     $fp=fopen("../".$_POST['bbs']."/index.html",'w');
     fwrite($fp,head($bbs_name,$_POST['title']));
     fwrite($fp,index_display($bbs_name,$_POST['title'],$bbs['display']));
     fwrite($fp,index_menu($_POST['bbs'],$db_prefix,$menu_n,$index_n));
     fwrite($fp,index($_POST['bbs'],$db_prefix,$index_posts_n,$index_n,$_POST['postname'],$_POST['show_id']));
     fwrite($fp,form($_POST['bbs']));
     fwrite($fp,$foot);
     fclose($fp);

     $fp=fopen("../".$_POST['bbs']."/subback.html",'w');
     fwrite($fp,$head);
     fwrite($fp,index_menu($_POST['bbs'],$db_prefix));
     fwrite($fp,$foot);
     fclose($fp);
     }
    }
   ?>
Create BBS:
<form action="?operate=bbs&action=create" method="post">
<table style="margin-left: auto; margin-right: auto; text-align: left;" border="1">
<tr><td>Directory</td><td><input type="text" name="bbs" /></td></tr>
<tr><td>Title</td><td><input type="text" name="title" /></td></tr>
<tr><td>Posting Name</td><td><input type="text" name="postname" /></td></tr>
<tr><td>Show ID</td><td><input type="radio" name="show_id" value="0" /> No<br /><input type="radio" name="show_id" value="1" /> Yes</td></tr>
<tr><td>Front Display</td><td><textarea name="display"></textarea></td></tr>
</table>
<input type="submit" name="submit" value="Create" /></form></div>
예제 #2
0
$_POST['message'] = str_replace("\\r<br />", "<br />\n", $_POST['message']);
$_POST['message'] = stripslashes($_POST['message']);
$ip = md5(md5(getenv('REMOTE_ADDR') . mhash(MHASH_CRC32, getenv('REMOTE_ADDR'))) . mhash(MHASH_CRC32, getenv('REMOTE_ADDR') . crypt(getenv('REMOTE_ADDR'), getenv('REMOTE_ADDR') . md5(getenv('REMOTE_ADDR')))));
$ip = stripslashes($ip);
$ip = mysql_real_escape_string($ip);
if (mysql_query("INSERT INTO " . $db_prefix . "messages (`key`,bbs,`from`,tripcode,mail,message,`datetime`,ip) VALUES ('" . $_POST['key'] . "','" . $bbs['id'] . "','" . $_POST['from'] . "','" . $tripcode . "','" . $_POST['mail'] . "','" . $_POST['message'] . "',NOW(),'" . $ip . "')")) {
    if (!$thread and $_POST['mail'] != 'sage') {
        mysql_query("UPDATE " . $db_prefix . "threads SET last=NOW() WHERE id=" . $_POST['key']);
    }
    echo post_redirect($bbs['bbs']);
} else {
    echo "Your message has not been posted successfully.";
    exit;
}
if ($thread) {
    $m = mysql_fetch_array(mysql_query("SELECT id FROM " . $db_prefix . "messages WHERE `key`=" . $thread['id']));
    mysql_query("UPDATE " . $db_prefix . "threads SET id_first=" . $m['id'] . " WHERE id=" . $thread['id']);
}
$fp = fopen("../" . $bbs['bbs'] . "/index.html", 'w');
fwrite($fp, head($bbs_name, $bbs['title']));
fwrite($fp, index_display($bbs_name, $bbs['title'], $bbs['display']));
fwrite($fp, index_menu($bbs['id'], $db_prefix, $menu_n, $index_n));
fwrite($fp, index($bbs['id'], $db_prefix, $index_posts_n, $index_n, $bbs['postname'], $bbs['show_id']));
fwrite($fp, form($bbs['bbs']));
fwrite($fp, $foot);
fclose($fp);
$fp = fopen("../" . $bbs['bbs'] . "/subback.html", 'w');
fwrite($fp, $head);
fwrite($fp, index_menu($bbs['id'], $db_prefix));
fwrite($fp, $foot);
fclose($fp);