Wp-Insert - Version 1.5.2

Version Description

Download this release

Release Info

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

Code changes from version 1.5.1 to 1.5.2

css/adminStyle.css CHANGED
@@ -16,6 +16,19 @@ margin-left:205px;
16
  width: 80%;
17
  }
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  .wp-insert-submit {
20
  text-align: center;
21
  }
@@ -48,4 +61,9 @@ margin-left:205px;
48
  #popUpMaster h4{position:absolute;top:0;left:0;z-index:10;padding:0;margin:6px 0 0 10px;color:#333333;text-shadow:0 1px 0 #FFFFFF;
49
  font-family:Arial, Helvetica, sans-serif;font-size:12px;line-height:15px;cursor:move;background:nonImage.gif;
50
  width:100%}
51
- /*End Make default admin menu wider*/
 
 
 
 
 
16
  width: 80%;
17
  }
18
 
19
+ .earnings {
20
+ margin: 30px 15px;
21
+ font-weight: bold;
22
+ font-size: 40px;
23
+ color: green;
24
+ float: right;
25
+ }
26
+
27
+ .bigbold {
28
+ font-size: 11px;
29
+ font-weight: bold;
30
+ }
31
+
32
  .wp-insert-submit {
33
  text-align: center;
34
  }
61
  #popUpMaster h4{position:absolute;top:0;left:0;z-index:10;padding:0;margin:6px 0 0 10px;color:#333333;text-shadow:0 1px 0 #FFFFFF;
62
  font-family:Arial, Helvetica, sans-serif;font-size:12px;line-height:15px;cursor:move;background:nonImage.gif;
63
  width:100%}
64
+ /*End Make default admin menu wider*/
65
+
66
+ .multipleSelectBoxControl div select option {
67
+ font-size: 10px;
68
+ padding: 0px;
69
+ }
includes/ads.php CHANGED
@@ -11,7 +11,6 @@ function smart_add_menu() {
11
  add_submenu_page(__FILE__, 'wp-insert', 'Tracking Codes', 8, 'Tracking Codes', 'smart_add_analytics');
12
  add_submenu_page(__FILE__, 'wp-insert', 'WYSIWYG Editor', 8, 'WYSIWYG Editor', 'smart_add_wysiwyg_pages');
13
  add_submenu_page(__FILE__, 'wp-insert', 'Syntax Highlighting', 8, 'Syntax Highlighting', 'smart_add_syntaxhighlighting_pages');
14
- //add_submenu_page(__FILE__, 'wp-insert', 'Tracking Codes', 8, 'Manage Feeds', 'wp_insert_add_trackingpage');
15
  //ensure, that the needed javascripts been loaded to allow drag/drop, expand/collapse and hide/show of boxes
16
  wp_enqueue_script('common');
17
  wp_enqueue_script('wp-lists');
@@ -66,7 +65,7 @@ function wp_insert_multiple_ad_network_HTML() {
66
  if(!get_option('wp_insert_multiple_ad_network_type')) { add_option("wp_insert_multiple_ad_network_type", 'Primary Ad Network Only', '', 'yes'); }
67
  ?>
68
  <div>
69
- Select the Multiple Ad Network Setup that best suits you : <select name="wp_insert_multiple_ad_network_type" id="wp_insert_multiple_ad_network_type">
70
  <?php
71
  $multiple_ad_network_types = array("Primary Ad Network Only","Primary and Alternate Ad Network 1","All Ad Networks");
72
  $output = '';
@@ -100,14 +99,14 @@ function wp_insert_ad_HTML($adID, $ad_type) { ?>
100
  <?php if($ad_type == 'template_ad') { ?>
101
  <p>
102
  <label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_insertion_code">Code to add in your theme:</label>
103
- <input id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_insertion_code" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_insertion_code" type="text" style="border: medium none ; padding: 3px; font-size: 11px; width: 100%; display: inline;" class="widefat" readonly="true" value="&lt;?php if(function_exists('wp_template_ad')) { wp_template_ad('<?php echo $adID; ?>'); } ?&gt;"/>
104
  </p>
105
  <?php } ?>
106
 
107
  <?php if($ad_type == 'ad_widget') { ?>
108
  <p>
109
  <label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_title">Title:</label>
110
- <input id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_title" class="widefat" type="text" value="<?php echo get_option('wp_insert_'.$ad_type.'_'.$adID.'_title'); ?>" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_title"/>
111
  </p>
112
  <?php } ?>
113
 
@@ -115,29 +114,29 @@ function wp_insert_ad_HTML($adID, $ad_type) { ?>
115
  <?php if((get_option('wp_insert_multiple_ad_network_type') == "Primary and Alternate Ad Network 1") || (get_option('wp_insert_multiple_ad_network_type') == "All Ad Networks")) { ?><input type="button" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_button" value="Primary Ad Code" class="button" style="color:#2f9303;" onclick="SwitchAds('wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content','wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_1','wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_2')"/> <?php } else {?><label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content">Primary Ad Code:</label><?php } ?>
116
  <?php if((get_option('wp_insert_multiple_ad_network_type') == "Primary and Alternate Ad Network 1") || (get_option('wp_insert_multiple_ad_network_type') == "All Ad Networks")) { ?><input type="button" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_1_button" value="Alternative Ad Code : 1" class="button" style="color:red;" onclick="SwitchAds('wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_1','wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content','wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_2')"/> <?php } ?>
117
  <?php if(get_option('wp_insert_multiple_ad_network_type') == "All Ad Networks") { ?><input type="button" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_2_button" value="Alternative Ad Code : 2" class="button" style="color:red;" onclick="SwitchAds('wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_2','wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_1','wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content')"/> <?php } ?>
118
- <textarea style="display:block;height:200px;" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content" class="widefat" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content" cols="20" rows="16"><?php echo get_option('wp_insert_'.$ad_type.'_'.$adID.'_content'); ?></textarea>
119
- <textarea style="display:none;height:0px;" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_1" class="widefat" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_1" cols="20" rows="16"><?php echo get_option('wp_insert_'.$ad_type.'_'.$adID.'_content_1'); ?></textarea>
120
- <textarea style="display:none;height:0px;" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_2" class="widefat" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_2" cols="20" rows="16"><?php echo get_option('wp_insert_'.$ad_type.'_'.$adID.'_content_2'); ?></textarea>
121
  </div>
122
 
123
  <div style="margin:6px;">
124
  <label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_ids">Exclude On Posts/Pages:</label><div class="clear"></div>
125
- <input style="margin: 10px 6px 0pt; float: left; width: 60%;" class="widefat" type="text" value="<?php echo get_option('wp_insert_'.$ad_type.'_'.$adID.'_exclude_ids'); ?>" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_ids" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_ids" />
126
  <img style="float:left; margin-top:14px; cursor: pointer;" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/images/search-16x16.png" width="16px" height="16px" onclick="ShowPostPicker('wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_ids')" />
127
  <div class="clear"></div>
128
  </div>
129
  <p>
130
  <label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_home">Exclude On Home Page:</label>
131
- <input id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_home" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_home" type="checkbox" value="1"<?php if(get_option('wp_insert_'.$ad_type.'_'.$adID.'_exclude_home')) echo ' checked="checked"'; ?> />
132
  </p>
133
  <p>
134
  <label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_archives">Exclude On Archives Pages:</label>
135
- <input id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_archives" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_archives" type="checkbox" value="1"<?php if(get_option('wp_insert_'.$ad_type.'_'.$adID.'_exclude_archives')) echo ' checked="checked"'; ?> />
136
  </p>
137
 
138
  <div style="margin:6px;padding: 6px;border: 1px solid #DDDDDD;">
139
  <label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_style">Ad Box CSS Styler</label><div class="clear"></div>
140
- <input style="float:left; width:60%; margin: 10px 6px 0pt;background: #FFEEEE;" class="widefat" type="text" value="<?php if(get_option('wp_insert_'.$ad_type.'_'.$adID.'_style') != '') { echo get_option('wp_insert_'.$ad_type.'_'.$adID.'_style'); } else { echo 'margin: 5px;padding: 0px;'; } ?>" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_style" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_style" />
141
  <img style="float:left; margin-top:14px; cursor: pointer;" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/images/style-16x16.png" width="0px" height="0px" onclick="ShowStyler('wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_style')" />
142
  <div class="clear"></div>
143
  </div>
11
  add_submenu_page(__FILE__, 'wp-insert', 'Tracking Codes', 8, 'Tracking Codes', 'smart_add_analytics');
12
  add_submenu_page(__FILE__, 'wp-insert', 'WYSIWYG Editor', 8, 'WYSIWYG Editor', 'smart_add_wysiwyg_pages');
13
  add_submenu_page(__FILE__, 'wp-insert', 'Syntax Highlighting', 8, 'Syntax Highlighting', 'smart_add_syntaxhighlighting_pages');
 
14
  //ensure, that the needed javascripts been loaded to allow drag/drop, expand/collapse and hide/show of boxes
15
  wp_enqueue_script('common');
16
  wp_enqueue_script('wp-lists');
65
  if(!get_option('wp_insert_multiple_ad_network_type')) { add_option("wp_insert_multiple_ad_network_type", 'Primary Ad Network Only', '', 'yes'); }
66
  ?>
67
  <div>
68
+ Select the Multiple Ad Network Setup that best suits you : <select name="wp_insert_multiple_ad_network_type" id="wp_insert_multiple_ad_network_type" onchange="wpInsertToggleNotSavedAlert()" >
69
  <?php
70
  $multiple_ad_network_types = array("Primary Ad Network Only","Primary and Alternate Ad Network 1","All Ad Networks");
71
  $output = '';
99
  <?php if($ad_type == 'template_ad') { ?>
100
  <p>
101
  <label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_insertion_code">Code to add in your theme:</label>
102
+ <input id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_insertion_code" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_insertion_code" type="text" style="border: medium none ; padding: 3px; font-size: 11px; width: 100%; display: inline;" class="widefat" readonly="true" value="&lt;?php if(function_exists('wp_template_ad')) { wp_template_ad('<?php echo $adID; ?>'); } ?&gt;" />
103
  </p>
104
  <?php } ?>
105
 
106
  <?php if($ad_type == 'ad_widget') { ?>
107
  <p>
108
  <label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_title">Title:</label>
109
+ <input id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_title" class="widefat" type="text" value="<?php echo get_option('wp_insert_'.$ad_type.'_'.$adID.'_title'); ?>" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_title" onchange="wpInsertToggleNotSavedAlert()" />
110
  </p>
111
  <?php } ?>
112
 
114
  <?php if((get_option('wp_insert_multiple_ad_network_type') == "Primary and Alternate Ad Network 1") || (get_option('wp_insert_multiple_ad_network_type') == "All Ad Networks")) { ?><input type="button" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_button" value="Primary Ad Code" class="button" style="color:#2f9303;" onclick="SwitchAds('wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content','wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_1','wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_2')"/> <?php } else {?><label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content">Primary Ad Code:</label><?php } ?>
115
  <?php if((get_option('wp_insert_multiple_ad_network_type') == "Primary and Alternate Ad Network 1") || (get_option('wp_insert_multiple_ad_network_type') == "All Ad Networks")) { ?><input type="button" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_1_button" value="Alternative Ad Code : 1" class="button" style="color:red;" onclick="SwitchAds('wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_1','wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content','wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_2')"/> <?php } ?>
116
  <?php if(get_option('wp_insert_multiple_ad_network_type') == "All Ad Networks") { ?><input type="button" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_2_button" value="Alternative Ad Code : 2" class="button" style="color:red;" onclick="SwitchAds('wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_2','wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_1','wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content')"/> <?php } ?>
117
+ <textarea style="display:block;height:200px;" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content" class="widefat" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content" cols="20" rows="16" onchange="wpInsertToggleNotSavedAlert()" ><?php echo get_option('wp_insert_'.$ad_type.'_'.$adID.'_content'); ?></textarea>
118
+ <textarea style="display:none;height:0px;" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_1" class="widefat" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_1" cols="20" rows="16" onchange="wpInsertToggleNotSavedAlert()" ><?php echo get_option('wp_insert_'.$ad_type.'_'.$adID.'_content_1'); ?></textarea>
119
+ <textarea style="display:none;height:0px;" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_2" class="widefat" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_2" cols="20" rows="16" onchange="wpInsertToggleNotSavedAlert()" ><?php echo get_option('wp_insert_'.$ad_type.'_'.$adID.'_content_2'); ?></textarea>
120
  </div>
121
 
122
  <div style="margin:6px;">
123
  <label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_ids">Exclude On Posts/Pages:</label><div class="clear"></div>
124
+ <input style="margin: 10px 6px 0pt; float: left; width: 60%;" class="widefat" type="text" value="<?php echo get_option('wp_insert_'.$ad_type.'_'.$adID.'_exclude_ids'); ?>" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_ids" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_ids" onchange="wpInsertToggleNotSavedAlert()" />
125
  <img style="float:left; margin-top:14px; cursor: pointer;" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/images/search-16x16.png" width="16px" height="16px" onclick="ShowPostPicker('wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_ids')" />
126
  <div class="clear"></div>
127
  </div>
128
  <p>
129
  <label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_home">Exclude On Home Page:</label>
130
+ <input id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_home" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_home" type="checkbox" value="1"<?php if(get_option('wp_insert_'.$ad_type.'_'.$adID.'_exclude_home')) echo ' checked="checked"'; ?> onchange="wpInsertToggleNotSavedAlert()" />
131
  </p>
132
  <p>
133
  <label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_archives">Exclude On Archives Pages:</label>
134
+ <input id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_archives" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_archives" type="checkbox" value="1"<?php if(get_option('wp_insert_'.$ad_type.'_'.$adID.'_exclude_archives')) echo ' checked="checked"'; ?> onchange="wpInsertToggleNotSavedAlert()" />
135
  </p>
136
 
137
  <div style="margin:6px;padding: 6px;border: 1px solid #DDDDDD;">
138
  <label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_style">Ad Box CSS Styler</label><div class="clear"></div>
139
+ <input style="float:left; width:60%; margin: 10px 6px 0pt;background: #FFEEEE;" class="widefat" type="text" value="<?php if(get_option('wp_insert_'.$ad_type.'_'.$adID.'_style') != '') { echo get_option('wp_insert_'.$ad_type.'_'.$adID.'_style'); } else { echo 'margin: 5px;padding: 0px;'; } ?>" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_style" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_style" onchange="wpInsertToggleNotSavedAlert()" />
140
  <img style="float:left; margin-top:14px; cursor: pointer;" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/images/style-16x16.png" width="0px" height="0px" onclick="ShowStyler('wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_style')" />
141
  <div class="clear"></div>
142
  </div>
includes/adsenseperformance.php CHANGED
@@ -1,16 +1,29 @@
1
  <?php
2
  require_once (dirname(__FILE__) . '/adsense.php');
3
 
 
 
 
4
  function wp_insert_adsense_page() {
5
  global $screen_layout_columns;
6
 
7
  add_meta_box('wp_insert_adsense_login_credentials', 'Adsense Username and Password', 'wp_insert_adsense_login_credentials_HTML', 'col_1');
8
- add_meta_box('wp_insert_adsense_sincelastpayment', 'Adsense : Total Since Last Payment', 'wp_insert_adsense_sincelastpayment_HTML', 'col_1');
9
- /*add_meta_box('wp_insert_adsense_today', 'Adsense : Today', 'wp_insert_adsense_today_HTML', 'col_1');
10
- add_meta_box('wp_insert_adsense_yesterday', 'Adsense : Yesterday', 'wp_insert_adsense_yesterday_HTML', 'col_1');
11
- add_meta_box('wp_insert_adsense_last7days', 'Adsense : Last 7 Days', 'wwp_insert_adsense_last7days', 'col_1');
12
- add_meta_box('wp_insert_adsense_lastmonth', 'Adsense : Last Month', 'wp_insert_adsense_lastmonth_HTML', 'col_1');
13
- add_meta_box('wp_insert_adsense_thismonth', 'Adsense : This Month', 'wp_insert_adsense_thismonth_HTML', 'col_1');*/
 
 
 
 
 
 
 
 
 
 
14
 
15
  $parameters = 'wp_insert_adsense_username, wp_insert_adsense_password';
16
  wp_insert_settings_page_layout($parameters, 'WP-INSERT : Monitor Adsense', 'adsense');
@@ -27,14 +40,59 @@ function wp_insert_adsense_login_credentials_HTML() { ?>
27
  <input id="wp_insert_adsense_password" class="widefat" type="password" value="<?php echo get_option('wp_insert_adsense_password'); ?>" name="wp_insert_adsense_password"/>
28
  </p>
29
  <p>
30
- <small>Data Retrieval Based on <a href="http://www.webtoolkit.info/php-adsense-account-monitor.html">PHP AdSense account monitor class</a></small>
 
 
 
31
  </p>
32
  </div>
33
  <?php }
34
 
 
 
 
 
 
 
 
 
 
 
 
35
  function wp_insert_adsense_sincelastpayment_HTML() { ?>
36
- <div>
 
 
 
37
 
38
- </div>
 
 
 
39
  <?php }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  ?>
1
  <?php
2
  require_once (dirname(__FILE__) . '/adsense.php');
3
 
4
+ $adsense = new AdSense();
5
+ $adsenseStatus = false;
6
+
7
  function wp_insert_adsense_page() {
8
  global $screen_layout_columns;
9
 
10
  add_meta_box('wp_insert_adsense_login_credentials', 'Adsense Username and Password', 'wp_insert_adsense_login_credentials_HTML', 'col_1');
11
+
12
+ global $adsense;
13
+ global $adsenseStatus;
14
+ if(get_option('wp_insert_adsense_username') != '') {
15
+ if ($adsense->connect(get_option('wp_insert_adsense_username'), get_option('wp_insert_adsense_password'))) {
16
+ $adsenseStatus = true;
17
+ add_meta_box('wp_insert_adsense_sincelastpayment', 'Adsense : Total Since Last Payment', 'wp_insert_adsense_sincelastpayment_HTML', 'col_1');
18
+ add_meta_box('wp_insert_adsense_today', 'Adsense : Today', 'wp_insert_adsense_today_HTML', 'col_1');
19
+ add_meta_box('wp_insert_adsense_yesterday', 'Adsense : Yesterday', 'wp_insert_adsense_yesterday_HTML', 'col_1');
20
+ add_meta_box('wp_insert_adsense_last7days', 'Adsense : Last 7 Days', 'wp_insert_adsense_last7days', 'col_1');
21
+ add_meta_box('wp_insert_adsense_thismonth', 'Adsense : This Month', 'wp_insert_adsense_thismonth_HTML', 'col_1');
22
+ add_meta_box('wp_insert_adsense_lastmonth', 'Adsense : Last Month', 'wp_insert_adsense_lastmonth_HTML', 'col_1');
23
+ } else {
24
+ $adsenseStatus = false;
25
+ }
26
+ }
27
 
28
  $parameters = 'wp_insert_adsense_username, wp_insert_adsense_password';
29
  wp_insert_settings_page_layout($parameters, 'WP-INSERT : Monitor Adsense', 'adsense');
40
  <input id="wp_insert_adsense_password" class="widefat" type="password" value="<?php echo get_option('wp_insert_adsense_password'); ?>" name="wp_insert_adsense_password"/>
41
  </p>
42
  <p>
43
+ <?php global $adsenseStatus; if($adsenseStatus == true) { echo "<span style='color:green'>Adsense - Remote Login : Successful</span>"; } else { echo "<span style='color:red'>Adsense - Remote Login : Failed</span>"; } ?>
44
+ </p>
45
+ <p>
46
+ <small>Data Retrieval Based on <a href="http://www.webtoolkit.info/php-adsense-account-monitor.html">PHP AdSense account monitor class</a></small><br/>
47
  </p>
48
  </div>
49
  <?php }
50
 
51
+ function wp_insert_get_adsense_result_HTML($data) { ?>
52
+ <p>
53
+ <span class="earnings"><?php echo $data['earnings']; ?></span>
54
+ <span class="bigbold">Impressions : <?php echo $data['impressions']; ?></span><br/>
55
+ <span class="bigbold">Clicks : <?php echo $data['clicks']; ?></span><br/>
56
+ <span class="bigbold">CTR : <?php echo $data['ctr']; ?></span><br/>
57
+ <span class="bigbold">eCPM : <?php echo $data['ecpm']; ?></span>
58
+ </p>
59
+ <div class="clear"></div>
60
+ <?php }
61
+
62
  function wp_insert_adsense_sincelastpayment_HTML() { ?>
63
+ <div>
64
+ <?php global $adsense; wp_insert_get_adsense_result_HTML($adsense->sincelastpayment()); ?>
65
+ </div>
66
+ <?php }
67
 
68
+ function wp_insert_adsense_today_HTML() { ?>
69
+ <div>
70
+ <?php global $adsense; wp_insert_get_adsense_result_HTML($adsense->today()); ?>
71
+ </div>
72
  <?php }
73
+
74
+ function wp_insert_adsense_yesterday_HTML() { ?>
75
+ <div>
76
+ <?php global $adsense; wp_insert_get_adsense_result_HTML($adsense->yesterday()); ?>
77
+ </div>
78
+ <?php }
79
+
80
+ function wp_insert_adsense_last7days() { ?>
81
+ <div>
82
+ <?php global $adsense; wp_insert_get_adsense_result_HTML($adsense->last7days()); ?>
83
+ </div>
84
+ <?php }
85
+
86
+ function wp_insert_adsense_thismonth_HTML() { ?>
87
+ <div>
88
+ <?php global $adsense; wp_insert_get_adsense_result_HTML($adsense->thismonth()); ?>
89
+ </div>
90
+ <?php }
91
+
92
+ function wp_insert_adsense_lastmonth_HTML() { ?>
93
+ <div>
94
+ <?php global $adsense; wp_insert_get_adsense_result_HTML($adsense->lastmonth()); ?>
95
+ </div>
96
+ <?php $adsense->log_out();
97
+ }
98
  ?>
includes/twitter-lib/CHANGES ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ + Added
2
+ - Removed
3
+ * Changed/fixed
4
+
5
+ * fixed a bug in destroyStatus
6
+ * removed a call to buildRequest I forgot to get rid of
7
+ * fixed bugs with createFavorite and destroyFavorite
8
+ * removed debug output
9
+
10
+ 05 14 2009
11
+ - buildRequest was actually kind of unneccessary. Like the second c in that word.
12
+ * Smarter handling of GET/POST requests, thanks to Gabriel Sosa @pendexgabo
13
+ * $require_credentials now defaults to true in apiCall
14
+ + getMentions method maps to statuses/mentions
15
+ * createFriendship takes an array of options now
16
+ * getRateLimitStatus allows you to choose whether or not to authenticate
17
+ + blockExists method maps to blocks/exists
18
+ + getBlocking method maps to blocks/blocking
19
+ + getBlockingIDs method maps to blocks/blocking/ids
20
+
21
+ 03 28 2009
22
+ * Moved core functionality to TwitterBase class, and made Twitter a subclass
23
+ of it. That way, a TwitterOAuth class can be extended from TwitterBase in the
24
+ future
25
+ - Removed a debug message, oops
26
+
27
+ 03 24 2009
28
+ * Return formats are no longer first in the argument list, and they all have
29
+ defaults of XML. That was one of the more irritating things in the library.
30
+ * A lot of methods with multiple options now take a single array that gets
31
+ mapped to GET parameters, so you don't have to worry about order.
32
+ * Changed showStatus to getStatus
33
+ - Removed getFeatured method
34
+ + Added getFriendIDs method
35
+ + Added getFollowerIDs method
36
+ - Removed updateLocation method
37
+ + Added updateProfileColors method
38
+ + Added updateProfile method
39
+ - Removed downtimeSchedule method
40
+ - Removed getArchive method
41
+
42
+ 11 26 2007
43
+ * Initial release!
includes/twitter-lib/LICENSE ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) <2008> Justin Poliey <jdp34@njit.edu>
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
includes/twitter-lib/README ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ twitterlibphp - Twitter/PHP interface
2
+ http://jdp.github.com/twitterlibphp
3
+
4
+ This is a simple interface to the Twitter API.
5
+
6
+ I've tried to keep as close as possible to the real API
7
+ calls (some had to be changed due to ambiguity), but all
8
+ of the arguments are as they are in the official docs.
9
+
10
+ For documentation, go to:
11
+
12
+ http://jdp.github.com/twitterlibphp/doc
13
+ http://apiwiki.twitter.com
14
+
15
+ Usage:
16
+
17
+ $twitter = new Twitter("username", "password");
18
+ $public_timeline = $twitter->getPublicTimeline();
19
+
20
+ When you go through the docs, a lot of methods just take
21
+ an $options array and a $format parameter. The $options array
22
+ allows you to pass API arguments just like you would if you
23
+ were calling it from pure HTTP. For example:
24
+
25
+ $twitter->getMentions(array('page'=>2), 'json')
26
+
27
+ is mapped to...
28
+
29
+ http://twitter.com/statuses/mentions.json?page=2
30
+
31
+ Justin Poliey <jdp34@njit.edu>
32
+ http://justinpoliey.com
33
+ @justinpoliey
includes/twitter-lib/twitter.lib.php ADDED
@@ -0,0 +1,535 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (c) <2008> Justin Poliey <jdp34@njit.edu>
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person
6
+ * obtaining a copy of this software and associated documentation
7
+ * files (the "Software"), to deal in the Software without
8
+ * restriction, including without limitation the rights to use,
9
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the
11
+ * Software is furnished to do so, subject to the following
12
+ * conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be
15
+ * included in all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
+ * OTHER DEALINGS IN THE SOFTWARE.
25
+ */
26
+
27
+ /**
28
+ * Twitterlibphp is a PHP implementation of the Twitter API, allowing you
29
+ * to take advantage of it from within your PHP applications.
30
+ *
31
+ * @author Justin Poliey <jdp34@njit.edu>
32
+ * @package twitterlibphp
33
+ */
34
+
35
+ /**
36
+ * Twitter API abstract class
37
+ * @package twitterlibphp
38
+ */
39
+ abstract class TwitterBase {
40
+
41
+ /**
42
+ * the last HTTP status code returned
43
+ * @access private
44
+ * @var integer
45
+ */
46
+ private $http_status;
47
+
48
+ /**
49
+ * the whole URL of the last API call
50
+ * @access private
51
+ * @var string
52
+ */
53
+ private $last_api_call;
54
+
55
+ /**
56
+ * the application calling the API
57
+ * @access private
58
+ * @var string
59
+ */
60
+ private $application_source;
61
+
62
+ /**
63
+ * Returns the 20 most recent statuses from non-protected users who have set a custom user icon.
64
+ * @param string $format Return format
65
+ * @return string
66
+ */
67
+ function getPublicTimeline($format = 'xml') {
68
+ return $this->apiCall('statuses/public_timeline', 'get', $format, array(), false);
69
+ }
70
+
71
+ /**
72
+ * Returns the 20 most recent statuses posted by the authenticating user and that user's friends.
73
+ * @param array $options Options to pass to the method
74
+ * @param string $format Return format
75
+ * @return string
76
+ */
77
+ function getFriendsTimeline($options = array(), $format = 'xml') {
78
+ return $this->apiCall('statuses/friends_timeline', 'get', $format, $options);
79
+ }
80
+
81
+ /**
82
+ * Returns the 20 most recent statuses posted from the authenticating user.
83
+ * @param array $options Options to pass to the method
84
+ * @param string $format Return format
85
+ * @return string
86
+ */
87
+ function getUserTimeline($options = array(), $format = 'xml') {
88
+ return $this->apiCall('statuses/user_timeline', 'get', $format, $options, true);
89
+ }
90
+
91
+ /**
92
+ * Returns the 20 most recent mentions (status containing @username) for the authenticating user.
93
+ * @param array $options Options to pass to the method
94
+ * @param string $format Return format
95
+ * @return string
96
+ */
97
+ function getMentions($options = array(), $format = 'xml') {
98
+ return $this->apiCall("statuses/mentions", 'get', $format, $options);
99
+ }
100
+
101
+ /**
102
+ * Returns the 20 most recent @replies (status updates prefixed with @username) for the authenticating user.
103
+ * @param array $options Options to pass to the method
104
+ * @param string $format Return format
105
+ * @return string
106
+ * @deprecated
107
+ */
108
+ function getReplies($options = array(), $format = 'xml') {
109
+ return $this->apiCall('statuses/replies', 'get', $format, $options);
110
+ }
111
+
112
+ /**
113
+ * Returns a single status, specified by the $id parameter.
114
+ * @param string|integer $id The numerical ID of the status to retrieve
115
+ * @param string $format Return format
116
+ * @return string
117
+ */
118
+ function getStatus($id, $format = 'xml') {
119
+ return $this->apiCall("statuses/show/{$id}", 'get', $format, array(), false);
120
+ }
121
+
122
+ /**
123
+ * Updates the authenticated user's status.
124
+ * @param string $status Text of the status, no URL encoding necessary
125
+ * @param string|integer $reply_to ID of the status to reply to. Optional
126
+ * @param string $format Return format
127
+ * @return string
128
+ */
129
+ function updateStatus($status, $reply_to = null, $format = 'xml') {
130
+ $options = array('status' => $status);
131
+ if ($reply_to) {
132
+ $options['in_reply_to_status_id'] = $reply_to;
133
+ }
134
+ return $this->apiCall('statuses/update', 'post', $format, $options);
135
+ }
136
+
137
+ /**
138
+ * Destroys the status specified by the required ID parameter. The authenticating user must be the author of the specified status.
139
+ * @param integer|string $id ID of the status to destroy
140
+ * @param string $format Return format
141
+ * @return string
142
+ */
143
+ function destroyStatus($id, $format = 'xml') {
144
+ return $this->apiCall("statuses/destroy/{$id}", 'post', $format, $options);
145
+ }
146
+
147
+ /**
148
+ * Returns the authenticating user's friends, each with current status inline.
149
+ * @param array $options Options to pass to the method
150
+ * @param string $format Return format
151
+ * @return string
152
+ */
153
+ function getFriends($options = array(), $format = 'xml') {
154
+ return $this->apiCall('statuses/friends', 'get', $format, $options, false);
155
+ }
156
+
157
+ /**
158
+ * Returns the authenticating user's followers, each with current status inline.
159
+ * @param array $options Options to pass to the method
160
+ * @param string $format Return format
161
+ * @return string
162
+ */
163
+ function getFollowers($options = array(), $format = 'xml') {
164
+ return $this->apiCall('statuses/followers', 'get', $format, $options);
165
+ }
166
+
167
+ /**
168
+ * Returns extended information of a given user.
169
+ * @param array $options Options to pass to the method
170
+ * @param string $format Return format
171
+ * @return string
172
+ */
173
+ function showUser($options = array(), $format = 'xml') {
174
+ if (!array_key_exists('id', $options) && !array_key_exists('user_id', $options) && !array_key_exists('screen_name', $options)) {
175
+ $options['id'] = substr($this->credentials, 0, strpos($this->credentials, ':'));
176
+ }
177
+ return $this->apiCall('users/show', 'get', $format, $options, false);
178
+ }
179
+
180
+ /**
181
+ * Returns a list of the 20 most recent direct messages sent to the authenticating user.
182
+ * @param array $options Options to pass to the method
183
+ * @param string $format Return format
184
+ * @return string
185
+ */
186
+ function getMessages($options = array(), $format = 'xml') {
187
+ return $this->apiCall('direct_messages', 'get', $format, $options);
188
+ }
189
+
190
+ /**
191
+ * Returns a list of the 20 most recent direct messages sent by the authenticating user.
192
+ * @param array $options Options to pass to the method
193
+ * @param string $format Return format
194
+ * @return string
195
+ */
196
+ function getSentMessages($options = array(), $format = 'xml') {
197
+ return $this->apiCall('direct_messages/sent', 'get', $format, $options);
198
+ }
199
+
200
+ /**
201
+ * Sends a new direct message to the specified user from the authenticating user.
202
+ * @param string $user The ID or screen name of a recipient
203
+ * @param string $text The message to send
204
+ * @param string $format Return format
205
+ * @return string
206
+ */
207
+ function newMessage($user, $text, $format = 'xml') {
208
+ $options = array(
209
+ 'user' => $user,
210
+ 'text' => $text
211
+ );
212
+ return $this->apiCall('direct_messages/new', 'post', $format, $options);
213
+ }
214
+
215
+ /**
216
+ * Destroys the direct message specified in the required $id parameter.
217
+ * @param integer|string $id The ID of the direct message to destroy
218
+ * @param string $format Return format
219
+ * @return string
220
+ */
221
+ function destroyMessage($id, $format = 'xml') {
222
+ return $this->apiCall("direct_messages/destroy/{$id}", 'post', $format, $options);
223
+ }
224
+
225
+ /**
226
+ * Befriends the user specified in the ID parameter as the authenticating user.
227
+ * @param array $options Options to pass to the method
228
+ * @param string $format Return format
229
+ * @return string
230
+ */
231
+ function createFriendship($options = array(), $format = 'xml') {
232
+ if (!array_key_exists('follow', $options)) {
233
+ $options['follow'] = 'true';
234
+ }
235
+ return $this->apiCall('friendships/create', 'post', $format, $options);
236
+ }
237
+
238
+ /**
239
+ * Discontinues friendship with the user specified in the ID parameter as the authenticating user.
240
+ * @param integer|string $id The ID or screen name of the user to unfriend
241
+ * @param string $format Return format
242
+ * @return string
243
+ */
244
+ function destroyFriendship($id, $format = 'xml') {
245
+ $options = array('id' => $id);
246
+ return $this->apiCall('friendships/destroy', 'post', $format, $options);
247
+ }
248
+
249
+ /**
250
+ * Tests if a friendship exists between two users.
251
+ * @param integer|string $user_a The ID or screen name of the first user
252
+ * @param integer|string $user_b The ID or screen name of the second user
253
+ * @param string $format Return format
254
+ * @return string
255
+ */
256
+ function friendshipExists($user_a, $user_b, $format = 'xml') {
257
+ $options = array(
258
+ 'user_a' => $user_a,
259
+ 'user_b' => $user_b
260
+ );
261
+ return $this->apiCall('friendships/exists', 'get', $format, $options);
262
+ }
263
+
264
+ /**
265
+ * Returns an array of numeric IDs for every user the specified user is followed by.
266
+ * @param array $options Options to pass to the method
267
+ * @param string $format Return format
268
+ * @return string
269
+ */
270
+ function getFriendIDs($options = array(), $format = 'xml') {
271
+ return $this->apiCall('friends/ids', 'get', $format, $options);
272
+ }
273
+
274
+ /**
275
+ * Returns an array of numeric IDs for every user the specified user is following.
276
+ * @param array $options Options to pass to the method
277
+ * @param string $format Return format
278
+ * @return string
279
+ */
280
+ function getFollowerIDs($options = array(), $format = 'xml') {
281
+ return $this->apiCall('followers/ids', 'get', $format, $options);
282
+ }
283
+
284
+ /**
285
+ * Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; returns a 401 status code and an error message if not.
286
+ * @param string $format Return format
287
+ * @return string
288
+ */
289
+ function verifyCredentials($format = 'xml') {
290
+ return $this->apiCall('account/verify_credentials', 'get', $format, array());
291
+ }
292
+
293
+ /**
294
+ * Returns the remaining number of API requests available to the requesting user before the API limit is reached for the current hour.
295
+ * @param boolean $authenticate Authenticate before calling method
296
+ * @param string $format Return format
297
+ * @return string
298
+ */
299
+ function rateLimitStatus($authenticate = false, $format = 'xml') {
300
+ return $this->apiCall('account/rate_limit_status', 'get', $format, array(), $authenticate);
301
+ }
302
+
303
+ /**
304
+ * Ends the session of the authenticating user, returning a null cookie.
305
+ * @param string $format Return format
306
+ * @return string
307
+ */
308
+ function endSession($format = 'xml') {
309
+ return $this->apiCall('account/end_session', 'post', $format, array());
310
+ }
311
+
312
+ /**
313
+ * Sets which device Twitter delivers updates to for the authenticating user.
314
+ * @param string $device The delivery device used. Must be sms, im, or none
315
+ * @return string
316
+ */
317
+ function updateDeliveryDevice($device, $format = 'xml') {
318
+ $options = array('device' => $device);
319
+ return $this->apiCall('account/update_delivery_device', 'post', $format, $options);
320
+ }
321
+
322
+ /**
323
+ * Sets one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com.
324
+ * @param array $options Options to pass to the method
325
+ * @param string $format Return format
326
+ * @return string
327
+ */
328
+ function updateProfileColors($options, $format = 'xml') {
329
+ return $this->apiCall('account/update_profile_colors', 'post', $format, $options);
330
+ }
331
+
332
+ /**
333
+ * Sets values that users are able to set under the "Account" tab of their settings page.
334
+ * @param array $options Options to pass to the method
335
+ * @param string $format Return format
336
+ * @return string
337
+ */
338
+ function updateProfile($options, $format = 'xml') {
339
+ return $this->apiCall('account/update_profile', 'post', $format, array());
340
+ }
341
+
342
+
343
+ /**
344
+ * Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
345
+ * @param array $options Options to pass to the method
346
+ * @param string $format Return format
347
+ * @return string
348
+ */
349
+ function getFavorites($options = array(), $format = 'xml') {
350
+ return $this->apiCall('favorites', 'get', $format, $options);
351
+ }
352
+
353
+ /**
354
+ * Favorites the status specified in the ID parameter as the authenticating user.
355
+ * @param integer|string $id The ID of the status to favorite
356
+ * @param string $format Return format
357
+ * @return string
358
+ */
359
+ function createFavorite($id, $format = 'xml') {
360
+ return $this->apiCall("favorites/create/{$id}", 'post', $format, array());
361
+ }
362
+
363
+ /**
364
+ * Un-favorites the status specified in the ID parameter as the authenticating user.
365
+ * @param integer|string $id The ID of the status to un-favorite
366
+ * @param string $format Return format
367
+ * @return string
368
+ */
369
+ function destroyFavorite($id, $format = 'xml') {
370
+ return $this->apiCall("favorites/destroy/{$id}", 'post', $format, array());
371
+ }
372
+
373
+ /**
374
+ * Enables notifications for updates from the specified user to the authenticating user.
375
+ * @param integer|string $id The ID or screen name of the user to follow
376
+ * @param string $format Return format
377
+ * @return string
378
+ */
379
+ function follow($id, $format = 'xml') {
380
+ $options = array('id' => $id);
381
+ return $this->apiCall('notifications/follow', 'post', $format, $options);
382
+ }
383
+
384
+ /**
385
+ * Disables notifications for updates from the specified user to the authenticating user.
386
+ * @param integer|string $id The ID or screen name of the user to leave
387
+ * @param string $format Return format
388
+ * @return string
389
+ */
390
+ function leave($id, $format = 'xml') {
391
+ $options = array('id' => $id);
392
+ return $this->apiCall('notifications/leave', 'post', $format, $options);
393
+ }
394
+
395
+ /**
396
+ * Blocks the user specified in the ID parameter as the authenticating user.
397
+ * @param integer|string $id The ID or screen name of the user to block
398
+ * @param string $format Return format
399
+ * @return string
400
+ */
401
+ function createBlock($id, $format = 'xml') {
402
+ $options = array('id' => $id);
403
+ return $this->apiCall('blocks/create', 'post', $format, $options);
404
+ }
405
+
406
+ /**
407
+ * Unblocks the user specified in the ID parameter as the authenticating user.
408
+ * @param integer|string $id The ID or screen name of the user to unblock
409
+ * @param string $format Return format
410
+ * @return string
411
+ */
412
+ function destroyBlock($id, $format = 'xml') {
413
+ $options = array('id' => $id);
414
+ return $this->apiCall('blocks/destroy', 'post', $format, $options);
415
+ }
416
+
417
+ /**
418
+ * Returns if the authenticating user is blocking a target user.
419
+ * @param array $options Options to pass to the method
420
+ * @param string $format Return format
421
+ * @return string
422
+ */
423
+ function blockExists($options, $format = 'xml') {
424
+ return $this->apiCall('blocks/exists', 'get', $format, $options);
425
+ }
426
+
427
+ /**
428
+ * Returns an array of user objects that the authenticating user is blocking.
429
+ * @param array $options Options to pass to the method
430
+ * @param string $format Return format
431
+ * @return string
432
+ */
433
+ function getBlocking($options, $format = 'xml') {
434
+ return $this->apiCall('blocks/blocking', 'get', $format, $options);
435
+ }
436
+
437
+ /**
438
+ * Returns an array of numeric user ids the authenticating user is blocking.
439
+ * @param array $options Options to pass to the method
440
+ * @param string $format Return format
441
+ * @return string
442
+ */
443
+ function getBlockingIDs($format = 'xml') {
444
+ return $this->apiCall('blocks/blocking/ids', 'get', $format, array());
445
+ }
446
+
447
+ /**
448
+ * Returns the string "ok" in the requested format with a 200 OK HTTP status code.
449
+ * @param string $format Return format
450
+ * @return string
451
+ */
452
+ function test($format = 'xml') {
453
+ return $this->apiCall('help/test', 'get', $format, array(), false);
454
+ }
455
+
456
+ /**
457
+ * Returns the last HTTP status code
458
+ * @return integer
459
+ */
460
+ function lastStatusCode() {
461
+ return $this->http_status;
462
+ }
463
+
464
+ /**
465
+ * Returns the URL of the last API call
466
+ * @return string
467
+ */
468
+ function lastApiCall() {
469
+ return $this->last_api_call;
470
+ }
471
+ }
472
+
473
+ /**
474
+ * Access to the Twitter API through HTTP auth
475
+ * @package twitterlibphp
476
+ */
477
+ class Twitter extends TwitterBase {
478
+
479
+ /**
480
+ * the Twitter credentials in HTTP format, username:password
481
+ * @access private
482
+ * @var string
483
+ */
484
+ var $credentials;
485
+
486
+ /**
487
+ * Fills in the credentials {@link $credentials} and the application source {@link $application_source}.
488
+ * @param string $username Twitter username
489
+ * @param string $password Twitter password
490
+ * @param $source string Optional. Name of the application using the API
491
+ */
492
+ function __construct($username, $password, $source = null) {
493
+ $this->credentials = sprintf("%s:%s", $username, $password);
494
+ $this->application_source = $source;
495
+ }
496
+
497
+ /**
498
+ * Executes an API call
499
+ * @param string $twitter_method The Twitter method to call
500
+ * @param string $http_method The HTTP method to use
501
+ * @param string $format Return format
502
+ * @param array $options Options to pass to the Twitter method
503
+ * @param boolean $require_credentials Whether or not credentials are required
504
+ * @return string
505
+ */
506
+ protected function apiCall($twitter_method, $http_method, $format, $options, $require_credentials = true) {
507
+ $curl_handle = curl_init();
508
+ $api_url = sprintf('http://twitter.com/%s.%s', $twitter_method, $format);
509
+ if (($http_method == 'get') && (count($options) > 0)) {
510
+ $api_url .= '?' . http_build_query($options);
511
+ }
512
+ //echo $api_url . "\n";
513
+ curl_setopt($curl_handle, CURLOPT_URL, $api_url);
514
+ if ($require_credentials) {
515
+ curl_setopt($curl_handle, CURLOPT_USERPWD, $this->credentials);
516
+ }
517
+ if ($http_method == 'post') {
518
+ curl_setopt($curl_handle, CURLOPT_POST, true);
519
+ curl_setopt($curl_handle, CURLOPT_POSTFIELDS, http_build_query($options));
520
+ }
521
+ curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, TRUE);
522
+ curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array('Expect:'));
523
+ $twitter_data = curl_exec($curl_handle);
524
+ $this->http_status = curl_getinfo($curl_handle, CURLINFO_HTTP_CODE);
525
+ $this->last_api_call = $api_url;
526
+ curl_close($curl_handle);
527
+ return $twitter_data;
528
+ }
529
+
530
+ }
531
+
532
+ /**
533
+ * TODO: Add TwitterOAuth class
534
+ */
535
+ ?>
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Namith Jawahar
3
  Donate link:http://www.wp-insert.smartlogix.co.in/
4
  Tags: adsense,google,widget,post,admin,plugin,rss,feedburner,ads,subscribe,fck editor,category description editor,excerpt,WYSIWYG,WYSIWYG editor,in post ads,feed logo,smartlogix,ads in feeds,analytics,google analytics,header,footer,ad management,advertisements,content,ad,advertising,blog,feed,feeds,formatting,html,javascript,manage,post,posts,seo,sidebar,widget,widgets,wordpress,tracking,syntex highlighter,highlighting,theme tools,plugin tools,developer tools,highlighting,theme editor,plugin editor,middle ad,ad filtration,pagewise ad filtration,template ads,ad tags,adbrite ads,adsense ready,easy adsense,adsense optimized
5
  Requires at least: 2.7
6
- Tested up to: 2.8.6
7
- Stable tag: 1.5.1
8
 
9
  Wp-Insert is the most powerful yet easiest to use wordpress ad management plugin which does a lot more than ad management.
10
 
3
  Donate link:http://www.wp-insert.smartlogix.co.in/
4
  Tags: adsense,google,widget,post,admin,plugin,rss,feedburner,ads,subscribe,fck editor,category description editor,excerpt,WYSIWYG,WYSIWYG editor,in post ads,feed logo,smartlogix,ads in feeds,analytics,google analytics,header,footer,ad management,advertisements,content,ad,advertising,blog,feed,feeds,formatting,html,javascript,manage,post,posts,seo,sidebar,widget,widgets,wordpress,tracking,syntex highlighter,highlighting,theme tools,plugin tools,developer tools,highlighting,theme editor,plugin editor,middle ad,ad filtration,pagewise ad filtration,template ads,ad tags,adbrite ads,adsense ready,easy adsense,adsense optimized
5
  Requires at least: 2.7
6
+ Tested up to: 2.9
7
+ Stable tag: 1.5.2
8
 
9
  Wp-Insert is the most powerful yet easiest to use wordpress ad management plugin which does a lot more than ad management.
10
 
wp-insert.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: wp-insert
4
  Plugin URI: http://www.wp-insert.smartlogix.co.in/
5
  Description: The ultimate wordpress plugin
6
- Version: 1.5.1
7
  Author: Namith Jawahar
8
  Author URI: http://www.smartlogix.co.in/
9
  WP-INSERT by SMARTLOGIX : The ultimate wordpress plugin
3
  Plugin Name: wp-insert
4
  Plugin URI: http://www.wp-insert.smartlogix.co.in/
5
  Description: The ultimate wordpress plugin
6
+ Version: 1.5.2
7
  Author: Namith Jawahar
8
  Author URI: http://www.smartlogix.co.in/
9
  WP-INSERT by SMARTLOGIX : The ultimate wordpress plugin