View Single Post
Old 05-16-2006, 12:26 AM   #1
shockfreezer
Green Mole
 
Join Date: Oct 2005
Location: Switzerland
Posts: 6
Exclude not working 1.8.9 RC1 (Workaround included)

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 :
PHP Code:
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 is offline   Reply With Quote