Quote:
Originally Posted by quantum-x
Most multisites are too lazy [..or want the code to drop] that they don't rewrite your code for you...
|
Meh.
Code:
<?php
// NATS code site rewite header; throwaway code by GrouchyAdmin.
// This simple little function is given to the community at large.
// To use, @include() at the very top of your PHP pages for your
// tours to rewrite all affiliate codes to the current site;
// edit the site number below, and the default type-in code,
// as applicable.
// --
// What is this site's numeric in Sites Admin?
$this_site = "1";
// We'll use NATS' helper functions.
require_once("/wherever/nats/includes/helper.php");
// If 'nats' code is not set, use our default code.
$nats_code = $_GET['nats'] ? $_GET['nats'] : 'MDowOjEzE';
// If this site code is not the same as the one given, rewrite it
if (nats_extract_program($nats_code) != $this_site) {
// Overriding $_GET is nasty, but makes this an easy prepend
$_GET['nats'] = nats_modify_site($nats_code, $this_site);
}
?>