Customizing SMF > SMF Coding Discussion

Broken paths when requiring SSI.php from outside SMF dir

(1/2) > >>

vroum:
Hi guys,

I'm using the ssi_register() function and it's not working with SMF 2 because of broken paths when used outside the forum directory.

Everything works fine when the page [which requires SSI.php & calls ssi_register()] is INSIDE the forum directory.  BUT it stops working as soon as I put the page in the forum's parent folder (I have updated the path to SSI.php of course) the form appears but all the paths are WRONG in the HTML source. (for example: example.com/parentdir/forumdir/Themes     becomes   example.com/parentdir/Themes)

when echo'ing the $boardurl from outside SMF it reads example.com/parentdir      instead of   example.com/parentdir/forumdir

So far $boardurl  &  $scripturl are wrong, so I reassigned them the right values at the beginning of the ssi_register() function and it partly solved the problem.

The main problem is that the paths are still wrong when ssi_register() calls template_control_verification($context['visual_verification_id'], 'all')  which returns a bit of HTML containing wrong paths like  example.com/parentdir/Themes/...

It worked fine with 1.1.16, I don't if it's the right place to report this kind of issue, should I file a bug report ? where ?

Please help !
Vroum.

vroum:
Even ssi_login() is NOT working because of broken paths.

emanuele:
Can you please paste a bit of the code you are using?

What I'd like to understand is if you are moving SSI to another directory or what.

vroum:
Hi emanuele,

Well, the homepage is in /parentdir  and SSI.php is in /parentdir/forum .


--- Code: ---index.php in http://127.0.0.1/parentdir
<?php
$ssi_guest_access=true; //This is for the ssi_register() to work with 1.1.13 and up
require("forums/SSI.php");
ssi_login(); ssi_logout("http://127.0.0.1/parentdir/");
?>
--- End code ---

Before upgrading, I have restored a live site backup to my local lamp server in /opt/lampp/htdocs/parentdir  I have corrected the paths & values in Settings.php & cleaned the .htaccess files then, I've upgraded to 2.0.2 and everything went fine except for the paths when requiring SSI.php from outside the forum directory.

http://127.0.0.1/parentdir/forums/ssi_examples.php   works fine.

Thanks !
Vroum.

emanuele:
login and logout both work fine here...copied the code you used a similar structure and I was able to login and out without any problem.

Okay, it's late I can't think of anything...maybe tomorrow...

Navigation

[0] Message Index

[#] Next page

Go to full version