[kdewebdev-site] Problem with the site layout

Alexander Hans alexander.hans at stud.tu-ilmenau.de
Tue Mar 1 17:05:50 EST 2005


Hi,

I can see the problem now. Sorry for just posting before without really
knowing what was going on, obviously I didn't tell you anything new ...


> The layout on the server is:
> /home/kdewebdev/public_html = kdewebdev.org
> /home/kdewebdev/project/public_html = project.kdewebdev.org, so
> /home/kdewebdev/kallery/public_html = kallery.kdewebdev.org
>
> Now the default.css is in /home/kdewebdev/public_html/css, the common
> PHP files (like the left menus) are
> in /home/kdewebdev/public_html/include and the common images are
> in /home/kdewebdev/public_html/images.
>
> What I (we) would like is to use the common CSS, images and PHP files
> from inside a project webpage, like kallery.

Ok. Using relative paths obviously won't work from project webpages if you
want to stick with the sub domains. What you maybe could do is creating
symlinks for common images and common CSS. If you don't need a CSS
directory for every project, a symlink like
/home/kdewebdev/kallery/public_html/css could simply point to
/home/kdewebdev/public_html/css. If you need to have a directory for each
subproject, it would be possible to create a symlink named say "common"
inside that directory. Do that with every project and you can use the same
relative paths with each project to access common files.


>> You probably don't want to access those files from within your
>> PHP, but want to create links to it so the browser knows where to
>> find CSS files and images. That's why it did work when changing it to
>> the external address.
> I know. The problem is what to do with the PHP files. The PHP docs say
> that include ("http://kdewebdev.org/include/file.php") should work, but
> it can be disabled. Seems that here it is disabled as it does not work.

Turning on Safemode disables that funcionality, since it can easily be
abused by an attacker to include arbitrary code if not used carefully.

As long as the to be included files are filesystem-reachable it isn't
neede anyway.


>> You are right, that way it would work. I remember I had that problem
>> before, strange behaviour when refering image files from CSS files.
>> You could try to change to the following:
>> background-image:url("../../images/page/bg_line_.gif");
> I'm afraid that will fail for the main kdewebdev site.

I think it might work on the main site but will fail on project sites. I
wasn't aware of the sub domains.


>> You can do that by setting $_libpath to the same directory
>> (filesystem path) in each PHP file and placing left.inc.php in that
>> directory.
> I don't get it now. $_libpath = "/home/kdewebdev/public_html/include/",
> which is a filesystem path and there is where left.inc.php is. But it's
> not found for some unknown reason.

That's really weird. Maybe it's some permission problem? Is the main site
running under the same user as the project sites?


>> A better approach would be to create a file named
>> globals.php, defining everything that's needed on all pages in there,
>> and including only that file as first statement in each PHP file
>> that's accessed to render a page.
> The problem here is the same: where to put that files and how to include
> from every subdomain (project domain)?

It should be possible to put the files into main site's directory as
stated above.

Another good idea might be to treat the main site as a project, too. That
way you would have something like /home/kdewebdev/main/public_html =
kdewebdev.org
Common files could go to /home/kdewebdev/common/... and would be reachable
from every project and the main site the same way.

Why do you have a public_html for each project? Why don't you have
something like /home/kdewebdev/public_html/project =
project.kdewebdev.org?


Is there any way I could access the source code of the site? Right now I'm
still at work but tonight I might find some time ...


Alexander

-- 
PGP Public Key: http://www.tu-ilmenau.de/~alha-in/ahans.asc
Fingerprint: E110 4CA3 288A 93F3 5237  E904 A85B 4B18 CFDC 63E3



More information about the kdewebdev-site mailing list