Jag undrar om det är någon som vet hur man kan göra så att andra får ett forum på min hemsida
Som det är på den här bilden

http://img180.imageshack.us/img180/3002/phpbbxh0.th.gif
Moderator: Moderatorgrupp

Kod: Markera allt
<?php
ob_start();
session_start();
define("IN_PHPBB", 1);
$phpbb_root_path = '../';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'config.'.$phpEx);
include($phpbb_root_path . 'includes/db.'.$phpEx);
$sql = "SELECT *
FROM multiforums_settings";
if( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, "Could not query multiforums information", "", __LINE__, __FILE__, $msql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$board_config[$row['config_name']] = $row['config_value'];
}
if ($_GET['mode']=="install")
{
$access_name = $_POST['access_name'];
$admin_name = $_POST['admin_name'];
$admin_email = $_POST['admin_email'];
$pass = $_POST['pass'];
// check if the form is filled in
if ($access_name==true AND $admin_name==true AND $admin_email==true AND $pass1 == true AND $pass2 == true)
{
echo "<html><head><title>Please Wait</title></head><body><div align=\"center\"><h2>Please wait while your phpBB Site is being created.</h2>";
flush();
// Filter out the input
$access_name = preg_replace('/[^a-zA-Z0-9]/','',$access_name);
$admin_name = preg_replace('/[^a-zA-Z0-9]/','',$admin_name);
$pass1 = preg_replace('/[^a-zA-Z0-9]/', '', $pass1);
$pass2 = preg_replace('/[^a-zA-Z0-9]/', '', $pass2);
// E-mail input
$admin_email = htmlspecialchars($admin_email);
// make sure they are lower case..
$access_name = strtolower($access_name);
$forum_name = strtolower($forum_name);
// Remove the blank spaces that they put..
$access_name = trim($access_name);
$admin_name = trim($admin_name);
$admin_email = trim($admin_email);
$pass1 = trim($pass1);
$pass2 = trim($pass2);
// The second time is the charm! :D
$access_name = ereg_replace(' ', '', $access_name);
// Check if all the forms have been completed.
// If not give them a Javascript pop-up error!
$check_result = $db->sql_query("SELECT * FROM `multiforums_forums` WHERE access_name = '".$access_name."'");
if ($db->sql_numrows($check_result) > 0)
{
echo "<html><body><script language=javascript1.1>alert('This access name is already in use, please choose a new one'); javascript:history.back();</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>";
exit;
}
if ($ForumSetupMultiforums == true)
{
echo "<html><body><script language=javascript1.1>alert('You have already made a forum'); javascript:history.back();</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>";
exit;
}
if ($pass1 != $pass2)
{
echo "<html><body><script language=javascript1.1>alert('Your passwords do not patch correctly'); javascript:history.back();</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>";
exit;
}
// md5 the password
$password = md5($pass1);
$server_name = $board_config['server_name'];
$script_path = $board_config['script_path'];
// Checks are complete. Now create the tables
$current_time = mktime();
$phpbb_prefix = $access_name."_";
$filename = "multiforums.sql";
$data = file_get_contents($filename);
$data = str_replace("phpbb_", "$phpbb_prefix", $data);
$data = str_replace("%default_admin_name%", "$admin_name", $data);
$data = str_replace("%default_md5_password%", "$password", $data);
$data = str_replace("%default_admin_email%", "$admin_email", $data);
$data = str_replace("%default_time_stamp%", "$current_time", $data);
$data = str_replace("%board_name%", "$access_name", $data);
$data = str_replace("%phpbb2cookie%", "phpbb_$access_name", $data);
$data = str_replace("%server_name%", "$server_name", $data);
$data = str_replace("%script_path%", "$script_path", $data);
$data = explode("\n", $data);
$query = "";
foreach($data as $sql_line) {
$trimmed = trim($sql_line);
if (($sql_line != "") && (substr($trimmed, 0, 2) != "--") && (substr($trimmed, 0, 1) != "#")) {
$query .= $sql_line;
if(preg_match("/;\s*$/", $sql_line)) {
if (!$db->sql_query($query)) {
echo "<b>Error</b><br />SQL : $query<br />Error : " . mysql_error() . "<br /><br />";
}
$query = "";
}
}
}
// Make avatar folder
$avatar_folder = "../" . $board_config['avatar_path'] . "/" . $access_name;
if (! is_dir($avatar_folder) )
{
mkdir($avatar_folder, 0777);
}
@chmod($avatar_folder, 0777);
$sql = "INSERT INTO `multiforums_forums` ( `id` , `access_name` , `admin_email` , `time_created`) VALUES ('', '$access_name', '$admin_email', '$current_time');";
setcookie ("ForumSetupMultiforums", "true");
// The sql is complete, e-mail the users their information...
$email = "$admin_email";
$subject = "Your Forum Has Been Set Up!";
$message = "Hello $admin_name,\n\n You have created a forum at http://" . $board_config['server_name'] . $board_config['script_path'] . "?mforum=$access_name, remember that your forum is hosted free and you will not be charged anything for it. You can access support from " . $board_config['server_name'] . ". \n\n\n Thanks, \n " . $board_config['server_name'] . " Staff";
mail("$email", "$subject", "$message", "From: " . $board_config['admin_email']);
$db->sql_query($sql) or print(mysql_error() . "<br />");
echo "<h3>Your Multi-Forums site has been set up successfully!</h3>";
echo "Your login details have been e-mailed to you.<br>";
echo "You can now go to your site: <a href='http://" . $board_config['server_name'] . $board_config['script_path'] . "?mforum=$access_name'>
http://" . $board_config['server_name'] . $board_config['script_path'] . "?mforum=$access_name</a>!";
}
else
{
echo "<html><body><script language=javascript1.1>alert('Please fill in the form'); javascript:history.back();</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>";
exit;
}
echo "</div></body></html>";
exit;
}
$domain = ($board_config['access_type'] == 1) ? "http://" . $board_config['server_name'] . $board_config['script_path'] ."?mforum=" : "http://" . $board_config['server_name'] . $board_config['script_path'] ;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>Welcome to phpBB 2 Installation :: Set Up form</title>
<link rel="stylesheet" href="../templates/subSilver/subSilver.css" type="text/css">
<style type="text/css">
</style>
</head>
<body bgcolor="#E5E5E5" text="#000000" link="#006699" vlink="#5584AA">
<script language="JavaScript">
<!--
function submitForm()
{
document.makeforum.submit();
}
//-->
</script>
<form name="makeforum" action='<?php echo $PHP_SELF; ?>?mode=install' method='POST'>
<table width="100%" border="0" cellspacing="0" cellpadding="10" align="center">
<tr>
<td class="bodyline" width="100%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="../templates/subSilver/images/logo_phpBB.gif" border="0" alt="Forum Home" vspace="1" /></td>
<td align="center" width="100%" valign="middle"><span class="maintitle">Welcome to phpBB 2 Installation</span></td>
</tr>
</table></td>
</tr>
<tr>
<td><br /><br /></td>
</tr>
<tr>
<td colspan="2"><table width="90%" border="0" align="center" cellspacing="0" cellpadding="0">
<tr>
<td><span class="gen">Thank you for choosing phpBB 2. In order to complete this install please fill out the details requested below.</span></td>
</tr>
</table></td>
</tr>
<tr>
<td><br /><br /></td>
</tr>
<tr>
<td width="100%" valign="middle">
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline"><form action="install.php" name="install" method="post">
<tr>
<th colspan="2">Basic Configuration</th>
</tr>
<tr>
<td class="row1" align="right" width="35%"><span class="gen"><b>Access name:</b></span></td>
<td width="65%" valign="middle" class="row2"><font color="red" size="4"><?php echo $domain; ?><input name="access_name" type="text" id="access_name" value="<? echo $access_name; ?>" /><br />
<?
if($access_name==true)
{
print "<font color='green'><b>The forum is <i>Available</i>, register it today!</b></font>";
}
?></font></td>
</tr>
<tr>
<th colspan="2">Admin Configuration</th>
</tr>
<tr>
<td class="row1" align="right"><span class="gen"><b>Username</b>:</span></td>
<td class="row2"><input name="admin_name" type="text" id="admin_name" value="" /></td>
</tr>
<tr>
<td class="row1" align="right"><span class="gen"><b>Password</b>:</span></td>
<td class="row2"><input name="pass1" type="password" id="pass1" value="" /></td>
</tr>
<tr>
<td class="row1" align="right"><span class="gen"><b>Confirm Password</b>:</span></td>
<td class="row2"><input name="pass2" type="password" id="pass2" value="" /></td>
</tr>
<tr>
<td class="row1" align="right"><span class="gen"><b>Email Address</b>:</span></td>
<td valign="middle" class="row2"><input name="admin_email" type="text" id="admin_email" value="" /></td>
</tr>
<tr>
<td class="catBottom" align="center" colspan="2"><input onClick="JavaScript: Submit.disabled=true; Submit.value='Please wait...'; submitForm(); return true" type="submit" name="Submit" value="Create My Forum"></td>
</tr>
</table></td>
</tr>
</table>
<?php
echo "<br /><div align=center><font size=1 face='Arial, Helvetica, sans-serif'>Powered by <a href='http://www.multiforums.org' target=_blank>Multi-Forums</a> Lite Version " . $board_config['mf_version'] . "</div>";
?>
</td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html> Användare som besöker denna kategori: 2 och 0 gäster