コード例 #1
0
if (isset($_GET['wintype']) && $_GET['wintype'] == 'pop') {
    $no_header = "yes";
}
//if popup, do not display header
//depending on type, show and run link checker form
if (isset($_GET['type']) && strtolower($_GET['type']) == 'records') {
    //set header variables and include header file
    $subcat = "records";
    $page_title = "Records Link Checker";
    $use_jquery = array("ui_styles");
    include "../includes/header.php";
    //create new link checker object
    $lobjLinkChecker = new LinkChecker($proxyURL);
    $lobjLinkChecker->displayHTMLForm('record');
    if (isset($_POST['LinkCheckRecords'])) {
        $lobjLinkChecker->checkRecordsLinks();
    }
} else {
    //set header variables and include header file
    $subcat = "guides";
    $page_title = "Guide Link Checker";
    $use_jquery = array("ui_styles");
    include "../includes/header.php";
    //create new link checker object
    $lobjLinkChecker = new LinkChecker($proxyURL);
    $lobjLinkChecker->displayHTMLForm('subject');
    if (isset($_POST['subject_id'])) {
        $lobjLinkChecker->checkSubjectLinks($_POST['subject_id']);
    }
}
include '../includes/footer.php';
コード例 #2
0
             $label_text = _("Location (Enter Call Number)");
             break;
         case 3:
             $label_text = _("Location (Enter Persistent Catalog URL--include http://)");
             break;
     }
     print $label_text;
     break;
 case "check_title":
     break;
 case "check_url":
     // check link
     if (isset($_POST['useProxy']) && $_POST['useProxy'] == 'TRUE') {
         $lobjLinkChecker = new LinkChecker($proxyURL, 5, FALSE);
     } else {
         $lobjLinkChecker = new LinkChecker('', 5, FALSE);
     }
     $lobjError = $lobjLinkChecker->checkUrl($_REQUEST["checkurl"]);
     if ($lobjError['message'] == "") {
         $feedback = _("This URL looks OK to me");
         print "<i class=\"fa fa-check fa-2x\" alt=\"check url\" border=\"0\" id=\"check_url\" alt=\"{$feedback}\" title=\"{$feedback}\" ></i> ";
     } else {
         $feedback = _("This URL looks dodgy; better check it");
         print "<i class=\"fa fa-exclamation-triangle fa-2x alert-colour\" alt=\"check url\" border=\"0\" id=\"check_url\" alt=\"{$feedback}\" title=\"{$feedback}\" /></i> ";
     }
     break;
 case "recommend_delete":
     $del_record = $CpanelPath . "records/record.php?record_id=" . $_POST["our_id"];
     $message_body = "<p>" . _("The following record is recommended for delete") . ":</p>\n            <p><a href=\"{$del_record}\">{$del_record}</a></p>";
     $messageParams = array('from' => $_SESSION['email'], 'to' => $administrator_email, 'subjectLine' => _("SubjectsPlus: AZRecord Delete Recommendation"), 'content' => $message_body);
     $message = new MailMessage($messageParams);
コード例 #3
0
ファイル: linkchecker.php プロジェクト: kenirwin/SubjectsPlus
    $linkReport = "<br /><h3>" . _("Results") . "</h3>";
    // 1. Get public url of guide to be tested
    $full_url = $PublicPath . "guide.php?subject=" . $shortie;
    // Load page into $page variable via CURL
    //  echo $sub_url . "\n";
    $c = curl_init($full_url);
    curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);
    $page = curl_exec($c);
    $page = explode("<body", $page);
    $page = $page[1];
    $info = curl_getinfo($c);
    curl_close($c);
    $base_url = $PublicPath . "";
    try {
        $lc = new LinkChecker("linkcheck_blacklist.txt", $base_url);
    } catch (Exception $e) {
        echo $e;
    }
    try {
        $linkReport .= $lc->checkLinks($page);
    } catch (Exception $e) {
        echo "Couldn't check links: {$e}";
    }
    if ($linkReport == "") {
        $linkReport .= _("Wow, it appears that all your links are okay.  Good work!");
    } else {
        // Give mail option
        $mailReport = "<p>" . _("Would you like to mail this report to someone?") . "</p><br />\n            <input type=\"submit\" name=\"send_report2owner\" value=\"" . _("Send report to: ") . $_SESSION["email"] . "\"> &nbsp; <input type=\"submit\" name=\"send_report2all\" value=\"" . _("Send report to All Guide Owners") . "\"><br />\n        <div id=\"email_results\"></div>\n        ";
    }
}