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.
Location:
extensions/Register_FluxBB/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/Register_FluxBB/trunk/admin/admin.php

    r5606 r5635  
    8282  $result = pwg_query($query); 
    8383   
    84   while($row = mysql_fetch_array($result)) 
     84  while($row = pwg_db_fetch_assoc($result)) 
    8585    $msg_error_PWG_Dup .= '<br>'.l10n('Error_PWG_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']); 
    8686 
     
    100100  $result = pwg_query($query); 
    101101   
    102   while($row = mysql_fetch_array($result)) 
     102  while($row = pwg_db_fetch_assoc($result)) 
    103103  { 
    104104    $msg_error_FluxBB_Dup .= '<br>'.l10n('Error_FluxBB_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']); 
     
    111111    $subresult = pwg_query($subquery); 
    112112   
    113     while($subrow = mysql_fetch_array($subresult)) 
     113    while($subrow = pwg_db_fetch_assoc($subresult)) 
    114114    { 
    115115      $msg_error_FluxBB_Dup .= '<br>id:'.$subrow['id'].'='.stripslashes($subrow['username']).' ('.$subrow['email'].')'; 
     
    157157  $result = pwg_query($query); 
    158158   
    159   while($row = mysql_fetch_array($result)) 
     159  while($row = pwg_db_fetch_assoc($result)) 
    160160  { 
    161161    $msg_error_Link_Break .= '<br>'.l10n('Error_Link_Break').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'; 
     
    196196  $result = pwg_query($query); 
    197197   
    198   while($row = mysql_fetch_array($result)) 
     198  while($row = pwg_db_fetch_assoc($result)) 
    199199  { 
    200200    $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Del').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'.' -- '.stripslashes($row['bb_user']).' ('.$row['bb_mail'].')'; 
     
    245245;"; 
    246246 
    247   $Compteur = mysql_fetch_array(pwg_query($query)); 
     247  $Compteur = pwg_db_fetch_assoc(pwg_query($query)); 
    248248 
    249249  if (!empty($Compteur) and $Compteur['nbr_dead'] > 0) 
     
    278278  $result = pwg_query($query); 
    279279   
    280   while($row = mysql_fetch_array($result)) 
     280  while($row = pwg_db_fetch_assoc($result)) 
    281281  { 
    282282    $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Dup').$row['nbr_dup'].' = '.stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).')'; 
     
    318318  $result = pwg_query($query); 
    319319   
    320   while($row = mysql_fetch_array($result)) 
     320  while($row = pwg_db_fetch_assoc($result)) 
    321321  { 
    322322    if ( ($row['pwg_pwd'] != $row['bb_pwd']) or ($row['pwg_eml'] != $row['bb_eml']) ) 
     
    373373  $result = pwg_query($query); 
    374374 
    375   while($row = mysql_fetch_array($result)) 
     375  while($row = pwg_db_fetch_assoc($result)) 
    376376  { 
    377377    $msg_error_PWG2FluxBB .= '<br>'.l10n('Error_PWG2FluxBB').stripslashes($row['username']).' ('.$row['mail_address'].')'; 
     
    415415  $result = pwg_query($query); 
    416416 
    417   while($row = mysql_fetch_array($result)) 
     417  while($row = pwg_db_fetch_assoc($result)) 
    418418  { 
    419419    $msg_error_FluxBB2PWG .= '<br>'.l10n('Error_FluxBB2PWG').stripslashes($row['username']).' ('.$row['email'].')'; 
     
    513513SELECT id AS id_pwg, username, password, mail_address  
    514514FROM ".USERS_TABLE." 
    515 WHERE BINARY username = BINARY '".mysql_real_escape_string($_GET['username'])."' 
     515WHERE BINARY username = BINARY '".pwg_db_real_escape_string($_GET['username'])."' 
    516516LIMIT 1 
    517517;"; 
    518518 
    519   $data = mysql_fetch_array(pwg_query($query)); 
     519  $data = pwg_db_fetch_assoc(pwg_query($query)); 
    520520   
    521521  if (!empty($data)) 
     
    531531SELECT id, username, password, mail_address  
    532532FROM ".USERS_TABLE." 
    533 WHERE BINARY username = BINARY '".mysql_real_escape_string($_GET['username'])."' 
     533WHERE BINARY username = BINARY '".pwg_db_real_escape_string($_GET['username'])."' 
    534534LIMIT 1 
    535535;"; 
    536536 
    537   $data = mysql_fetch_array(pwg_query($query)); 
     537  $data = pwg_db_fetch_assoc(pwg_query($query)); 
    538538   
    539539  if (!empty($data)) 
     
    633633    $result = pwg_query($query); 
    634634   
    635     while ($row = mysql_fetch_array($result)) 
     635    while ($row = pwg_db_fetch_assoc($result)) 
    636636    { 
    637637      if((stripslashes($row['username']) != stripslashes($conf_Register_FluxBB[2])) and (stripslashes($row['username']) != stripslashes($conf_Register_FluxBB[1]))) 
     
    658658    $msg_Mig_Add_AllUsers = ''; 
    659659   
    660     while ($row = mysql_fetch_array($result)) 
     660    while ($row = pwg_db_fetch_assoc($result)) 
    661661    { 
    662662      if((stripslashes($row['username']) != 'guest') and (stripslashes($row['username']) != stripslashes($conf_Register_FluxBB[1]))) 
     
    677677;"; 
    678678 
    679     $row = mysql_fetch_array(pwg_query($query)); 
     679    $row = pwg_db_fetch_assoc(pwg_query($query)); 
    680680 
    681681    if (!empty($row)) 
     
    736736    $result = pwg_query($query); 
    737737   
    738     while($row = mysql_fetch_array($result)) 
     738    while($row = pwg_db_fetch_assoc($result)) 
    739739      $msg_error_PWG_Dup .= '<br>'.l10n('Error_PWG_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']); 
    740740 
     
    752752    $result = pwg_query($query); 
    753753   
    754     while($row = mysql_fetch_array($result)) 
     754    while($row = pwg_db_fetch_assoc($result)) 
    755755    { 
    756756      $msg_error_FluxBB_Dup .= '<br>'.l10n('Error_FluxBB_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']); 
     
    764764      $subresult = pwg_query($subquery); 
    765765   
    766       while($subrow = mysql_fetch_array($subresult)) 
     766      while($subrow = pwg_db_fetch_assoc($subresult)) 
    767767      { 
    768768        $msg_error_FluxBB_Dup .= '<br>id:'.$subrow['id'].'='.stripslashes($subrow['username']).' ('.$subrow['email'].')'; 
     
    809809      $result = pwg_query($query); 
    810810     
    811       while($row = mysql_fetch_array($result)) 
     811      while($row = pwg_db_fetch_assoc($result)) 
    812812      { 
    813813        $msg_error_Link_Break .= '<br>'.l10n('New_Link').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'; 
     
    832832      $result = pwg_query($query); 
    833833     
    834       while($row = mysql_fetch_array($result)) 
     834      while($row = pwg_db_fetch_assoc($result)) 
    835835      { 
    836836        $msg_error_Link_Bad .= '<br>'.l10n('Link_Del').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'.' -- '.stripslashes($row['bb_user']).' ('.$row['bb_mail'].')'; 
     
    859859;"; 
    860860 
    861       $Compteur = mysql_fetch_array(pwg_query($query)); 
     861      $Compteur = pwg_db_fetch_assoc(pwg_query($query)); 
    862862     
    863863      if ( !empty($Compteur) and $Compteur['nbr_dead'] > 0) 
     
    892892      $result = pwg_query($query); 
    893893     
    894       while($row = mysql_fetch_array($result)) 
     894      while($row = pwg_db_fetch_assoc($result)) 
    895895      { 
    896896        $msg_error_Link_Bad .= '<br>'.l10n('Link_Dup').$row['nbr_dup'].' = '.stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).')'; 
     
    916916      $result = pwg_query($query); 
    917917     
    918       while($row = mysql_fetch_array($result)) 
     918      while($row = pwg_db_fetch_assoc($result)) 
    919919      { 
    920920        if ( ($row['pwg_pwd'] != $row['bb_pwd']) or ($row['pwg_eml'] != $row['bb_eml']) ) 
     
    928928;"; 
    929929 
    930           $data = mysql_fetch_array(pwg_query($query)); 
     930          $data = pwg_db_fetch_assoc(pwg_query($query)); 
    931931         
    932932          if (!empty($data)) 
     
    955955      $result = pwg_query($query); 
    956956   
    957       while($row = mysql_fetch_array($result)) 
     957      while($row = pwg_db_fetch_assoc($result)) 
    958958      { 
    959959        $msg_error_PWG2FluxBB .= '<br>'.l10n('Add_User').stripslashes($row['username']).' ('.$row['mail_address'].')'; 
     
    966966;"; 
    967967 
    968         $data = mysql_fetch_array(pwg_query($query)); 
     968        $data = pwg_db_fetch_assoc(pwg_query($query)); 
    969969       
    970970        if (!empty($data)) 
     
    992992      $result = pwg_query($query); 
    993993   
    994       while($row = mysql_fetch_array($result)) 
     994      while($row = pwg_db_fetch_assoc($result)) 
    995995      { 
    996996        $msg_error_FluxBB2PWG .= '<br>'.l10n('Error_FluxBB2PWG').stripslashes($row['username']).' ('.$row['email'].')'; 
  • 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;"; 
  • extensions/Register_FluxBB/trunk/main.inc.php

    r5606 r5635  
    165165;'; 
    166166 
    167           list($current_password) = mysql_fetch_row(pwg_query($query)); 
     167          list($current_password) = pwg_db_fetch_row(pwg_query($query)); 
    168168       
    169169          if ($conf['pass_convert']($_POST['password']) != $current_password) 
     
    184184;'; 
    185185 
    186         list($username) = mysql_fetch_row(pwg_query($query)); 
     186        list($username) = pwg_db_fetch_row(pwg_query($query)); 
    187187 
    188188        FluxBB_Updateuser($user['id'], stripslashes($username), sha1($_POST['use_new_pwd']), $_POST['mail_address']); 
Note: See TracChangeset for help on using the changeset viewer.