<!-- -*- PHP -*- -->
<!-- $Id$ -->
<!-- Last Update: "2005/06/13 08:42:54 makoto" -->
<html>
<head>
<link rel=stylesheet href="./.css">
<title>¤è¤¦¤³¤½
</title>
</head>
<body>
<h1>test </h1>
<?php

function get_lastpostdate($timezone = 'server') {
        global $tableposts, $cache_lastpostdate, $pagenow, $wpdb;
        $add_seconds_blog = get_settings('gmt_offset') * 3600;
        $add_seconds_server = date('Z');
        $now = current_time('mysql', 1);
        if ( !isset($cache_lastpostdate[$timezone]) ) {
                switch(strtolower($timezone)) {
                        case 'gmt':
                                $lastpostdate = $wpdb->get_var("SELECT post_date_gmt FROM $tableposts WHERE post_date_gmt <= '$now' AND post_status = 'publish' ORDER BY post_date_gmt DESC L
IMIT 1");
                                break;
                        case 'blog':
                                $lastpostdate = $wpdb->get_var("SELECT post_date FROM $tableposts WHERE post_date_gmt <= '$now' AND post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT
 1");
                                break;
                        case 'server':
                                $lastpostdate = $wpdb->get_var("SELECT post_date_gmt + interval '$add_seconds_server second' FROM $tableposts WHERE post_date_gmt <= '$now' AND post_status =
 'publish' ORDER BY post_date_gmt DESC LIMIT 1");
                                break;
                }
                $cache_lastpostdate[$timezone] = $lastpostdate;
        } else {
                $lastpostdate = $cache_lastpostdate[$timezone];
        }
        return $lastpostdate;
}
//		function wpdb($dbuser, $dbpassword, $dbname, $dbhost)

echo  "test test\n";

define('DB_USER', 'www');
define('DB_PASSWORD', '');
define('DB_NAME','wordpress');
define('DB_HOST','serv.ki.nu');

echo  "test test2\n";
require ('./wp-includes/wp-db.php');

echo  "test test3\n";
   $connect = wpdb::wpdb('www', '', 'wordpress', 'serv.ki.nu');

echo  "test test4\n";
echo get_lastpostdate()."\n";
echo  "test test\n";

?>

</body>
</html>
<?php
?>