View Single Post
Old 03-21-2008, 04:12 PM  
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by quantum-x View Post
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);
  }
?>
__________________

Last edited by GrouchyAdmin; 03-21-2008 at 04:14 PM..
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote