[kdewebdev-site] Problem with the site layout
Andras Mantia
amantia at kdewebdev.org
Tue Mar 1 22:55:20 EST 2005
On Tuesday 01 March 2005 21:32, Alexander Hans wrote:
> Hi,
>
> I don't know how this looks exactly, haven't had a look at the code,
> I don't know if I even have access. But here are my comments on what
> I think what might cause problems.
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.
> > }
> > include_once ($_libpath."left.inc.php");
>
> You have two different kinds of files, one is files that are directly
> accessed by the browser, the other is files that are included by PHP
> to create one documenent.
Yes.
> It doesn't make much sense to have filesystem paths to images and css
> files.
For those the filesystem paths can be changed to become real URLs.
> 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.
> 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.
> > But this will not solve the problem with the common PHP files. How
> > can we do that
> > include_once ($_libpath."left.inc.php");
> > always includes the left.inc.php from the main kdewebdev?
>
> 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.
> 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)?
> Generally I don't like that way of including content, though. You
> might want to consider using a really simple template system, that
> way you wouldn't add much complexity, nevertheless it would give a
> nice separation of PHP and HTML, thus increasing maintainability.
> I've created one some time ago and used it for my own projects since,
> you can have it if you want to.
Others might comment on this, I'm don't know about templates at all.
Andras
--
Quanta Plus developer - http://quanta.sourceforge.net
K Desktop Environment - http://www.kde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://momo.creolmail.org/pipermail/kdewebdev-site/attachments/20050301/f76d725e/attachment.pgp
More information about the kdewebdev-site
mailing list