Advertisement
Guest User

bfa_get_options.php

a guest
May 25th, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.59 KB | None | 0 0
  1. <?php
  2. // If no option 'bfa_ata4' was saved yet
  3. if (get_option('bfa_ata4') === FALSE) {
  4.  
  5. // 268 Old ATA 3.X options:
  6. $bfa_ata3 = array(
  7. "start_here",
  8. "import_settings",
  9. "use_bfa_seo",
  10. "homepage_meta_description",
  11. "homepage_meta_keywords",
  12. "add_blogtitle",
  13. "title_separator_code",
  14. "archive_noindex",
  15. "cat_noindex",
  16. "tag_noindex",
  17. "h1_on_single_pages",
  18. "nofollow",
  19. "body_style",
  20. "link_color",
  21. "link_hover_color",
  22. "link_default_decoration",
  23. "link_hover_decoration",
  24. "link_weight",
  25. "layout_width",
  26. "layout_min_width",
  27. "layout_max_width",
  28. "layout_style",
  29. "layout_style_leftright_padding",
  30. "favicon_file",
  31. "configure_header",
  32. "logoarea_style",
  33. "logo",
  34. "logo_style",
  35. "blog_title_show",
  36. "blog_title_style",
  37. "blog_title_weight",
  38. "blog_title_color",
  39. "blog_title_color_hover",
  40. "blog_tagline_show",
  41. "blog_tagline_style",
  42. "show_search_box",
  43. "searchbox_style",
  44. "searchbox_text",
  45. "horbar1",
  46. "horbar2",
  47. "header_image_info",
  48. "header_image_javascript",
  49. "header_image_javascript_preload",
  50. "header_image_clickable",
  51. "headerimage_height",
  52. "headerimage_alignment",
  53. "header_opacity_left",
  54. "header_opacity_left_width",
  55. "header_opacity_left_color",
  56. "header_opacity_right",
  57. "header_opacity_right_width",
  58. "header_opacity_right_color",
  59. "overlay_blog_title",
  60. "overlay_blog_tagline",
  61. "overlay_box_style",
  62. "rss_settings_info" ,
  63. "rss_box_width",
  64. "show_posts_icon",
  65. "post_feed_link",
  66. "post_feed_link_title",
  67. "show_comments_icon",
  68. "comment_feed_link",
  69. "comment_feed_link_title",
  70. "show_email_icon",
  71. "email_subscribe_link",
  72. "email_subscribe_link_title",
  73. "feedburner_email_id",
  74. "feedburner_old_new",
  75. "home_page_menu_bar",
  76. "exclude_page_menu_bar",
  77. "levels_page_menu_bar",
  78. "sorting_page_menu_bar",
  79. "titles_page_menu_bar",
  80. "page_menu_1st_level_not_linked",
  81. "anchor_border_page_menu_bar",
  82. "page_menu_bar_background_color",
  83. "page_menu_bar_background_color_hover",
  84. "page_menu_bar_background_color_parent",
  85. "page_menu_font",
  86. "page_menu_bar_link_color",
  87. "page_menu_bar_link_color_hover",
  88. "page_menu_transform",
  89. "page_menu_arrows",
  90. "page_menu_submenu_width",
  91. "home_cat_menu_bar",
  92. "exclude_cat_menu_bar",
  93. "levels_cat_menu_bar",
  94. "sorting_cat_menu_bar",
  95. "order_cat_menu_bar",
  96. "titles_cat_menu_bar",
  97. "add_descr_cat_menu_links",
  98. "default_cat_descr_text",
  99. "anchor_border_cat_menu_bar",
  100. "cat_menu_bar_background_color",
  101. "cat_menu_bar_background_color_hover",
  102. "cat_menu_bar_background_color_parent",
  103. "cat_menu_font",
  104. "cat_menu_bar_link_color",
  105. "cat_menu_bar_link_color_hover",
  106. "cat_menu_transform",
  107. "cat_menu_arrows",
  108. "cat_menu_submenu_width",
  109. "center_column_style",
  110. "content_above_loop",
  111. "content_inside_loop",
  112. "content_below_loop",
  113. "content_not_found",
  114. "next_prev_orientation",
  115. "home_multi_next_prev",
  116. "home_single_next_prev",
  117. "multi_next_prev_newer",
  118. "multi_next_prev_older",
  119. "single_next_prev_newer",
  120. "single_next_prev_older",
  121. "comments_next_prev_newer",
  122. "comments_next_prev_older",
  123. "location_comments_next_prev",
  124. "next_prev_style_comments_above",
  125. "next_prev_style_comments_below",
  126. "next_prev_comments_pagination",
  127. "location_multi_next_prev",
  128. "location_single_next_prev",
  129. "next_prev_style_top",
  130. "next_prev_style_middle",
  131. "next_prev_style_bottom",
  132. "leftcol_on",
  133. "left_col_pages_exclude",
  134. "left_col_cats_exclude",
  135. "leftcol2_on",
  136. "left_col2_pages_exclude",
  137. "left_col2_cats_exclude",
  138. "rightcol_on",
  139. "right_col_pages_exclude",
  140. "right_col_cats_exclude",
  141. "rightcol2_on",
  142. // legacy "ight_col2" besides "right_col2" due to typo in "bfa_theme_options.php" in ATA 3.4.6
  143. "ight_col2_pages_exclude",
  144. "right_col2_pages_exclude",
  145. //
  146. "right_col2_cats_exclude",
  147. "left_sidebar_width",
  148. "left_sidebar2_width",
  149. "right_sidebar_width",
  150. "right_sidebar2_width",
  151. "left_sidebar_style",
  152. "left_sidebar2_style",
  153. "right_sidebar_style",
  154. "right_sidebar2_style",
  155. "widget_container",
  156. "widget_title_box",
  157. "widget_title",
  158. "widget_content",
  159. "widget_lists",
  160. "widget_lists2",
  161. "widget_lists3",
  162. "category_widget_display_type",
  163. "select_font_size",
  164. "widget_areas_reset",
  165. "widget_areas_info",
  166. "post_kicker_home",
  167. "post_kicker_multi",
  168. "post_kicker_single",
  169. "post_kicker_page",
  170. "post_byline_home",
  171. "post_byline_multi",
  172. "post_byline_single",
  173. "post_byline_page",
  174. "post_footer_home",
  175. "post_footer_multi",
  176. "post_footer_single",
  177. "post_footer_page",
  178. "post_container_style",
  179. "post_container_sticky_style",
  180. "post_kicker_style",
  181. "post_kicker_style_links",
  182. "post_kicker_style_links_hover",
  183. "post_headline_style",
  184. "post_headline_style_text",
  185. "post_headline_style_links",
  186. "post_headline_style_links_hover",
  187. "post_byline_style",
  188. "post_byline_style_links",
  189. "post_byline_style_links_hover",
  190. "post_bodycopy_style",
  191. "post_footer_style",
  192. "post_footer_style_links",
  193. "post_footer_style_links_hover",
  194. "excerpt_length",
  195. "dont_strip_excerpts",
  196. "custom_read_more",
  197. "excerpts_home",
  198. "full_posts_homepage",
  199. "excerpts_category",
  200. "excerpts_archive",
  201. "excerpts_tag",
  202. "excerpts_search",
  203. "excerpts_author",
  204. "post_thumbnail_width",
  205. "post_thumbnail_height",
  206. "post_thumbnail_crop",
  207. "post_thumbnail_css",
  208. "more_tag",
  209. "author_highlight",
  210. "author_highlight_color",
  211. "author_highlight_border_color",
  212. "comment_background_color",
  213. "comment_alt_background_color",
  214. "comment_border",
  215. "comment_author_size",
  216. "comment_reply_link_text",
  217. "comment_edit_link_text",
  218. "comment_moderation_text",
  219. "comments_are_closed_text",
  220. "comments_on_pages",
  221. "separate_trackback",
  222. "avatar_size",
  223. "avatar_style",
  224. "show_xhtml_tags",
  225. "comment_form_style",
  226. "submit_button_style",
  227. "comment_display_order",
  228. "footer_style",
  229. "footer_style_links",
  230. "footer_style_links_hover",
  231. "footer_style_content",
  232. "sticky_layout_footer",
  233. "footer_show_queries",
  234. "table",
  235. "table_caption",
  236. "table_th",
  237. "table_td",
  238. "table_tfoot_td",
  239. "table_zebra_stripes",
  240. "table_zebra_td",
  241. "table_hover_rows",
  242. "table_hover_td",
  243. "form_input_field_style",
  244. "form_input_field_background",
  245. "highlight_forms",
  246. "highlight_forms_style",
  247. "button_style",
  248. "button_style_hover",
  249. "blockquote_style",
  250. "blockquote_style_2nd_level",
  251. "post_image_style",
  252. "post_image_caption_style",
  253. "image_caption_text",
  254. "html_inserts_header",
  255. "html_inserts_body_tag",
  256. "html_inserts_body_top",
  257. "html_inserts_body_bottom",
  258. "html_inserts_css",
  259. "archives_page_id",
  260. "archives_date_show",
  261. "archives_date_title",
  262. "archives_date_type",
  263. "archives_date_limit",
  264. "archives_date_count",
  265. "archives_category_show",
  266. "archives_category_title",
  267. "archives_category_count",
  268. "archives_category_depth",
  269. "archives_category_orderby",
  270. "archives_category_order",
  271. "archives_category_feed",
  272. "css_external",
  273. "javascript_external",
  274. "pngfix_selectors",
  275. "css_compress",
  276. "allow_debug");
  277.  
  278. // If no old settings exit, use the new 'default' style
  279. $old_setting_exists = 'no';
  280. foreach ($bfa_ata3 as $old_option) {
  281. if (get_option( 'bfa_ata_' . $old_option ) !== FALSE )
  282. $old_setting_exists = 'yes';
  283. }
  284.  
  285. // Separate option bfa_widget_areas
  286. if (get_option('bfa_widget_areas') !== FALSE) {
  287. $all_old_widget_areas = get_option('bfa_widget_areas');
  288. foreach ( $all_old_widget_areas as $old_widget_area) {
  289. if ( isset($old_widget_area) )
  290. $old_setting_exists = 'yes';
  291. }
  292. }
  293.  
  294. if ( $old_setting_exists == 'yes' )
  295. $bfa_ata_default = unserialize(file_get_contents( TEMPLATEPATH . '/styles/ata-classic.txt' ));
  296. else
  297. $bfa_ata_default = unserialize(file_get_contents( TEMPLATEPATH . '/styles/ata-default.txt' ));
  298.  
  299. foreach ($options as $value) {
  300. if ($value['type'] != 'info') {
  301. if (get_option( 'bfa_ata_' . $value['id'] ) === FALSE)
  302. $bfa_ata4[ $value['id'] ] = $bfa_ata_default[ $value['id'] ];
  303. else
  304. $bfa_ata4[ $value['id'] ] = get_option( 'bfa_ata_' . $value['id'] );
  305. }
  306. }
  307. // Separate option bfa_widget_areas
  308. $bfa_ata4['bfa_widget_areas'] = get_option('bfa_widget_areas');
  309.  
  310. update_option('bfa_ata4', $bfa_ata4);
  311. }
  312.  
  313. $bfa_ata = get_option('bfa_ata4');
  314.  
  315. /*
  316. $bfa_ata['name'] = "Atahualpa";
  317. $bfa_ata['version'] = "3.4.8";
  318. */
  319. /*
  320. ob_start();
  321. if (get_bloginfo('wpurl') == '') {
  322. // Older WP versions
  323. bloginfo('siteurl');
  324. } else {
  325. bloginfo('wpurl');
  326. }
  327. $bfa_ata['siteurl'] = ob_get_contents();
  328. ob_end_clean();
  329. ob_start(); bloginfo('template_directory'); $bfa_ata['template_directory'] = ob_get_contents(); ob_end_clean();
  330. ob_start(); bloginfo('home'); $bfa_ata['get_option_home'] = ob_get_contents(); ob_end_clean();
  331.  
  332.  
  333. ob_start(); bloginfo('name'); $bfa_ata['bloginfo_name'] = ob_get_contents(); ob_end_clean();
  334. ob_start(); bloginfo('description'); $bfa_ata['bloginfo_description'] = ob_get_contents(); ob_end_clean();
  335.  
  336. ob_start(); bloginfo('comments_rss2_url'); $bfa_ata['bloginfo_comments_rss2_url'] = ob_get_contents(); ob_end_clean();
  337. ob_start(); bloginfo('rss2_url'); $bfa_ata['bloginfo_rss2_url'] = ob_get_contents(); ob_end_clean();
  338. */
  339.  
  340.  
  341. if ( is_page() ) {
  342. global $wp_query;
  343. $current_page_id = $wp_query->get_queried_object_id();
  344. }
  345.  
  346.  
  347. //figure out sidebars and "colspan=XX", based on theme options and type or ID of page that we are currently on:
  348.  
  349. $cols = 1;
  350. $left_col = '';
  351. $left_col2 = '';
  352. $right_col = '';
  353. $right_col2 = '';
  354.  
  355. if ( is_page() AND (function_exists('is_front_page') ? !is_front_page() : '') AND !is_home() ) {
  356.  
  357.  
  358. if ($bfa_ata['left_col_pages_exclude'] != "") {
  359. $pages_exlude_left = explode(",", str_replace(" ", "", $bfa_ata['left_col_pages_exclude']));
  360. if ( $bfa_ata['leftcol_on']['page'] AND !in_array($current_page_id, $pages_exlude_left) ) {
  361. $cols++; $left_col = "on";
  362. }
  363. } else {
  364. if ( $bfa_ata['leftcol_on']['page'] ) {
  365. $cols++; $left_col = "on";
  366. }
  367. }
  368.  
  369. if ($bfa_ata['left_col2_pages_exclude'] != "") {
  370. $pages_exlude_left2 = explode(",", str_replace(" ", "", $bfa_ata['left_col2_pages_exclude']));
  371. if ( $bfa_ata['leftcol2_on']['page'] AND !in_array($current_page_id, $pages_exlude_left2) ) {
  372. $cols++; $left_col2 = "on";
  373. }
  374. } else {
  375. if ( $bfa_ata['leftcol2_on']['page'] ) {
  376. $cols++; $left_col2 = "on";
  377. }
  378. }
  379.  
  380. if ($bfa_ata['right_col_pages_exclude'] != "") {
  381. $pages_exlude_right = explode(",", str_replace(" ", "", $bfa_ata['right_col_pages_exclude']));
  382. if ( $bfa_ata['rightcol_on']['page'] AND !in_array($current_page_id, $pages_exlude_right) ) {
  383. $cols++; $right_col = "on";
  384. }
  385. } else {
  386. if ( $bfa_ata['rightcol_on']['page'] ) {
  387. $cols++; $right_col = "on";
  388. }
  389. }
  390.  
  391. if ($bfa_ata['right_col2_pages_exclude'] != "") {
  392. $pages_exlude_right2 = explode(",", str_replace(" ", "", $bfa_ata['right_col2_pages_exclude']));
  393. if ( $bfa_ata['rightcol2_on']['page'] AND !in_array($current_page_id, $pages_exlude_right2) ) {
  394. $cols++; $right_col2 = "on";
  395. }
  396. } else {
  397. if ( $bfa_ata['rightcol2_on']['page'] ) {
  398. $cols++; $right_col2 = "on";
  399. }
  400. }
  401.  
  402. } elseif ( is_category() ) {
  403.  
  404. $current_cat_id = get_query_var('cat');
  405.  
  406. if ($bfa_ata['left_col_cats_exclude'] != "") {
  407. $cats_exlude_left = explode(",", str_replace(" ", "", $bfa_ata['left_col_cats_exclude']));
  408. if ( $bfa_ata['leftcol_on']['category'] AND !in_array($current_cat_id, $cats_exlude_left) ) {
  409. $cols++; $left_col = "on";
  410. }
  411. } else {
  412. if ( $bfa_ata['leftcol_on']['category'] ) {
  413. $cols++; $left_col = "on";
  414. }
  415. }
  416.  
  417. if ($bfa_ata['left_col2_cats_exclude'] != "") {
  418. $cats_exlude_left2 = explode(",", str_replace(" ", "", $bfa_ata['left_col2_cats_exclude']));
  419. if ( $bfa_ata['leftcol2_on']['category'] AND !in_array($current_cat_id, $cats_exlude_left2) ) {
  420. $cols++; $left_col2 = "on";
  421. }
  422. } else {
  423. if ( $bfa_ata['leftcol2_on']['category'] ) {
  424. $cols++; $left_col2 = "on";
  425. }
  426. }
  427.  
  428. if ($bfa_ata['right_col_cats_exclude'] != "") {
  429. $cats_exlude_right = explode(",", str_replace(" ", "", $bfa_ata['right_col_cats_exclude']));
  430. if ( $bfa_ata['rightcol_on']['category'] AND !in_array($current_cat_id, $cats_exlude_right) ) {
  431. $cols++; $right_col = "on";
  432. }
  433. } else {
  434. if ( $bfa_ata['rightcol_on']['category'] ) {
  435. $cols++; $right_col = "on";
  436. }
  437. }
  438.  
  439. if ($bfa_ata['right_col2_cats_exclude'] != "") {
  440. $cats_exlude_right2 = explode(",", str_replace(" ", "", $bfa_ata['right_col2_cats_exclude']));
  441. if ( $bfa_ata['rightcol2_on']['category'] AND !in_array($current_cat_id, $cats_exlude_right2) ) {
  442. $cols++; $right_col2 = "on";
  443. }
  444. } else {
  445. if ( $bfa_ata['rightcol2_on']['category'] ) {
  446. $cols++; $right_col2 = "on";
  447. }
  448. }
  449.  
  450. } else {
  451.  
  452. if ( (is_home() && $bfa_ata['leftcol_on']['homepage']) OR
  453. ( function_exists('is_front_page') ? is_front_page() AND $bfa_ata['leftcol_on']['frontpage'] : '') OR
  454. ( is_single() && $bfa_ata['leftcol_on']['single']) OR ( is_date() AND $bfa_ata['leftcol_on']['date']) OR
  455. ( is_tag() && $bfa_ata['leftcol_on']['tag']) OR ( is_archive() AND !( is_tag() OR is_author() OR is_date() OR is_category()) && $bfa_ata['leftcol_on']['taxonomy'])
  456. OR ( is_search() AND $bfa_ata['leftcol_on']['search']) OR
  457. ( is_author() && $bfa_ata['leftcol_on']['author']) OR ( is_404() AND $bfa_ata['leftcol_on']['404']) OR
  458. ( is_attachment() && $bfa_ata['leftcol_on']['attachment']) ) {
  459. $cols++; $left_col = "on";
  460. }
  461.  
  462. if ( (is_home() && $bfa_ata['leftcol2_on']['homepage']) OR
  463. ( function_exists('is_front_page') ? is_front_page() AND $bfa_ata['leftcol2_on']['frontpage'] : '') OR
  464. ( is_single() && $bfa_ata['leftcol2_on']['single']) OR ( is_date() AND $bfa_ata['leftcol2_on']['date']) OR
  465. ( is_tag() && $bfa_ata['leftcol2_on']['tag']) OR ( is_archive() AND !( is_tag() OR is_author() OR is_date() OR is_category()) && $bfa_ata['leftcol2_on']['taxonomy'])
  466. OR ( is_search() AND $bfa_ata['leftcol2_on']['search']) OR
  467. ( is_author() && $bfa_ata['leftcol2_on']['author']) OR ( is_404() AND $bfa_ata['leftcol2_on']['404']) OR
  468. ( is_attachment() && $bfa_ata['leftcol2_on']['attachment']) ) {
  469. $cols++; $left_col2 = "on";
  470. }
  471.  
  472. if ( (is_home() && $bfa_ata['rightcol_on']['homepage']) OR
  473. ( function_exists('is_front_page') ? is_front_page() AND $bfa_ata['rightcol_on']['frontpage'] : '') OR
  474. ( is_single() && $bfa_ata['rightcol_on']['single']) OR ( is_date() AND $bfa_ata['rightcol_on']['date']) OR
  475. ( is_tag() && $bfa_ata['rightcol_on']['tag']) OR ( is_archive() AND !( is_tag() OR is_author() OR is_date() OR is_category()) && $bfa_ata['rightcol_on']['taxonomy'])
  476. OR ( is_search() AND $bfa_ata['rightcol_on']['search']) OR
  477. ( is_author() && $bfa_ata['rightcol_on']['author']) OR ( is_404() AND $bfa_ata['rightcol_on']['404']) OR
  478. ( is_attachment() && $bfa_ata['rightcol_on']['attachment']) ) {
  479. $cols++; $right_col = "on";
  480. }
  481.  
  482. if ( (is_home() && $bfa_ata['rightcol2_on']['homepage']) OR
  483. ( function_exists('is_front_page') ? is_front_page() AND $bfa_ata['rightcol2_on']['frontpage'] : '') OR
  484. ( is_single() && $bfa_ata['rightcol2_on']['single']) OR ( is_date() AND $bfa_ata['rightcol2_on']['date']) OR
  485. ( is_tag() && $bfa_ata['rightcol2_on']['tag']) OR ( is_archive() AND !( is_tag() OR is_author() OR is_date() OR is_category()) && $bfa_ata['rightcol2_on']['taxonomy'])
  486. OR ( is_search() AND $bfa_ata['rightcol2_on']['search']) OR
  487. ( is_author() && $bfa_ata['rightcol2_on']['author']) OR ( is_404() AND $bfa_ata['rightcol2_on']['404']) OR
  488. ( is_attachment() && $bfa_ata['rightcol2_on']['attachment']) ) {
  489. $cols++; $right_col2 = "on";
  490. }
  491.  
  492. }
  493.  
  494.  
  495. // $bfa_ata['h1_on_single_pages'] turn the blogtitle to h2 and the post/page title to h1 on single post pages and static "page" pages
  496. if ( $bfa_ata['h1_on_single_pages'] == "Yes" AND ( is_single() OR is_page() ) ) {
  497. $bfa_ata['h_blogtitle'] = 2; $bfa_ata['h_posttitle'] = 1;
  498. } else {
  499. $bfa_ata['h_blogtitle'] = 1; $bfa_ata['h_posttitle'] = 2;
  500. }
  501.  
  502.  
  503.  
  504. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement