示例#1
0
to this script (jb-xml-pickup.php) :
$req = $xml_data;
$host = '127.0.0.1';
$header .= "POST /JamitJobBoard-3.2.0/jb-xml-pickup.php?feed_id=1&key=test HTTP/1.1\r\n";
$header .= "Host: $host\n";
$header .= "Content-Type: text/xml; charset=UTF-8\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
$fp = fsockopen ($host, 80, $errno, $errstr, 30);
fputs ($fp, $header . $req); // post
*/
if (!is_numeric($_REQUEST['feed_id'])) {
    die('feed_id parameter not present');
} else {
    $feed_id = $_REQUEST['feed_id'];
}
$importer = new xmlFeedImporter($feed_id);
if ($importer->feed_row['pickup_method'] == 'POST') {
    $hosts = array();
    $hosts = explode(',', $importer->feed_row['ip_allow']);
    $allowed = false;
    if (sizeof($hosts) > 0) {
        foreach ($hosts as $host) {
            if (strtoupper($host) == 'ALL') {
                // all hosts
                $allowed = true;
            }
            if (strtolower($host) == 'localhost' && $_SERVER['REMOTE_ADDR'] == '127.0.0.1') {
                $allowed = true;
            }
            if ($host == $_SERVER['REMOTE_ADDR']) {
                $allowed = true;
示例#2
0
function JB_process_xml_import()
{
    $sql = "SELECT feed_id FROM xml_import_feeds WHERE `cron`='Y' AND `status`='READY' AND `pickup_method`!='POST' ";
    $result = jb_mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        require_once dirname(__FILE__) . '/xml_import_functions.php';
        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
            $importer = new xmlFeedImporter($row['feed_id']);
            $importer->import();
        }
    }
}
示例#3
0
set_time_limit(60 * 15);
if (function_exists('apache_setenv')) {
    apache_setenv('no-gzip', 1);
}
@ini_set('zlib.output_compression', 0);
@ini_set('implicit_flush', 1);
require "../config.php";
require dirname(__FILE__) . "/admin_common.php";
require_once "../include/xml_import_functions.php";
JB_admin_header('XML Import Iframe', 'xmlimport_iframe');
?>


<div id='status' style="position: absolute; left:0px; top:0px; background-color:red; color: white; font-weight: bold; font-size: 12pt;">
Importing...
</div>
<pre>
<?php 
//$sql = "DELETE FROM posts_table WHERE `guid` != '' ";
//jb_mysql_query($sql);
$feed_id = (int) $_REQUEST['feed_id'];
$importer = new xmlFeedImporter($feed_id);
if ($importer->feed_row['pickup_method'] != 'POST') {
    $importer->verbose = true;
    $importer->import();
    echo "Done.\n";
}
?>
</pre>
<?php 
JB_admin_footer();