PDA

View Full Version : update only changed files


boyd
04-07-2005, 02:22 PM
Ver 1.8.7

Indexed the site ok, only using one site.

when I change a couple of pages in a dir, and then go re-index that dir only (update frame green arrow) it re-indexes every page even if only one has changed, is this the expected behavior? As it records dates I presumed it would only both with changed files. Can I make it only index changed files?

Thanks,
B. :confused:

Charter
04-07-2005, 02:30 PM
Click a blue arrow and then click a green check mark on the right hand side. If you click a green check mark on the left hand side, PhpDig will reindex the pages shown when you click the blue arrow. Note that PhpDig only undates what is already there. If you add links to a page, and want to index those new links, use the textbox to reindex the page, setting the options under the textbox to your preference.

boyd
04-07-2005, 02:37 PM
ok i understand that thanks, but if i have changed 10 files in a directory of 500 am i going to have to either re-index 500 or select 10 one at a time?

and what about 20 files scattered around a 5000 page site? I want to re-index the 20 not the whole thing?

Thanks for the help. (worth at least twice the $5) :-)

Charter
04-08-2005, 07:26 AM
<?php

// purpose: link to files modified less than $secs seconds ago
// as-is, no warranty, as-is, no warranty, as-is, no warranty
// save this script at http://www.your-domain.com/name.php
// use PhpDig to index http://www.your-domain.com/name.php
// delete name.php from the PhpDig admin panel when index done
// tip: visit http://www.php.net/manual/en/function.opendir.php

/************* Start Configuration */

// 600 seconds is 10 minutes or use $secs = 10*60; // 10 minutes times 60 seconds

$secs = 600; // seconds since last modification

// separate (partial) names in $avoid1, $avoid2, $avoid3, $avoid4 with | character

$avoid1 = ".|.."; // avoid files that match with these
$avoid2 = "private|hidden"; // avoid files that start with these
$avoid3 = "htaccess|htpasswd|jpg|gif|png"; // avoid files that end with these
$avoid4 = "robots|admin|install|include"; // avoid files that contain these

/************* End Configuration */

$base = basename($_SERVER['PHP_SELF']);
$avoid = "^($avoid1|$base)\$|^($avoid2)|($avoid3)\$|($avoid4)";
$dirs = array(".");

while (list($key,$dir) = each($dirs)) {
if ($handle = opendir($dir)) {
while (false !== ($name = readdir($handle))) {
$loc = substr($dir."/".$name,2);
if (!is_dir($loc) && !eregi($avoid,$name)) {
if (filemtime($loc) > time() - $secs) {
echo "<a href=\"$loc\">$loc</a><br>\n";
}
}
elseif (is_dir($loc) && !eregi($avoid,$name)) {
$dirs[] = "./".$loc;
}
}
closedir($handle);
}
}

?>

boyd
04-08-2005, 05:56 PM
Thanks for that, just one more problem when I enter the script page in the url box search follows all the links included in the files or only indexes the script file.

I want to it to just index the list of files in the script file and nothing else

I have tried various search links depth settings with out success. Can you assist?

boyd
04-08-2005, 10:44 PM
worked it out, wrote my own spider form to push the links i want changed in, thanks for the help