Hi Guys,

I wished to display the number of indexed URLs. To be able to do this nicely (using 
templates), I did the following changes:

*** in init.inc, in the global variables declarations, i added:
global $numurlsdb;

*** Then, after

   if  ($db_format == '3.1') {

*** I added:
   // ----------------------------------------------------------------------
   // Laurent LEVIER changes to add NU code to return number of indexed URLs
   // ----------------------------------------------------------------------

   $query ="SELECT count(*) from url";

   if($DEBUG) echo "last_parse(): ",$query,"<BR><HR>";

   if (!$res=db_query($query)) print_error_local('Query error: 

   if ($row=db_fetchrow($res)) {


*** To parse the data nicely, I changed template.inc:

*** I added in all the ereg_replace a new one. I put it after lang_url_translation:

    $str=ereg_replace('\$NU', $numurlsdb, $str);

*** and of course, the global declaration in the print_template function:

global $numurlsdb;

It works fine. In my case, adding this in the top section of the template:
$NU URLs exists in the database.

This new keyword is now replaced with the number of urls in table url.

As this query is SQL92 conformant, it should work everywhere, so no need to deal with 
SQL server format.

Please confirm this represent the real number of URL that can be searched.


Laurent LEVIER
IT Systems & Networks, Unix System Engineer
Security Specialist

Argosnet Security Server : http://www.Argosnet.com
"Le Veilleur Technologique", "The Technology Watcher"

If you want to unsubscribe send "unsubscribe udmsearch"

Reply via email to