This is a list of rooms and industries that you will be building in Dwarf Fortress v42.xx. Use it to help plan your fortress, get some ideas, or figure out what should go in your stockpiles.
Indoor Storage: Raw plants, Prepared meals
| <?php | |
| // Converts a number into a short version, eg: 1000 -> 1k | |
| // Based on: http://stackoverflow.com/a/4371114 | |
| function number_format_short( $n, $precision = 1 ) { | |
| if ($n < 900) { | |
| // 0 - 900 | |
| $n_format = number_format($n, $precision); | |
| $suffix = ''; | |
| } else if ($n < 900000) { |
| <?php | |
| // $src = wp_get_attachment_image_src( $attachment_id, 'store-archive' ); | |
| // $src[0] = "http://.../uploads/my_image-240x350.jpg" | |
| // $src[1] = 240 | |
| // $src[2] = 350 | |
| add_action( 'after_setup_theme', 'ld_theme_image_sizes' ); | |
| function ld_theme_image_sizes() { | |
| // archive pages |
| [WORLD_GEN] | |
| [TITLE:RAD] | |
| [DIM:257:257] | |
| [EMBARK_POINTS:1504] | |
| [END_YEAR:1050] | |
| [BEAST_END_YEAR:300:80] | |
| [REVEAL_ALL_HISTORY:1] | |
| [CULL_HISTORICAL_FIGURES:1] | |
| [ELEVATION:1:400:800:800] | |
| [RAINFALL:0:100:400:400] |
| <?php | |
| /* | |
| Include this script then access your wordpress website with the URL ending in: ?wppscan=1 | |
| It will go through each post, 10 at a time, and update the views total/daily/weekly/monthly as post meta. | |
| This is to co-exist with your own option that saves these values periodically when saving post. That functionality is not included here. | |
| */ | |
| global $ld_recalc; |
| <?php | |
| function ld_custom_installation( $user_id ) { | |
| global $wpdb, $wp_rewrite, $table_prefix; | |
| // Use a blank site description instead of "Just another WordPress site" | |
| update_option( 'blogdescription', '' ); | |
| // Set Timezone to PST -- Full list at http://php.net/manual/en/timezones.america.php | |
| update_option( 'timezone_string', "America/Los_Angeles" ); |
| <?php | |
| function hfoh_use_first_image_as_featured_fallback( $html, $post_id, $thumbnail_id, $size, $attr ) { | |
| if ( $html ) return $html; | |
| // Pull the hook temporarily to prevent infinite loop | |
| remove_filter( 'post_thumbnail_html', 'hfoh_use_first_image_as_featured_fallback', 20 ); | |
| // If we have already detected one through content before, use the cached version. | |
| $custom_id = get_post_meta( $post_id, 'lm_thumbnail', true ); |
| // Autoplay youtube videos in Swipebox | |
| var autoplaySlide = function() { | |
| var $slider = jQuery('#swipebox-slider'); | |
| var $slide = $slider.children('.slide.current'); | |
| var $iframe = $slide.find('iframe'); | |
| if ( $iframe.length > 0 ) { | |
| if ( $iframe.attr('src').indexOf('youtu') >= 0 ) { | |
| if ( $iframe.attr('src').indexOf('autoplay=') >= 0 ) { | |
| $iframe.attr('src', function() { return jQuery(this).attr('src').replace('autoplay=0', 'autoplay=1'); }); |
| <?php | |
| // Example 1) Using a function. Returns an array. | |
| function radgh_get_video_data( $url, $width = null, $height = null ) { | |
| if ( function_exists('_wp_oembed_get_object') ) { | |
| require_once( ABSPATH . WPINC . '/class-oembed.php' ); | |
| } | |
| $args = array(); | |
| if ( $width ) $args['width'] = $width; | |
| if ( $height ) $args['height'] = $height; |
| <?php | |
| /* | |
| * Returns a URL that upon visiting, will add the product to the cart and do some other things as described below. | |
| * $qty = How many items to add to the cart | |
| * $limit = If true, it will prevent you from having more than $qty in your cart. | |
| * $remove_others = If true, any other products will be removed from the cart. | |
| * $redirect_to = If set to "cart" or "checkout", will redirect after adding the item. Does not work with a URL (to avoid XSS). | |
| * | |
| * @param $product_id | |
| * @param int $qty |