[44] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | // This file is part of the Carrington Theme Framework for WordPress
|
---|
| 4 | // http://carringtontheme.com
|
---|
| 5 | //
|
---|
| 6 | // Copyright (c) 2008-2009 Crowd Favorite, Ltd. All rights reserved.
|
---|
| 7 | // http://crowdfavorite.com
|
---|
| 8 | //
|
---|
| 9 | // Released under the GPL license
|
---|
| 10 | // http://www.opensource.org/licenses/gpl-license.php
|
---|
| 11 | //
|
---|
| 12 | // **********************************************************************
|
---|
| 13 | // This program is distributed in the hope that it will be useful, but
|
---|
| 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
---|
| 16 | // **********************************************************************
|
---|
| 17 |
|
---|
| 18 | if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die(); }
|
---|
| 19 |
|
---|
| 20 | // ini_set('display_errors', '1');
|
---|
| 21 | // ini_set('error_reporting', E_ALL);
|
---|
| 22 |
|
---|
| 23 | load_theme_textdomain('carrington');
|
---|
| 24 |
|
---|
| 25 | $cfct_options[] = 'cfct_about_text';
|
---|
| 26 | $cfct_options[] = 'cfct_credit';
|
---|
| 27 | $cfct_options[] = 'cfct_wp_footer';
|
---|
| 28 |
|
---|
| 29 | include_once(CFCT_PATH.'carrington-core/admin.php');
|
---|
| 30 | include_once(CFCT_PATH.'carrington-core/templates.php');
|
---|
| 31 | include_once(CFCT_PATH.'carrington-core/utility.php');
|
---|
| 32 | include_once(CFCT_PATH.'carrington-core/ajax-load.php');
|
---|
| 33 | include_once(CFCT_PATH.'carrington-core/attachment.php');
|
---|
| 34 | include_once(CFCT_PATH.'carrington-core/compatibility.php');
|
---|
| 35 |
|
---|
| 36 | cfct_load_plugins();
|
---|
| 37 |
|
---|
| 38 | function cfct_init() {
|
---|
| 39 | cfct_admin_request_handler();
|
---|
| 40 | if (cfct_get_option('cfct_ajax_load') == 'yes') {
|
---|
| 41 | cfct_ajax_load();
|
---|
| 42 | }
|
---|
| 43 | }
|
---|
| 44 | add_action('init', 'cfct_init');
|
---|
| 45 |
|
---|
| 46 | function cfct_wp_footer() {
|
---|
| 47 | echo get_option('cfct_wp_footer');
|
---|
| 48 | }
|
---|
| 49 | add_action('wp_footer', 'cfct_wp_footer');
|
---|
| 50 |
|
---|
| 51 | function cfct_about_text() {
|
---|
| 52 | $about_text = get_option('cfct_about_text');
|
---|
| 53 | if (!empty($about_text)) {
|
---|
| 54 | $about_text = cfct_basic_content_formatting($about_text);
|
---|
| 55 | }
|
---|
| 56 | else {
|
---|
| 57 | global $post, $wp_query;
|
---|
| 58 | $page = $wp_query->query_vars['page'];
|
---|
| 59 | // temporary - resetting below
|
---|
| 60 | $wp_query->query_vars['page'] = null;
|
---|
| 61 | remove_filter('the_excerpt', 'st_add_widget');
|
---|
| 62 | $about_query = new WP_Query('pagename=about');
|
---|
| 63 | while ($about_query->have_posts()) {
|
---|
| 64 | $about_query->the_post();
|
---|
| 65 | $about_text = get_the_excerpt().sprintf(__('<a class="more" href="%s">more →</a>', 'carrington'), get_permalink());
|
---|
| 66 | }
|
---|
| 67 | $wp_query->query_vars['page'] = $page;
|
---|
| 68 | }
|
---|
| 69 | if (function_exists('st_add_widget')) {
|
---|
| 70 | add_filter('the_excerpt', 'st_add_widget');
|
---|
| 71 | }
|
---|
| 72 | return $about_text;
|
---|
| 73 | }
|
---|
| 74 |
|
---|
| 75 | function cfct_get_custom_colors($type = 'option') {
|
---|
| 76 | global $cfct_color_options;
|
---|
| 77 | $colors = array();
|
---|
| 78 | foreach ($cfct_color_options as $option => $value) {
|
---|
| 79 | switch ($type) {
|
---|
| 80 | case 'preview':
|
---|
| 81 | !empty($_GET[$option]) ? $colors[$option] = strip_tags(stripslashes($_GET[$option])) : $colors[$option] = '';
|
---|
| 82 | break;
|
---|
| 83 | case 'option':
|
---|
| 84 | default:
|
---|
| 85 | $colors[$option] = cfct_get_option($option);
|
---|
| 86 | break;
|
---|
| 87 | }
|
---|
| 88 | }
|
---|
| 89 | return $colors;
|
---|
| 90 | }
|
---|
| 91 |
|
---|
| 92 | if (!defined('CFCT_DEBUG')) {
|
---|
| 93 | define('CFCT_DEBUG', false);
|
---|
| 94 | }
|
---|
| 95 |
|
---|
| 96 | ?> |
---|