For " . date("l, F j Y") . " --
' . htmlspecialchars($attrs['DESCRIPTION']) . "
" . htmlspecialchars($attrs['EXTENDED']) . "
Bookmarks provided by del.icio.us. Thumbnails courtesy of WebSnapr'; } } $empty = true; # Get today, and make timestamp $today = getdate(); $date = mktime(0,0,0,$today['mon'], $today['mday'], $today['year']); # Get Dates for Post $now = current_time('mysql'); $now_gmt = current_time('mysql', 1); $dt = date("Y-m-d"); #$dt = '2006-10-21'; $del_url = "https://$del_user:$del_password@api.del.icio.us/v1/posts/get?dt=$dt"; if ($del_tag) { $del_url = "https://$del_user:$del_password@api.del.icio.us/v1/posts/get?dt=$dt&tag=$del_tag"; } if (!ini_get('allow_url_fopen')) { $tempfile = $wp_tmp_file; $ch = curl_init($del_url); $fp = fopen($tempfile, 'w'); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); fclose($fp); $del_url = $tempfile; } $fp = fopen($del_url, "r"); $content = ""; $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); while ($data = fread($fp, 4096)) { if (!xml_parse($xml_parser, $data, feof($fp))) { die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } } xml_parser_free($xml_parser); if ($empty) return; $wp_posttitle = $wp_posttitle . $dt; # Build Query $query = "INSERT INTO $tableposts " . "(`post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_status`, `comment_status`, `ping_status`, `post_name`, `post_modified`, `post_modified_gmt`) " . "VALUES " . "(" . $wp_userid . ", '" . $now . "', '" . $now_gmt . "', '" . addslashes($content) . "', '" . addslashes($wp_posttitle) . "', 'publish', '" . $wp_allowcomments . "', '" . $wp_allowpings . "', '" . $wp_postname . "', '" . $now . "', '" . $now_gmt . "');"; # Run Query $wpdb->query($query); # Get ID for category $post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1"); # Build category query $query = "INSERT INTO $tablepost2cat " . "(`post_id`, `category_id`) " . "VALUES " . "('" . $post_ID . "', '" . $wp_catid . "');"; # Run Category Query $wpdb->query($query); # Clear Cache if ($wp_clear_cache) { wp_cache_delete('/'); } ?>