This commit has been accessed 304 times via Git panel.
commit 33174264c2c425a1d4d7beda3210a15ca3002c71
tree feca42d1120bb3cc34014f9fe11687559c3681b6
parent ef64f868acab9b9dec9b2268890ea88aa4d6b693
author Engels Antonio <engels@majcms.org> 1277314191 +0800
committer Engels Antonio <engels@majcms.org> 1277314191 +0800
maj-0.14-20071110-bb.zip
diff --git a/dig.php b/dig.php
index 654549e..e6693c0 100644
--- a/dig.php
+++ b/dig.php
@@ -117,10 +117,21 @@ if ($dh_search_items = opendir($dir)) {
if ($entry_search_items != "." && $entry_search_items != ".." && fnmatch("*", $entry_search_items) && (preg_match("/\b$search\b/i", file_get_contents("data/items/$entry_search_items/title.txt")) or preg_match("/\b$search\b/i", file_get_contents("data/items/$entry_search_items/body.txt")))) {
$show_search_items[] = $entry_search_items;
}
+
+ if ($entry_search_items != "." && $entry_search_items != ".." && fnmatch("*", $entry_search_items) && file_exists("data/items/$entry_search_items/comments/live")) {
+ if ($dh_comment_items = opendir("data/items/$entry_search_items/comments/live")) {
+ while (($entry_comment_items = readdir($dh_comment_items)) !== false) {
+ if ($entry_comment_items != "." && $entry_comment_items != ".." && preg_match("/\b$search\b/i", file_get_contents("data/items/$entry_search_items/comments/live/$entry_comment_items/comment.txt"))) {
+ $show_search_items[] = $entry_search_items;
+ }
+ }
+ }
+ }
}
closedir($dh_search_items);
}
+$show_search_items = array_unique($show_search_items);
rsort($show_search_items);
reset($show_search_items);
$count_search_items = count($show_search_items);
@@ -157,6 +168,19 @@ if (($count_search_items > 0) and ($count_total_items > 0)) {
$body = trim($body);
// comment out next line for _long_ quote
$body = str_replace(".","<br />", $body);
+
+ if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt")) {
+ $badwords = file_get_contents("data/pf-badwords.txt");
+
+ if (file_exists("data/pf-censor.txt")) {
+ $censor = file_get_contents("data/pf-censor.txt");
+ }
+ else {
+ $censor = "[expletive]";
+ }
+ $body = preg_replace("/\b($badwords)\b/i",$censor,$body);
+ }
+
$body = nl2br($body);
$body = explode("<br />", $body);
foreach ($body as $line) {
tree feca42d1120bb3cc34014f9fe11687559c3681b6
parent ef64f868acab9b9dec9b2268890ea88aa4d6b693
author Engels Antonio <engels@majcms.org> 1277314191 +0800
committer Engels Antonio <engels@majcms.org> 1277314191 +0800
maj-0.14-20071110-bb.zip
diff --git a/dig.php b/dig.php
index 654549e..e6693c0 100644
--- a/dig.php
+++ b/dig.php
@@ -117,10 +117,21 @@ if ($dh_search_items = opendir($dir)) {
if ($entry_search_items != "." && $entry_search_items != ".." && fnmatch("*", $entry_search_items) && (preg_match("/\b$search\b/i", file_get_contents("data/items/$entry_search_items/title.txt")) or preg_match("/\b$search\b/i", file_get_contents("data/items/$entry_search_items/body.txt")))) {
$show_search_items[] = $entry_search_items;
}
+
+ if ($entry_search_items != "." && $entry_search_items != ".." && fnmatch("*", $entry_search_items) && file_exists("data/items/$entry_search_items/comments/live")) {
+ if ($dh_comment_items = opendir("data/items/$entry_search_items/comments/live")) {
+ while (($entry_comment_items = readdir($dh_comment_items)) !== false) {
+ if ($entry_comment_items != "." && $entry_comment_items != ".." && preg_match("/\b$search\b/i", file_get_contents("data/items/$entry_search_items/comments/live/$entry_comment_items/comment.txt"))) {
+ $show_search_items[] = $entry_search_items;
+ }
+ }
+ }
+ }
}
closedir($dh_search_items);
}
+$show_search_items = array_unique($show_search_items);
rsort($show_search_items);
reset($show_search_items);
$count_search_items = count($show_search_items);
@@ -157,6 +168,19 @@ if (($count_search_items > 0) and ($count_total_items > 0)) {
$body = trim($body);
// comment out next line for _long_ quote
$body = str_replace(".","<br />", $body);
+
+ if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt")) {
+ $badwords = file_get_contents("data/pf-badwords.txt");
+
+ if (file_exists("data/pf-censor.txt")) {
+ $censor = file_get_contents("data/pf-censor.txt");
+ }
+ else {
+ $censor = "[expletive]";
+ }
+ $body = preg_replace("/\b($badwords)\b/i",$censor,$body);
+ }
+
$body = nl2br($body);
$body = explode("<br />", $body);
foreach ($body as $line) {