Пример #1
0
    /**
     * Helper function used by RollingArchives
     */
    function setup_rolling_archives()
    {
        global $wp_query;
        // Get the query
        if (is_array($wp_query->query)) {
            $rolling_query = $wp_query->query;
        } elseif (is_string($wp_query->query)) {
            parse_str($wp_query->query, $rolling_query);
        }
        // Get list of page dates
        if (!is_page() and !is_single()) {
            $page_dates = get_rolling_page_dates($wp_query);
        }
        // Get the current page
        $rolling_page = intval(get_query_var('paged'));
        if ($rolling_page < 1) {
            $rolling_page = 1;
        }
        ?>
			<script type="text/javascript">
			// <![CDATA[
				jQuery(document).ready(function() {
					K2.RollingArchives.setState(
						<?php 
        echo (int) $rolling_page;
        ?>
,
						<?php 
        echo (int) $wp_query->max_num_pages;
        ?>
,
						<?php 
        output_javascript_hash($rolling_query);
        ?>
,
						<?php 
        output_javascript_array($page_dates);
        ?>
					);

					if (K2.Animations) {
						smartPosition('#dynamic-content');
					}
				});
			// ]]>
			</script>
		<?php 
    }
Пример #2
0
        ?>
",
			"<?php 
        echo attribute_escape(__('Page %1$d of %2$d', k2_domain));
        ?>
",
			<?php 
        echo $rolling_page;
        ?>
,
			<?php 
        echo $wp_query->max_num_pages;
        ?>
,
			<?php 
        output_javascript_hash($rolling_query);
        ?>
,
			<?php 
        output_javascript_array($page_dates);
        ?>
		);

		k2Trimmer.setup(100);
	});
// ]]>
</script>
<?php 
    }
}
?>