house keeping

pull/1/head
root 18 years ago
parent afe502a0aa
commit 01a7241f69

@ -23,8 +23,6 @@
<li><?=_("Inclusion into mainstream browsers!")?></li>
<li><?=_("To provide a trust mechanism to go with the security aspects of encryption.")?></li>
</ul>
<br>
<p><a href="http://blog.CAcert.org"><?=_("Latest News")?></a> - [ <a href='http://blog.CAcert.org'><?=_("More News Items")?></a> ]</p>
<?
/*
$query = "select *, UNIX_TIMESTAMP(`when`) as `TS` from news order by `when` desc limit 5";
@ -40,38 +38,44 @@
*/
$rss = "";
$open = $items = 0;
$fp = fopen("http://blog.CAcert.org/feed/rss/", "r");
while(!feof($fp))
$rss .= trim(fgets($fp, 4096));
fclose($fp);
$rss = str_replace("><", ">\n<", $rss);
$lines = explode("\n", $rss);
foreach($lines as $line)
$fp = @fopen("http://blog.CAcert.org/feed/rss/", "r");
if($fp)
{
$line = trim($line);
echo '<br><p><a href="http://blog.CAcert.org">'._('Latest News').'</a> - [ <a href="http://blog.CAcert.org">'._('More News Items').'</a> ]</p>';
if($line != "<item>" && $open == 0)
continue;
if($line == "<item>" && $open == 0)
while(!feof($fp))
$rss .= trim(fgets($fp, 4096));
fclose($fp);
$rss = str_replace("><", ">\n<", $rss);
$lines = explode("\n", $rss);
foreach($lines as $line)
{
$open = 1;
continue;
}
$line = trim($line);
if($line == "</item>" && $open == 1)
{
$items++;
if($items >= 2)
break;
$open == 0;
continue;
if($line != "<item>" && $open == 0)
continue;
if($line == "<item>" && $open == 0)
{
$open = 1;
continue;
}
if($line == "</item>" && $open == 1)
{
$items++;
if($items >= 2)
break;
$open == 0;
continue;
}
if(substr($line, 0, 7) == "<title>")
echo "<h3>".str_replace("&amp;#", "&#", recode_string("UTF8..html", str_replace("&amp;", "", trim(substr($line, 7, -8)))))."</h3>\n";
if(substr($line, 0, 13) == "<description>")
echo "<p>".str_replace("&amp;#", "&#", recode_string("UTF8..html", str_replace("&amp;", "", trim(substr($line, 13, -14)))))."</p>\n";
if(substr($line, 0, 6) == "<link>")
echo "<p>[ <a href='".trim(substr($line, 6, -7))."'>"._("Full Story")."</a> ]</p>\n";
}
if(substr($line, 0, 7) == "<title>")
echo "<h3>".str_replace("&amp;#", "&#", recode_string("UTF8..html", str_replace("&amp;", "", trim(substr($line, 7, -8)))))."</h3>\n";
if(substr($line, 0, 13) == "<description>")
echo "<p>".str_replace("&amp;#", "&#", recode_string("UTF8..html", str_replace("&amp;", "", trim(substr($line, 13, -14)))))."</p>\n";
if(substr($line, 0, 6) == "<link>")
echo "<p>[ <a href='".trim(substr($line, 6, -7))."'>"._("Full Story")."</a> ]</p>\n";
}
?>

@ -2,6 +2,8 @@
<?
include_once("../includes/mysql.php");
mysql_query("update `locations` set `acount`=0");
$query = "SELECT `users`.`locid` AS `locid`, count(*) AS `total` FROM `users`, `notary`
WHERE `users`.`id` = `notary`.`to` AND `users`.`locid` != 0
GROUP BY `users`.`id`, `users`.`locid`
@ -10,6 +12,7 @@
while($row = mysql_fetch_assoc($res))
{
$query = "update `locations` set `acount`='${row['total']}' where `id`='${row['locid']}'";
// echo $query."\n";
mysql_query($query);
}
?>

Loading…
Cancel
Save