Create custom page on other directory

Started by FindL, March 31, 2016, 09:57:49 AM

Previous topic - Next topic

FindL

Hello,

I've a little problem.
I'm creating scripts on a directory named: /scripts.

But, when I'm going on a page on this directory, all themes url take this form: <link rel="stylesheet" type="text/css" href="website.com/scripts/Themes/default/css/index.css?fin20" />
So, the theme doesn't load...

What I have to do ?

Regards

EDIT: On local PC, I don't have this problem...
I have a dedicated server with apache2 on it.

Kindred

you'll have to do more than talk in generalities...   Please attach or include the code from at least one of your "custom" pages
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

FindL

So, here is custom.php in the folder "scripts" located in forum root.

So, you have this:

-index.php
-SSI.php
-- Scripts
--- custom.php

Here is the code:

<?php 
// Header
include('header.php');

$context['page_title_html_safe'] = 'Custom page'// Name of page
global $alerte_stock// A variable that I use, its located in Settings.php

// Footer
template_footer(); 
?>


Code of header.php
<?php require(dirname(__FILE__) . '/../SSI.php');
template_header(); 
$ssi_ban true?>


I already tryied the script "repair_settings.php", no changes.
But what is weird, it's that I have no problem in my local server (wamp) but I have this on dedicated server (using apache2)...

Kindred

well, repair_settings only corrects urls and paths within the forum itself...

the theme directories are actually correct, within the path....
What seems to be happening on your external server is that the default SMF path/URL is getting corrupted to use your scripts subdirectory as the root instead...

That probably has to be something in the server configuration

unless you are using RELATIVE paths in your external server's forum configuration instead of absolute paths?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

FindL

Quote from: Kindred on March 31, 2016, 11:30:12 AM
unless you are using RELATIVE paths in your external server's forum configuration instead of absolute paths?

What do you mean ?

Like this:
require(dirname(__FILE__) . '/../SSI.php');

To this:

require('../SSI.php');

?

Kindred

no...   in your forum settings -- are you using absolute paths?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

FindL

Quote from: Kindred on March 31, 2016, 12:10:59 PM
no...   in your forum settings -- are you using absolute paths?

Oh; yes I do. Like /var/www/forum/Themes etc etc

Kindred

hmm..... then, if it works on one server and not on another -- it almost has to be related to the configuration of said servers...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

FindL

Ok fixed it by comment theses lines:

$settings['theme_url'] = strtr($settings['theme_url'], array($oldurl => $boardurl));
$settings['default_theme_url'] = strtr($settings['default_theme_url'], array($oldurl => $boardurl));
$settings['actual_theme_url'] = strtr($settings['actual_theme_url'], array($oldurl => $boardurl));
$settings['images_url'] = strtr($settings['images_url'], array($oldurl => $boardurl));
$settings['default_images_url'] = strtr($settings['default_images_url'], array($oldurl => $boardurl));
$settings['actual_images_url'] = strtr($settings['actual_images_url'], array($oldurl => $boardurl));


They are located into: Sources/load.php
#1541


Kindred

AFAIK, those values are necessary for the proper working of the forum itself.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

FindL

It seem work pretty nice.. If I have problem I'll uncomment them and.. I don't know 

Advertisement: