mirror of
https://github.com/php/web-master.git
synced 2026-04-30 02:43:10 +02:00
37 lines
1.2 KiB
PHP
Executable File
37 lines
1.2 KiB
PHP
Executable File
#!/usr/local/bin/php -q
|
|
<?php
|
|
|
|
mysql_connect("localhost","nobody","")
|
|
or die("unable to connect to server");
|
|
mysql_select_db("phpmasterdb")
|
|
or die("unable to select database");
|
|
|
|
$query = "SELECT COUNT(*) AS count,sect FROM note"
|
|
. " GROUP BY sect ORDER BY count DESC LIMIT 20";
|
|
|
|
$res = mysql_query($query)
|
|
or die("query to get top 20 pages failed");
|
|
|
|
$body = "Notes | Page\n"
|
|
. "-------+---------------------------------------------------------\n";
|
|
|
|
$top20 = 0;
|
|
while ($row = mysql_fetch_array($res,MYSQL_ASSOC)) {
|
|
$body .= sprintf("%5d | http://php.net/manual/en/%s.php\n", $row['count'], $row['sect']);
|
|
$top20 += $row['count'];
|
|
}
|
|
|
|
$query = "SELECT COUNT(*) FROM note";
|
|
|
|
$res = mysql_query($query)
|
|
or die("query to get total count of notes failed");
|
|
|
|
$total = mysql_result($res,0);
|
|
|
|
$body = "Following are the top 20 pages of the manual, sorted by the number\n"
|
|
. "of user notes contributed. These sections could use a polish, those\n"
|
|
. sprintf("notes represent %.1f%% of the %d total user notes.\n\n", ($top20 / $total)*100, $total)
|
|
. $body;
|
|
|
|
mail("phpdoc@lists.php.net, php-notes@lists.php.net","Notes Status, $total total",$body,"From: phpdoc@lists.php.net", "-fnoreply@php.net");
|