Results 1 to 3 of 3

Thread: Modsubdomaintemplateassoctiations

  1. #1
    amorousca
    Guest

    Default Modsubdomaintemplateassoctiations

    <insert into params.inc.php>
    Code:
    $ignoredtmpl = 'adl';
    
    // ModSubdomainTemplateAssociations
    // jmcveigh 05/14/2007
    $subdomain = substr($_SERVER["SERVER_NAME"],0,strpos($_SERVER["SERVER_NAME"],"."));
    $link = mysql_connect(DATABASE_HOST, DATABASE_USER, DATABASE_PASS) or die("ModSubdomainTemplateAssociations: Could not connect to database.");
    mysql_select_db(DATABASE_NAME,$link) or die("ModSubdomainTemplateAssociations: Could not connect to " . DATABASE_NAME . ".");
    $result = mysql_query("SELECT subdomain,template FROM ModSubdomainTemplateAssociations WHERE subdomain = '" . $subdomain . "' ORDER BY id DESC LIMIT 1",$link) or die("ModSubdomainTemplateAssociations: Could not locate subdomain.");
    if(mysql_num_rows($result) > 0)
    {
    	$row = mysql_fetch_object($result);
    	$tmpl = $row->template;
    	setcookie("skin",$row->template,0,"/");
    }
    else
    {
    	$tmpl = 'adl';
    }
    mysql_close($link);
    // end ModSubdomainTemplateAssociations
    <insert into global_settings.php>
    Code:
                    // ModSubdomainTemplateAssociations
                    // jmcveigh 05/14/2007
                    case 'template': $vtarget = '$ignoredtmpl';
                        break;
                    // end ModSubdomainTemplateAssociations
    <create subdomains that use symbolic links to connect to a single instance of dolphin>

    <ModSubdomainTemplateAssociations table>
    Code:
    id INTEGER PRIMARY KEY AUTO_INCREMENT
    subdomain VARCHAR(128)
    template VARCHAR(16)
    ...
    email jason.mcveigh@gmail.com for more information
    Last edited by Smoge; 05-14-2007 at 10:32 PM.

  2. #2
    Administrator Smoge's Avatar
    Join Date
    Mar 2005
    Posts
    6,634
    Blog Entries
    5

    Default

    amorousca, I added CODE tags to your post. When posting code, please surround in CODE tags.

    I only read it quickly, but looks like a good start on support for multiple domains.

    Keep posting.

    Smoge
    ModMySite Administrator

    Problems? Questions? Need modifications or other help with your site?

    Open A Ticket , Send Us An Email Or Give Us A Telephone Call +1 518-632-4152.

  3. #3
    birkenstam's Avatar
    Join Date
    Mar 2006
    Posts
    205

    Default

    Hi,
    What is this? i cant understand i am bit slow. i wish it was a code that generate username as subdomain that will be good for SEO.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •