示例#1
0
print "</div></p>\n";
$some = 1;
$req = Sql_Query(sprintf('select * from %s where status = "%s" order by listorder,regex', $GLOBALS['tables']['bounceregex'], $type));
$ls = new WebblerListing($GLOBALS['I18N']->get('Bounce Regular Expressions'));
if (!Sql_Num_Rows($req)) {
    print $GLOBALS['I18N']->get('No Rules found');
    $some = 0;
} else {
    print formStart('class="bouncerulesListing"');
}
while ($row = Sql_Fetch_Array($req)) {
    $element = $GLOBALS['I18N']->get('rule') . ' ' . $row['id'];
    $ls->addElement($element, PageUrl2('bouncerule&amp;id=' . $row['id']));
    if ($type == 'candidate') {
        # check if it matches an active rule
        $activerule = matchedBounceRule($row['regex'], 1);
        if ($activerule) {
            $ls->addColumn($element, $GLOBALS['I18N']->get('match'), PageLink2('bouncerule&amp;id=' . $activerule, $GLOBALS['I18N']->get('match')));
        }
    }
    $ls->addColumn($element, $GLOBALS['I18N']->get('expression'), '<a name="' . $row['id'] . '"></a>' . shortenTextDisplay($row['regex'], 50));
    $ls->addColumn($element, $GLOBALS['I18N']->get('action'), $GLOBALS['bounceruleactions'][$row['action']]);
    #  $num = Sql_Fetch_Row_Query(sprintf('select count(*) from %s where regex = %d',$GLOBALS['tables']['bounceregex_bounce'],$row['id']));
    #  $ls->addColumn($element,$GLOBALS['I18N']->get('#bncs'),$num[0]);
    $ls->addColumn($element, $GLOBALS['I18N']->get('#bncs'), $row['count']);
    $ls->addColumn($element, $GLOBALS['I18N']->get('tag'), sprintf('<input type="checkbox" name="tagged[%d]" value="%d">', $row['id'], $row['listorder']));
    $ls->addColumn($element, $GLOBALS['I18N']->get('order'), sprintf('<input type="text" name="listorder[%d]" value="%d" size=3>', $row['id'], $row['listorder']));
    $ls->addColumn($element, $GLOBALS['I18N']->get('del'), PageLink2('bouncerules&del=' . $row['id'] . $url, $GLOBALS['I18N']->get('del')));
}
print $ls->display();
if ($some) {
示例#2
0
 $alive = checkLock($process_id);
 if ($alive) {
     keepLock($process_id);
 } else {
     print $GLOBALS['I18N']->get('Process Killed by other process');
     exit;
 }
 ++$count;
 if ($count % 10 == 0) {
     print '. ' . "\n";
     flush();
     if ($count > 1000000) {
         return;
     }
 }
 $regexid = matchedBounceRule($row['data']);
 if ($regexid) {
     Sql_Query(sprintf('insert into %s (regex,bounce) values(%d,%d)', $GLOBALS['tables']['bounceregex_bounce'], $regexid, $row['id']), 1);
     $bouncematched = 1;
     ++$existmatch;
 } else {
     $lines = explode("\n", $row['data']);
     #  print '<br/>'.sizeof($lines).' lines';
     $bouncematched = 0;
     set_time_limit(100);
     foreach ($lines as $line) {
         if (preg_match('/ (55\\d) (.*)/', $line, $regs)) {
             $bouncematched = 1;
             $code = $regs[1];
             $info = $regs[2];
             #if ($code != 550) {