Example #1
0
 function misc_get_keywords_alnum($s, $keyword_size = 3)
 {
     if (strlen(trim($s)) < $keyword_size) {
         return false;
     }
     for ($i = 0; $s[$i]; $i++) {
         if (!isalnum($s[$i]) && $s[$i] != '_' && $s[$i] != '.') {
             return false;
         }
     }
     return true;
 }
Example #2
0
        $a = -$a;
    }
    if ($b < 0) {
        $b = -$b;
    }
    $y1 = $gbot - $a;
    $y2 = $gbot - $b;
    $CC = $dv[$C][$x];
    //error_log("y1 = $y1, y2 = $y2, x1 = $x1, x2 = $x2, ($CC)");
    if ($CC == '!') {
        ImageLine($png, $x1, $y1, $x2, $y2, $col[$Y1]);
    } else {
        if ($dv[$C][$x] == '"') {
            ImageLine($png, $x1, $y1, $x2, $y2, $red);
        } else {
            if (isalnum($dv[$C][$x]) && $R >= 0) {
                $y3 = (int) ($gbot - $dv[$R][$x] * $ymult);
                // the next two lines center the code and
                // stop the bird dropping just short of it.
                $lodrop = $y2 + 8 > $gbot ? $gbot : $y2 + 8;
                ImageDashedLine($png, $x2, $lodrop, $x2, $y3, $red);
                if ($dv[$C][$x] != '#') {
                    ImageString($png, 2, $x2 - 2, $y2, $dv[$C][$x], $blue);
                }
            }
        }
    }
    if ($cnv == 1) {
        error_log("cnv ({$Y1}:{$x} = {$dv[$Y1]}[{$x}])");
    }
}