Wp-Insert - Version 2.0.2

Version Description

Download this release

Release Info

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

Code changes from version 2.0.1 to 2.0.2

includes/adwidgets/widget.php CHANGED
@@ -20,9 +20,9 @@ class wpInsertAdWidget extends WP_Widget {
20
  if (!empty($title)) { echo $before_title.$title.$after_title; }
21
 
22
  if(($options['adwidgets-'.$instance['instance']]['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['adwidgets-'.$instance['instance']]['country_1'])))) {
23
- echo '<div class="wpInsert wpInsertAdWidget"'.(($options['adwidgets-'.$instance['instance']]['styles'] != '')?' style="'.$options['adwidgets-'.$instance['instance']]['styles'].'"':'').'>'.$options['adwidgets-'.$instance['instance']]['country_code_1'].'</div>';
24
  } else {
25
- echo '<div class="wpInsert wpInsertAdWidget"'.(($options['adwidgets-'.$instance['instance']]['styles'] != '')?' style="'.$options['adwidgets-'.$instance['instance']]['styles'].'"':'').'>'.$options['adwidgets-'.$instance['instance']]['ad_code_'.$wpInsertAdInstance].'</div>';
26
  }
27
  echo $after_widget;
28
  }
20
  if (!empty($title)) { echo $before_title.$title.$after_title; }
21
 
22
  if(($options['adwidgets-'.$instance['instance']]['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['adwidgets-'.$instance['instance']]['country_1'])))) {
23
+ echo '<div class="wpInsert wpInsertAdWidget"'.(($options['adwidgets-'.$instance['instance']]['styles'] != '')?' style="'.$options['adwidgets-'.$instance['instance']]['styles'].'"':'').'>'.do_shortcode($options['adwidgets-'.$instance['instance']]['country_code_1']).'</div>';
24
  } else {
25
+ echo '<div class="wpInsert wpInsertAdWidget"'.(($options['adwidgets-'.$instance['instance']]['styles'] != '')?' style="'.$options['adwidgets-'.$instance['instance']]['styles'].'"':'').'>'.do_shortcode($options['adwidgets-'.$instance['instance']]['ad_code_'.$wpInsertAdInstance]).'</div>';
26
  }
27
  echo $after_widget;
28
  }
includes/common/admin-page.php CHANGED
@@ -2,13 +2,11 @@
2
  function wp_insert_admin_page($pageTitle, $sectionName, $optionName) { ?>
3
  <div class="wrap wp-insert">
4
  <a href="http://www.wp-insert.smartlogix.co.in"><img src="<?php echo WP_INSERT_URL; ?>/includes/common/images/logo.png" /></a>
5
- <form method="post" action="options.php" name="wp_auto_commenter_form">
6
  <?php settings_fields($optionName); ?>
7
  <div id="poststuff" class="metabox-holder has-right-sidebar wp-insert-plugin">
8
  <div id="side-info-column" class="inner-sidebar">
9
- <p class="submit">
10
- <input type="submit" name="Submit" class="button-primary submit" value="<?php esc_attr_e('Save Changes') ?>" />
11
- </p>
12
  </div>
13
  <div id="post-body" class="has-sidebar">
14
  <div id="post-body-content" class="has-sidebar-content">
2
  function wp_insert_admin_page($pageTitle, $sectionName, $optionName) { ?>
3
  <div class="wrap wp-insert">
4
  <a href="http://www.wp-insert.smartlogix.co.in"><img src="<?php echo WP_INSERT_URL; ?>/includes/common/images/logo.png" /></a>
5
+ <form method="post" action="options.php" name="wp_auto_commenter_form" id="wp_insert_form">
6
  <?php settings_fields($optionName); ?>
7
  <div id="poststuff" class="metabox-holder has-right-sidebar wp-insert-plugin">
8
  <div id="side-info-column" class="inner-sidebar">
9
+ <?php do_settings_sections('wp-insert-support'); ?>
 
 
10
  </div>
11
  <div id="post-body" class="has-sidebar">
12
  <div id="post-body-content" class="has-sidebar-content">
includes/common/common.php CHANGED
@@ -4,7 +4,9 @@ require_once(dirname(__FILE__).'/status.php');
4
  require_once(dirname(__FILE__).'/countries.php');
5
  require_once(dirname(__FILE__).'/menu.php');
6
  require_once(dirname(__FILE__).'/styles.php');
 
7
  require_once(dirname(__FILE__).'/admin-page.php');
8
  require_once(dirname(__FILE__).'/controls.php');
9
  require_once(dirname(__FILE__).'/jquery.php');
 
10
  ?>
4
  require_once(dirname(__FILE__).'/countries.php');
5
  require_once(dirname(__FILE__).'/menu.php');
6
  require_once(dirname(__FILE__).'/styles.php');
7
+ require_once(dirname(__FILE__).'/support.php');
8
  require_once(dirname(__FILE__).'/admin-page.php');
9
  require_once(dirname(__FILE__).'/controls.php');
10
  require_once(dirname(__FILE__).'/jquery.php');
11
+ require_once(dirname(__FILE__).'/http-post.php');
12
  ?>
includes/common/css/style.css CHANGED
@@ -391,7 +391,8 @@ label.iOSCheckLabelOff span {
391
  .wp-insert input.submit {
392
  background: #21759B;
393
  padding: 10px 0;
394
- width: 100%;
 
395
  }
396
 
397
  .wp-insert .rules {
391
  .wp-insert input.submit {
392
  background: #21759B;
393
  padding: 10px 0;
394
+ width: 97%;
395
+ border: 4px solid gold;
396
  }
397
 
398
  .wp-insert .rules {
includes/common/http-post.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //
3
+ // Post provided content to an http server and optionally
4
+ // convert chunk encoded results. Returns false on errors,
5
+ // result of post on success. This example only handles http,
6
+ // not https.
7
+ //
8
+ function wp_insert_httpPost($ip=null,$port=80,$uri=null,$content=null) {
9
+ if (empty($ip)) { return false; }
10
+ if (!is_numeric($port)) { return false; }
11
+ if (empty($uri)) { return false; }
12
+ if (empty($content)) { return false; }
13
+ // generate headers in array.
14
+ $t = array();
15
+ $t[] = 'POST ' . $uri . ' HTTP/1.1';
16
+ $t[] = 'Content-Type: application/x-www-form-urlencoded';
17
+ $t[] = 'Host: ' . $ip . ':' . $port;
18
+ $t[] = 'Content-Length: ' . strlen($content);
19
+ $t[] = 'Connection: close';
20
+ $t = implode("\r\n",$t) . "\r\n\r\n" . $content;
21
+ //
22
+ // Open socket, provide error report vars and timeout of 10
23
+ // seconds.
24
+ //
25
+ $fp = @fsockopen($ip,$port,$errno,$errstr,10);
26
+ // If we don't have a stream resource, abort.
27
+ if (!(get_resource_type($fp) == 'stream')) { return false; }
28
+ //
29
+ // Send headers and content.
30
+ //
31
+ if (!fwrite($fp,$t)) {
32
+ fclose($fp);
33
+ return false;
34
+ }
35
+ //
36
+ // Read all of response into $rsp and close the socket.
37
+ //
38
+ $rsp = '';
39
+ while(!feof($fp)) { $rsp .= fgets($fp,8192); }
40
+ fclose($fp);
41
+ //
42
+ // Call parseHttpResponse() to return the results.
43
+ //
44
+ return wp_insert_parseHttpResponse($rsp);
45
+ }
46
+
47
+ //
48
+ // Accepts provided http content, checks for a valid http response,
49
+ // unchunks if needed, returns http content without headers on
50
+ // success, false on any errors.
51
+ //
52
+ function wp_insert_parseHttpResponse($content=null) {
53
+ if (empty($content)) { return false; }
54
+ // split into array, headers and content.
55
+ $hunks = explode("\r\n\r\n",trim($content));
56
+ if (!is_array($hunks) or count($hunks) < 2) {
57
+ return false;
58
+ }
59
+ $header = $hunks[count($hunks) - 2];
60
+ $body = $hunks[count($hunks) - 1];
61
+ $headers = explode("\n",$header);
62
+ unset($hunks);
63
+ unset($header);
64
+ if (!wp_insert_validateHttpResponse($headers)) { return false; }
65
+ if (in_array('Transfer-Coding: chunked',$headers)) {
66
+ return trim(wp_insert_unchunkHttpResponse($body));
67
+ } else {
68
+ return trim($body);
69
+ }
70
+ }
71
+
72
+ //
73
+ // Validate http responses by checking header. Expects array of
74
+ // headers as argument. Returns boolean.
75
+ //
76
+ function wp_insert_validateHttpResponse($headers=null) {
77
+ if (!is_array($headers) or count($headers) < 1) { return false; }
78
+ switch(trim(strtolower($headers[0]))) {
79
+ case 'http/1.0 100 ok':
80
+ case 'http/1.0 200 ok':
81
+ case 'http/1.1 100 ok':
82
+ case 'http/1.1 200 ok':
83
+ return true;
84
+ break;
85
+ }
86
+ return false;
87
+ }
88
+
89
+ //
90
+ // Unchunk http content. Returns unchunked content on success,
91
+ // false on any errors... Borrows from code posted above by
92
+ // jbr at ya-right dot com.
93
+ //
94
+ function wp_insert_unchunkHttpResponse($str=null) {
95
+ if (!is_string($str) or strlen($str) < 1) { return false; }
96
+ $eol = "\r\n";
97
+ $add = strlen($eol);
98
+ $tmp = $str;
99
+ $str = '';
100
+ do {
101
+ $tmp = ltrim($tmp);
102
+ $pos = strpos($tmp, $eol);
103
+ if ($pos === false) { return false; }
104
+ $len = hexdec(substr($tmp,0,$pos));
105
+ if (!is_numeric($len) or $len < 0) { return false; }
106
+ $str .= substr($tmp, ($pos + $add), $len);
107
+ $tmp = substr($tmp, ($len + $pos + $add));
108
+ $check = trim($tmp);
109
+ } while(!empty($check));
110
+ unset($tmp);
111
+ return $str;
112
+ }
113
+ ?>
includes/common/images/blog_for_$100_ad.png ADDED
Binary file
includes/common/images/donate_btn.png ADDED
Binary file
includes/common/images/fb_like_btn.png ADDED
Binary file
includes/common/popups/categories.php CHANGED
@@ -39,9 +39,9 @@ require('../../../../../../wp-blog-header.php');
39
  <?php
40
  foreach($categories as $category) {
41
  if($selected && in_array($category->term_id, $selected)) {
42
- echo '<option value="'.$category->term_id.'" selected="selected">'.$category->name.'</option>';
43
  } else {
44
- echo '<option value="'.$category->term_id.'">'.$category->name.'</option>';
45
  }
46
  }
47
  ?>
39
  <?php
40
  foreach($categories as $category) {
41
  if($selected && in_array($category->term_id, $selected)) {
42
+ echo '<option value="'.$category->term_id.'" selected="selected">'.esc_html(substr($category->name, 0, 35)).'</option>';
43
  } else {
44
+ echo '<option value="'.$category->term_id.'">'.esc_html(substr($category->name, 0, 35)).'</option>';
45
  }
46
  }
47
  ?>
includes/common/popups/pages.php CHANGED
@@ -39,9 +39,9 @@ require('../../../../../../wp-blog-header.php');
39
  <?php
40
  foreach($pages as $page) {
41
  if($selected && in_array($page->ID, $selected)) {
42
- echo '<option value="'.$page->ID.'" selected="selected">'.$page->post_title.'</option>';
43
  } else {
44
- echo '<option value="'.$page->ID.'">'.$page->post_title.'</option>';
45
  }
46
  }
47
  ?>
39
  <?php
40
  foreach($pages as $page) {
41
  if($selected && in_array($page->ID, $selected)) {
42
+ echo '<option value="'.$page->ID.'" selected="selected">'.esc_html(substr($page->post_title, 0, 35)).'</option>';
43
  } else {
44
+ echo '<option value="'.$page->ID.'">'.esc_html(substr($page->post_title, 0, 35)).'</option>';
45
  }
46
  }
47
  ?>
includes/common/popups/posts.php CHANGED
@@ -39,9 +39,9 @@ require('../../../../../../wp-blog-header.php');
39
  <?php
40
  foreach($posts as $post) {
41
  if($selected && in_array($post->ID, $selected)) {
42
- echo '<option value="'.$post->ID.'" selected="selected">'.$post->post_title.'</option>';
43
  } else {
44
- echo '<option value="'.$post->ID.'">'.$post->post_title.'</option>';
45
  }
46
  }
47
  ?>
39
  <?php
40
  foreach($posts as $post) {
41
  if($selected && in_array($post->ID, $selected)) {
42
+ echo '<option value="'.$post->ID.'" selected="selected">'.esc_html(substr($post->post_title, 0, 35)).'</option>';
43
  } else {
44
+ echo '<option value="'.$post->ID.'">'.esc_html(substr($post->post_title, 0, 35)).'</option>';
45
  }
46
  }
47
  ?>
includes/common/status.php CHANGED
@@ -15,7 +15,7 @@ function wp_insert_track_post_instance($content) {
15
  add_action('wp', 'wp_insert_track_ad_instance', 1);
16
  function wp_insert_track_ad_instance($content) {
17
  global $wpInsertAdInstance;
18
- $networkCount = get_option('wp-insert-multiple-network-status');
19
  $wpInsertAdInstance = rand(1, $networkCount);
20
  }
21
 
15
  add_action('wp', 'wp_insert_track_ad_instance', 1);
16
  function wp_insert_track_ad_instance($content) {
17
  global $wpInsertAdInstance;
18
+ $networkCount = intval(get_option('wp_insert_multiple_network_status'));
19
  $wpInsertAdInstance = rand(1, $networkCount);
20
  }
21
 
includes/common/support.php ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('admin_init', 'wp_insert_support_admin_init');
3
+ function wp_insert_support_admin_init() {
4
+ if(isset($_POST['is_showcase_submission']) && ($_POST['is_showcase_submission'] == 'true')) {
5
+ $data = 'site_name='.(string)$_POST['site_name'].'&site_description='.(string)$_POST['site_description'].'&site_category='.(string)$_POST['site_category'].'&site_url='.(string)$_POST['site_url'].'&admin_email='.(string)$_POST['admin_email'];
6
+ try {
7
+ $post_results = wp_insert_httpPost('wp-insert.smartlogix.co.in','80', '/wp-content/plugins/wp-insert-directory/request-handler.php', $data);
8
+ if(($post_results != false) && (strpos($post_results, 'SUBMISSION SUCCESSFUL') !== false)) {
9
+ update_option('wp_insert_showcase_submission', 'PENDING');
10
+ } else {
11
+ echo '<div id="message" class="error">A error occurred while submitting the request. Please try again later.</div>';
12
+ }
13
+ } catch(Exception $e) {
14
+ echo '<div id="message" class="error">A error occurred while submitting the request. Please try again later.</div>';
15
+ }
16
+ }
17
+ add_settings_section('wp-insert-support-top', '', 'wp_insert_support_section', 'wp-insert-support');
18
+ add_meta_box('wp_insert_facebook', 'Like Us On Facebook', 'wp_insert_facebook_content', 'wp-insert-support-top', 'advanced', 'high');
19
+ add_meta_box('wp_insert_donate', 'Donate and Support Free Plugins', 'wp_insert_donate_content', 'wp-insert-support-top', 'advanced', 'high');
20
+ add_meta_box('wp_insert_matching_blog', 'Matching Blog for $100', 'wp_insert_matching_blog_content', 'wp-insert-support-bottom', 'advanced', 'high');
21
+ if(get_option('wp_insert_showcase_submission') != 'SUBMITTED') {
22
+ add_meta_box('wp_insert_showcase', 'Showcase your Site', 'wp_insert_showcase_content', 'wp-insert-support-bottom', 'advanced', 'high');
23
+ }
24
+ }
25
+
26
+ function wp_insert_support_section() {
27
+ do_meta_boxes('wp-insert-support-top', 'advanced', null);
28
+ echo '<p class="submit"><input type="submit" name="Submit" class="button-primary submit" value="Save Changes" /></p>';
29
+ do_meta_boxes('wp-insert-support-bottom', 'advanced', null);
30
+ }
31
+
32
+ function wp_insert_facebook_content() {
33
+ echo '<a href="https://www.facebook.com/SmartLogix"><img src="'.WP_INSERT_URL.'/includes/common/images/fb_like_btn.png" style="margin-top: 5px;" /></a>';
34
+ }
35
+
36
+ function wp_insert_donate_content() {
37
+ echo '<a href="http://www.wp-insert.smartlogix.co.in/support/"><img src="'.WP_INSERT_URL.'/includes/common/images/donate_btn.png" style="margin-top: 5px;" /></a><br /><small style="display: block; text-align: center;"><a href="http://wordpress.org/extend/plugins/wp-insert/">Rate the plugin in Wordpress Plugin Repository</a></small>';
38
+ }
39
+
40
+ function wp_insert_showcase_content() {
41
+ if(get_option('wp_insert_showcase_submission') == 'PENDING') {
42
+ echo '<div id="message" class="updated" style="margin-top: 15px;"><p>Thank you for submitting your site to the Wp-Insert user directory. You will receive a notification Email when the site is published in the Directory</p></div>';
43
+ update_option('wp_insert_showcase_submission', 'SUBMITTED');
44
+ } else {
45
+ echo '<div id="showcaseForm">';
46
+ echo '<p style="text-align: justify;">Showcase your site in the Wp-Insert User Directory and get a free backlink and targeted visitors. A screenshot of the site will be automatically generated and the site will appear in the selected category in our <a href="http://www.wp-insert.smartlogix.co.in/directory/">user directory</a> within a couple of hours.</p>';
47
+ echo '<p><label for="site_url">Site URL:</label></br /><input type="text" readonly="readonly" class="widefat" id="site_url" name="site_url" value="'.get_bloginfo('url').'" /></p>';
48
+ echo '<p><label for="site_name">Site Name:</label></br /><input type="text" class="widefat" id="site_name" name="site_name" value="'.get_bloginfo('name').'" /><small>Site Name will be Cropped at 40 Characters</small></p>';
49
+ echo '<p><label for="site_description">Site Description</label></br /><textarea class="widefat" id="site_description" name="site_description" >'.get_bloginfo('description').'</textarea><small>Site Description will be Cropped at 300 Characters</small></p>';
50
+ echo '<p><label for="site_category">Site Category</label></br />';
51
+ echo '<select id="site_category" name="site_category" class="widefat">';
52
+ echo '<option value="529">Accounting & Auditing</option>';
53
+ echo '<option value="530">Advertising & Marketing</option>';
54
+ echo '<option value="531">Antivirus & Malware</option>';
55
+ echo '<option value="532">Apparel</option>';
56
+ echo '<option value="533">Arts & Entertainment</option>';
57
+ echo '<option value="534">Auctions</option>';
58
+ echo '<option value="535">Banking</option>';
59
+ echo '<option value="536">Baseball</option>';
60
+ echo '<option value="537">Blogging Resources & Services</option>';
61
+ echo '<option value="538">Broadcast & Network News</option>';
62
+ echo '<option value="539">Business Plans & Presentations</option>';
63
+ echo '<option value="540">Cartoons</option>';
64
+ echo '<option value="541">Casual Games</option>';
65
+ echo '<option value="542">Celebrities & Entertainment News</option>';
66
+ echo '<option value="543">Classifieds</option>';
67
+ echo '<option value="544">Clip Art & Animated GIFs</option>';
68
+ echo '<option value="545">Computer & Video Games</option>';
69
+ echo '<option value="546">Computer Hardware</option>';
70
+ echo '<option value="547">Consumer Electronics</option>';
71
+ echo '<option value="548">Coupons & Discount Offers</option>';
72
+ echo '<option value="549">Credit Cards</option>';
73
+ echo '<option value="550">Dating & Personals</option>';
74
+ echo '<option value="551">Dictionaries & Encyclopedias</option>';
75
+ echo '<option value="552">Directories & Listings</option>';
76
+ echo '<option value="553">DVD & Video Rentals</option>';
77
+ echo '<option value="554">E-Commerce Services</option>';
78
+ echo '<option value="555">Email & Messaging</option>';
79
+ echo '<option value="556">Entertainment Media</option>';
80
+ echo '<option value="557">Fantasy Sports</option>';
81
+ echo '<option value="558">Fashion & Style</option>';
82
+ echo '<option value="559">File Sharing & Hosting</option>';
83
+ echo '<option value="560">Flash-Based Entertainment</option>';
84
+ echo '<option value="561">Freeware & Shareware</option>';
85
+ echo '<option value="562">Games</option>';
86
+ echo '<option value="563">General Reference</option>';
87
+ echo '<option value="564">Health</option>';
88
+ echo '<option value="565">Home Furnishings</option>';
89
+ echo '<option value="566">Hotels & Accommodations</option>';
90
+ echo '<option value="567">How-To� DIY & Expert Content</option>';
91
+ echo '<option value="568">Import & Export</option>';
92
+ echo '<option value="569">Internet & Telecom</option>';
93
+ echo '<option value="570">Internet Clients & Browsers</option>';
94
+ echo '<option value="571">Investing</option>';
95
+ echo '<option value="572">ISPs</option>';
96
+ echo '<option value="573">Java</option>';
97
+ echo '<option value="574">Jobs</option>';
98
+ echo '<option value="575">Local News</option>';
99
+ echo '<option value="576">Mac OS</option>';
100
+ echo '<option value="577">Mail & Package Delivery</option>';
101
+ echo '<option value="578">Maps</option>';
102
+ echo '<option value="579">Marketing Services</option>';
103
+ echo '<option value="580">Mass Merchants & Department Stores</option>';
104
+ echo '<option value="581">Merchant Services & Payment Systems</option>';
105
+ echo '<option value="582">Movie Reference</option>';
106
+ echo '<option value="583">Movies</option>';
107
+ echo '<option value="584">Multimedia Software</option>';
108
+ echo '<option value="585">Music & Audio</option>';
109
+ echo '<option value="586">Music Streams & Downloads</option>';
110
+ echo '<option value="5">News</option>';
111
+ echo '<option value="587">Newspapers</option>';
112
+ echo '<option value="588">Online Communities</option>';
113
+ echo '<option value="589">Online Games</option>';
114
+ echo '<option value="590">Online Journals & Personal Sites</option>';
115
+ echo '<option value="591">Online Media</option>';
116
+ echo '<option value="592">Online Video</option>';
117
+ echo '<option value="593">Open Source</option>';
118
+ echo '<option value="594">Phone Service Providers</option>';
119
+ echo '<option value="595">Photo & Image Sharing</option>';
120
+ echo '<option value="596">Photo & Video Sharing</option>';
121
+ echo '<option value="597">Radio</option>';
122
+ echo '<option value="598">Real Estate</option>';
123
+ echo '<option value="599">Search Engine Optimization & Marketing</option>';
124
+ echo '<option value="600">Search Engines</option>';
125
+ echo '<option value="601">Service Providers</option>';
126
+ echo '<option value="602">Shopping</option>';
127
+ echo '<option value="603">Shopping Portals & Search Engines</option>';
128
+ echo '<option value="604">Social Network Apps & Add-Ons</option>';
129
+ echo '<option value="605">Social Networks</option>';
130
+ echo '<option value="606">Software</option>';
131
+ echo '<option value="607">Sports News</option>';
132
+ echo '<option value="608">Translation Tools & Resources</option>';
133
+ echo '<option value="609">Travel</option>';
134
+ echo '<option value="610">TV Networks & Stations</option>';
135
+ echo '<option value="611">Vehicle Shopping</option>';
136
+ echo '<option value="612">Video Sharing</option>';
137
+ echo '<option value="613">Voice & Video Chat</option>';
138
+ echo '<option value="614">Weather</option>';
139
+ echo '<option value="615">Web Apps & Online Tools</option>';
140
+ echo '<option value="616">Web Design & Development</option>';
141
+ echo '<option value="617">Web Hosting & Domain Registration</option>';
142
+ echo '<option value="618">Web Portals</option>';
143
+ echo '<option value="619">Web Services</option>';
144
+ echo '<option value="620">Webcams & Virtual Tours</option>';
145
+ echo '<option value="621">Windows OS</option>';
146
+ echo '<option value="622">World News</option>';
147
+ echo '</select>';
148
+ echo '</p>';
149
+ echo '<p><label for="admin_email">Admin Email</label></br /><input type="text" class="widefat" id="admin_email" name="admin_email" value="" /><br /><small style="text-align: justify; display: block">Your Email wont be shared with any third party and will only be used to sent notifications about SmartLogix Services related to WordPress. All data provided to SmartLogix is bound by our <a href="http://smartlogix.co.in/privacy-policy/">privacy policy</a></small></p>';
150
+ echo '<p><input type="hidden" id="is_showcase_submission" name="is_showcase_submission" value="false" /><input type="button" class="button-secondary" value="Submit" style="float: right" onclick="showcase_submit()" /></p><div style="clear: both;"></div>';
151
+ echo '<script type="text/javascript">';
152
+ echo 'function showcase_submit() {';
153
+ echo 'jQuery("#is_showcase_submission").val("true");';
154
+ echo 'jQuery("#wp_insert_form").submit();';
155
+ echo '}';
156
+ echo '</script>';
157
+ echo '</div>';
158
+ }
159
+ }
160
+
161
+ function wp_insert_matching_blog_content() {
162
+ echo '<a href="http://smartlogix.co.in/matching-blog-for-100-offer/"><img src="'.WP_INSERT_URL.'/includes/common/images/blog_for_$100_ad.png" style="margin-top: 5px;" /></a><br /><small style="display: block; text-align: center;">This offer is only available for a limited period to Wp-Insert users and our existing customers.</small>';
163
+ }
164
+ ?>
includes/inpostads/content.php CHANGED
@@ -24,9 +24,9 @@ function wp_insert_inpostads_filter_the_content($content) {
24
  }
25
  if($position) {
26
  if(($options['middle']['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['middle']['country_1'])))) {
27
- $content = substr_replace($content, '/p>'.'<div class="wpInsert wpInsertInPostAd wpInsertMiddle"'.(($options['middle']['styles'] != '')?' style="'.$options['middle']['styles'].'"':'').'>'.$options['middle']['country_code_1'].'</div>', $position, 3);
28
  } else {
29
- $content = substr_replace($content, '/p>'.'<div class="wpInsert wpInsertInPostAd wpInsertMiddle"'.(($options['middle']['styles'] != '')?' style="'.$options['middle']['styles'].'"':'').'>'.$options['middle']['ad_code_'.$wpInsertAdInstance].'</div>', $position, 3);
30
  }
31
  }
32
  } else {
@@ -38,9 +38,9 @@ function wp_insert_inpostads_filter_the_content($content) {
38
  }
39
  if($position) {
40
  if(($options['middle']['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['middle']['country_1'])))) {
41
- $content = substr_replace($content, '/p>'.'<div class="wpInsert wpInsertInPostAd wpInsertMiddle"'.(($options['middle']['styles'] != '')?' style="'.$options['middle']['styles'].'"':'').'>'.$options['middle']['country_code_1'].'</div>', $position, 3);
42
  } else {
43
- $content = substr_replace($content, '/p>'.'<div class="wpInsert wpInsertInPostAd wpInsertMiddle"'.(($options['middle']['styles'] != '')?' style="'.$options['middle']['styles'].'"':'').'>'.$options['middle']['ad_code_'.$wpInsertAdInstance].'</div>', $position, 3);
44
  }
45
  }
46
  }
@@ -49,30 +49,30 @@ function wp_insert_inpostads_filter_the_content($content) {
49
  }
50
  if(wp_insert_get_ad_status($options['left'])) {
51
  if(($options['left']['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['left']['country_1'])))) {
52
- $content = '<div class="wpInsert wpInsertInPostAd wpInsertLeft" style="float: left; '.(($options['left']['styles'] != '')?$options['left']['styles']:'').'">'.$options['left']['country_code_1'].'</div>'.$content;
53
  } else {
54
- $content = '<div class="wpInsert wpInsertInPostAd wpInsertLeft" style="float: left; '.(($options['left']['styles'] != '')?$options['left']['styles']:'').'">'.$options['left']['ad_code_'.$wpInsertAdInstance].'</div>'.$content;
55
  }
56
  }
57
  if(wp_insert_get_ad_status($options['right'])) {
58
  if(($options['right']['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['right']['country_1'])))) {
59
- $content = '<div class="wpInsert wpInsertInPostAd wpInsertRight" style="float: right; '.(($options['right']['styles'] != '')?$options['right']['styles']:'').'">'.$options['right']['country_code_1'].'</div>'.$content;
60
  } else {
61
- $content = '<div class="wpInsert wpInsertInPostAd wpInsertRight" style="float: right; '.(($options['right']['styles'] != '')?$options['right']['styles']:'').'">'.$options['right']['ad_code_'.$wpInsertAdInstance].'</div>'.$content;
62
  }
63
  }
64
  if(wp_insert_get_ad_status($options['above'])) {
65
  if(($options['above']['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['above']['country_1'])))) {
66
- $content = '<div class="wpInsert wpInsertInPostAd wpInsertAbove"'.(($options['above']['styles'] != '')?' style="'.$options['above']['styles'].'"':'').'>'.$options['above']['country_code_1'].'</div>'.$content;
67
  } else {
68
- $content = '<div class="wpInsert wpInsertInPostAd wpInsertAbove"'.(($options['above']['styles'] != '')?' style="'.$options['above']['styles'].'"':'').'>'.$options['above']['ad_code_'.$wpInsertAdInstance].'</div>'.$content;
69
  }
70
  }
71
  if(wp_insert_get_ad_status($options['below'])) {
72
  if(($options['below']['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['below']['country_1'])))) {
73
- $content = $content.'<div class="wpInsert wpInsertInPostAd wpInsertBelow"'.(($options['below']['styles'] != '')?' style="'.$options['below']['styles'].'"':'').'>'.$options['below']['country_code_1'].'</div>';
74
  } else {
75
- $content = $content.'<div class="wpInsert wpInsertInPostAd wpInsertBelow"'.(($options['below']['styles'] != '')?' style="'.$options['below']['styles'].'"':'').'>'.$options['below']['ad_code_'.$wpInsertAdInstance].'</div>';
76
  }
77
  }
78
  return $content;
24
  }
25
  if($position) {
26
  if(($options['middle']['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['middle']['country_1'])))) {
27
+ $content = substr_replace($content, '/p>'.'<div class="wpInsert wpInsertInPostAd wpInsertMiddle"'.(($options['middle']['styles'] != '')?' style="'.$options['middle']['styles'].'"':'').'>'.do_shortcode($options['middle']['country_code_1']).'</div>', $position, 3);
28
  } else {
29
+ $content = substr_replace($content, '/p>'.'<div class="wpInsert wpInsertInPostAd wpInsertMiddle"'.(($options['middle']['styles'] != '')?' style="'.$options['middle']['styles'].'"':'').'>'.do_shortcode($options['middle']['ad_code_'.$wpInsertAdInstance]).'</div>', $position, 3);
30
  }
31
  }
32
  } else {
38
  }
39
  if($position) {
40
  if(($options['middle']['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['middle']['country_1'])))) {
41
+ $content = substr_replace($content, '/p>'.'<div class="wpInsert wpInsertInPostAd wpInsertMiddle"'.(($options['middle']['styles'] != '')?' style="'.$options['middle']['styles'].'"':'').'>'.do_shortcode($options['middle']['country_code_1']).'</div>', $position, 3);
42
  } else {
43
+ $content = substr_replace($content, '/p>'.'<div class="wpInsert wpInsertInPostAd wpInsertMiddle"'.(($options['middle']['styles'] != '')?' style="'.$options['middle']['styles'].'"':'').'>'.do_shortcode($options['middle']['ad_code_'.$wpInsertAdInstance]).'</div>', $position, 3);
44
  }
45
  }
46
  }
49
  }
50
  if(wp_insert_get_ad_status($options['left'])) {
51
  if(($options['left']['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['left']['country_1'])))) {
52
+ $content = '<div class="wpInsert wpInsertInPostAd wpInsertLeft" style="float: left; '.(($options['left']['styles'] != '')?$options['left']['styles']:'').'">'.do_shortcode($options['left']['country_code_1']).'</div>'.$content;
53
  } else {
54
+ $content = '<div class="wpInsert wpInsertInPostAd wpInsertLeft" style="float: left; '.(($options['left']['styles'] != '')?$options['left']['styles']:'').'">'.do_shortcode($options['left']['ad_code_'.$wpInsertAdInstance]).'</div>'.$content;
55
  }
56
  }
57
  if(wp_insert_get_ad_status($options['right'])) {
58
  if(($options['right']['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['right']['country_1'])))) {
59
+ $content = '<div class="wpInsert wpInsertInPostAd wpInsertRight" style="float: right; '.(($options['right']['styles'] != '')?$options['right']['styles']:'').'">'.do_shortcode($options['right']['country_code_1']).'</div>'.$content;
60
  } else {
61
+ $content = '<div class="wpInsert wpInsertInPostAd wpInsertRight" style="float: right; '.(($options['right']['styles'] != '')?$options['right']['styles']:'').'">'.do_shortcode($options['right']['ad_code_'.$wpInsertAdInstance]).'</div>'.$content;
62
  }
63
  }
64
  if(wp_insert_get_ad_status($options['above'])) {
65
  if(($options['above']['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['above']['country_1'])))) {
66
+ $content = '<div class="wpInsert wpInsertInPostAd wpInsertAbove"'.(($options['above']['styles'] != '')?' style="'.$options['above']['styles'].'"':'').'>'.do_shortcode($options['above']['country_code_1']).'</div>'.$content;
67
  } else {
68
+ $content = '<div class="wpInsert wpInsertInPostAd wpInsertAbove"'.(($options['above']['styles'] != '')?' style="'.$options['above']['styles'].'"':'').'>'.do_shortcode($options['above']['ad_code_'.$wpInsertAdInstance]).'</div>'.$content;
69
  }
70
  }
71
  if(wp_insert_get_ad_status($options['below'])) {
72
  if(($options['below']['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['below']['country_1'])))) {
73
+ $content = $content.'<div class="wpInsert wpInsertInPostAd wpInsertBelow"'.(($options['below']['styles'] != '')?' style="'.$options['below']['styles'].'"':'').'>'.do_shortcode($options['below']['country_code_1']).'</div>';
74
  } else {
75
+ $content = $content.'<div class="wpInsert wpInsertInPostAd wpInsertBelow"'.(($options['below']['styles'] != '')?' style="'.$options['below']['styles'].'"':'').'>'.do_shortcode($options['below']['ad_code_'.$wpInsertAdInstance]).'</div>';
76
  }
77
  }
78
  return $content;
includes/legal-pages/content.php CHANGED
@@ -3,13 +3,13 @@ add_filter('the_content', 'wp_insert_legal_filter_the_content');
3
  function wp_insert_legal_filter_the_content($content) {
4
  $options = get_option('wp_insert_legal_options');
5
  $page_details = wp_insert_get_page_details();
6
- if(in_array($page_details['ID'], split(',', $options['privacy-policy']['pages']))) {
7
  return $options['privacy-policy']['content'];
8
- } else if(in_array($page_details['ID'], split(',', $options['terms-and-conditions']['pages']))) {
9
  return $options['terms-and-conditions']['content'];
10
- } if(in_array($page_details['ID'], split(',', $options['disclaimer']['pages']))) {
11
  return $options['disclaimer']['content'];
12
- } if(in_array($page_details['ID'], split(',', $options['copyright-notice']['pages']))) {
13
  return $options['copyright-notice']['content'];
14
  }
15
  return $content;
3
  function wp_insert_legal_filter_the_content($content) {
4
  $options = get_option('wp_insert_legal_options');
5
  $page_details = wp_insert_get_page_details();
6
+ if(in_array($page_details['ID'], explode(',', $options['privacy-policy']['pages']))) {
7
  return $options['privacy-policy']['content'];
8
+ } else if(in_array($page_details['ID'], explode(',', $options['terms-and-conditions']['pages']))) {
9
  return $options['terms-and-conditions']['content'];
10
+ } if(in_array($page_details['ID'], explode(',', $options['disclaimer']['pages']))) {
11
  return $options['disclaimer']['content'];
12
+ } if(in_array($page_details['ID'], explode(',', $options['copyright-notice']['pages']))) {
13
  return $options['copyright-notice']['content'];
14
  }
15
  return $content;
includes/templateads/template-tag.php CHANGED
@@ -9,9 +9,9 @@ function wp_template_ad($instance) {
9
  }
10
  if(wp_insert_get_ad_status($options['templateads-'.$instance])) {
11
  if(($options['templateads-'.$instance]['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['templateads-'.$instance]['country_1'])))) {
12
- echo '<div class="wpInsert wpInsertTemplateTag"'.(($options['templateads-'.$instance]['styles'] != '')?' style="'.$options['templateads-'.$instance]['styles'].'"':'').'>'.$options['templateads-'.$instance]['country_code_1'].'</div>';
13
  } else {
14
- echo '<div class="wpInsert wpInsertTemplateTag"'.(($options['templateads-'.$instance]['styles'] != '')?' style="'.$options['templateads-'.$instance]['styles'].'"':'').'>'.$options['templateads-'.$instance]['ad_code_'.$wpInsertAdInstance].'</div>';
15
  }
16
  }
17
  }
9
  }
10
  if(wp_insert_get_ad_status($options['templateads-'.$instance])) {
11
  if(($options['templateads-'.$instance]['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['templateads-'.$instance]['country_1'])))) {
12
+ echo '<div class="wpInsert wpInsertTemplateTag"'.(($options['templateads-'.$instance]['styles'] != '')?' style="'.$options['templateads-'.$instance]['styles'].'"':'').'>'.do_shortcode($options['templateads-'.$instance]['country_code_1']).'</div>';
13
  } else {
14
+ echo '<div class="wpInsert wpInsertTemplateTag"'.(($options['templateads-'.$instance]['styles'] != '')?' style="'.$options['templateads-'.$instance]['styles'].'"':'').'>'.do_shortcode($options['templateads-'.$instance]['ad_code_'.$wpInsertAdInstance]).'</div>';
15
  }
16
  }
17
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:www.wp-insert.smartlogix.co.in/support
4
  Tags: adsense,google,widget,post,admin,plugin,ads,in post ads,feed logo,smartlogix,ads in feeds,analytics,google analytics,header,footer,ad management,advertisements,content,ad,advertising,privacy policy,privacy,policy,automatic privacy policy,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,terms and conditions,terms,conditions,automatic terms and conditions
5
  Requires at least: 3.2
6
  Tested up to: 3.4.2
7
- Stable tag: 2.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -31,6 +31,7 @@ All these from within a well contained and easy to use interface.
31
  * Insert Ads in the middle of the content. (Option to control the minimum length required for an articles in which middle ads show up as well as option to exactly define where the middle ads appears in a post)
32
  * Insert Ads to the left of the content.
33
  * Insert Ads to the right of the content.
 
34
  * Extensive and elaborate RULES section to control when and where you display the ads. (Precise control down to single post/page level)
35
  * Geo Targeting : Pick different ads for different Geographical locations. (You might want to promote an affiliate product for visitors from USA while showing Google Adsense to Rest of the World)
36
 
4
  Tags: adsense,google,widget,post,admin,plugin,ads,in post ads,feed logo,smartlogix,ads in feeds,analytics,google analytics,header,footer,ad management,advertisements,content,ad,advertising,privacy policy,privacy,policy,automatic privacy policy,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,terms and conditions,terms,conditions,automatic terms and conditions
5
  Requires at least: 3.2
6
  Tested up to: 3.4.2
7
+ Stable tag: 2.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
31
  * Insert Ads in the middle of the content. (Option to control the minimum length required for an articles in which middle ads show up as well as option to exactly define where the middle ads appears in a post)
32
  * Insert Ads to the left of the content.
33
  * Insert Ads to the right of the content.
34
+ * Support for Short-codes.
35
  * Extensive and elaborate RULES section to control when and where you display the ads. (Precise control down to single post/page level)
36
  * Geo Targeting : Pick different ads for different Geographical locations. (You might want to promote an affiliate product for visitors from USA while showing Google Adsense to Rest of the World)
37
 
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: WP-INSERT by SMARTLOGIX : The ultimate wordpress plugin
6
- Version: 2.0.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: WP-INSERT by SMARTLOGIX : The ultimate wordpress plugin
6
+ Version: 2.0.2
7
  Author: Namith Jawahar
8
  Author URI: http://www.smartlogix.co.in/
9
  WP-INSERT by SMARTLOGIX : The ultimate wordpress plugin