Posted on: 01/05/03 07:38pm
By: Anonymous (Anonymous)
Posted on: 01/06/03 04:13am
By: Dirk
Posted on: 05/13/03 10:26am
By: Anonymous (Anonymous)
Posted on: 06/24/08 08:20am
By: Anonymous (Fernando Ipar)
<?php require "config.php"; # this is a text file where I store the last seen number of comments define('CNT_FILE','/path/to/geeklog/geeklog_comments'); # this is the destination e-mail for notifications define('DESTINATION','your@email.com'); $link = mysql_pconnect($_DB_host, $_DB_user, $_DB_pass); mysql_select_db($_DB_name,$link); $res = mysql_query("select count(*) as cnt_comments from ".$_DB_table_prefix."comments" $cnt = 0; if (file_exists(CNT_FILE)) { $cnt = file_get_contents(CNT_FILE); } $arr = mysql_fetch_assoc($res); if ($cnt < $arr["cnt_comments"]) { file_put_contents(CNT_FILE,$arr["cnt_comments"]); $rs = mysql_query("select distinct sid from ".$_DB_table_prefix."comments where cid > ".$cnt." order by date desc"); $msg = "There are new comments in the following stories: "; while ($arr = mysql_fetch_assoc($rs)) { $msg .= $arr["sid"]; } mail(DESTINATION,"new geeklog comment",$msg); } mysql_close($link);
Posted on: 06/24/08 01:52pm
By: Dirk