Wp-Insert - Version 1.0

Version Description

Download this release

Release Info

Developer namith.jawahar
Plugin Icon 128x128 Wp-Insert
Version 1.0
Comparing to
See all releases

Version 1.0

ads/insert-ads.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Hook for adding admin menus
3
+ add_action("plugins_loaded", "register_ad_widgets");
4
+
5
+ // Creating the dynamic widget for the widgets page
6
+ function register_ad_widgets() {
7
+ if(get_option('ad_widget_1_enable')) { register_sidebar_widget(__('Ad Widget : 1'), 'ad_widget_1_create'); }
8
+ if(get_option('ad_widget_2_enable')) { register_sidebar_widget(__('Ad Widget : 2'), 'ad_widget_2_create'); }
9
+ if(get_option('ad_widget_3_enable')) { register_sidebar_widget(__('Ad Widget : 3'), 'ad_widget_3_create'); }
10
+ if(get_option('ad_widget_4_enable')) { register_sidebar_widget(__('Ad Widget : 4'), 'ad_widget_4_create'); }
11
+ if(get_option('ad_widget_5_enable')) { register_sidebar_widget(__('Ad Widget : 5'), 'ad_widget_5_create'); }
12
+ }
13
+
14
+ function ad_widget_1_create($args) {
15
+ extract($args);
16
+ echo $before_widget;
17
+ echo get_option('ad_widget_1');
18
+ echo $after_widget;
19
+ }
20
+
21
+ function ad_widget_2_create($args) {
22
+ extract($args);
23
+ echo $before_widget;
24
+ echo get_option('ad_widget_2');
25
+ echo $after_widget;
26
+ }
27
+
28
+ function ad_widget_3_create($args) {
29
+ extract($args);
30
+ echo $before_widget;
31
+ echo get_option('ad_widget_3');
32
+ echo $after_widget;
33
+ }
34
+
35
+ function ad_widget_4_create($args) {
36
+ extract($args);
37
+ echo $before_widget;
38
+ echo get_option('ad_widget_4');
39
+ echo $after_widget;
40
+ }
41
+
42
+ function ad_widget_5_create($args) {
43
+ extract($args);
44
+ echo $before_widget;
45
+ echo get_option('ad_widget_5');
46
+ echo $after_widget;
47
+ }
48
+
49
+ // action function for adding the administrative page
50
+ function smart_add_adspage() { ?>
51
+ <div class="wrap">
52
+ <h2>WP-INSERT : Manage Ads</h2>
53
+ <?php show_support_options(); ?>
54
+ <form method="post" action="options.php">
55
+ <?php wp_nonce_field('update-options'); ?>
56
+
57
+ <table class="form-table">
58
+
59
+ <tr valign="top">
60
+ <th scope="row"><b>In post ads</b></th>
61
+ <td>Paste your ads below to make them appear automatically in your posts.</td>
62
+ </tr>
63
+
64
+ <tr valign="top">
65
+ <th scope="row">Ad code to insert<br/><b>( Above the post )</b><br/>
66
+ <br/><input id="ad_top_enable" name="ad_top_enable" type="checkbox" value="1"<?php if(get_option('ad_top_enable')) echo ' checked="checked"'; ?>/> Enabled</th>
67
+ <td><textarea id="ad_top" name="ad_top" style="width:350px;height:150px;"><?php echo get_option('ad_top'); ?></textarea><br/>
68
+ <small>( Paste your ad-sense or similar code in the box above )</small></td>
69
+ </tr>
70
+
71
+ <tr valign="top">
72
+ <th scope="row">Ad code to insert<br/><b>( Below the post )</b><br/>
73
+ <br/><input id="ad_bottom_enable" name="ad_bottom_enable" type="checkbox" value="1"<?php if(get_option('ad_bottom_enable')) echo ' checked="checked"'; ?>/> Enabled</th>
74
+ <td><textarea id="ad_bottom" name="ad_bottom" style="width:350px;height:150px;"><?php echo get_option('ad_bottom'); ?></textarea><br/>
75
+ <small>( Paste your ad-sense or similar code in the box above )</small></td>
76
+ </tr>
77
+
78
+ <tr valign="top">
79
+ <th scope="row">Ad code to insert<br/><b>( Left of the post )</b><br/>
80
+ <br/><input id="ad_left_enable" name="ad_left_enable" type="checkbox" value="1"<?php if(get_option('ad_left_enable')) echo ' checked="checked"'; ?>/> Enabled</th>
81
+ <td><textarea id="ad_left" name="ad_left" style="width:350px;height:150px;"><?php echo get_option('ad_left'); ?></textarea><br/>
82
+ <small>( Paste your ad-sense or similar code in the box above )</small></td>
83
+ </tr>
84
+
85
+ <tr valign="top">
86
+ <th scope="row">Ad code to insert<br/><b>( Right of the post )</b><br/>
87
+ <br/><input id="ad_right_enable" name="ad_right_enable" type="checkbox" value="1"<?php if(get_option('ad_right_enable')) echo ' checked="checked"'; ?>/> Enabled</th>
88
+ <td><textarea id="ad_right" name="ad_right" style="width:350px;height:150px;"><?php echo get_option('ad_right'); ?></textarea><br/>
89
+ <small>( Paste your ad-sense or similar code in the box above )</small></td>
90
+ </tr>
91
+
92
+ <tr valign="top">
93
+ <th scope="row"></th>
94
+ <td><input id="ad_enable_single" name="ad_enable_single" type="checkbox" value="1"<?php if(get_option('ad_enable_single')) echo ' checked="checked"'; ?>/> Show Ads only on single posts and pages<br/></td>
95
+ </tr>
96
+
97
+ <tr valign="top">
98
+ <th scope="row"><b>Ad Widgets</b></th>
99
+ <td>Paste your ads below and use the widgets section to insert the ads into your sidebar.</td>
100
+ </tr>
101
+
102
+ <tr valign="top">
103
+ <th scope="row">Ad code to insert<br/><b>( Ad widget : 1 )</b><br/>
104
+ <br/><input id="ad_widget_1_enable" name="ad_widget_1_enable" type="checkbox" value="1"<?php if(get_option('ad_widget_1_enable')) echo ' checked="checked"'; ?>/> Enabled</th>
105
+ <td><textarea id="ad_widget_1" name="ad_widget_1" style="width:350px;height:150px;"><?php echo get_option('ad_widget_1'); ?></textarea><br/>
106
+ <small>( Paste your ad-sense or similar code in the box above )</small></td>
107
+ </tr>
108
+
109
+ <tr valign="top">
110
+ <th scope="row">Ad code to insert<br/><b>( Ad widget : 2 )</b><br/>
111
+ <br/><input id="ad_widget_2_enable" name="ad_widget_2_enable" type="checkbox" value="1"<?php if(get_option('ad_widget_2_enable')) echo ' checked="checked"'; ?>/> Enabled</th>
112
+ <td><textarea id="ad_widget_2" name="ad_widget_2" style="width:350px;height:150px;"><?php echo get_option('ad_widget_2'); ?></textarea><br/>
113
+ <small>( Paste your ad-sense or similar code in the box above )</small></td>
114
+ </tr>
115
+
116
+ <tr valign="top">
117
+ <th scope="row">Ad code to insert<br/><b>( Ad widget : 3 )</b><br/>
118
+ <br/><input id="ad_widget_3_enable" name="ad_widget_3_enable" type="checkbox" value="1"<?php if(get_option('ad_widget_3_enable')) echo ' checked="checked"'; ?>/> Enabled</th>
119
+ <td><textarea id="ad_widget_3" name="ad_widget_3" style="width:350px;height:150px;"><?php echo get_option('ad_widget_3'); ?></textarea><br/>
120
+ <small>( Paste your ad-sense or similar code in the box above )</small></td>
121
+ </tr>
122
+
123
+ <tr valign="top">
124
+ <th scope="row">Ad code to insert<br/><b>( Ad widget : 4 )</b><br/>
125
+ <br/><input id="ad_widget_4_enable" name="ad_widget_4_enable" type="checkbox" value="1"<?php if(get_option('ad_widget_4_enable')) echo ' checked="checked"'; ?>/> Enabled</th>
126
+ <td><textarea id="ad_widget_4" name="ad_widget_4" style="width:350px;height:150px;"><?php echo get_option('ad_widget_4'); ?></textarea><br/>
127
+ <small>( Paste your ad-sense or similar code in the box above )</small></td>
128
+ </tr>
129
+
130
+ <tr valign="top">
131
+ <th scope="row">Ad code to insert<br/><b>( Ad widget : 5 )</b><br/>
132
+ <br/><input id="ad_widget_5_enable" name="ad_widget_5_enable" type="checkbox" value="1"<?php if(get_option('ad_widget_5_enable')) echo ' checked="checked"'; ?>/> Enabled</th>
133
+ <td><textarea id="ad_widget_5" name="ad_widget_5" style="width:350px;height:150px;"><?php echo get_option('ad_widget_5'); ?></textarea><br/>
134
+ <small>( Paste your ad-sense or similar code in the box above )</small></td>
135
+ </tr>
136
+
137
+ </table>
138
+
139
+ <input type="hidden" name="action" value="update" />
140
+ <input type="hidden" name="page_options" value="ad_top,ad_top_enable,ad_bottom,ad_bottom_enable,ad_left,ad_left_enable,ad_right,ad_right_enable,ad_enable_single,ad_widget_5_enable,ad_widget_4_enable,ad_widget_3_enable,ad_widget_2_enable,ad_widget_1_enable,ad_widget_5,ad_widget_4,ad_widget_3,ad_widget_2,ad_widget_1" />
141
+ <p class="submit">
142
+ <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
143
+ </p>
144
+ </form>
145
+ </div>
146
+ <?php }
147
+ //Actual insertion of ads into content takes place here.
148
+ add_filter('the_content', 'insert_into_content');
149
+
150
+ function insert_into_content($content) {
151
+ if(!is_singular() && get_option('ad_enable_single')) { return $content; }
152
+ else {
153
+ $output = '<table><tr>';
154
+ if(get_option('ad_left_enable') && get_option('ad_right_enable')) {$cellspan=' colspan="3"';} else if(get_option('ad_left_enable') || get_option('ad_right_enable')) {$cellspan=' colspan="2"';} else {$cellspan='';}
155
+
156
+ if(get_option('ad_top_enable')) {
157
+
158
+ $output .= '<td'.$cellspan.' align="center">'.get_option('ad_top').'</td></tr><tr>';
159
+ }
160
+ if(get_option('ad_left_enable')) {
161
+ $output .= '<td valign="top">'.get_option('ad_left').'</td>';
162
+ }
163
+
164
+ $output .= '<td>'.$content.'</td>';
165
+
166
+ if(get_option('ad_right_enable')) {
167
+ $output .= '<td valign="top">'.get_option('ad_right').'</td>';
168
+ }
169
+ if(get_option('ad_bottom_enable')) {
170
+ $output .= '</tr><tr><td'.$cellspan.' align="center">'.get_option('ad_bottom').'</td>';
171
+ }
172
+
173
+ $output .= '</tr></table>';
174
+ return $output;
175
+ }
176
+ }
177
+ ?>
feeds/insert-feeds.php ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('template_redirect', 'register_feed_redirect');
3
+ add_action("plugins_loaded", "register_feed_head_manipulation");
4
+ add_filter('the_content', 'register_feed_ad_manipulation');
5
+ add_action("plugins_loaded", "register_email_feed_widget");
6
+
7
+ // Creating the dynamic widget for the widgets page
8
+ function register_email_feed_widget() {
9
+ if(get_option('smart_feed_email_enabled')) { register_sidebar_widget(__('Feedburner : Subscribe via Email'), 'feed_email_subscribe_widget_create'); }
10
+ if(get_option('smart_feed_subscribe_widget_enabled')) { register_sidebar_widget(__('Subscribe to Feed'), 'feed_subscribe_widget_create'); }
11
+ }
12
+
13
+ function feed_subscribe_widget_create($args) {
14
+ extract($args);
15
+ echo $before_widget;
16
+ if(get_option('smart_feed_subscribe_widget_header') != "") {
17
+ echo $before_title.get_option('smart_feed_subscribe_widget_header').$after_title;
18
+ }
19
+ if(get_option('smart_feed_feedburner_enabled')) {
20
+ echo '<ul><li><a href="'.get_option('smart_feed_feedburner').'"><img src="'.get_bloginfo('url').'/wp-content/plugins/wp-insert/images/feed-icon-24x24.gif" /> Subscribe</a></li></ul>';
21
+ } else {
22
+ echo '<ul><li><a href="'.get_bloginfo('rss2_url').'"><img src="'.get_bloginfo('url').'/wp-content/plugins/wp-insert/images/feed-icon-24x24.gif" /> Subscribe</a></li></ul>';
23
+ }
24
+ echo $after_widget;
25
+ }
26
+
27
+ function feed_email_subscribe_widget_create($args) {
28
+ extract($args);
29
+ echo $before_widget;
30
+ echo get_option('smart_feed_email');
31
+ echo $after_widget;
32
+ }
33
+
34
+ function register_feed_redirect() {
35
+ if(get_option('smart_feed_feedburner_enabled')) {
36
+ if (!is_feed()) { return; }
37
+ else if (preg_match('/feedburner/', $_SERVER['HTTP_USER_AGENT'])) { return; }
38
+ else {
39
+ header("Location: ".get_option('smart_feed_feedburner'));
40
+ }
41
+ }
42
+ else { return; }
43
+ }
44
+
45
+ function register_feed_ad_manipulation($content) {
46
+ if(is_feed()) {
47
+ $prefix = '';
48
+ $suffix = '';
49
+ if(get_option('smart_feed_ad_top_enabled')) {
50
+ $prefix = get_option('smart_feed_ad_top');
51
+ }
52
+ if(get_option('smart_feed_ad_bottom_enabled')) {
53
+ $suffix = "<p>".get_option('smart_feed_ad_bottom')."</p>";
54
+ }
55
+ return $prefix.$content.$suffix;
56
+ }
57
+ else { return $content; }
58
+ }
59
+
60
+ function register_feed_head_manipulation() {
61
+ if(get_option('smart_feed_head_enable')) {
62
+ add_action('rss_head', 'smart_add_feedimage_rss');
63
+ add_action('rss2_head', 'smart_add_feedimage_rss');
64
+ }
65
+ }
66
+
67
+ function smart_add_feedimage_rss() {
68
+ echo "<image>
69
+ <title>".get_bloginfo('name')."</title>
70
+ <url>".get_option('smart_feed_head')."</url>
71
+ <link>".get_bloginfo('url')."</link>
72
+ <width>".get_option('smart_feed_head_width')."</width>
73
+ <height>".get_option('smart_feed_head_height')."</height>
74
+ <description>get_bloginfo('description')</description>
75
+ </image>";
76
+ }
77
+ // action function for adding the administrative page
78
+ function smart_add_feedspage() { ?>
79
+ <div class="wrap">
80
+ <h2>WP-INSERT : Manage Feeds</h2>
81
+ <?php show_support_options(); ?>
82
+ <form method="post" action="options.php">
83
+ <?php wp_nonce_field('update-options'); ?>
84
+
85
+ <table class="form-table">
86
+
87
+ <tr valign="top">
88
+ <th scope="row"><b>Logo for your feed</b></th>
89
+ <td><input id="smart_feed_head_enable" name="smart_feed_head_enable" type="checkbox" value="1" <?php if(get_option('smart_feed_head_enable')) echo 'checked="checked"'; ?> /> Enabled</td>
90
+ </tr>
91
+
92
+ <tr valign="top">
93
+ <th scope="row">Logo URL</th>
94
+ <td><input id="smart_feed_head" name="smart_feed_head" type="text" value="<?php echo get_option('smart_feed_head'); ?>" style="width:350px;" /><br/>
95
+ <small>( Paste the URL of your logo image in the box above )</small></td>
96
+ </tr>
97
+
98
+ <tr valign="top">
99
+ <th scope="row">Logo Width</th>
100
+ <td><input id="smart_feed_head_width" name="smart_feed_head_width" type="text" value="<?php echo get_option('smart_feed_head_width'); ?>" style="width:350px;" /><br/>
101
+ <small>( The width of your logo image )</small></td>
102
+ </tr>
103
+
104
+ <tr valign="top">
105
+ <th scope="row">Logo Height</th>
106
+ <td><input id="smart_feed_head_height" name="smart_feed_head_height" type="text" value="<?php echo get_option('smart_feed_head_height'); ?>" style="width:350px;" /><br/>
107
+ <small>( The height of your logo image )</small></td>
108
+ </tr>
109
+
110
+ <tr valign="top">
111
+ <th scope="row"><b>Insert ads into your feed</b></th>
112
+ <td>The ads might not show up for already written posts!</td>
113
+ </tr>
114
+
115
+ <tr valign="top">
116
+ <th scope="row">Ad code to insert<br/>( Above feed content )<br/>
117
+ <br/><input id="smart_feed_ad_top_enabled" name="smart_feed_ad_top_enabled" type="checkbox" value="1"<?php if(get_option('smart_feed_ad_top_enabled')) echo ' checked="checked"'; ?>/> Enabled</th>
118
+ <td><textarea id="smart_feed_ad_top" name="smart_feed_ad_top" style="width:350px;height:150px;"><?php echo get_option('smart_feed_ad_top'); ?></textarea><br/>
119
+ <small>( Paste your ad-sense or similar code in the box above )</small></td>
120
+ </tr>
121
+
122
+ <tr valign="top">
123
+ <th scope="row">Ad code to insert<br/>( Below feed content )<br/>
124
+ <br/><input id="smart_feed_ad_bottom_enabled" name="smart_feed_ad_bottom_enabled" type="checkbox" value="1"<?php if(get_option('smart_feed_ad_bottom_enabled')) echo ' checked="checked"'; ?>/> Enabled</th>
125
+ <td><textarea id="smart_feed_ad_bottom" name="smart_feed_ad_bottom" style="width:350px;height:150px;"><?php echo get_option('smart_feed_ad_bottom'); ?></textarea><br/>
126
+ <small>( Paste your ad-sense or similar code in the box above )</small></td>
127
+ </tr>
128
+
129
+ <tr valign="top">
130
+ <th scope="row"><b>Feedburner</b></th>
131
+ <td></td>
132
+ </tr>
133
+
134
+ <tr valign="top">
135
+ <th scope="row">Feedburner Feed URL<br/>
136
+ <br/><input id="smart_feed_feedburner_enabled" name="smart_feed_feedburner_enabled" type="checkbox" value="1"<?php if(get_option('smart_feed_feedburner_enabled')) echo ' checked="checked"'; ?>/> Enabled</th>
137
+ <td><input type="text" id="smart_feed_feedburner" name="smart_feed_feedburner" style="width:350px;" value="<?php echo get_option('smart_feed_feedburner'); ?>" /><br/>
138
+ <small>( Paste your Feedburner feed URL in the box above )</small></td>
139
+ </tr>
140
+
141
+ <tr valign="top">
142
+ <th scope="row">Subscribe via E-mail Widget<br/>
143
+ <br/><input id="smart_feed_email_enabled" name="smart_feed_email_enabled" type="checkbox" value="1"<?php if(get_option('smart_feed_email_enabled')) echo ' checked="checked"'; ?>/> Enabled</th>
144
+ <td><textarea id="smart_feed_email" name="smart_feed_email" style="width:350px;height:150px;"><?php echo get_option('smart_feed_email'); ?></textarea><br/>
145
+ <small>( Paste your Feedburner Subscribe via email code in the box above )</small></td>
146
+ </tr>
147
+
148
+ <tr valign="top">
149
+ <th scope="row"><b>Subscribe Widget</b></th>
150
+ <td></td>
151
+ </tr>
152
+
153
+ <tr valign="top">
154
+ <th scope="row">Subscribe Widget Header<br/>( Optional ) <input id="smart_feed_subscribe_widget_enabled" name="smart_feed_subscribe_widget_enabled" type="checkbox" value="1"<?php if(get_option('smart_feed_subscribe_widget_enabled')) echo ' checked="checked"'; ?>/> Enabled</th>
155
+ <td><input type="text" id="smart_feed_subscribe_widget_header" name="smart_feed_subscribe_widget_header" style="width:350px;" value="<?php echo get_option('smart_feed_subscribe_widget_header'); ?>" /><br/>
156
+ <small>( Paste the header text for subscribe in the box above )</small></td>
157
+ </tr>
158
+
159
+ </table>
160
+
161
+ <input type="hidden" name="action" value="update" />
162
+ <input type="hidden" name="page_options" value="smart_feed_head_enable,smart_feed_head,smart_feed_head_width,smart_feed_head_height,smart_feed_ad_top_enabled,smart_feed_ad_top,smart_feed_ad_bottom_enabled,smart_feed_ad_bottom,smart_feed_feedburner_enabled,smart_feed_feedburner,smart_feed_email,smart_feed_email_enabled,smart_feed_subscribe_widget_enabled,smart_feed_subscribe_widget_header" />
163
+ <p class="submit">
164
+ <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
165
+ </p>
166
+ </form>
167
+ </div>
168
+ <?php } ?>
images/Smart-Logix-we-customize.jpg ADDED
Binary file
images/feed-icon-24x24.gif ADDED
Binary file
readme.txt ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Plugin Name ===
2
+ Contributors: Namith Jawahar
3
+ Donate link: http://smartlogix.co.in/
4
+ Tags: adsense,google,ad widget,ads,feeds,feedburner,subscribe,email,advertise around posts,left ad,right ad,top ad,bottom ad,ad widgets,subscribe widgets,email widgets,analytics,google analytics,header code insertion,insert codes,insert code,footer code,tracking,ad code insertion
5
+ Requires at least: 2.0.2
6
+ Tested up to: 2.7.1
7
+ Stable tag: 1.0
8
+
9
+ Use wp-insert to insert every kind of code you will ever need to insert into your blog.
10
+
11
+ == Description ==
12
+
13
+ Use wp-insert to insert every kind of code you will ever need to insert into your blog. The plugin features 5 ad widgets, provision to insert ads into right,left,top and bottom of your posts/pages, feed management options like adding your logo to your feeds, redirecting your feeds to feedburner, feedburner subscribe via email widget, Provisions to insert ads above or below your feeds, Subscribe to feed widget, Provision to insert google analytics code easily, Provision to add any kind of code to your header and footer area.
14
+
15
+ == Installation ==
16
+
17
+ This section describes how to install the plugin and get it working.
18
+
19
+ e.g.
20
+
21
+ 1. Upload 'wp-insert' folder to the '/wp-content/plugins/' directory
22
+ 1. Activate the plugin through the 'Plugins' menu in WordPress
23
+ 1. Go to the wp-insert menu to configure
24
+
25
+ == Frequently Asked Questions ==
26
+
support/support.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php function show_support_options() { ?>
2
+ <table class="form-table">
3
+ <tr>
4
+ <td align="left">
5
+ <a href="http://www.smartlogix.co.in/"><img src="<?php echo get_bloginfo('url') ?>/wp-content/plugins/wp-insert/images/Smart-Logix-we-customize.jpg" /></a>
6
+ </td>
7
+ <td align="right">
8
+ <b>Think we have done a great job?</b><br/><a href="http://wordpress.org/extend/plugins/wp-insert/">Rate the plugin</a> or <a href="http://www.smartlogix.co.in/">Leave Us a Comment</a>
9
+ <div>
10
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
11
+ <input type="hidden" name="cmd" value="_s-xclick">
12
+ <input type="hidden" name="hosted_button_id" value="5199131">
13
+ <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
14
+ <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
15
+ </form>
16
+ </div>
17
+ </td>
18
+ </tr>
19
+ </table>
20
+ <?php } ?>
tracking/insert-analytics.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('wp_footer', 'smart_add_footer_code');
3
+ add_action('wp_head', 'smart_add_header_code');
4
+
5
+ function smart_add_header_code($arg) {
6
+ if(get_option('smart_analytics_header_enabled')) {
7
+ echo get_option('smart_analytics_header_code');
8
+ }
9
+ return $arg;
10
+ }
11
+
12
+ function smart_add_footer_code($arg) {
13
+ if(get_option('smart_analytics_enabled')) { ?>
14
+ <script type="text/javascript">
15
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
16
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
17
+ </script>
18
+ <script type="text/javascript">
19
+ var pageTracker = _gat._getTracker("<?php echo get_option('smart_analytics_id'); ?>");
20
+ pageTracker._trackPageview();
21
+ </script>
22
+ <?php }
23
+ if(get_option('smart_analytics_footer_enabled')) {
24
+ echo get_option('smart_analytics_footer_code');
25
+ }
26
+ return $arg;
27
+ }
28
+
29
+ // action function for adding the administrative page
30
+ function smart_add_analytics() { ?>
31
+ <div class="wrap">
32
+ <h2>WP-INSERT : Tracking Codes</h2>
33
+ <?php show_support_options(); ?>
34
+ <form method="post" action="options.php">
35
+ <?php wp_nonce_field('update-options'); ?>
36
+
37
+ <table class="form-table">
38
+
39
+ <tr valign="top">
40
+ <th scope="row">Google Analytics Tracker ID
41
+ <br/><input id="smart_analytics_enabled" name="smart_analytics_enabled" type="checkbox" value="1"<?php if(get_option('smart_analytics_enabled')) echo ' checked="checked"'; ?>/> Enabled</th>
42
+ <td><input id="smart_analytics_id" name="smart_analytics_id" type="text" value="<?php echo get_option('smart_analytics_id'); ?>" style="width:350px;" /><br/>
43
+ <small>( Paste your Google Analytics Tracker ID (XX-XXXXX-X) above )</small></td>
44
+ </tr>
45
+
46
+ <tr valign="top">
47
+ <th scope="row">Insert Code into Header<br/>
48
+ <br/><input id="smart_analytics_header_enabled" name="smart_analytics_header_enabled" type="checkbox" value="1"<?php if(get_option('smart_analytics_header_enabled')) echo ' checked="checked"'; ?>/> Enabled</th>
49
+ <td><textarea id="smart_analytics_header_code" name="smart_analytics_header_code" style="width:350px;height:150px;"><?php echo get_option('smart_analytics_header_code'); ?></textarea><br/>
50
+ <small>( Paste Analytics or similar code in the box above )</small></td>
51
+ </tr>
52
+
53
+ <tr valign="top">
54
+ <th scope="row">Insert Code into Footer<br/>
55
+ <br/><input id="smart_analytics_footer_enabled" name="smart_analytics_footer_enabled" type="checkbox" value="1"<?php if(get_option('smart_analytics_footer_enabled')) echo ' checked="checked"'; ?>/> Enabled</th>
56
+ <td><textarea id="smart_analytics_footer_code" name="smart_analytics_footer_code" style="width:350px;height:150px;"><?php echo get_option('smart_analytics_footer_code'); ?></textarea><br/>
57
+ <small>( Paste Analytics or similar code in the box above )</small></td>
58
+ </tr>
59
+
60
+ </table>
61
+
62
+ <input type="hidden" name="action" value="update" />
63
+ <input type="hidden" name="page_options" value="smart_analytics_enabled,smart_analytics_id,smart_analytics_header_enabled,smart_analytics_header_code,smart_analytics_footer_enabled,smart_analytics_footer_code" />
64
+ <p class="submit">
65
+ <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
66
+ </p>
67
+ </form>
68
+ </div>
69
+ <?php } ?>
wp-insert.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: wp-insert
4
+ Plugin URI: http://www.smartlogix.co.in/
5
+ Description: Manage Ads,Feeds,Tracking etc
6
+ Version: 1.0
7
+ Author: Namith Jawahar
8
+ Author URI: http://www.smartlogix.co.in/
9
+
10
+ Use wp-insert to insert every kind of code you will ever need to insert into your blog.
11
+ */
12
+
13
+ add_action('admin_menu', 'smart_add_menu');
14
+
15
+ // action function for above hook
16
+ function smart_add_menu() {
17
+ add_menu_page('Wp-Insert', 'Wp-Insert', 8, __FILE__);
18
+ add_submenu_page(__FILE__, 'wp-insert', 'Manage Ads', 8, __FILE__, 'smart_add_adspage');
19
+ add_submenu_page(__FILE__, 'wp-insert', 'Manage Feeds', 8, 'Manage Feeds', 'smart_add_feedspage');
20
+ add_submenu_page(__FILE__, 'wp-insert', 'Tracking Codes', 8, 'Tracking Codes', 'smart_add_analytics');
21
+ //add_submenu_page(__FILE__, 'wp-insert', 'SEO Optimization', 8, 'SEO', 'smart_add_SEOpages');
22
+ //add_submenu_page(__FILE__, 'wp-insert', 'Social Bookmarking', 8, 'Social Bookmarking', 'smart_add_socialpages');
23
+ }
24
+
25
+ require_once (dirname(__FILE__) . '/support/support.php');
26
+ require_once (dirname(__FILE__) . '/ads/insert-ads.php');
27
+ require_once (dirname(__FILE__) . '/feeds/insert-feeds.php');
28
+ require_once (dirname(__FILE__) . '/tracking/insert-analytics.php');
29
+ ?>