Hi,
I'm the author of two bridges, one for
coppermine and other for
phpbb.
Both use the same logic and I'd like to adapt them to work with the coming Joomla 1.5.
Explanation of the logic: it's not joomla that include the script as a component but the contrary: the script that include joomla.
I modify the script in a way that it capture joomla's output (by including index.php). Then the output is processed in order
that this output is viewable from script subfolder.
Additional processing is done to join script's output to joomla's output in order to avoid the use of a wrapper.
Well that's a "rough" explanation, but you should get the idea.
Here's a basic example of how to capture Joomla's output from a subfolder:
Code:
<?php
$tmpdir=getcwd();
chdir("../");
ob_start();
include("index.php");
$joomlapage= ob_get_contents();
ob_end_clean();
chdir($tmpdir);
// Fix the links in the included page to refer to the Joomla root directory
$joomlapage=preg_replace('#(<[^>]*)(href|src|action|link|background)\s*=\s*"([^/:"][^:"]*)"#i',' \1\2="../\3"',$joomlapage);
//other fixes, not there for simplicity of example
echo $joomlapage;
?>
Now here's my problem. This logic work pretty well with Joomla 1.08.
When I login into Joomla 1.08, and then that I use that the previous basic script in a subfolder, I get a correct Joomla's output; in particular, In the output I see that I'm also logged.
However with the latest Joomla 1.5 build I've downloaded, I see a problem . I can be connected into Joomla 1.05, but with the script it looks like as if I'm still disconnected.
I can also perform the test by changing a line in the previous basic example.
Instead of:
Code:
echo $joomlapage;
I replace by:
Code:
if($my->id) echo "connected";
else echo "disconnected";
It this case it will always display "disconnected" with Joomla 1.5. Not the case with version 1.08.
Would you help me to find/fix the problem ?
Does this have with increased security inside Joomla 1.5 ?
Could the problem be avoided ?
thanks