Database integration with phpBB3

Please post here if you have problems in using Wing FTP Server.

Re: Database integration with phpBB3

Postby FTP » Mon Sep 13, 2010 12:07 pm

Could you chat with me using livechat on our website? I am Luke
FTP
Site Admin
 
posts 1243
 
joined Tue Sep 29, 2009 6:09 am

Re: Database integration with phpBB3

Postby chaosnature » Mon Sep 13, 2010 1:23 pm

when i insert that code you gave me
Code: Select all
<?php

//Wing FTP Server MOD start
$ftp_dbname = "chaosnat_phpbb3";                //Wing FTP Server's mysql database name, assume in the same server.
$ftp_domain_name = "default";                 //ftp's domain name.
$ftp_dirpath = "D:/ftp_data/".$data['username'];//user's directory path
$ftp_upload_limit = TRUE;                     //whether to limit the quota size
$ftp_maxuoload_size = 1024*1024*100;          //if $ftp_upload_limit = TRUE, this value means the max quota bytes.
$db->sql_query("USE ".$ftp_dbname.";");

$db->sql_query("INSERT INTO `wftp_mysqltable_user` VALUES ('".$ftp_domain_name."','".$data['username']."',1,1,'".md5($data['new_password'])."',63,0,NULL,0,0,0,0,0,0,0,1,1,1,0,1,1,0,0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,0,0,0,'0',NULL,0,0,0,".intval($ftp_upload_limit).",0,".$ftp_maxuoload_size.",0,0,0,'');");

$mkdir_result = @mkdir($ftp_dirpath);
if($mkdir_result == TRUE)
   $db->sql_query("INSERT INTO `wftp_mysqltable_dir` VALUES ('".$ftp_domain_name."','".$data['username']."','".$ftp_dirpath."','/',1,1,1,1,1,1,1,1,1,1,1,1);");

$db->sql_query("USE ".$db->dbname.";");
//Wing FTP Server end

?>

i get
Fatal error: Call to a member function sql_query() on a non-object in C:\xampp\htdocs\10x-PHP\phpBB3\sql\sqltest.php on line 9
chaosnature
 
posts 16
 
joined Thu Sep 09, 2010 1:32 am

Re: Database integration with phpBB3

Postby FTP » Mon Sep 13, 2010 1:35 pm

Oh, no, you mixed testing code and real code... you just need to look for, in the source file "includes/ucp/ucp_register.php", the code:

$user_id = user_add($user_row, $cp_data);

then add the below code directly after it. (please change the variables $ftp_domain_name and $ftp_domain_name into yourself)


Code: Select all
//Wing FTP Server MOD start
$ftp_dbname = "chaosnat_phpbb3";                //Wing FTP Server's mysql database name, assume in the same server.
$ftp_domain_name = "default";                 //ftp's domain name.
$ftp_dirpath = "D:/ftp_data/".$data['username'];//user's directory path
$ftp_upload_limit = FALSE;                     //whether to limit the quota size
$ftp_maxuoload_size = 0;          //if $ftp_upload_limit = TRUE, this value means the max quota bytes.
$db->sql_query("USE ".$ftp_dbname.";");

$db->sql_query("INSERT INTO `wftp_mysqltable_user` VALUES ('".$ftp_domain_name."','".$data['username']."',1,1,'".md5($data['new_password'])."',63,0,NULL,0,0,0,0,0,0,0,1,1,1,0,1,1,0,0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,0,0,0,'0',NULL,0,0,0,".intval($ftp_upload_limit).",0,".$ftp_maxuoload_size.",0,0,0,'');");

$mkdir_result = @mkdir($ftp_dirpath);
if($mkdir_result == TRUE)
   $db->sql_query("INSERT INTO `wftp_mysqltable_dir` VALUES ('".$ftp_domain_name."','".$data['username']."','".$ftp_dirpath."','/',1,1,1,1,1,1,1,1,1,1,1,1);");

$db->sql_query("USE ".$db->dbname.";");
//Wing FTP Server end
FTP
Site Admin
 
posts 1243
 
joined Tue Sep 29, 2009 6:09 am

Re: Database integration with phpBB3

Postby chaosnature » Mon Sep 13, 2010 1:43 pm

this is what i inserted into my php script:

Code: Select all
//Wing FTP Server MOD start
                                                                                                                                                                                                                                       //Wing FTP Server MOD start
$ftp_dbname = "chaosnat_phpbb3";                //Wing FTP Server's mysql database name, assume in the same server.
$ftp_domain_name = "default";                 //ftp's domain name.
$ftp_dirpath = "D:/ftp_data/".$data['username'];//user's directory path
$ftp_upload_limit = TRUE;                     //whether to limit the quota size
$ftp_maxuoload_size = 1024*1024*100;          //if $ftp_upload_limit = TRUE, this value means the max quota bytes.
$db->sql_query("USE ".$ftp_dbname.";");

$db->sql_query("INSERT INTO `wftp_mysqltable_user` VALUES ('".$localhost."','".$data['username']."',1,1,'".md5($data['new_password'])."',63,0,NULL,0,0,0,0,0,0,0,1,1,1,0,1,1,0,0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,0,0,0,'0',NULL,0,0,0,".intval($ftp_upload_limit).",0,".$ftp_maxuoload_size.",0,0,0,'');");

$mkdir_result = @mkdir($ftp_dirpath);
if($mkdir_result == TRUE)
   $db->sql_query("INSERT INTO `wftp_mysqltable_dir` VALUES ('".$localhost."','".$data['username']."','".$ftp_dirpath."','/',1,1,1,1,1,1,1,1,1,1,1,1);");

$db->sql_query("USE ".$db->dbname.";");
//Wing FTP Server end


is this correct?
i am running it locally so not domain name
chaosnature
 
posts 16
 
joined Thu Sep 09, 2010 1:32 am

Re: Database integration with phpBB3

Postby FTP » Mon Sep 13, 2010 1:48 pm

Code: Select all
$ftp_domain_name = "default";                             //ftp's domain name.
$ftp_dirpath = "D:/ftp_data/".$data['username'];   //user's directory path
$ftp_upload_limit = TRUE;                                    //whether to limit the quota size
$ftp_maxuoload_size = 1024*1024*100;                 //if $ftp_upload_limit = TRUE, this value means the max quota bytes.


Please note the comment of each lines...

$ftp_domain_name is your domain name in Wing FTP Server.
Folder "D:/ftp_data/" must be created already.
FTP
Site Admin
 
posts 1243
 
joined Tue Sep 29, 2009 6:09 am

Re: Database integration with phpBB3

Postby chaosnature » Mon Sep 13, 2010 2:44 pm

my domain name is ct.com

so i hav inserted:

Code: Select all
//Wing FTP Server MOD start
                                                                                                                                                                                                                                       //Wing FTP Server MOD start
$ftp_dbname = "chaosnat_phpbb3";                //Wing FTP Server's mysql database name, assume in the same server.
$ftp_domain_name = "ct.com";                 //ftp's domain name.
$ftp_dirpath = "c:/ftp_data/".$data['root'];//user's directory path
$ftp_upload_limit = TRUE;                     //whether to limit the quota size
$ftp_maxuoload_size = 1024*1024*100;          //if $ftp_upload_limit = TRUE, this value means the max quota bytes.
$db->sql_query("USE ".$ftp_dbname.";");

$db->sql_query("INSERT INTO `wftp_mysqltable_user` VALUES ('".$ftp_domain_name."','".$data['username']."',1,1,'".md5($data['new_password'])."',63,0,NULL,0,0,0,0,0,0,0,1,1,1,0,1,1,0,0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,0,0,0,'0',NULL,0,0,0,".intval($ftp_upload_limit).",0,".$ftp_maxuoload_size.",0,0,0,'');");

$mkdir_result = @mkdir($ftp_dirpath);
if($mkdir_result == TRUE)
   $db->sql_query("INSERT INTO `wftp_mysqltable_dir` VALUES ('".$ftp_domain_name."','".$data['username']."','".$ftp_dirpath."','/',1,1,1,1,1,1,1,1,1,1,1,1);");

$db->sql_query("USE ".$db->dbname.";");
//Wing FTP Server end


is this right?

and created C\:ftp_data folder on the ftp server, (does the folder need to be shared)
chaosnature
 
posts 16
 
joined Thu Sep 09, 2010 1:32 am

Re: Database integration with phpBB3

Postby FTP » Mon Sep 13, 2010 3:31 pm

I think the above code will be OK. Just test it.
FTP
Site Admin
 
posts 1243
 
joined Tue Sep 29, 2009 6:09 am

Re: Database integration with phpBB3

Postby chaosnature » Mon Sep 13, 2010 3:35 pm

O.k,

when i run the ucp_register.php i get a blank page which suggest to me there r no errors,

but i still don't have the users populating into the wing ftp user panel

any ideas?

when a user registers on php forums should we not see the user in the ftp user panel?
chaosnature
 
posts 16
 
joined Thu Sep 09, 2010 1:32 am

Re: Database integration with phpBB3

Postby FTP » Mon Sep 13, 2010 4:17 pm

Use livechat, I am online now.
FTP
Site Admin
 
posts 1243
 
joined Tue Sep 29, 2009 6:09 am

Previous

Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests