Ignore:
Timestamp:
04/04/10 16:28:26 (10 years ago)
Author:
Eric
Message:

[Register_FluxBB]

  • Bug 1577 fixed : Compatibility with other database systems than MySql like PostgreSql or Sqlite. Using Piwigo's pwg_db_### functions.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Register_FluxBB/trunk/include/functions.inc.php

    r5606 r5635  
    1414;"; 
    1515   
    16   $data = mysql_fetch_array(pwg_query($query)); 
     16  $data = pwg_db_fetch_row(pwg_query($query)); 
    1717   
    1818  if (!empty($data)) 
     
    6565;"; 
    6666 
    67   $o_default_user_group = mysql_fetch_array(pwg_query($query)); 
     67  $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query)); 
    6868   
    6969  $query = " 
     
    7373;"; 
    7474 
    75   $o_server_timezone = mysql_fetch_array(pwg_query($query)); 
     75  $o_server_timezone = pwg_db_fetch_assoc(pwg_query($query)); 
    7676   
    7777  $query = " 
     
    8181;"; 
    8282 
    83   $o_default_lang = mysql_fetch_array(pwg_query($query)); 
     83  $o_default_lang = pwg_db_fetch_assoc(pwg_query($query)); 
    8484   
    8585  $query = " 
     
    8989;"; 
    9090 
    91   $o_default_style = mysql_fetch_array(pwg_query($query)); 
     91  $o_default_style = pwg_db_fetch_assoc(pwg_query($query)); 
    9292   
    9393  $query = ' 
     
    105105  ) 
    106106VALUES( 
    107   '".mysql_real_escape_string($login)."', 
     107  '".pwg_db_real_escape_string($login)."', 
    108108  ". ( isset($o_default_user_group['conf_value']) ? "'".$o_default_user_group['conf_value']."'" : '' ) .", 
    109109  '".$password."',  
     
    120120  $result = pwg_query($query); 
    121121 
    122   $bb_id = mysql_insert_id(); 
     122  $bb_id = pwg_db_insert_id(); 
    123123   
    124124  FluxBB_Linkuser($pwg_id, $bb_id); 
     
    135135;"; 
    136136 
    137   $data = mysql_fetch_array(pwg_query($query)); 
     137  $data = pwg_db_fetch_assoc(pwg_query($query)); 
    138138   
    139139  if (!empty($data)) 
     
    157157;"; 
    158158 
    159   $data0 = mysql_fetch_array(pwg_query($query0)); 
     159  $data0 = pwg_db_fetch_assoc(pwg_query($query0)); 
    160160 
    161161  // Si égale à VRAI, suppression de tous les posts et topics 
     
    173173    $subquery = " 
    174174DELETE FROM ".FluxBB_TOPICS_TABLE." 
    175 WHERE BINARY poster = BINARY '".mysql_real_escape_string($data0['username'])."' 
     175WHERE BINARY poster = BINARY '".pwg_db_real_escape_string($data0['username'])."' 
    176176;"; 
    177177 
     
    210210;"; 
    211211 
    212   $row = mysql_fetch_array(pwg_query($query)); 
     212  $row = pwg_db_fetch_assoc(pwg_query($query)); 
    213213 
    214214  if (!empty($row)) 
     
    216216    $query = " 
    217217UPDATE ".FluxBB_USERS_TABLE." 
    218 SET username = '".mysql_real_escape_string($username)."', email = '".$adresse_mail."', password = '".$password."'  
     218SET username = '".pwg_db_real_escape_string($username)."', email = '".$adresse_mail."', password = '".$password."'  
    219219WHERE id = ".$row['FluxBB_id']." 
    220220;"; 
     
    229229SELECT id as FluxBB_id 
    230230FROM ".FluxBB_USERS_TABLE." 
    231 WHERE BINARY username = BINARY '".mysql_real_escape_string($username)."' 
    232 ;"; 
    233  
    234     $row = mysql_fetch_array(pwg_query($query)); 
     231WHERE BINARY username = BINARY '".pwg_db_real_escape_string($username)."' 
     232;"; 
     233 
     234    $row = pwg_db_fetch_assoc(pwg_query($query)); 
    235235   
    236236    if (!empty($row)) 
     
    238238      $query = " 
    239239UPDATE ".FluxBB_USERS_TABLE." 
    240 SET username = '".mysql_real_escape_string($username)."', email = '".$adresse_mail."', password = '".$password."'  
     240SET username = '".pwg_db_real_escape_string($username)."', email = '".$adresse_mail."', password = '".$password."'  
    241241WHERE id = ".$row['FluxBB_id']." 
    242242;"; 
Note: See TracChangeset for help on using the changeset viewer.