PDA

View Full Version : Exclude not working 1.8.9 RC1 (Workaround included)


shockfreezer
05-16-2006, 01:26 AM
Hi there,

ok time for another workaround in phpDig 1.8.9 RC1: ;)
The new spider engine removes all line breaks in the content wich would retrieve.
That causes a problem with the exclude mechanism. This mechanisem works until now line based, that means that every line is checked for an exclude. If there is an exclude no more lines would be stored until the next include tag.
If there is just one line of content with exclude and include tags included this mechanism dosn't work.

That's why I've written a little regex to remove all the parts in the line wich are excluded.
Insert following code in file admin/robot_functions.php in function phpdigIndexFile on line 1219 :

foreach ($file_content as $num => $line) {
//Remove excludet parts
$pattern = "".preg_quote(PHPDIG_EXCLUDE_COMMENT).".+?".preg_quote(PHPDIG_INCLUDE_COMMENT)."";
$line = mb_eregi_replace("".$pattern."","",$line);
if (trim($line)) {


At the moment this code is experimental, it looks like it works fine, but i can't guarantee that it will work on your site!

Greez
shockfreezer

shockfreezer
05-16-2006, 01:55 AM
Ok first fix is here:

$pattern = "".preg_quote(PHPDIG_EXCLUDE_COMMENT).".+?(".preg_quote(PHPDIG_INCLUDE_COMMENT)."|$)";