The following assumes that your donators are in usergroup 6, and that the ads are also supposed to be seen no matter what by everyone else not in the donator group.
Ok...
You'll have to create a new field in the users table. Run this query...
ALTER TABLE w3t_users ADD U_Ads tinyint(1) NOT NULL default '0'
...and then add a config option in their display preferences section.
editdisplay.php...
$adsyes = ""; <br />$adsno = ""; <br /> <br />if ($ads == 1) { <br /> $adsyes = "selected=\"selected\""; <br />else { <br /> $adsno = "selected=\"selected\""; <br />}
...which will only appear if they belong to that group and default that selection to 0 (No). You can add the PHP in the template for that.
editdisplay.tmpl...
UBBTPRINT; <br />if ((preg_match("/-6-/",$postergroup)) { <br />echo "Do you wish to see ads?<br /> <br /><select name = \"Adselect\" class=\"formboxes\"> <br /><option value = \"1\" $adsyes>Yes</option> <br /><option value = \"0\" $adsno>No</option> <br /></select> <br /><br /><br />"; <br />} <br />echo <<<UBBTPRINT
In changedisplay.php add in the necessary stuff...
// ------------- <br />// Get the input <br /> $Adselect = get_input("Adselect","post"); <br /> if ((empty($Adselect)) || (!Adselect)) { <br /> $Adselect = 0; <br /> } <br /> <br />// ----------------------- <br />// Format the query words <br /> $Adselect_q = addslashes($Adselect); <br /> <br />// -------------------------- <br />// Update the User's profile <br /> $query = " <br /> UPDATE {$config['tbprefix']}Users <br /> SET U_Ads = '$Adselect_q', <br />
You'd also have to make sure to authenticate U_Ads in ubbt.inc.php and assign it a variable ($ads).
Then in the header.php ad code, you'd modify it to say something like...
if ( ((preg_match("/-6-/",$postergroup)) && ($ads == 1)) || (!preg_match("/-6-/",$postergroup)) ) { <br /> if (@include(getenv('DOCUMENT_ROOT').'/php/phpadsnew/phpadsnew.inc.php')) { <br /> if (!isset($phpAds_context)) $phpAds_context = array(); <br /> $phpAds_raw = view_raw ('zone:3', 0, '_blank', '', '0', $phpAds_context); <br /> echo $phpAds_raw['html']; <br /> } <br />}