Templates shared installation

Having trouble installing serendipity?
Post Reply
Arnold Nijboer
Regular
Posts: 42
Joined: Mon Oct 23, 2006 7:48 pm
Contact:

Templates shared installation

Post by Arnold Nijboer »

Hey guy's
could someone help me?

i'm running a shared installation of s9y, but all templates are in the users direcory.
ex. www.mysite.nl/myblog/templates
while the core templates are at.
ex. www.mysite.nl/serendipity/templates

so every time i download a template i need to copy it to all the user's blogs, is there a way to just link to the core templates directory.
i've tried to change the template directory in my index.php?admin->configuration but that doesn't wordk somehow or does that tels where the template_c directory is??

Greatings
Arnold Nijboer
abdussamad
Regular
Posts: 117
Joined: Fri Apr 21, 2006 10:11 pm
Location: Karachi, Pakistan
Contact:

Post by abdussamad »

hi

I was just looking through the shared installation guidehere and I see that you can also link to your core s9y installation's templates dir from each of your user's dirs. This way all users get access to whatever templates you store in your core s9y templates dir.

BTW, I'd like to pose a question to you inturn, you need root access to your server to set up a shared installation right? This can't be done on a shared hosting account?
Arnold Nijboer
Regular
Posts: 42
Joined: Mon Oct 23, 2006 7:48 pm
Contact:

Post by Arnold Nijboer »

abdussamad wrote:hi
BTW, I'd like to pose a question to you inturn, you need root access to your server to set up a shared installation right? This can't be done on a shared hosting account?
i don't know if i understand the question right but i'll try.

if it's about the directory root no that doesn't mind you can put it in anny subdirectory you want.

if it's about the admin user root, you need to gain access to mysql to create and or remove databases, apache(or other servers) is not nessecery you can do it with .htaccess or dns.

hope i answerd you question right?!

by the way thank for your answer i didn't look in faq on shared installation i just lookt at the forum :oops:

Greating Arnold
Arnold Nijboer
Regular
Posts: 42
Joined: Mon Oct 23, 2006 7:48 pm
Contact:

Post by Arnold Nijboer »

sorry i'm back...

i've read the shared installation file (olso before i installed everything) and i know why i copyed everything instead of linking...
i didn't understand how to link (where to place that code
$ ln -s -d /usr/local/lib/php/s9y/templates /home/www/garvin.s9yblogs.org/htdocs/templates
$ ln -s -d /usr/local/lib/php/s9y/htmlarea /home/www/garvin.s9yblogs.org/
i'm running win xp with apache 2, php 5, mysql 5.
and i was in the understanding it was linux code, or do i need to put it in .htaccess?
Greating
Arnold Nijboer
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

On Windows Ssystems you cannot use symbolic links! Thus you need to copy everything, I'm sorry.

Linking only works on linux servers, which is generally the better choice for hosting *ggg* :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Arnold Nijboer
Regular
Posts: 42
Joined: Mon Oct 23, 2006 7:48 pm
Contact:

Post by Arnold Nijboer »

thank garv... i know i know, but i can't seem to find the time to upgrade my server to linux. and to understand all the linux shit. so i'm stuck with windows and it still runs great so why change!

but don't you think i can do it with .htaccess rewrite mod. if so do you know how? or else change something somewhere in the source code (i know you don't like it)

Greatings
Arnold Nijboer
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

No, s9y needs to access files on a filesystem-level, so there mod_rewrite cannot help, I'm sorry.

You would need to change all template-related features where $serendipity['templatePath'] is used, I guess. Or maybe you can try to enter a "faked" relative path in the templatePath directory, like "../../../central_templates"?

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Arnold Nijboer
Regular
Posts: 42
Joined: Mon Oct 23, 2006 7:48 pm
Contact:

Post by Arnold Nijboer »

hey garvin!
i looked in the code and try to find $serendipity['templatePath']
the only one of intrest i found was in include/compat.inc.php but it says:
* Some defaults for our config vars.
* They are likely to be overwritten later in the code
$serendipity['templatePath'] = 'templates/';
isn't it the same as in the database serendipity_config/templatePath/
or previous in the config_local.inc.php.

Greatings
Arnold Nijboer
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Hm, you should search more thoroughly. The important places are here in these files :

./include/functions.inc.php
./include/functions_config.inc.php
./include/functions_smarty.inc.php

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Arnold Nijboer
Regular
Posts: 42
Joined: Mon Oct 23, 2006 7:48 pm
Contact:

Post by Arnold Nijboer »

Hi Garvin!

Thanks for the info, but i ran into a problem. perhaps a heads up for all developers. some code directs to for example:
c:/website/myblog/templates/
while other code directs to
templates/

if i change te $serendipity['templatePath'] = "templates/" into for example
$serendipity['templatePath'] = "../../serendipity/templates".
the tamplates are loaded (../../serendipity/templates/) but in the admin style page the preview.png files are not loaded (c:/website/myblog/templates/../../serendipity/templates/).

Greatings
Arnold Nijboer[/code]
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Ah, okay. Then my solution to change the templatePath does not work for you.

As I mentioned, this is not supported by Serendipity (so not really bug, but a missing feature) - so it seems the only way for you apart frmo using Linux is to patch the serendipity code and contribute the patch for your working environment? :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Arnold Nijboer
Regular
Posts: 42
Joined: Mon Oct 23, 2006 7:48 pm
Contact:

Post by Arnold Nijboer »

Hi garvin.

Alright you win...
linux rules!! :D

do you know if i can install linux on a seperate computer and then copy an image to my server once i'm ready an fully tetsted? my understanding of linux (some 10 years ago) was that it was pretty system depended?

Do you know a small linux distribution with things standard installed (apache,php,mysql)

if you can confince me i will switch :lol: :P

meanwhile i'll find a solution for my problem......

Greatings
Arnold Nijboer
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

I just think, maybe you can simply use a NTFS partition on your windows machine. From what I heard NTFS supports symbolic links?

About Linux: You can clone linux installations from one system to another, but that much depends on how you compiled your system and if you use any fundamental kernel drivers that do not run on different hardware.

I personally use Debian on all my systems.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Arnold Nijboer
Regular
Posts: 42
Joined: Mon Oct 23, 2006 7:48 pm
Contact:

Post by Arnold Nijboer »

hi garvin..

i am using ntfs, and yes it shoulb be suported. but unfortunetley i can't get the damn thing to work.
i've used the php fuction symlink :

Code: Select all

function _symlink( $target, $link ) {
  if ($_SERVER['WINDIR'] || $_SERVER['windir']) {
   exec('junction "' . $link . '" "' . $target . '"');
  } else {
   symlink($target,$link);
  }
}
wich works with junction.exe. the only error i get is that symlink is an unknown function (the else function) so for some reasen the if function is not executed. i found out that it could have one of two reasens first symlink is turnd off in php (but i don't know where to put it on). the other one is that junction creates hard links.

Does anywhone has an idee how to get this to work?

Greating
Arnold Nijboer
Post Reply