Members: 16,996
Threads: 38,846
Posts: 159,391
Online: 30

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse
Old 01.04.2005, 22:23   #1 (permalink)
Mamber
 
august's Avatar
 
Join Date: Aug 2004
Location: Oppland, Norway, Europe
Posts: 99
august is on a distinguished road
Default Dynamic live site scripts - move site without need of config!

I have played around with a small dynamic live site script.

This scripts makes the $mosConfig_live_site-variable dynamic, and it changes as the actual live site does. This meens if you move your site from www.example.com to www.anotherone.com, the live site is automatically changed in the configuration.php

Here it comes:

First add these lines from line two, under the <?php tag:

PHP Code:
if($_SERVER['SERVER_PORT'] == 80) {
    
$root $_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];
} else {
    
$root $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].$_SERVER['PHP_SELF'];
}
$root str_replace("/index.php","",$root);
$url "http://".$root
This script is an modified version of the script that can be found in mambos own installation. I have only added the port-function, if the live site uses a port it will be added to the URL.

Then, find the live site variable:

PHP Code:
$mosConfig_live_site 'http://www.example.com'
Replace it with this:

PHP Code:
$mosConfig_live_site $url 
I have tried to work out the same thing for the pathway, but i am no pro coder and couln'd do it properly. I tried to replace it with the "getcwd()"-function in PHP, but it somehow didnt work. Nice if someone could help me on this one!

Anyway, i think this should be some sort of standard in mambo, at least an option.
__________________
August Lilleaas

Last edited by august; 03.04.2005 at 10:45.
august is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
URL's of images in MSAS and at live site doc Mambo 4.5.1 Installation and Upgrades 2 31.03.2005 00:45
MSAS to live site transfer/installation doc Mambo 4.5.1 Installation and Upgrades 11 16.02.2005 00:02
Site Scripts for mambo tombempty Mambo 4.5.1 'How Do I' Questions 2 18.10.2004 14:13
From testing to live site rober Mambo 4.5 Security 4 09.09.2004 18:31
Using redirect domain as live site url? iwyen Mambo 4.5 'How Do I' Questions 0 08.07.2004 10:38


All times are GMT +2. The time now is 13:46.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.