PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   Bug Tracker (http://www.phpdig.net/forum/forumdisplay.php?f=27)
-   -   Exclude not working 1.8.9 RC1 (Workaround included) (http://www.phpdig.net/forum/showthread.php?t=2452)

shockfreezer 05-16-2006 12:26 AM

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 05-16-2006 12:55 AM

Ok first fix is here:
PHP Code:

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



All times are GMT -8. The time now is 02:36 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.