Skip to content
Newer
Older
100644 133 lines (117 sloc) 3.47 KB
aab64ad @alexkingorg adding compatibility functions
alexkingorg authored Nov 21, 2008
1 <?php
2
58bb01f @alexkingorg copyright year update
alexkingorg authored Jun 11, 2011
3 // This file is part of the Carrington Core Platform for WordPress
1a7d216 @alexkingorg update URL and copyright year
alexkingorg authored Nov 12, 2013
4 // http://crowdfavorite.com/carrington-core/
aab64ad @alexkingorg adding compatibility functions
alexkingorg authored Nov 21, 2008
5 //
1a7d216 @alexkingorg update URL and copyright year
alexkingorg authored Nov 12, 2013
6 // Copyright (c) 2008-2013 Crowd Favorite, Ltd. All rights reserved.
aab64ad @alexkingorg adding compatibility functions
alexkingorg authored Nov 21, 2008
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
a0a3867 @alexkingorg undo error reporting
alexkingorg authored Oct 30, 2010
20 // ini_set('display_errors', '1');
21 // ini_set('error_reporting', E_ALL);
aab64ad @alexkingorg adding compatibility functions
alexkingorg authored Nov 21, 2008
22
fb2374e @alexkingorg bump version number
alexkingorg authored Nov 12, 2013
23 define('CFCT_CORE_VERSION', '3.7');
1da2fb3 @alexkingorg adding version into core
alexkingorg authored Aug 16, 2009
24
ceb26b8 @gordonbrander Define CFCT_PATH if it hasn't been defined in the implementation.
gordonbrander authored Apr 1, 2010
25 // Path to Carrington Core parent directory (usually the theme).
26 if (!defined('CFCT_PATH')) {
27 define('CFCT_PATH', trailingslashit(TEMPLATEPATH));
28 }
29
6a453d2 @alexkingorg move some theme specific stuff out of core
alexkingorg authored Jan 4, 2009
30 load_theme_textdomain('carrington');
31
e0b1e22 @alexkingorg restructuring, removing unneeded code
alexkingorg authored Jan 18, 2009
32 include_once(CFCT_PATH.'carrington-core/admin.php');
33 include_once(CFCT_PATH.'carrington-core/templates.php');
34 include_once(CFCT_PATH.'carrington-core/utility.php');
35 include_once(CFCT_PATH.'carrington-core/ajax-load.php');
36 include_once(CFCT_PATH.'carrington-core/attachment.php');
56a758c @gordonbrander Adding compatibility functions, removing sandbox class functions in f…
gordonbrander authored Feb 16, 2009
37 include_once(CFCT_PATH.'carrington-core/compatibility.php');
aab64ad @alexkingorg adding compatibility functions
alexkingorg authored Nov 21, 2008
38
39 cfct_load_plugins();
40
dd2c7a1 @alexkingorg lots of changes: adds support for custom taxonomies, PHPdoc, fixes mi…
alexkingorg authored Oct 30, 2010
41 /**
42 * Loads AJAX request handler
43 *
44 **/
aab64ad @alexkingorg adding compatibility functions
alexkingorg authored Nov 21, 2008
45 function cfct_init() {
46 cfct_admin_request_handler();
6f1b1a0 Prefixing cfct options, using cfct_get_option instead of get_option
Evan Anderson authored Jul 18, 2011
47 if (cfct_get_option('ajax_load') == 'yes') {
aab64ad @alexkingorg adding compatibility functions
alexkingorg authored Nov 21, 2008
48 cfct_ajax_load();
49 }
50 }
8129105 WP core settings API integration
Evan Anderson authored Jul 13, 2011
51 //add_action('init', 'cfct_init');
aab64ad @alexkingorg adding compatibility functions
alexkingorg authored Nov 21, 2008
52
dd2c7a1 @alexkingorg lots of changes: adds support for custom taxonomies, PHPdoc, fixes mi…
alexkingorg authored Oct 30, 2010
53 /**
65c5122 @alexkingorg remove unused home stuff, refactor options page
alexkingorg authored Jun 21, 2011
54 * Loads header code from Carrington Options
55 *
56 **/
57 function cfct_wp_head() {
6f1b1a0 Prefixing cfct options, using cfct_get_option instead of get_option
Evan Anderson authored Jul 18, 2011
58 echo cfct_get_option('wp_head');
65c5122 @alexkingorg remove unused home stuff, refactor options page
alexkingorg authored Jun 21, 2011
59 }
60 add_action('wp_head', 'cfct_wp_head');
61
62 /**
dd2c7a1 @alexkingorg lots of changes: adds support for custom taxonomies, PHPdoc, fixes mi…
alexkingorg authored Oct 30, 2010
63 * Loads footer code from Carrington Options
64 *
65 **/
aab64ad @alexkingorg adding compatibility functions
alexkingorg authored Nov 21, 2008
66 function cfct_wp_footer() {
6f1b1a0 Prefixing cfct options, using cfct_get_option instead of get_option
Evan Anderson authored Jul 18, 2011
67 echo cfct_get_option('wp_footer');
aab64ad @alexkingorg adding compatibility functions
alexkingorg authored Nov 21, 2008
68 }
69 add_action('wp_footer', 'cfct_wp_footer');
70
dd2c7a1 @alexkingorg lots of changes: adds support for custom taxonomies, PHPdoc, fixes mi…
alexkingorg authored Oct 30, 2010
71 /**
72 * Loads about text from Carrington options for display in the sidebar
73 *
74 * @return string Markup for the about text
75 *
76 **/
f261850 @alexkingorg abstracted about text
alexkingorg authored Nov 21, 2008
77 function cfct_about_text() {
6f1b1a0 Prefixing cfct options, using cfct_get_option instead of get_option
Evan Anderson authored Jul 18, 2011
78 $about_text = cfct_get_option('about_text');
f261850 @alexkingorg abstracted about text
alexkingorg authored Nov 21, 2008
79 if (!empty($about_text)) {
76cb414 @alexkingorg abstract basic formatting
alexkingorg authored Mar 7, 2009
80 $about_text = cfct_basic_content_formatting($about_text);
f261850 @alexkingorg abstracted about text
alexkingorg authored Nov 21, 2008
81 }
82 else {
b79eebd @alexkingorg workaround for possible WP bug
alexkingorg authored May 11, 2009
83 global $post, $wp_query;
83dbec6 @alexkingorg reset post to original after getting about content
alexkingorg authored Aug 31, 2009
84 $orig_post = $post;
ab61f9c @alexkingorg suppress harmless PHP notices
alexkingorg authored Oct 7, 2009
85 isset($wp_query->query_vars['page']) ? $page = $wp_query->query_vars['page'] : $page = null;
b79eebd @alexkingorg workaround for possible WP bug
alexkingorg authored May 11, 2009
86 // temporary - resetting below
87 $wp_query->query_vars['page'] = null;
f261850 @alexkingorg abstracted about text
alexkingorg authored Nov 21, 2008
88 remove_filter('the_excerpt', 'st_add_widget');
89 $about_query = new WP_Query('pagename=about');
90 while ($about_query->have_posts()) {
91 $about_query->the_post();
92 $about_text = get_the_excerpt().sprintf(__('<a class="more" href="%s">more &rarr;</a>', 'carrington'), get_permalink());
93 }
b79eebd @alexkingorg workaround for possible WP bug
alexkingorg authored May 11, 2009
94 $wp_query->query_vars['page'] = $page;
dd2c7a1 @alexkingorg lots of changes: adds support for custom taxonomies, PHPdoc, fixes mi…
alexkingorg authored Oct 30, 2010
95 if (!empty($orig_post)) {
96 $post = $orig_post;
97 setup_postdata($post);
98 }
f261850 @alexkingorg abstracted about text
alexkingorg authored Nov 21, 2008
99 }
100 if (function_exists('st_add_widget')) {
101 add_filter('the_excerpt', 'st_add_widget');
102 }
103 return $about_text;
104 }
105
dd2c7a1 @alexkingorg lots of changes: adds support for custom taxonomies, PHPdoc, fixes mi…
alexkingorg authored Oct 30, 2010
106 /**
107 * Gets custom colors to be used with a themes
108 *
109 * @return string Custom color
110 *
111 **/
0ce605a @alexkingorg cleanup
alexkingorg authored Mar 20, 2009
112 function cfct_get_custom_colors($type = 'option') {
113 global $cfct_color_options;
114 $colors = array();
115 foreach ($cfct_color_options as $option => $value) {
116 switch ($type) {
117 case 'preview':
118 !empty($_GET[$option]) ? $colors[$option] = strip_tags(stripslashes($_GET[$option])) : $colors[$option] = '';
119 break;
120 case 'option':
121 default:
122 $colors[$option] = cfct_get_option($option);
123 break;
124 }
125 }
126 return $colors;
127 }
128
aab64ad @alexkingorg adding compatibility functions
alexkingorg authored Nov 21, 2008
129 if (!defined('CFCT_DEBUG')) {
130 define('CFCT_DEBUG', false);
131 }
132
Something went wrong with that request. Please try again.