PluginProbe
oik / 1.2
oik v1.2
1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.2 1.3 1.3.1 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.0.1 2.1 2.2 2.3 2.4 2.5 2.5.1 All 71 releases
oik / oik.php

oik.php in oik 1.2, at oik.php

212 lines 8.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 Plugin Name: oik base plugin
5 Plugin URI: http://www.bobbingwidewebdesign.com/oik
6 Description: Easy to use shortcode macros for often included key-information
7 Version: 1.2
8 Author: bobbingwide
9 Author URI: http://www.bobbingwide.com
10 License: GPL2
11
12 Copyright 2010, 2011 Bobbing Wide (email : herb@bobbingwide.com )
13
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License version 2,
16 as published by the Free Software Foundation.
17
18 You may NOT assume that you can use any other version of the GPL.
19
20 This program is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License for more details.
24
25 The license for this software can likely be found here:
26 http://www.gnu.org/licenses/gpl-2.0.html
27
28 */
29 global $bw_options;
30
31
32 //echo '<p>BATa='.$bwapi_trace_test.'=aBAT</p>';
33 /* All of the oik plugins and many of the common functions include calls to bw_trace so we
34 need to include it
35 */
36
37 require_once( 'bwtrace.inc' );
38 require_once( "bobbfunc.inc" );
39 require_once( "bobblink.inc" );
40 require_once( "bobbcomp.inc" );
41 require_once( "bwlink.inc" );
42 require_once( "bobbgoog.inc" );
43
44 function oik_version() {
45 return bw_oik_version();
46 }
47
48 $bobb_prefix = NULL;
49 $bw_echo = NULL;
50
51 $theme = "bobbingwide";
52 $art_theme = NULL;
53 $bobb_theme = NULL;
54
55 require_once( "oik-shortc-shortcodes.php" );
56 require_once( "oik-add-shortcodes.php" );
57
58 add_filter('widget_text', 'do_shortcode');
59 add_filter('the_title', 'do_shortcode' );
60 //add_filter('wpbody-content', 'do_shortcode' );
61 add_filter('wp_footer', 'do_shortcode' );
62
63 add_filter('get_the_excerpt', 'do_shortcode' );
64 add_filter('the_excerpt', 'do_shortcode' );
65 add_filter('the_content', 'do_shortcode' );
66 //add_filter('get_pages', 'do_shortcode' );
67
68
69 // In which sequence should these go?
70 // trying api, bobbingwide then bwlink
71
72 $bw_options = get_option( 'bw_options' );
73
74 wp_enqueue_style( 'oikCSS', WP_PLUGIN_URL . '/oik/oik.css' );
75 wp_enqueue_style( 'bwlinkCSS', WP_PLUGIN_URL . '/oik/bwlink.css' );
76
77 $customCSS = bw_get_company( 'customCSS' );
78 if ( !empty( $customCSS) )
79 wp_enqueue_style( 'customCSS', get_theme_root_uri() . $customCSS);
80
81
82 add_action('admin_init', 'oik_options_init' );
83 add_action('admin_menu', 'oik_options_add_page');
84
85 // Init plugin options
86 function oik_options_init() {
87 register_setting( 'oik_options_options', 'bw_options', 'oik_options_validate' );
88 }
89
90 // Add the options page
91 function oik_options_add_page() {
92 add_options_page('[oik] Options', 'oik options', 'manage_options', 'bw_options', 'oik_options_do_page');
93 }
94
95 // Draw the oik options page
96 function oik_options_do_page() {
97 require_once( "bobbforms.inc" );
98 sdiv( "column span-15 wrap" );
99 h2( bw_oik(). " shortcode options" );
100 e( '<form method="post" action="options.php">' );
101 $options = get_option('bw_options');
102
103 stag( 'table class="form-table"' );
104 bw_flush();
105 settings_fields('oik_options_options');
106
107 textfield( "bw_options[telephone]", 50, "Telephone [bw_telephone] / [bw_tel]", $options['telephone'] );
108 textfield( "bw_options[fax]", 50, "Fax [bw_fax]", $options['fax'] );
109 textfield( "bw_options[mobile]", 50, "Mobile [bw_mobile] / [bw_mob]", $options['mobile'] );
110
111 textfield( "bw_options[company]", 50, "Company [bw_company]", $options['company'] );
112 textfield( "bw_options[business]", 50, "Business [bw_business]", $options['business'] );
113 textfield( "bw_options[formal]", 50, "Formal [bw_formal]", $options['formal'] );
114
115 textfield( "bw_options[main-slogan]", 50, "Main slogan [bw_slogan]", $options['main-slogan'] );
116 textfield( "bw_options[alt-slogan]", 50, "Alt. slogan [bw_alt_slogan]", $options['alt-slogan'] );
117
118 textfield( "bw_options[contact]", 50, "Contact [bw_contact]", $options['contact'] );
119 textfield( "bw_options[email]", 50, "Email [bw_mailto]/[bw_email]", $options['email'] );
120 textfield( "bw_options[admin]", 50, "Admin [bw_admin]", $options['admin'] );
121 textfield( "bw_options[contact-link]", 50, "Contact button page permalink [bw_contact_button]", $options['contact-link'] );
122 textfield( "bw_options[contact-text]", 50, "Contact button text ", $options['contact-text'] );
123 textfield( "bw_options[contact-title]", 50, "Contact button tooltip", $options['contact-title'] );
124
125
126 // extended-address e.g. Bobbing Wide
127 // street-address e.g. 41 Redhill Road
128 // locality e.g Rowlands Castle
129 // region e.g. HANTS
130 // postal-code e.g. PO9 6DE
131 // country-name e.g. UK
132
133
134 textfield( "bw_options[extended-address]", 50, "Extended-address [bw_address]", $options['extended-address'] );
135 textfield( "bw_options[street-address]", 50, "Street-address", $options['street-address'] );
136 textfield( "bw_options[locality]", 50, "Locality", $options['locality'] );
137 textfield( "bw_options[region]", 50, "Region", $options['region'] );
138 textfield( "bw_options[postal-code]", 50, "Post code", $options['postal-code'] );
139 textfield( "bw_options[country-name]", 50, "Country name", $options['country-name'] );
140
141 textfield( "bw_options[lat]", 50, "Latitude [bw_geo] [bw_directions]", $options['lat'] );
142 textfield( "bw_options[long]", 50, "Longitude", $options['long'] );
143
144 // ABQIAAAAEraXBMl-kX5b-Swk0AR98BQiFdr9vy7axdrApFjkJGV6ZRaqtxRqjZfTaNvU9q3jxZ50yMHK-mrzag
145 textfield( "bw_options[google_maps_api_key]", 87, "Google Maps API key [bw_show_googlemap]", $options['google_maps_api_key'] );
146 textfield( "bw_options[width]", 10, "Google Map width", $options['width'] );
147 textfield( "bw_options[height]", 10, "Google Map height", $options['height'] );
148
149
150 textfield( "bw_options[domain]", 50, "Domain [bw_domain] [bw_wpadmin]", $options['domain'] );
151 textfield( "bw_options[customCSS]", 50, "Custom CSS in theme directory " . get_theme_root_uri(), $options['customCSS'] );
152
153 textfield( "bw_options[twitter]", 50, "Twitter URL [bw_twitter]", $options['twitter'] );
154 textfield( "bw_options[facebook]", 50, "Facebook URL [bw_facebook]", $options['facebook'] );
155 textfield( "bw_options[linkedin]", 50, "LinkedIn URL [bw_linkedin]", $options['linkedin'] );
156 textfield( "bw_options[googleplus]", 50, "Google Plus URL [bw_googleplus]", $options['googleplus'] );
157 textfield( "bw_options[youtube]", 50, "YouTube URL [bw_youtube]", $options['youtube'] );
158 textfield( "bw_options[flickr]", 50, "Flickr URL [bw_flickr]", $options['flickr'] );
159 textfield( "bw_options[picasa]", 50, "Picasa URL [bw_picasa]", $options['picasa'] );
160 textfield( "bw_options[skype]", 50, "Skype Name [bw_skype]", $options['skype'] );
161
162
163 textfield( "bw_options[paypal-email]", 50, "PayPal email [bw_paypal]", $options['paypal-email'] );
164
165 $upload_dir = wp_upload_dir();
166 $baseurl = $upload_dir['baseurl'];
167
168 textfield( "bw_options[logo-image]", 50, "Logo image [bw_logo] in uploads: " . $baseurl, $options['logo-image'] );
169 textfield( "bw_options[qrcode-image]", 50, "QR code image [bw_qrcode] in uploads", $options['qrcode-image'] );
170
171 tablerow( "", "<input type=\"submit\" name=\"ok\" value=\"Save changes\" />" );
172
173 etag( "table" );
174 etag( "form" );
175
176 ediv();
177 sdiv("column span-6 wrap last");
178
179 h2( "Usage notes" );
180 p("Use the shortcode options in your pages, widgets and titles. e.g." );
181 p("[bw_telephone] for your telephone number" );
182 p( bw_telephone() );
183 p("[bw_address] to print your address" );
184 p( bw_address());
185 p( "[bw_follow_me] for ALL your Follow me buttons" );
186 p( bw_follow_me() );
187 p("For more information:" );
188 art_button( "http://www.bobbingwidewebdesign.com/oik", "oik documentation", "Read the documentation for the oik plugin" );
189
190 ediv();
191 bw_flush();
192 }
193
194
195 // Sanitize and validate input. Accepts an array, return a sanitized array.
196 function oik_options_validate($input) {
197 // Our first value is either 0 or 1
198 //$input['option1'] = ( $input['option1'] == 1 ? 1 : 0 );
199
200 // Say our second option must be safe text with no HTML tags
201 //$input['sometext'] = wp_filter_nohtml_kses($input['sometext']);
202
203 return $input;
204 }
205
206 //echo '<p>BAT='.$bwapi_trace_test.'=BAT</p>';
207 //bwapi_trace_test( 'oik' );
208
209
210
211
212