1 | <?php
|
---|
2 | global $options;
|
---|
3 | foreach ($options as $value) { if (get_option( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_option( $value['id'] ); } }
|
---|
4 | // figure out sidebars
|
---|
5 | global $cols;
|
---|
6 | $cols = 1;
|
---|
7 | if ( is_page() ) {
|
---|
8 | #$current_page_id = $wp_query->get('page_id');
|
---|
9 | $current_page_id = $wp_query->get_queried_object_id();
|
---|
10 | if ($bfa_ata_left_col_pages_exclude != "") {
|
---|
11 | $pages_exlude_left = explode(",", str_replace(" ", "", $bfa_ata_left_col_pages_exclude));
|
---|
12 | if ( $bfa_ata_leftcol_on['page'] && !in_array($current_page_id, $pages_exlude_left) ) {
|
---|
13 | $cols++; $left_col = "on"; }
|
---|
14 | } else {
|
---|
15 | if ( $bfa_ata_leftcol_on['page'] ) {
|
---|
16 | $cols++; $left_col = "on"; }
|
---|
17 | }
|
---|
18 | if ($bfa_ata_right_col_pages_exclude != "") {
|
---|
19 | $pages_exlude_right = explode(",", str_replace(" ", "", $bfa_ata_right_col_pages_exclude));
|
---|
20 | if ( $bfa_ata_rightcol_on['page'] && !in_array($current_page_id, $pages_exlude_right) ) {
|
---|
21 | $cols++; $right_col = "on"; }
|
---|
22 | } else {
|
---|
23 | if ( $bfa_ata_rightcol_on['page'] ) {
|
---|
24 | $cols++; $right_col = "on"; }
|
---|
25 | }
|
---|
26 | } elseif ( is_category() ) {
|
---|
27 | $current_cat_id = get_query_var('cat');
|
---|
28 | if ($bfa_ata_left_col_cats_exclude != "") {
|
---|
29 | $cats_exlude_left = explode(",", str_replace(" ", "", $bfa_ata_left_col_cats_exclude));
|
---|
30 | if ( $bfa_ata_leftcol_on['category'] && !in_array($current_cat_id, $cats_exlude_left) ) {
|
---|
31 | $cols++; $left_col = "on"; }
|
---|
32 | } else {
|
---|
33 | if ( $bfa_ata_leftcol_on['category'] ) {
|
---|
34 | $cols++; $left_col = "on"; }
|
---|
35 | }
|
---|
36 | if ($bfa_ata_right_col_cats_exclude != "") {
|
---|
37 | $cats_exlude_right = explode(",", str_replace(" ", "", $bfa_ata_right_col_cats_exclude));
|
---|
38 | if ( $bfa_ata_rightcol_on['category'] && !in_array($current_cat_id, $cats_exlude_right) ) {
|
---|
39 | $cols++; $right_col = "on"; }
|
---|
40 | } else {
|
---|
41 | if ( $bfa_ata_rightcol_on['category'] ) {
|
---|
42 | $cols++; $right_col = "on"; }
|
---|
43 | }
|
---|
44 | } else {
|
---|
45 | if ( (is_home() && $bfa_ata_leftcol_on['homepage']) || ( is_front_page() && $bfa_ata_leftcol_on['frontpage']) ||
|
---|
46 | ( is_single() && $bfa_ata_leftcol_on['single']) || ( is_date() && $bfa_ata_leftcol_on['date']) ||
|
---|
47 | ( is_tag() && $bfa_ata_leftcol_on['tag']) || ( is_search() && $bfa_ata_leftcol_on['search']) ||
|
---|
48 | ( is_author() && $bfa_ata_leftcol_on['author']) || ( is_404() && $bfa_ata_leftcol_on['404']) ||
|
---|
49 | ( is_attachment() && $bfa_ata_leftcol_on['attachment']) ) {
|
---|
50 | $cols++; $left_col = "on";
|
---|
51 | }
|
---|
52 | if ( (is_home() && $bfa_ata_rightcol_on['homepage']) || ( is_front_page() && $bfa_ata_rightcol_on['frontpage']) ||
|
---|
53 | ( is_single() && $bfa_ata_rightcol_on['single']) || ( is_date() && $bfa_ata_rightcol_on['date']) ||
|
---|
54 | ( is_tag() && $bfa_ata_rightcol_on['tag']) || ( is_search() && $bfa_ata_rightcol_on['search']) ||
|
---|
55 | ( is_author() && $bfa_ata_rightcol_on['author']) || ( is_404() && $bfa_ata_rightcol_on['404']) ||
|
---|
56 | ( is_attachment() && $bfa_ata_rightcol_on['attachment']) ) {
|
---|
57 | $cols++; $right_col = "on";
|
---|
58 | }
|
---|
59 | }
|
---|
60 | ?>
|
---|
61 | </td>
|
---|
62 | <!-- / Main Column -->
|
---|
63 |
|
---|
64 | <?php if ( $right_col == "on" ) { ?>
|
---|
65 | <!-- Right Sidebar -->
|
---|
66 | <td id="right">
|
---|
67 |
|
---|
68 | <?php // Widgetize the Right Sidebar
|
---|
69 | if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : echo "To put some content here, go to Site Admin -> Appearance/Presentation -> Widgets -> Select \"Right Sidebar\" -> Click \"Show\" -> Click on \"Add\" on one of the widgets on the left side -> Click \"Save changes\" -> Done";
|
---|
70 | endif; ?>
|
---|
71 |
|
---|
72 | </td>
|
---|
73 | <!-- / Right Sidebar -->
|
---|
74 | <?php } ?>
|
---|
75 |
|
---|
76 | </tr>
|
---|
77 | <!-- / Main Body -->
|
---|
78 |
|
---|
79 | <tr>
|
---|
80 |
|
---|
81 | <!-- Footer -->
|
---|
82 | <td id="footer" colspan="<?php echo $cols; ?>">
|
---|
83 |
|
---|
84 | <p>
|
---|
85 | <?php echo bfa_footer($bfa_ata_footer_style_content); ?>
|
---|
86 | </p>
|
---|
87 | <?php if ($bfa_ata_footer_show_queries == "Yes - visible") { ?>
|
---|
88 | <p>
|
---|
89 | <?php echo $wpdb->num_queries; ?><?php _e(' queries. ','atahualpa'); ?><?php timer_stop(1); ?><?php _e(' seconds.','atahualpa'); ?>
|
---|
90 | </p>
|
---|
91 | <?php } ?>
|
---|
92 |
|
---|
93 | <?php if ($bfa_ata_footer_show_queries == "Yes - in source code") { ?>
|
---|
94 | <!--
|
---|
95 | <?php echo $wpdb->num_queries; ?><?php _e(' queries. ','atahualpa'); ?><?php timer_stop(1); ?><?php _e(' seconds.','atahualpa'); ?>
|
---|
96 | -->
|
---|
97 | <?php } ?>
|
---|
98 |
|
---|
99 | <?php wp_footer(); ?>
|
---|
100 | </td>
|
---|
101 | <!-- / Footer -->
|
---|
102 |
|
---|
103 | </tr>
|
---|
104 | </table><!-- / layout -->
|
---|
105 | </div><!-- / container -->
|
---|
106 | </div><!-- / wrapper -->
|
---|
107 | <?php echo ($bfa_ata_html_inserts_body_bottom != "" ? apply_filters(widget_text, $bfa_ata_html_inserts_body_bottom) : ''); ?>
|
---|
108 | </body>
|
---|
109 | </html>
|
---|