PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Mod Submissions

Reply
 
Thread Tools
Old 12-18-2003, 02:20 AM   #1
Freddie
Green Mole
 
Join Date: Dec 2003
Posts: 8
show number of indexed pages on homepage

like google
Freddie is offline   Reply With Quote
Old 12-18-2003, 03:01 AM   #2
Freddie
Green Mole
 
Join Date: Dec 2003
Posts: 8
I don't know much about php but... I got it


before head:

PHP Code:
$relative_script_path '..';
include 
"$relative_script_path/includes/config.php"
and...

PHP Code:
$phpdig_tables = array('sites'=>'Hosts','spider'=>'Pages');

while (list(
$table,$name) = each($phpdig_tables))
       {
       
$result mysql_fetch_array(mysql_query("SELECT count(*) as num FROM ".PHPDIG_DB_PREFIX."$table"),MYSQL_ASSOC);
       print 
"<tr>\n\t<td class=\"greyFormLight\">\n$name : </td>\n\t<td class=\"greyForm\">\n<b>".$result['num']."</b></td>\n</tr>\n";
       }

print 
"</table>\n"
Freddie is offline   Reply With Quote
Old 03-04-2004, 02:09 PM   #3
TiM
Green Mole
 
Join Date: Mar 2004
Posts: 7
He

Where this must be added?
TiM is offline   Reply With Quote
Old 03-04-2004, 03:28 PM   #4
Freddie
Green Mole
 
Join Date: Dec 2003
Posts: 8
in the code of the page where you want to display the number of indexed pages
Freddie is offline   Reply With Quote
Old 12-09-2004, 09:31 AM   #5
Slider
Orange Mole
 
Join Date: Jan 2004
Posts: 30
Show number of indexed pages on homepage

Code:
<?
$db=mysql_connect('host','db_user','db_pass');
mysql_select_db("database_name");
$query = "SELECT *  FROM spider";
$results = mysql_query($query);
$num_results = mysql_num_rows($results);
?>


Searching <?echo $num_results?> web pages
I did find and old post with the same title but the code wouldn't work so I made this. I was not able to post to the old post , so here is a working version.
Slider is offline   Reply With Quote
Old 01-18-2005, 05:36 PM   #6
BulForce
Orange Mole
 
Join Date: Aug 2004
Location: none
Posts: 33
Before the </head> tag add this lines:

<?php
$relative_script_path = '/home/virtual/site15/fst/var/www/search';
include "$relative_script_path/includes/config.php";
?>

change "/home/virtual/site10/fst/var/www/search" with your full script path

then at the place where you want to display the pages add this code:

<?php
$phpdig_tables = array('spider'=>'Currently indexed');

while (list($table,$name) = each($phpdig_tables))
{
$result = mysql_fetch_array(mysql_query("SELECT count(*) as num FROM ".PHPDIG_DB_PREFIX."$table"),MYSQL_ASSOC);
print "$name ".$result['num']." pages";
}
?>

And in the place where you want to display the hosts add this code:

<?php
$phpdig_tables = array('sites'=>'At');

while (list($table,$name) = each($phpdig_tables))
{
$result = mysql_fetch_array(mysql_query("SELECT count(*) as num FROM ".PHPDIG_DB_PREFIX."$table"),MYSQL_ASSOC);
print "$name ".$result['num']." hosts";
}
?>

Thas all
BulForce is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
show sites indexed richwilson How-to Forum 2 04-06-2006 05:31 PM
Number of pages indexed claudiomet How-to Forum 0 08-30-2004 03:26 PM
Set time limit on spider.php or number of pages paullind Troubleshooting 1 05-01-2004 08:25 AM
pages number limited indexing JÿGius³ Mod Requests 4 01-13-2004 12:17 PM
Limit number of spidered pages Not Logged In How-to Forum 5 12-16-2003 04:03 PM


All times are GMT -8. The time now is 08:34 PM.


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