Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Streamlining sites.
Hi,

I have five sites using the same code, apart from images and database
connection.

I wanted to set them up so that they share the code and a config file sets
up the individual bits.

I'm currently on IIS so this is how I went about it.

Set up a folder containing the php files. In that folder I have the
following:

folders
--templates
--images (contains common images used across all sites)
and for each website
--site_includes (contains config and image files)
--site_templates_c
--site_cache // added later
--site_configs // added later

For 'site' above, I replace with the virtual host name as used by IIS.

I then set IIS to point the various virtual hosts to that main folder and
the home.php checks the 'ORIG_PATH' to know which site it is in and then
calls the appropriate site_includes folder and stores the 'site' in a
cookie.

Initially, I figured that the individual site_templates_C would keep the
data from mixing across sites but that didn't work and I had images failing
to display correctly and data traversing across the sites. I then created
individual site_cache and site_configs folders for each site and that seems
to be working fine.

This might help someone else out the wanting to do something similar with
Smarty. I'm not sure how this works with Apache, but As I'm migrating to
Apache2 (win2003) in the new year, I'm going to find out.

Cheers

George

Report this thread to moderator Post Follow-up to this message
Old Post
George Pitcher
08-30-05 12:57 PM


Re: Streamlining sites.
>>> site_templates_c

$smarty already has a $compile_id var to help with this.. Thi smeans one
can have one shared compile dir across all sites

http://smarty.php.net/manual/en/variable.compile.id.php


$smarty->compile_id = $_SERVER['SERVER_NAME'];
$smarty->compile_dir = 'path/to/shared_compile_dir';

This is really useful - particullarily when upgrading smarty

Pedro



George Pitcher wrote:
> Hi,
>
> I have five sites using the same code, apart from images and database
> connection.
>
> I wanted to set them up so that they share the code and a config file sets
> up the individual bits.
>
> I'm currently on IIS so this is how I went about it.
>
> Set up a folder containing the php files. In that folder I have the
> following:
>
> folders
> --templates
> --images (contains common images used across all sites)
> and for each website
> --site_includes (contains config and image files)
> --site_templates_c
> --site_cache // added later
> --site_configs // added later
>
> For 'site' above, I replace with the virtual host name as used by IIS.
>
> I then set IIS to point the various virtual hosts to that main folder and
> the home.php checks the 'ORIG_PATH' to know which site it is in and then
> calls the appropriate site_includes folder and stores the 'site' in a
> cookie.
>
> Initially, I figured that the individual site_templates_C would keep the
> data from mixing across sites but that didn't work and I had images failin
g
> to display correctly and data traversing across the sites. I then created
> individual site_cache and site_configs folders for each site and that seem
s
> to be working fine.
>
> This might help someone else out the wanting to do something similar with
> Smarty. I'm not sure how this works with Apache, but As I'm migrating to
> Apache2 (win2003) in the new year, I'm going to find out.
>
> Cheers
>
> George

Report this thread to moderator Post Follow-up to this message
Old Post
Pedro
08-30-05 12:57 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Smarty Templates archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:15 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.