[wp-pro] Re: I have a need for an advanced WordPress hack

Josh Mellicker jmellicker at gmail.com
Mon Jan 9 16:56:37 GMT 2006


Hello,

As a reminder, what I am trying to do, is create custom affiliate
headers so users will see their affiliate's header when they visit the
WordPress site...

I just thought of this way:

1. create a new table, "affiliate_headers", with 2 fields:

user_id
affiliate_header_filename



2. let's say "pepsi" was an affiliate, we would give them a link to
put on their site that was a form that included the hidden field:
affiliate_header_filename="pepsiheader.php"

3. then, we duplicate our header.php file to defaultheader.php

4. also duplicate header.php to pepsiheader.php and make some changes
(like add the pepsi logo, links)

5. then, rewrite header.php to just this:

if user just hit the site for the first time and there is an
"affiliate_header_filename" POST variable {

  store user_id, affiliate_header_filename in new table
  display this custom header

} else {

  if $user_id known {
    get correct header filename from "affiliate_headers" table and display
  } else {
    just display defaultheader.php
  }

}


Sorry for the bad code, I barely know what I'm talking about here :-)

Would this work?

I want to keep changes to a minimum, since I'll have to hack every
upgrade... but so far it is not too bad, right?


Thanks,

Josh


More information about the wp-pro mailing list