Changeset 540932
- Timestamp:
- 05/07/2012 02:35:13 PM (14 years ago)
- Location:
- mlb-standings/trunk
- Files:
-
- 2 edited
-
MLBStandings.php (modified) (4 diffs)
-
standings.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mlb-standings/trunk/MLBStandings.php
r539632 r540932 59 59 } 60 60 echo "</tr></table>"; 61 update_option($options['timestamp'], $xml->{'sports-metadata'}->attributes()->{'date-time'}); 62 $time_hour=substr($options['timestamp'],11,2); 63 $time_minute=substr($options['timestamp'],14,2); 64 $time_seconds=substr($options['timestamp'],17,2); 65 $temptime=$time_hour.":".$time_minute.":".$time_seconds; 61 $timestamp = $xml->{'sports-metadata'}->attributes()->{'date-time'}; 66 62 putenv("TZ=US/Pacific"); 67 $time=date("g:i A T", mktime($time_hour,$time_minute,$time_seconds)); 68 echo "<p class='date'>Last updated: ".substr($options['timestamp'],5,2)."/".substr($options['timestamp'],8,2)."/".substr($options['timestamp'],0,4)."</p></div>"; 63 $time=date("g:i A T", mktime(substr($timestamp,11,2),substr($timestamp,14,2),substr($timestamp,17,2))); 64 //echo "<p class='date'>Last updated: ".substr($timestamp,5,2)."/".substr($timestamp,8,2)."/".substr($timestamp,0,4)." - ".$time."</p></div>"; 65 echo "<p class='date'>Last updated: ".substr($timestamp,5,2)."/".substr($timestamp,8,2)."/".substr($timestamp,0,4)."</p></div>"; 69 66 } 70 67 } … … 90 87 function MLBStandings_add_defaults() { 91 88 $tmp = get_option('MLBStandings_options'); 92 if( ($tmp['chk_default_options_db']=='1')||(!is_array($tmp))) {93 delete_option('MLBStandings_options'); // so we don't have to reset all the 'off' checkboxes too! (don't think this is needed but leave for now)89 if(!is_array($tmp)) { 90 //delete_option('MLBStandings_options'); // so we don't have to reset all the 'off' checkboxes too! (don't think this is needed but leave for now) 94 91 $arr = array( "division" => "MLB-NL-E", 95 92 "team" => "Mets", 96 "timestamp"=>"2006-09-10T04:09:00-07:00", 97 "hour", date('h', time()) ); 93 "hour" => date('h', time())); 98 94 update_option('MLBStandings_options', $arr); 99 95 } … … 152 148 <table class="form-table"> 153 149 <tr> 154 <th scope="row">Division <?php echo ($options['division']); ?></th>150 <th scope="row">Division</th> 155 151 <td> 156 152 <select name='MLBStandings_options[division]' id='mydiv'> … … 167 163 168 164 <tr> 169 <th scope="row">Team <?php echo ($options['team']); ?></th>165 <th scope="row">Team</th> 170 166 <td> 171 <select name='MLBStandings_options[team]' id="MLB-AL-E" class="teams"> 172 <option value='Orioles' <?php selected('Orioles', $options['team']); ?>>Baltimore Orioles</option> 173 <option value='Red Sox' <?php selected('Red Sox', $options['team']); ?>>Boston Red Sox</option> 174 <option value='Yankees' <?php selected('Yankees', $options['team']); ?>>New York Yankees</option> 175 <option value='Rays' <?php selected('Rays', $options['team']); ?>>Tampa Bay Rays</option> 176 <option value='Blue Jays' <?php selected('Blue Jays', $options['team']); ?>>Toronto Blue Jays</option> 167 <select name='MLBStandings_options[team]' id="teams" class="teams"> 177 168 </select> 178 179 <select name='MLBStandings_options[team]' id="MLB-AL-C" class="teams">180 <option value ="White Sox" <?php selected('White Sox', $options['team']); ?>>Chicago White Sox</option>181 <option value ="Indians" <?php selected('Indians', $options['team']); ?>>Cleveland Indians</option>182 <option value ="Tigers" <?php selected('Tigers', $options['team']); ?>>Detroit Tigers</option>183 <option value ="Royals" <?php selected('Royals', $options['team']); ?>>Kansas City Royals</option>184 <option value ="Twins" <?php selected('Twins', $options['team']); ?>>Minnesota Twins</option>185 </select>186 187 <select name='MLBStandings_options[team]' id="MLB-AL-W" class="teams">188 <option value ="Angels" <?php selected('Angels', $options['team']); ?>>Los Angeles Angels</option>189 <option value ="Athletics" <?php selected('Athletics', $options['team']); ?>>Oakland Athletics</option>190 <option value ="Mariners" <?php selected('Mariners', $options['team']); ?>>Seattle Mariners</option>191 <option value ="Rangers" <?php selected('Rangers', $options['team']); ?>>Texas Rangers</option>192 </select>193 194 <select name='MLBStandings_options[team]' id="MLB-NL-E" class="teams">195 <option value ="Braves" <?php selected('Braves', $options['team']); ?>>Atlanta Braves</option>196 <option value ="Marlins" <?php selected('Marlins', $options['team']); ?>>Miami Marlins</option>197 <option value ="Mets" <?php selected('Mets', $options['team']); ?>>New York Mets</option>198 <option value ="Phillies" <?php selected('Phillies', $options['team']); ?>>Philadelphia Phillies</option>199 <option value ="Nationals" <?php selected('Nationals', $options['team']); ?>>Washington Nationals</option>200 </select>201 202 <select name='MLBStandings_options[team]' id="MLB-NL-C" class="teams">203 <option value ="Cubs" <?php selected('Cubs', $options['team']); ?>>Chicago Cubs</option>204 <option value ="Reds" <?php selected('Reds', $options['team']); ?>>Cincinnati Reds</option>205 <option value ="Astros" <?php selected('Astros', $options['team']); ?>>Houston Astros</option>206 <option value ="Brewers" <?php selected('Brewers', $options['team']); ?>>Milwaukee Brewers</option>207 <option value ="Pirates" <?php selected('Pirates', $options['team']); ?>>Pittsburgh Pirates</option>208 <option value ="Cardinals" <?php selected('Cardinals', $options['team']); ?>>St. Louis Cardinals</option>209 </select>210 211 <select name='MLBStandings_options[team]' id="MLB-NL-W" class="teams">212 <option value ="Diamondbacks" <?php selected('Diamondbacks', $options['team']); ?>>Arizona Diamondbacks</option>213 <option value ="Rockies" <?php selected('Rockies', $options['team']); ?>>Colorado Rockies</option>214 <option value ="Dodgers" <?php selected('Dodgers', $options['team']); ?>>Los Angeles Dodgers</option>215 <option value ="Padres" <?php selected('Padres', $options['team']); ?>>San Diego Padres</option>216 <option value ="Giants" <?php selected('Giants', $options['team']); ?>>San Francisco Giants</option>217 </select>218 219 169 <span style="color:#666666;margin-left:2px;">Select the team you'd like bolded in the standings.</span> 220 170 </td> 221 171 </tr> 222 172 </table> 173 <input type="hidden" name='MLBStandings_options[hour]' value=<?php echo date('h', time()); ?>> 223 174 <p class="submit"> 224 175 <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> 225 176 </p> 226 177 </form> 227 228 178 </div> 229 179 230 180 <script type='text/javascript'> 231 181 function teamchanger() { 232 jQuery(".teams").hide(); 233 jQuery("#" + jQuery("#mydiv").val()).show(); 182 jQuery("#teams").empty() 183 switch(jQuery("#mydiv").val()) { 184 case "MLB-AL-E": 185 jQuery("#teams").append("<option value='Orioles' <?php selected('Orioles', $options['team']); ?>>Baltimore Orioles</option><option value='Red Sox' <?php selected('Red Sox', $options['team']); ?>>Boston Red Sox</option><option value='Yankees' <?php selected('Yankees', $options['team']); ?>>New York Yankees</option><option value='Rays' <?php selected('Rays', $options['team']); ?>>Tampa Bay Rays</option><option value='Blue Jays' <?php selected('Blue Jays', $options['team']); ?>>Toronto Blue Jays</option>"); 186 break; 187 case "MLB-AL-C": 188 jQuery("#teams").append("<option value ='White Sox' <?php selected('White Sox', $options['team']); ?>>Chicago White Sox</option><option value ='Indians' <?php selected('Indians', $options['team']); ?>>Cleveland Indians</option><option value ='Tigers' <?php selected('Tigers', $options['team']); ?>>Detroit Tigers</option><option value ='Royals' <?php selected('Royals', $options['team']); ?>>Kansas City Royals</option><option value ='Twins' <?php selected('Twins', $options['team']); ?>>Minnesota Twins</option>"); 189 break; 190 case "MLB-AL-W": 191 jQuery("#teams").append("<option value ='Angels' <?php selected('Angels', $options['team']); ?>>Los Angeles Angels</option><option value ='Athletics' <?php selected('Athletics', $options['team']); ?>>Oakland Athletics</option><option value ='Mariners' <?php selected('Mariners', $options['team']); ?>>Seattle Mariners</option><option value ='Rangers' <?php selected('Rangers', $options['team']); ?>>Texas Rangers</option>"); 192 break; 193 case "MLB-NL-E": 194 jQuery("#teams").append("<option value ='Braves' <?php selected('Braves', $options['team']); ?>>Atlanta Braves</option><option value ='Marlins' <?php selected('Marlins', $options['team']); ?>>Miami Marlins</option><option value ='Mets' <?php selected('Mets', $options['team']); ?>>New York Mets</option><option value ='Phillies' <?php selected('Phillies', $options['team']); ?>>Philadelphia Phillies</option><option value ='Nationals' <?php selected('Nationals', $options['team']); ?>>Washington Nationals</option>"); 195 break; 196 case "MLB-NL-C": 197 jQuery("#teams").append("<option value ='Cubs' <?php selected('Cubs', $options['team']); ?>>Chicago Cubs</option><option value ='Reds' <?php selected('Reds', $options['team']); ?>>Cincinnati Reds</option><option value ='Astros' <?php selected('Astros', $options['team']); ?>>Houston Astros</option><option value ='Brewers' <?php selected('Brewers', $options['team']); ?>>Milwaukee Brewers</option><option value ='Pirates' <?php selected('Pirates', $options['team']); ?>>Pittsburgh Pirates</option><option value ='Cardinals' <?php selected('Cardinals', $options['team']); ?>>St. Louis Cardinals</option>"); 198 break; 199 case "MLB-NL-W": 200 jQuery("#teams").append("<option value ='Diamondbacks' <?php selected('Diamondbacks', $options['team']); ?>>Arizona Diamondbacks</option><option value ='Rockies' <?php selected('Rockies', $options['team']); ?>>Colorado Rockies</option><option value ='Dodgers' <?php selected('Dodgers', $options['team']); ?>>Los Angeles Dodgers</option><option value ='Padres' <?php selected('Padres', $options['team']); ?>>San Diego Padres</option><option value ='Giants' <?php selected('Giants', $options['team']); ?>>San Francisco Giants</option>"); 201 break; 202 } 234 203 } 204 235 205 jQuery(document).ready(function() { 236 206 teamchanger() -
mlb-standings/trunk/standings.css
r538981 r540932 29 29 } 30 30 .date{ 31 font-size:75% 31 font-size:75%; 32 32 }
Note: See TracChangeset
for help on using the changeset viewer.