<?php
-// $Id: spam.php,v 1.98 2007/01/03 10:54:55 henoheno Exp $
+// $Id: spam.php,v 1.99 2007/01/03 13:31:20 henoheno Exp $
// Copyright (C) 2006-2007 PukiWiki Developers Team
// License: GPL v2 or (at your option) any later version
$summary['DETAIL_BADHOST'] = implode(', ', $badhost);
}
if (! $asap && $progress['remains']['badhost']) {
- $summary['DETAIL_NEUTRAL_HOST'] =
- preg_replace(
- '/[^, a-z0-9.-]/i', '',
- implode(', ', array_keys($progress['remains']['badhost']))
- );
+ $count = count($progress['remains']['badhost']);
+ $summary['DETAIL_NEUTRAL_HOST'] = $count .
+ ' (' .
+ preg_replace(
+ '/[^, a-z0-9.-]/i', '',
+ implode(', ', array_keys($progress['remains']['badhost']))
+ ) .
+ ')';
}
$summary['COMMENT'] = $action;
$summary['PAGE'] = '[blocked] ' . (is_pagename($page) ? $page : '');
<?php
-// $Id: spam.php,v 1.98 2007/01/03 10:54:55 henoheno Exp $
+// $Id: spam.php,v 1.99 2007/01/03 13:31:20 henoheno Exp $
// Copyright (C) 2006-2007 PukiWiki Developers Team
// License: GPL v2 or (at your option) any later version
$summary['DETAIL_BADHOST'] = implode(', ', $badhost);
}
if (! $asap && $progress['remains']['badhost']) {
- $summary['DETAIL_NEUTRAL_HOST'] =
- preg_replace(
- '/[^, a-z0-9.-]/i', '',
- implode(', ', array_keys($progress['remains']['badhost']))
- );
+ $count = count($progress['remains']['badhost']);
+ $summary['DETAIL_NEUTRAL_HOST'] = $count .
+ ' (' .
+ preg_replace(
+ '/[^, a-z0-9.-]/i', '',
+ implode(', ', array_keys($progress['remains']['badhost']))
+ ) .
+ ')';
}
$summary['COMMENT'] = $action;
$summary['PAGE'] = '[blocked] ' . (is_pagename($page) ? $page : '');
<?php
-// $Id: spam_pickup.php,v 1.30 2007/01/03 10:56:12 henoheno Exp $
+// $Id: spam_pickup.php,v 1.31 2007/01/03 13:31:20 henoheno Exp $
// Concept-work of spam-uri metrics
// Copyright (C) 2006 PukiWiki Developers Team
// License: GPL v2 or (at your option) any later version
return $array;
}
-function show_form($string, $asap)
+function show_form($string, $asap, $pickup)
{
if ($asap) {
$asap = ' checked';
} else {
$asap = '';
}
+ if ($pickup) {
+ $pickup = ' checked';
+ } else {
+ $pickup = '';
+ }
$base = basename(__FILE__);
$string = htmlspecialchars($string);
print <<< EOF
<form action="$base" method="post">
<textarea name="msg" rows="8" cols="80">$string</textarea><br />
<input type="checkbox" name="asap" value="on"$asap>asap<br />
+ <input type="checkbox" name="pickup" value="on"$pickup>Show pickuped URIs<br />
<input type="submit" name="write" value="Submit" />
</form>
<br/>
// ---- Show form and result
echo basename(__FILE__) . '<br />';
-$msg = isset($_POST['msg']) ? $_POST['msg'] : '';
-$asap = isset($_POST['asap']) ? TRUE : FALSE;
-show_form($msg, $asap);
+$msg = isset($_POST['msg']) ? $_POST['msg'] : '';
+$asap = isset($_POST['asap']) ? TRUE : FALSE;
+$pickup = isset($_POST['pickup']) ? TRUE : FALSE;
+show_form($msg, $asap, $pickup);
echo '<pre>';
-$pickup = TRUE;
$method = check_uri_spam_method();
-if ($asap) {
- $method['asap'] = TRUE;
-}
+if ($asap) $method['asap'] = TRUE;
+
$progress = check_uri_spam(array('a', $msg, 'b'), $method);
if (! empty($progress)) {
}
}
if (isset($progress['remains']['badhost'])) {
- var_dump('DETAIL_NEUTRAL_HOST: ' .
- preg_replace(
- '/[^, a-z0-9.-]/i', '',
- implode(', ', array_keys($progress['remains']['badhost'])))
- );
+ $count = count($progress['remains']['badhost']);
+ var_dump('DETAIL_NEUTRAL_HOST: ' . $count .
+ ' (' .
+ preg_replace(
+ '/[^, a-z0-9.-]/i', '',
+ implode(', ', array_keys($progress['remains']['badhost']))
+ ) .
+ ')'
+ );
}
var_dump($progress);
}
<?php
-// $Id: spam_pickup.php,v 1.30 2007/01/03 10:56:12 henoheno Exp $
+// $Id: spam_pickup.php,v 1.31 2007/01/03 13:31:20 henoheno Exp $
// Concept-work of spam-uri metrics
// Copyright (C) 2006 PukiWiki Developers Team
// License: GPL v2 or (at your option) any later version
return $array;
}
-function show_form($string, $asap)
+function show_form($string, $asap, $pickup)
{
if ($asap) {
$asap = ' checked';
} else {
$asap = '';
}
+ if ($pickup) {
+ $pickup = ' checked';
+ } else {
+ $pickup = '';
+ }
$base = basename(__FILE__);
$string = htmlspecialchars($string);
print <<< EOF
<form action="$base" method="post">
<textarea name="msg" rows="8" cols="80">$string</textarea><br />
<input type="checkbox" name="asap" value="on"$asap>asap<br />
+ <input type="checkbox" name="pickup" value="on"$pickup>Show pickuped URIs<br />
<input type="submit" name="write" value="Submit" />
</form>
<br/>
// ---- Show form and result
echo basename(__FILE__) . '<br />';
-$msg = isset($_POST['msg']) ? $_POST['msg'] : '';
-$asap = isset($_POST['asap']) ? TRUE : FALSE;
-show_form($msg, $asap);
+$msg = isset($_POST['msg']) ? $_POST['msg'] : '';
+$asap = isset($_POST['asap']) ? TRUE : FALSE;
+$pickup = isset($_POST['pickup']) ? TRUE : FALSE;
+show_form($msg, $asap, $pickup);
echo '<pre>';
-$pickup = TRUE;
$method = check_uri_spam_method();
-if ($asap) {
- $method['asap'] = TRUE;
-}
+if ($asap) $method['asap'] = TRUE;
+
$progress = check_uri_spam(array('a', $msg, 'b'), $method);
if (! empty($progress)) {
}
}
if (isset($progress['remains']['badhost'])) {
- var_dump('DETAIL_NEUTRAL_HOST: ' .
- preg_replace(
- '/[^, a-z0-9.-]/i', '',
- implode(', ', array_keys($progress['remains']['badhost'])))
- );
+ $count = count($progress['remains']['badhost']);
+ var_dump('DETAIL_NEUTRAL_HOST: ' . $count .
+ ' (' .
+ preg_replace(
+ '/[^, a-z0-9.-]/i', '',
+ implode(', ', array_keys($progress['remains']['badhost']))
+ ) .
+ ')'
+ );
}
var_dump($progress);
}