Przedszkolak
Postów: 3
Data rejestracji: 10.08.2006 21:22
|
Dziś zainstalowałem sobie dodatek integrujący phpBB z PHP Fusion. Od strony fusion jest oczywiście wszystko ok, ale phpBB robi problemy. Ponieważ ja posiadam phpBB by przemo, a mod jest pod wersję phpBB. Czy mogę prosić o napisanie mi tego kodu pod phpBB by przemo? Oto kod phpBB.. A może coś innego jest przyczyną?
<?php
define("IN_PHPBB", true);
$phpbb_root_path = "./";
include($phpbb_root_path . "extension.inc");
include($phpbb_root_path . "common.".$phpEx);
include($phpbb_root_path . "includes/bbcode.".$phpEx);
// Verification Key
define("SECURE_REGKEY", "{Tutaj kod autoryzacyjny}");
if (!isset($_GET['userdata'])){
if(isset($_GET['login']) && isset($_GET['pass']) && isset($_GET['joined']) && ($_GET['verification'] == md5(SECURE_REGKEY))){
$login = $_GET['login'];
$pass = $_GET['pass'];
$joined = $_GET['joined'];
$sql = "SELECT * FROM phpbb_users WHERE username='$login'";
if (!($result = $db->sql_query($sql))) message('Could not obtain # information', 'error');
if (mysql_num_rows($result) == 0) echo "USER_FREE";
else {
$sql = "SELECT * FROM phpbb_users WHERE username='$login' AND (user_password='$pass' OR user_regdate='$joined')";
if (!($result = $db->sql_query($sql))) message('Could not obtain # information', 'error');
if (mysql_num_rows($result) == 1) echo "USER_REGISTERED";
else echo "OTHER_USER";
}
} else echo "VALUES_ERROR";
} else {
$userdata = unserialize(stripslashes(urldecode($_GET['userdata'])));
if (md5(SECURE_REGKEY.$userdata['u']) == $userdata['k']) {
$sql = "SELECT * FROM phpbb_users WHERE username='".$userdata['u']."'";
if (!($result = $db->sql_query($sql))) message('Could not obtain # information', 'error');
if (mysql_num_rows($result) != 0) message('User exists', 'error');
$sql = "SELECT MAX(user_id) AS total FROM ".USERS_TABLE;
if (!($result = $db->sql_query($sql))) message('Could not obtain next user_id information', 'error');
if (!($row = $db->sql_fetchrow($result))) message('Could not obtain next user_id information', 'error');
$user_id = $row['total'] + 1;
$sql = "SELECT * FROM ".CONFIG_TABLE;
if (!($result = $db->sql_query($sql))) message('Could not obtain default configuration information', 'error');
while($row = $db->sql_fetchrow($result)) {
if($row['config_name'] == 'default_style') $style = $row['config_value'];
if($row['config_name'] == 'default_dateformat') $dateformat = $row['config_value'];
if($row['config_name'] == 'board_timezone') $timezone = $row['config_value'];
if($row['config_name'] == 'default_lang') $lang = $row['config_value'];
}
$sql = "INSERT INTO phpbb_users (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey) VALUES ($user_id, '".$userdata['u']."', '".$userdata['r']."', '".$userdata['p']."', '".$userdata['e']."', '".$userdata['i']."', '".$userdata['w']."', '', '".$userdata['l']."', '', '".$userdata['s']."', '".make_bbcode_uid()."', '', '', ".($userdata['h'] == 0 ? 1 : 0).", '".$userdata['a']."', '', '', 1, 1, 0, 1, 1, 0, 1, 1, $timezone, '$dateformat', '$lang', $style, 0, 1, 1, '')";
if (!($result = $db->sql_query($sql))) message('Could not insert data into users table', 'error');
$sql = "INSERT INTO ".GROUPS_TABLE." (group_name, group_description, group_single_user, group_moderator) VALUES ('', 'Personal User', 1, 0)";
if (!($result = $db->sql_query($sql))) message('Could not insert data into groups table', 'error');
$group_id = $db->sql_nextid();
$sql = "INSERT INTO ".USER_GROUP_TABLE." (user_id, group_id, user_pending) VALUES ($user_id, $group_id, 0)";
if(!($result = $db->sql_query($sql))) message('Could not insert data into user_group table', 'error');
else message('Registration complete');
} else message('Bad key', 'error');
}
function message($msg, $type="") {
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<html dir=\"ltr\">
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-2\">
<meta http-equiv=\"Content-Style-Type\" content=\"text/css\">
<meta http-equiv='refresh' content='3; url=".($type == "error" ? "./profile.php?mode=register" : "./index.php")."'>
<title>PHP-Fusion >> phpBB Reg</title>
<style type=\"text/css\">
<!--
/*
The original subSilver Theme for phpBB version 2+
Created by subBlue design
http://www.subBlue.com
NOTE: These CSS definitions are stored within the main page body so that you can use the phpBB2
theme administration centre. When you have finalised your style you could cut the final CSS code
and place it in an external file, deleting this section to save bandwidth.
*/
/* General page style. The scroll bar colours only visible in IE5.5+ */
body {
background-color: #E5E5E5;
scrollbar-face-color: #DEE3E7;
scrollbar-highlight-color: #FFFFFF;
scrollbar-shadow-color: #DEE3E7;
scrollbar-3dlight-color: #D1D7DC;
scrollbar-arrow-color: #006699;
scrollbar-track-color: #EFEFEF;
scrollbar-darkshadow-color: #98AAB1;
}
font,th,td,p { font-family: Verdana, Arial, Helvetica, sans-serif }
a:link,a:active,a:visited { color : #006699; }
a:hover { text-decoration: underline; color : #DD6900; }
hr { height: 0px; border: solid #D1D7DC 0px; border-top-width: 1px;}
.forumline { background-color: #FFFFFF; border: 2px #006699 solid; }
td.row1 { background-color: #EFEFEF; }
th {
color: #FFA34F; font-size: 11px; font-weight : bold;
background-color: #006699; height: 25px;
background-image: url(templates/subSilver/images/cellpic3.gif);
}
th.thHead {
font-weight: bold; border: #FFFFFF; border-style: solid; height: 28px;
}
th.thHead { font-size: 12px; border-width: 1px 1px 0px 1px; }
.gen { font-size : 12px; }
.gen { color : #000000; }
a.gen { color: #006699; text-decoration: none; }
a.gen:hover { color: #DD6900; text-decoration: underline; }
.copyright { font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #444444; letter-spacing: -1px;}
a.copyright { color: #444444; text-decoration: none;}
a.copyright:hover { color: #000000; text-decoration: underline;}
-->
</style>
</head>
<body bgcolor=\"#E5E5E5\" text=\"#000000\" link=\"#006699\" vlink=\"#5493B4\">\n\n
<table class=\"forumline\" width=\"100%\" cellspacing=\"1\" cellpadding=\"4\" border=\"0\">
<tr><th class=\"thHead\" height=\"25\"><b>".($type == 'error' ? 'Error' : 'Message')."</b></th></tr>
<tr><td class=\"row1\"><table width=\"100%\" cellspacing=\"0\" cellpadding=\"1\" border=\"0\">
<tr><td> </td></tr>
<tr><td align=\"center\"><span class=\"gen\">$msg</span></td></tr>
<tr><td> </td></tr>
</table></td></tr>
</table>
<br clear=\"all\" />
<div align=\"center\"><span class=\"copyright\"><br /><br />
Powered by <a href=\"http://www.phpbb.com/\" target=\"_blank\" class=\"copyright\">phpBB</a> © 2001, 2005 phpBB Group<br /></span></div>
</body>
</html>\n";
exit;
}
?>
|