PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   How-to Forum (http://www.phpdig.net/forum/forumdisplay.php?f=33)
-   -   reindex specific PHP page on change? (http://www.phpdig.net/forum/showthread.php?t=254)

ZAP 11-28-2003 01:11 PM

reindex specific PHP page on change?
 
Hello -

Great script!

Our site has some pages with articles that users can comment on. The comments are added to a text file and then included at the bottom of the page using a simple PHP include statement. phpDig is able to index these comments with no problem.

What I would ideally like to do is to add a line to my PHP comment script that would make phpDig reindex just that page after adding the new comment. I realize that I could call the spider script after adding the comment, but how can I specify the specific URL and keep phpDig from spidering all the other links? I want to keep my search index up-to-date, but I don't want to tax the server unnecessarily.

THANKS in advance for your response.

Charter 11-28-2003 04:56 PM

Hi. Maybe try something like the following:
PHP Code:

// edit to fit your OS and script
if ($_POST['is_new_comment'] == "yes it is") {
$comment_page "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$comment_page escapeshellcmd($comment_page);
$the_command "php -f [PHPDIG_DIR]/admin/spider.php ".$comment_page;
exec($the_command);
}

/* set the following in config.php
define('SPIDER_MAX_LIMIT',0);
define('SPIDER_DEFAULT_LIMIT',0);
define('RESPIDER_LIMIT',0);
*/ 


ZAP 11-28-2003 06:35 PM

RE: reindex specific PHP page on change?
 
Thanks! I'll give it a try in a day or so and let you know how it turned out. I think I'll probably add a flag to spider.php to make it only reindex that one page rather than setting it in the config file (since at other times I'll want it to spider).


All times are GMT -8. The time now is 04:59 PM.

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