Changeset 17
- Timestamp:
- 10/19/06 17:50:30 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/admin.php
r16 r17 53 53 $config->setPostPassword($_POST['post_password']); 54 54 $config->setPostMailto($_POST['post_mailto']); 55 56 if ($_POST['filter_apply'] == "on") 57 { 58 $config->setConfig('filter_apply', '1'); 59 $config->setConfig('filter_date', mktime(0,0,0,$_POST['filter_month'],$_POST['filter_day'],$_POST['filter_year'])); 60 }else{ 61 $config->setConfig('filter_apply', '0'); 62 $config->setConfig('filter_date', 0); 63 } 55 64 56 65 $html .= "Changes saved."; … … 120 129 $html .= "<tr><td width=120><b>Require password for Comments:</b></td><td><input type=checkbox name=comments_pw id=comments_pw"; 121 130 if ($config->getConfig('comments_pw')) 122 131 $html .= " checked=\"checked\""; 123 132 $html .= "></td></tr>"; 133 124 134 // $html .= "<tr><td width=120><b>Display least active:</b></td><td><input type=checkbox name=least_active id=least_active"; 125 135 // if ( $config->getLeastActive() ) … … 133 143 $html .= "<tr><td width=120><b>Post password:</b></td><td><input type=text name=post_password id=post_password size=20 maxlength=20 value=\"" . $config->getPostPassword() . "\"></td></tr>"; 134 144 $html .= "<tr><td width=120><b>Killmail CC:</b></td><td><input type=text name=post_mailto id=post_mailto size=20 maxlength=80 value=\"" . $config->getPostMailto() . "\"> (e-mail address)</td></tr>"; 145 $html .= "<tr><td width=120><b>Disallow any killmails before:</b></td><td>" . dateSelector($config->getConfig('filter_apply'),$config->getConfig('filter_date')) . "</td></tr>"; 135 146 $html .= "</table>"; 136 147 … … 146 157 $page->addContext($menubox->generate()); 147 158 $page->generate(); 159 160 function dateSelector($apply,$date){ 161 if($date > 0){ 162 $date = getdate($date); 163 }else{ 164 $date = getdate(); 165 } 166 $html = "<input type=\"text\" name=\"filter_day\" id=\"filter_day\" style=\"width:20px\" value=\"{$date['mday']}\"/> "; 167 $html .= "<select name=\"filter_month\" id=\"filter_month\">"; 168 for($i=1;$i<=12;$i++){ 169 $t = mktime(0,0,0,$i,1,1980); 170 $month = date("M",$t); 171 if($date['mon'] == $i) $selected = " selected=\"selected\""; else $selected = ""; 172 $html .= "<option value=\"$i\"$selected>$month</option>"; 173 } 174 $html .= "</select> "; 175 176 $html .= "<select name=\"filter_year\" id=\"filter_year\">"; 177 for($i=date("Y")-7;$i<=date("Y");$i++){ 178 if($date['year'] == $i) $selected = " selected=\"selected\""; else $selected = ""; 179 $html .= "<option value=\"$i\"$selected>$i</option>"; 180 } 181 $html .= "</select> "; 182 $html .= "<input type=checkbox name=filter_apply id=filter_apply"; 183 if($apply=="1") $html .= " checked=\"checked\""; 184 $html .= "/>Apply "; 185 return $html; 186 } 148 187 ?>