$host = "localhost"; $dbuser = "for91_for91"; $password = 'C7$DgUm;#W('; $db = 'for91_for91days'; $link = mysql_connect($host, $dbuser, $password) or die("Could not connect : " . mysql_error()); mysql_select_db($db) or die("Could not select database"); mysql_set_charset('utf8'); $photodir = "/home/for91/public_html/photos/Thumbs/"; $photoweb = "https://for91days.com/photos/Thumbs/"; $q = "select ID, post_name, post_title, post_date, post_content from wp_posts where post_status = 'publish' and post_type = 'post' order by rand() limit 30"; if (!$r = mysql_query($q)) { echo "Problem executing $q\n"; exit(); } $count = 0; echo "
“;
$q = “select ID, post_name, post_title, post_date, post_content from wp_posts where post_status = ‘publish’ and post_type = ‘post’ order by rand() limit 3”;
if (!$r = mysql_query($q)) {
echo “Problem executing $q\n”;
exit();
}
while ($l = mysql_fetch_array($r, MYSQL_ASSOC)) {
$post_title = $l[‘post_title’];
$post_content = $l[‘post_content’];
$post_datetime = $l[‘post_date’];
$post_name = $l[‘post_name’];
$post_timestr = strtotime($post_datetime);
$linkdate = date(“y/m/d”, $post_timestr);
$pubdate = date (“M d, Y”, $post_timestr);
// get the image
$img_src = “https://for91days.com/photos/Thumbs/”.$post_name.”.jpg”;
$excerpt_begin = ““;
$excerpt_end = ““;
$excerpt_beginpos = strpos($post_content, $excerpt_begin);
if ($excerpt_beginpos) {
$excerpt_beginpos += strlen($excerpt_begin);
$trimmed_content = substr($post_content, $excerpt_beginpos);
$excerpt_endpos = strpos($trimmed_content, $excerpt_end);
$trimmed_content = substr($trimmed_content, 0, $excerpt_endpos);
$trimmed_content = strip_tags($trimmed_content);
if (substr($trimmed_content, -3) != ‘…’) {
$trimmed_content .= “…”;
} elseif (substr($trimmed_content, -1) == ‘.’) {
$trimmed_content = substr($trimmed_content, 0, -1);
}
} else {
$paragraphs = explode(“\n”, strip_tags($post_content));
$real_paragraphs = array();
foreach($paragraphs as $key => $paragraph_text) {
if (trim($paragraph_text)) {
$real_paragraphs[] = trim($paragraph_text);
}
}
$trimmed_content = $real_paragraphs[0];
}
$post_link = “https://oviedo.for91days.com/$linkdate/$post_name”;
“;
}
?>
For 91 Days in Oviedo – The E-Book
We’ve made the effort to convert our blog about Oviedo and Asturias into an e-book. For 91 Days in Oviedo contains all of our articles and a selection of over 150 of our best pictures. With an index sorted by category, links to the original blog posts, and cross-references spread throughout, the e-book is a perfect companion for a trip to Oviedo.
Amazon Kindle | Direct Download (PDF, MOBI) |
For just a few bucks, you can download your own copy of the book for use on your e-reader or computer, giving you access to our anecdotes and articles wherever you are, without having to connect to the internet. And, buying the e-book is a great way to support our project… take a look at some sample pages from the PDF.
echo allbooks("oviedo"); ?>