![]() ![]() |
||||||||||||
![]() ![]() ![]() ![]()
|
Welcome to the Houweling website.
NOTICE to other Australian Houweling Family's:- I am willing to allocate server space to any proven Australian Houweling, If you wish to discuss this further please email me.
Custom Search
|
|||||||||||
Copyright (C) 2000-2007 By Fred Houweling |
// Define functions
function get_rquote()
{
$table = "www_quote";
$copyright = "Copyright (c) 2006 by Fred Houweling fred@fh.dropbear.id.au";
$version = "Version 1.00, 6/5/2006";
$dboptions = "dbname=WebSite user=postgres";
$database = pg_Connect ($dboptions);
$res = pg_query ($database, "SELECT count(rec_id) FROM $table");
$rec_count = pg_result($res, 0, 0);
if($rec_count>=1)
{
$record=rand(0, $rec_count-1);
$res = pg_query ($database, "SELECT $table.*, www_user.nickname as nickname FROM $table, www_user where $table.contributor=www_user.rec_id limit 1 offset $record");
return pg_result($res, 0, "quote")."
Source: ".pg_result($res, 0, "source")." Contributed by: ".pg_result($res, 0, "nickname");
}
return "There is no quote today.";
}
function trancrlf($str) // Recreate string translating CR's and LF's into html BR blocks
{
$newstr="";
$br=0;
for($i=0; $i < strlen($str) ; $i++)
{
switch($str[$i])
{
case "\n":
case "\r":
$br=1;
break;
default:
if($br)
{
$newstr.="
\n";
$br=0;
}
$newstr.=$str[$i];
break;
}
}
return $newstr;
}
?>