Page 3 of 3

Re: Database integration with phpBB3

Posted: Mon Sep 13, 2010 12:07 pm
by FTP
Could you chat with me using livechat on our website? I am Luke

Re: Database integration with phpBB3

Posted: Mon Sep 13, 2010 1:23 pm
by chaosnature
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

Re: Database integration with phpBB3

Posted: Mon Sep 13, 2010 1:35 pm
by FTP
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

Re: Database integration with phpBB3

Posted: Mon Sep 13, 2010 1:43 pm
by chaosnature
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

Re: Database integration with phpBB3

Posted: Mon Sep 13, 2010 1:48 pm
by FTP

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.

Re: Database integration with phpBB3

Posted: Mon Sep 13, 2010 2:44 pm
by chaosnature
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)

Re: Database integration with phpBB3

Posted: Mon Sep 13, 2010 3:31 pm
by FTP
I think the above code will be OK. Just test it.

Re: Database integration with phpBB3

Posted: Mon Sep 13, 2010 3:35 pm
by chaosnature
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?

Re: Database integration with phpBB3

Posted: Mon Sep 13, 2010 4:17 pm
by FTP
Use livechat, I am online now.