ALTER TABLE dd_users ADD template VARCHAR(250) NOT NULL DEFAULT '';
$db->connect();
if(isset($_SESSION['userid'])){ $suserid = $_SESSION['userid']; $usrdata = $db->fetch_row($db->query(sprintf('SELECT * FROM dd_users WHERE userid=\'%u\'', $suserid)));}if(isset($suserid)){$query = mysql_query("SELECT `template` FROM `dd_users` WHERE `userid`='$suserid'");$row = mysql_fetch_array($query);$user_template = $row['template'];}else{$user_template = '';}
$template = $set['template'];
if(!empty($user_template) && $user_template != "default"){ $template = $user_template; }else{ $template = $set['template']; }
$newsletter = clean($_POST['newsletter']);
$utemplate = clean($_POST['template']);
newsletter='$newsletter'
, template='$utemplate'
------------------------------myaccount.php file------------------------------$newsletter = $r2['newsletter'];------------------------------managemembers.php file------------------------------$newsletter = $set['newsletter'];
------------------------------myaccount.php file------------------------------$utemplate = $r2['template'];------------------------------managemembers.php file------------------------------$utemplate = $set['template'];
<td class="content"><select type="dropdown" name="newsletter"><option value="no">No</option><option value="yes" '.$nsel.' >Yes</option></select></td></tr>
<tr><td class="content">Template:</td><td class="content"><select type="dropdown" name="template"><option value="default">default</option>'; $path = $directorypath."templates"; $directory = dir($path); while (false !== ($item = $directory->read())) { if ($item !== "." && $item !== "..") { if ($item == $utemplate) { $usel = "selected"; } echo" <option value=".$item." ".$usel." >".$item."</option>"; } }echo' </select></td></tr>
if(!empty($user_template) && $user_template != "default"){ $template = $user_template; }else{ $template = $set['template']; }if(((date('m') == 12) && (date('d') == 25)){ $template = "christmas"; }
Also, What does die() do? maybe i can work it in there if needed?
And allow the admin to activate or deactivate a template.