"; Markup('reflectionserror', ' $line) { //echo "Line #{$lineno}: " . htmlspecialchars($line) . "\n"; if (strncmp("name=$MDLdiscussion.", $line, $MDLdisclen + 6) === 0) { $name = rtrim(substr($line, $MDLdisclen + 6)); // echo "Name: $name\n"; } if (strncmp("text=", $line, 5) === 0) { $textlines = split("\n",urldecode(rtrim(substr($line, 5)))); // print_r($textlines); foreach ($textlines as $textlineno => $textline) { if (strncmp("[[#comment", $textline, 10) === 0) { // echo "Text: $textline\n"; if (preg_match("/\[\[[^)]*\)[^)]*\)(.*) \/ (.*) \/ (.*)/", $textline, $matches)) { // print_r($matches); print "$name\t$matches[2]\t$matches[3]\t$matches[1]\n"; $count++; } } } } } // echo "Name: $name\nText: $text\n"; } closedir($handle); } echo "Count: $count\n"; } if (!defined('PmWiki')) { # this is just used to test this code outside the context of PmWiki MDLcommentcount(); }