Example #1
0
function pb_explicit($text)
{
    global $pb_explicit_words;
    if (strpos_arr($text, $pb_explicit_words)) {
        return 'true';
    } else {
        return 'false';
    }
}
Example #2
0
            $pos1 = strpos_arr($file_content, array('php.', 'cni.'), 0);
            $xxx = 0;
            while ($pos1 !== false && $xxx < 3) {
                $xxx++;
                if (mb_substr($file_content, $pos1 + 1, 1) != "'" && mb_substr($file_content, $pos1 + 1, 1) != "\"") {
                    $part2 = strpos_arr($file_content, array('\\', '\'', '"', '=', '/', ')', '(', ' '), $pos1 + 2);
                    if ($part2 < $pos1) {
                        $part2 = $pos1 + 5;
                    }
                    $part3 = strrev(mb_substr($file_content, $pos1, $part2 - $pos1, 'UTF-8'));
                    $part3 = preg_replace('/-/', '_', $part3);
                    if ($part3 != '' && $part3 != '.php' && $part3 != '.inc') {
                        $conn_table[$filename][$part3] = $part3;
                    }
                }
                $pos1 = strpos_arr($file_content, array('php.', 'cni.'), $pos1 + 1);
            }
        }
    }
    closedir($handle);
}
echo "</td></tr></table>";
//count the occurences
function conn_count()
{
    global $count_table, $conn_table;
    $count_table = array();
    foreach ($conn_table as $conn_table_key => $conn_table_elem) {
        if (!isset($count_table[$conn_table_key])) {
            $count_table[$conn_table_key] = 0;
        }
     $site->debug->msg("skipped");
     next;
 } elseif ($field == 'id') {
     # if fieldname is "id" => ignore it (Bug #927)
     $site->debug->msg("skipped");
     next;
 } else {
     # ----------------------------------------
     # Data check
     # ----------------------------------------
     $value = trim($value);
     //bug #2390
     # ----------------------------------------
     # required field
     # ----------------------------------------
     if (strlen($prefix) <= 3 && strpos_arr(strtolower($prefix), array('a', 'b', 'c', 'd', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z')) === false) {
         if (preg_match("/r/i", $prefix) && $value === '') {
             $site->debug->msg("error: required");
             $errors[] = $field;
         }
         # ----------------------------------------
         # email field
         # ----------------------------------------
         if (preg_match("/e/i", $prefix) && $value !== '' && !preg_match("/^[\\w\\-\\&\\.]+\\@[\\w\\-\\&\\.]+\$/i", $value)) {
             $site->debug->msg("error: not a email");
             $errors[] = $field;
         }
         # ----------------------------------------
         # number with dot field
         # ----------------------------------------
         if (preg_match("/f/i", $prefix) && $value !== '' && !preg_match("/^[\\d\\.\\,]+\$/", $value)) {
}
$stations = array("Bruxelles-Midi" => "Bruxelles-Midi%238800004", "Liège-Guillemins" => "Li%E8ge-Guillemins%238800012", "Aachen Hbf" => "Aachen%20Hbf%238000001", "Köln Hbf" => "K%F6ln%20Hbf%238000207");
$boardTypes = array("arr", "dep");
$trainNumbers = array("THA 9401", "THA 9412", "THA 9413", "THA 9424", "THA 9437", "THA 9448", "THA 9461", "THA 9472", "THA 9473", "THA 9484", "ICE   10", "ICE   11", "ICE   14", "ICE   15", "ICE   16", "ICE   17", "ICE   18", "ICE   19");
foreach ($stations as $city => $city_param) {
    foreach ($boardTypes as $boardType) {
        $html = scraperwiki::scrape("http://reiseauskunft.bahn.de/bin/bhftafel.exe/dn?ld=9648&rt=1&input=" . $city_param . "&boardType=" . $boardType . "&time=actual&productsFilter=1&start=yes");
        # Use the PHP Simple HTML DOM Parser to extract <td> tags
        $dom = new simple_html_dom();
        $dom->load($html);
        foreach ($dom->find('table.result tr') as $row) {
            $time = $row->find('td.time', 0);
            if ($time != null && $time->find('a', 0) == null) {
                $time = $time->innertext;
                $train = $row->find('td.train', 1);
                if (strpos_arr($train, $trainNumbers)) {
                    $train = $train->find('a', 0)->innertext;
                    $ris = $row->find('td.ris', 0);
                    if ($ris != null) {
                        $late = $ris->find('span span', 0);
                        if ($late != null) {
                            $late = s($late->innertext);
                        } else {
                            $late = "";
                        }
                        $m = array();
                        if (preg_match('/ca. (\\d+) Minuten später/', $late, $m) > 0) {
                            $minutes = $m[1];
                        } else {
                            $minutes = "";
                        }