Changeset 1174699
- Timestamp:
- 06/04/2015 07:34:43 PM (11 years ago)
- Location:
- wp-stardate/trunk
- Files:
-
- 2 edited
-
src/options.php (modified) (2 diffs)
-
stardate.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-stardate/trunk/src/options.php
r1159122 r1174699 61 61 * @var string $input the input to validate 62 62 */ 63 return ( in_array($input, array('XI', 'XI_wikipedia' )) ? $input : 'Classic');63 return ( in_array($input, array('XI', 'XI_wikipedia', 'SOL')) ? $input : 'Classic'); 64 64 } 65 65 … … 105 105 <input name="stardate_style" type="radio" value="XI" <?php checked( 'XI', get_option( 'stardate_style' ) ); ?> /> XI (trekguide) <code><?php echo stardate_now('XI')?></code> 106 106 <input name="stardate_style" type="radio" value="XI_wikipedia" <?php checked( 'XI_wikipedia', get_option( 'stardate_style' ) ); ?> /> XI (wikipedia) <code><?php echo stardate_now('XI_wikipedia')?></code> 107 <input name="stardate_style" type="radio" value="SOL" <?php checked( 'SOL', get_option( 'stardate_style' ) ); ?> /> StarTrek Online (SOL) <code><?php echo stardate_now('SOL')?></code> 107 108 </td> 108 109 </tr> -
wp-stardate/trunk/stardate.php
r1160392 r1174699 85 85 'rewrite' => TRUE 86 86 ) 87 ); 88 register_taxonomy( 89 'stardate-parent', 90 'post', 91 array( 92 'hirarchical' => TRUE 93 94 ) 87 95 ); 88 96 } … … 219 227 */ 220 228 $stardate = mysql2date("Y.z", $date); 229 } elseif ($style == 'SOL') { 230 /* Represent the current date in YYMM.DD format, where "YY" is the current year minus 1900, 231 * MM is the current month (01-12), and DD is the current day of the month (01-31). 232 */ 233 $yy = mysql2date("Y", $date); 234 $day_of_year = mysql2date("z", $date); 235 236 if ($day_of_year > 143.9) 237 { 238 $day_of_year -= 143.9; 239 $yy -= 1922; 240 } else { 241 $day_of_year += 221.3422; 242 $yy -= 1923; 243 } 244 245 $dd = $day_of_year / 365.2422 * 1000; 246 $ff = ($dd - (int)$dd) * 100; 247 $stardate = sprintf("%s%03s.%01s", $yy, (int)$dd, (int)$ff); 221 248 } else { 222 249 /* Represent the current date in YYMM.DD format, where "YY" is the current year minus 1900,
Note: See TracChangeset
for help on using the changeset viewer.