|
|
Cannot send contents to remote sites! (0 viewing)
Favoured: 0
|
|
|
TOPIC: Cannot send contents to remote sites!
|
|
|
|
Re:Cannot send contents to remote sites! 2 Years, 1 Month ago
|
|
Regarding the files, they should be placed as it is described in the .XML file attached to the component. The most important ones are wrapperMySQL.php and query.txt, and they should be placed in the component root folder. When a remote query is done, the query.txt is also copied to the remote site, the same with the wrapperMySQL.php (if it wasn't copied before). But it is implementation things and it is not important now. Due to the testing that it has been done, maybe some files have been accidentally moved, deleted, etc. Please try to uninstall the component completely, and then, reinstall it. Now we know there remote root directory was wrong, we can start again with the correct data and maybe the problem was only that. According to the Open Source version, that is something I thought about and I am sure I'll make it in the future but not now. I am sorry for that. I know we could be discussing for hours the advantages and disadvantages , however, I think it's better now to trace the failure. 
|
|
|
|
|
|
|
Last Edit: 2008/06/01 16:58 By Jooglar.
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:Cannot send contents to remote sites! 2 Years, 1 Month ago
|
|
As I told you before, I am writing a test script that is using the functions of the component. Just wait a minute 
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:Cannot send contents to remote sites! 2 Years, 1 Month ago
|
|
Hi Jooglar wrote: Before that, let's try this: 1) Edit the wrapperMySQL.php from your component admin folder, and comment this line (line 39, I think):
| Code: : | unlink($archivo);
|
2) Now, delete those two files from the remote site and then , from the main site, go to the "Sites" section and hit "Check Site" button. A wrapperMySQL.php and query.txt should appear now in the remote site (root folder).
I am writing a php script right now for you, so we can see if the component can execute remote queries
Let's trace it!
I have commented the unlink in the wrapper as mentioned from the source installation and deleted two files from all the remote.
The query.txt and wrapperMySQL.php appears in the sites, always the latest timestamp.
The content is not being sent anywhere. Also the category from the remote database of remote installation is also not appearing in the drop down of the source.
I tried to send the categories to the remote but without success. It says that it have created categories successfully. However, looking after the remore, it did not create or delete the old...
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:Cannot send contents to remote sites! 2 Years, 1 Month ago
|
|
|
So if the files are sent, we know the FTP is fine.
Would you mind to check if the database settings are correct??
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:Cannot send contents to remote sites! 2 Years, 1 Month ago
|
|
Here you have a little script I made with the functions of the component. Place it in the root folder of the component to make it work properly. You have to write the settings of the remote site manually, and then , you can check the site and execute remote queries. The remote site to be tested needs the wrapperMySQL.php in its root folder. You can do it by: 1) Copying it manually 2) Executing the function checkSite($site) which copies the file there. I made it quickly so you could have it by now, so I apologise for any bug you find. File Attachment: File Name: _test.zipFile Size: 3096
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:Cannot send contents to remote sites! 2 Years, 1 Month ago
|
|
|
Jooglar wrote: Here you have a little script I made with the functions of the component. Place it in the root folder of the component to make it work properly. You have to write the settings of the remote site manually, and then , you can check the site and execute remote queries.
I executed the script from the URL with /_test.php and following is the ersult:
Site checked: OK
But this we know! Uh...
Thereafter I see that during the checksite, it did copy the wrappelMysql.php.
However when I uncomment the SQL > //queries which strlen is greater than _UMBRAL_QUERY
IT DOES NOT CREATE the query.txt!
Now I did the following modification to your script:
In the line 122, I uncommented for the script to echo:
echo $query; echo "n";
Following is the echo:
CREATE TABLE IF NOT EXISTS `jos_multip_prueba` ( `Prueba` VARCHAR( 5 ) NOT NULL ) DROP TABLE IF EXISTS `jos_multip_prueba` Site checked: OK SELECT * FROM jos_users
Does this help us?
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:Cannot send contents to remote sites! 2 Years, 1 Month ago
|
|
|
Hi,
From the uncommented SQL Query, I can see that the following:
jos_users
should have in all the SQL Queries in the test.php:
$remote_joomla_table_prefix.users
Right?
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:Cannot send contents to remote sites! 2 Years, 1 Month ago
|
|
|
Hi,
I changed the following in the test.php:
//if everything was right, we delete the dummy table created $query = "DROP TABLE IF EXISTS `jos_multip_prueba` "; // $res = executeRemoteQuery($query,$site);
Before there is an execute to create the jos_multip_prueba. It is not there and it is not getting created!
That means that there is some problem in the database connection as well as execution of the queries on the remote.
Now the connection details are CORRECT!
Any suggestions?
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:Cannot send contents to remote sites! 2 Years, 1 Month ago
|
|
However when I uncomment the SQL > //queries which strlen is greater than _UMBRAL_QUERY IT DOES NOT CREATE the query.txt!Ok, it doesn't create the file because the query to be executed is short (less than _UMBRAL_QUERY characters) and the query is passed via the method GET, it is attached to the URL that calls the wrapperMySQL.php remotely. CREATE TABLE IF NOT EXISTS `jos_multip_prueba` ( `Prueba` VARCHAR( 5 ) NOT NULL ) DROP TABLE IF EXISTS `jos_multip_prueba` Site checked: OK SELECT * FROM jos_users
Does this help us? Well, not much, it returns what it should. From the uncommented SQL Query, I can see that the following: jos_users should have in all the SQL Queries in the test.php: $remote_joomla_table_prefix.usersYes, the "jos_" I wrote was supposing that you are using the default prefix. Anyway, within the component, you define the remote prefix in the site settings. It is EXTREMELY important to set the correct one. If you don't, it could be a case in which the "Check Site" returns OK but the whole main functionalities won't work (sending categories, or content). The checking process for the database is just creating and deleting a table, (jos_multip_prueba), in the remote site. If you enter the right db settings but a joomla prefix that does not match with your installation it will still be passing that test but the sending proccess wont work. | Code: : | //queries which strlen is greater than _UMBRAL_QUERY (query threshold) will create a file (query.txt) to be passed via FTP, not via GET
//$query = "SELECT * FROM jos_users";
//$result_query = executeRemoteQuery($query,&$site);
//print_r($result_query);
|
Uncomment that and try a query in which you create a table. for example
$query = "CREATE TABLE jooglar_test";
Then execute it and look in the remote site if the table was created.
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:Cannot send contents to remote sites! 2 Years, 1 Month ago
|
|
Now the connection details are CORRECT!
Any suggestions?Ok I didnt see this message, sorry. If the connection data is right, check what is happening by printing the result like this: Execute whatever query | Code: : | $query = "SELECT * FROM jos_users";
$result_query = executeRemoteQuery($query,&$site);
print_r($result_query);
|
Do not forget the print_r. If you use firefox, the print_r will return a lot of unindented characters. Press Ctrl+U to see the source code of the page and copy the result with margins and tabulations.
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:Cannot send contents to remote sites! 2 Years, 1 Month ago
|
|
|
Well, I quickly modified your script to the following:
$site["table_prefix"] = "mytable_";
And then modified all the SQL Queries to, for e.g.:
$query = "CREATE TABLE IF NOT EXISTS `$site[table_prefix]multip_prueba` ( `Prueba` VARCHAR( 5 ) NOT NULL )";
So I cann see with the echo that it is using everywhere the same table prefix.
However the tables are NOT created in the remote database.
Here, do note that the table prefix of joomla is NOT IMPORTANT! This is an independent test.php and has nothing to do with joomla source or destination tables.
Hence it should create a table. IT DOES NOT!
Any further suggestions?
Also the following did not help:
//queries which strlen is greater than _UMBRAL_QUERY (query threshold) will create a file (query.txt) to be passed via FTP, not via GET $query = "SELECT * FROM $site[table_prefix]users WHERE username = 'admin' "; $result_query = executeRemoteQuery($query,&$site);
$error = get_error_message_remote_query($result_query); if($error) return $error; print_r($result_query);
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:Cannot send contents to remote sites! 2 Years, 1 Month ago
|
|
Another thing I can think of is the use of the class in snoopy.class.php. Some servers do not "like" it much. Try a simple script in which you are returned the text of any site: | Code: : |
require_once("includes/snoopy.class.php");
$snoopy = new Snoopy;
$url = "http://www.joomla.org";
$snoopy->fetchtext($url);
$read = $snoopy->results;
print($read);
|
You should see the text of the Joomla site in your browser.
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:Cannot send contents to remote sites! 2 Years, 1 Month ago
|
|
Hi, I am online and will be tonight until I make it work or you give up!  Yes, I inserted exactly after the remoresql query and it shows me the following: Joomla! Support Joomla! Main News Documentation Forum Extensions Shop Developers ul.horizmenulist { list-style: none; } ul.horizmenulist li { display: block; float: left; margin-right: 20px; padding-left: 15px; } ul.horizmenulist So it works! Further?
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:Cannot send contents to remote sites! 2 Years, 1 Month ago
|
|
|
Hi!
I am now sure that the wrapperMysql.php does not function as it should.
The database settings are correct. I even change the privilages of the mysql user and have assigned to the connection user full privilages. It cannot even update with the following:
$query = "UPDATE $site[table_prefix]users SET activation = 'xxxxx' WHERE username = 'admin' "; $result_query = executeRemoteQuery($query,&$site);
echo "Line 263: n"; print_r($result_query[0]);
So there is something wrong in the wrapperMysql.php.
Any further...
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:Cannot send contents to remote sites! 2 Years, 1 Month ago
|
|
Well, good thing it works. We are getting close. Now lets do something more "complicated" First, add to the wrapperMySQL.php this, on line 69, and then send this file to the remote site: | Code: : | line 69: print_r($output);
|
just AFTER the
| Code: : | echo "INICIO_RESULTADO_CONSULTA";
echo base64_encode(serialize($output));
echo "FIN_RESULTADO_CONSULTA";
|
We'll try to create a table in your remote database:
"query=Q1JFQVRFIFRBQkxFIGpvb2dsYXJfdGVzdF8wMDE=" is the obfuscated query equivalent to "CREATE TABLE jooglar_test_001"
You can obfuscate any query by using the apropriate function:
| Code: : | $query = obfuscar($query);
|
So you have to fill here your dbsettings and execute this URL in the browser, please, exactly the same dbsettings as in the test script:
| Code: : | http: / /www.yourRemoteSite.com/wrapperMySQL.php?dbserver=&dbuser=&dbpass=&dbname=&tipo=corta&query=Q1JFQVRFIFRBQkxFIGpvb2dsYXJfdGVzdF8wMDE=
|
This should execute the wrapperMySQL.php hosted in your remote site and create a table "jooglar_test_001". It will return some obfuscated text between the tags INICIO_RESULTADO_CONSULTA and FIN_RESULTADO_CONSULTA.
Then the output variable, (not obfuscated) will be shown. Look at what error you are getting, please.
And also Copy it here.
I'll be away for one hour more or less.
With that information you have something to "play" with till I'm back and see results.
|
|
|
|
|
|
|
Last Edit: 2008/06/01 20:06 By Jooglar.
|
|
|
The administrator has disabled public write access. |
|
|
|
|
|
| |
|
|