فتحت ملف MySBB
و بنيت عليه نظام SMF لكنه لم ينجح
كود: تحديد الكل
<?php
if (!defined('IN_COMMON'))
{
exit('no directly opening : ' . __file__);
}
function kleeja_auth_login ($name, $pass)
{
global $script_path, $lang, $script_encoding, $script_srv, $script_db, $script_user, $script_pass, $script_prefix;
if(isset($script_path)) {
if($script_path[strlen($script_path)] == '/')
{
$script_path = substr($script_path, 0, strlen($script_path));
}
$script_path = ($script_path[0] == '/' ? '..' : '../') . $script_path;
if(file_exists($script_path . '/Settings.php'))
{
require ($script_path . '/Settings.php');
$forum_srv = $db_server;
$forum_db = $db_name;
$forum_user = $db_user;
$forum_pass = $db_passwd;
$forum_prefix = $db_prefix;
}
else
{
big_error('Forum path is not correct', sprintf($lang['SCRIPT_AUTH_PATH_WRONG'], 'MySmartBB'));
}
}
else
{
$forum_srv = $script_srv;
$forum_db = $script_db;
$forum_user = $script_user;
$forum_pass = $script_pass;
$forum_prefix = $script_prefix;
}
if(empty($forum_srv) || empty($forum_user) || empty($forum_db))
{
return;
}
$SQLSM = new SSQL($forum_srv, $forum_user, $forum_pass, $forum_db);
$charset_db = @mysql_client_encoding($SQLSM->connect_id);
unset($forum_pass);
if(!function_exists('iconv') && !eregi('utf',strtolower($script_encoding)))
{
big_error('No support for ICONV', 'You must enable the ICONV library to integrate kleeja with your forum. You can solve your problem by changing your forum db charset to UTF8.');
}
$query = array('SELECT' => '*',
'FROM' => "`{$forum_prefix}members`",
'WHERE' => "member_name='" . $SQLSM->real_escape($name) . "' AND passwd ='" . sha1($pass) . "'"
);
($hook = kleeja_run_hook('qr_select_usrdata_smf_usr_class')) ? eval($hook) : null;
$result = $SQLSM->build($query);
if ($SQLSM->num_rows($result) != 0)
{
while($row=$SQLSM->fetch_array($result))
{
$_SESSION['USER_ID'] = $row['id_member '];
$_SESSION['USER_NAME'] = (eregi('utf',strtolower($script_encoding))) ? $row['member_name '] : iconv(strtoupper($script_encoding),"UTF-8//IGNORE",$row['member_name ']);
$_SESSION['USER_MAIL'] = $row['email_address '];
$_SESSION['USER_ADMIN'] = ($row['id_group '] == 1) ? 1 : 0;
$_SESSION['USER_SESS'] = session_id();
($hook = kleeja_run_hook('qr_while_usrdata_smf_usr_class')) ? eval($hook) : null;
}
$SQLSM->freeresult($result);
unset($pass);
$SQLSM->close();
return true;
}
else
{
$SQLSM->close();
return false;
}
}
function kleeja_auth_username ($user_id)
{
global $script_path, $lang, $script_encoding, $script_srv, $script_db, $script_user, $script_pass, $script_prefix;
if(isset($script_path)) {
if($script_path[strlen($script_path)] == '/')
{
$script_path = substr($script_path, 0, strlen($script_path));
}
$script_path = ($script_path[0] == '/' ? '..' : '../') . $script_path;
if(file_exists($script_path . '/Settings.php'))
{
require ($script_path . '/Settings.php');
$forum_srv = $db_server;
$forum_db = $db_name;
$forum_user = $db_user;
$forum_pass = $db_passwd;
$forum_prefix = $db_prefix;
}
else
{
big_error('Forum path is not correct', sprintf($lang['SCRIPT_AUTH_PATH_WRONG'], 'MySmartBB'));
}
}
else
{
$forum_srv = $script_srv;
$forum_db = $script_db;
$forum_user = $script_user;
$forum_pass = $script_pass;
$forum_prefix = $script_prefix;
}
if(empty($forum_srv) || empty($forum_user) || empty($forum_db))
{
return;
}
$SQLSM = new SSQL($forum_srv, $forum_user, $forum_pass, $forum_db, TRUE);
$charset_db = @mysql_client_encoding($SQLSM->connect_id);
unset($forum_pass);
if(!function_exists('iconv') && !eregi('utf',strtolower($script_encoding)))
{
big_error('No support for ICONV', 'You must enable the ICONV library to integrate kleeja with your forum. You can solve your problem by changing your forum db charset to UTF8.');
}
$query_name = array(
'SELECT' => 'member_name',
'FROM' => "`{$forum_prefix}members`",
'WHERE' => "id_member ='" . intval($user_id) . "'"
);
($hook = kleeja_run_hook('qr_select_usrname_ms_usr_class')) ? eval($hook) : null;
$result_name = $SQLVB->build($query_name);
if ($SQLSM->num_rows($result_name) > 0)
{
while($row = $SQLSM->fetch_array($result_name))
{
$returnname = (eregi('utf',strtolower($script_encoding))) ? $row['username'] : iconv(strtoupper($script_encoding),"UTF-8//IGNORE",$row['username']);
}#whil1
$SQLSM->freeresult($result_name);
$SQLSM->close();
return $returnname;
}
else
{
$SQLSM->close();
return false;
}
}
?>
و هل يوجد مكان لمبرمج معكم ؟
دمتم في حفظ الرحمن