function verify_pby_page($pby_id, $page)
{
    global $debug;
    if ($debug) {
        print "Pby:" . $pby_id . " Page:" . $page . "\n";
    }
    $nextref = "";
    $dom = getpbypage($pby_id, $page);
    $next = $dom->find("a[class='next']", 0);
    //print "Next:" . $next . "/" . sizeof($next) ."\n";
    // list of churches on this page.
    foreach ($dom->find('li[class^=result]') as $data) {
        $cid = getcid($data, $pby_id);
        $churchdat = scraperwiki::select("* from churches where church_id='" . $cid . "'");
        //print "church=" . $cid . " Pby=" . $pby_id . "\n";
        $churchdat[0]['verify'] = 2012;
        $churchdat[0]['church_id'] = $cid;
        scraperwiki::save_sqlite(array('church_id'), $churchdat, $table_name = "churches", $verbose = 0);
    }
    $page++;
    return $next;
}
Beispiel #2
0
    $pf = fopen("conf/admin_key.conf", "r");
    list($k0) = fscanf($pf, "%s");
    fclose($pf);
    return $k0 == $key;
}
function getcid()
{
    $pf = fopen("conf/cont.conf", "r");
    list($cid) = fscanf($pf, "%s");
    fclose(pf);
    return $cid;
}
if ($_FILES['file']['size'] > 0) {
    $dest = "./packs/" . $_FILES['file']['name'];
    if ($_GET['cmd'] == 'udata') {
        $cid = getcid();
        $dest = "../data/" . $cid . "/" . $_FILES['file']['name'];
        if (strstr($dest, "admin.conf") != false) {
            header("Location: error.php?word=Dangerous operation");
            return;
        }
        if (strlen($_POST['dest']) > 0) {
            $dest = "../data/" . $cid . "/" . $_POST['dest'];
        }
    } else {
        if (strlen($_POST['dest']) > 0) {
            $dest = $_POST['dest'];
        }
    }
    if (strstr($dest, "admin.conf") != false) {
        header("Location: error.php?word=Dangerous operation");