From 30fae5a621fe2b304872e78bf5d33219e3be356a Mon Sep 17 00:00:00 2001 From: Eric van der Vlist Date: Sat, 4 Jun 2011 09:40:37 +0200 Subject: [PATCH] =?UTF-8?q?Suppression=20des=20derni=C3=A8res=20r=C3=A9f?= =?UTF-8?q?=C3=A9rences=20=C3=A0=20perwarc=20(ancienne=20impl=C3=A9mentati?= =?UTF-8?q?on=20en=20bash)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wordpress/plugins/owark/owark.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/wordpress/plugins/owark/owark.php b/wordpress/plugins/owark/owark.php index 17c5f68..14055b4 100644 --- a/wordpress/plugins/owark/owark.php +++ b/wordpress/plugins/owark/owark.php @@ -68,7 +68,7 @@ if (!class_exists("Owark")) { add_filter ( 'get_comment_author_link', array($this, 'comment_filter')); add_action('owark_schedule_event', array(Owark, 'schedule')); - if ( !wp_next_scheduled( 'owark_schedule_event' , array('occurrences' => 30) ) ) { + if ( !wp_next_scheduled( 'owark_schedule_event', array('occurrences' => 30) ) ) { wp_schedule_event(time(), 'hourly', 'owark_schedule_event', array('occurrences' => 30)); } @@ -225,7 +225,7 @@ if (!class_exists("Owark")) { echo '

Tired of broken links? Archive yours with the Open Web Archive!

'; echo ""; - echo '

List of broken links with successfully archived pages:

'; + echo '

List of broken links with archived pages:

'; $query = "SELECT owark.id, owark.url, owark.status, owark.arc_date, owark.arc_location, blc_links.status_text FROM {$wpdb->prefix}owark AS owark, {$wpdb->prefix}blc_links as blc_links @@ -430,7 +430,7 @@ if (!class_exists("Owark")) { $home_url = home_url(); $loc = ""; - if( ($pos = strpos($link->arc_location, '/wp-content/perwac/')) !== FALSE ) + if( ($pos = strpos($link->arc_location, '/wp-content/plugins/owark/')) !== FALSE ) $loc = substr($link->arc_location, $pos); $arc_loc = home_url() . $loc; @@ -469,11 +469,9 @@ if (!class_exists("Owark")) { $url = $wpdb->get_row($query); $wpdb->flush(); - if ($url == NULL) { - wp_mail('vdv@dyomedea.com', 'Automatic email', "No row found, occurrences: $occurrences"); - } else { + if ($url != NULL) { $date = date('c'); - $path = dirname(__FILE__).'/archives/'. urlencode(preg_replace('/https?:\/\//', '', $url->final_url)) . '/' . $date; + $path = dirname(__FILE__).'/archives/'. str_replace('%2F', '/', urlencode(preg_replace('/https?:\/\//', '', $url->final_url))) . '/' . $date; //mkdir($path, $recursive=true); $output = array(); @@ -486,7 +484,7 @@ if (!class_exists("Owark")) { 'status' => $status, 'arc_date' => $date, 'arc_location' => $path)); - wp_mail('vdv@dyomedea.com', 'Automatic email', "URL: {$url->final_url}, occurrences: $occurrences"); + if ($occurrences > 0) { wp_schedule_single_event(time() + 90, 'owark_schedule_event', array('occurrences' => $occurrences - 1)); }