+ Changed from MySQL to MySQLi native driver.

+ Added 2 new functions in DataBase class: fetch($query) and num_rows($query)

git-svn-id: https://svn.pioder.pl/uf-svn/uF@20 72ec579a-5ced-4fa4-82f3-afba5d98df2f
This commit is contained in:
pioder
2009-05-03 10:50:00 +00:00
parent 6cc36dc266
commit b1f37b6ea5
43 changed files with 296 additions and 193 deletions

View File

@@ -18,7 +18,7 @@ class Secure
global $lng;
$sql = "SELECT * FROM ".FORUMS_TABLE." WHERE f_id='$fid'";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain forum information.');
$result = mysql_fetch_array($query);
$result = DataBase::fetch($query);
$result = $result['f_id'];
if ($result=='')
{
@@ -32,7 +32,7 @@ class Secure
{
$sql = "SELECT * FROM ".CENSORLIST_TABLE.";";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain censorlist information.');
while($word = mysql_fetch_array($query))
while($word = DataBase::fetch($query))
{
$text = str_replace($word['word'],'[censored]', $text);
}
@@ -69,7 +69,7 @@ class Secure
global $lng;
$sql = "SELECT * FROM ".PM_INBOX_TABLE." WHERE m_id='$mid'";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information.');
$result = mysql_fetch_array($query);
$result = DataBase::fetch($query);
$result = $result['m_id'];
if ($result=='')
{
@@ -81,7 +81,7 @@ class Secure
global $lng;
$sql = "SELECT * FROM ".PM_SENTBOX_TABLE." WHERE m_id='$mid'";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information.');
$result = mysql_fetch_array($query);
$result = DataBase::fetch($query);
$result = $result['u_n_id'];
if ($result!=$_SESSION['uid'])
{
@@ -92,7 +92,7 @@ class Secure
{
global $lng;
$sql = "SELECT * FROM ".PM_INBOX_TABLE." WHERE m_id='$mid'";
$result = mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain user information.'));
$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain user information.'));
$result = $result['u_id'];
if ($result!=$_SESSION['uid'])
{
@@ -103,7 +103,7 @@ class Secure
{
global $lng;
$sql = "SELECT * FROM ".PM_SENTBOX_TABLE." WHERE m_id='$mid'";
$result = mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain user information.'));
$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain user information.'));
$result = $result['m_id'];
if ($result=='')
{
@@ -115,7 +115,7 @@ class Secure
global $lng;
$sql = "SELECT * FROM `".TOPICS_TABLE."` WHERE `t_id`='$tid'";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain topic information.');
$result = mysql_fetch_array($query);
$result = DataBase::fetch($query);
$result = $result['t_id'];
if ($result=='')
{
@@ -127,7 +127,7 @@ class Secure
global $lng;
$sql = "SELECT * FROM ".POSTS_TABLE." WHERE p_id='$pid'";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain topic information.');
$result = mysql_fetch_array($query);
$result = DataBase::fetch($query);
$result = $result['p_id'];
if ($result=='')
{
@@ -138,7 +138,7 @@ class Secure
{
global $lng;
$sql = "SELECT * FROM ".USERS_TABLE." WHERE u_id='$uid'";
$result = mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain user information.'));
$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain user information.'));
$result = $result['u_id'];
if (($result=='') or ($result=='-1'))
{
@@ -149,7 +149,7 @@ class Secure
{
global $lng;
$sql = "SELECT `g_id` FROM `".GROUPS_TABLE."` WHERE g_id='$gid'";
$result = mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain group information.'));
$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain group information.'));
$result = $result['g_id'];
if ($result=='')
{
@@ -170,10 +170,10 @@ class Secure
{
global $lng;
$sql = "SELECT `f_id`,`lock` FROM `".TOPICS_TABLE."` WHERE `t_id`='$tid'";
$result = mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain topic information'));
$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain topic information'));
$fid = $result['f_id'];
$sql2 = "SELECT `lock` FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'";
$result2 = mysql_fetch_array(DataBase::sql_query($sql2,'GENERAL','Could not obtain forum information'));
$result2 = DataBase::fetch(DataBase::sql_query($sql2,'GENERAL','Could not obtain forum information'));
if (($result['lock']=='1') or ($result2['lock']=='1'))
{
message_forum($lng['no_posting_topic_locked'],'topic.php?t='.$tid);
@@ -183,7 +183,7 @@ class Secure
{
global $lng;
$sql = "SELECT `lock` FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'";
$result = mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain forum information'));
$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain forum information'));
if ($result['lock']=='1')
{
message_forum($lng['no_posting_forum_locked'],'forum.php?f='.$fid);