ID;
if (is_page($postid)) $posttype = "'page'";
else $posttype = "'post'";
$my_pre = "SELECT * FROM wp_posts WHERE post_status = 'publish' AND post_password = '' AND post_type = $posttype AND ID < $postid ORDER BY ID DESC LIMIT 1";
$id_my_pre = $wpdb->get_results( $my_pre, OBJECT);
if ($id_my_pre) {
foreach ($id_my_pre as $post):
setup_postdata($post);
?>
= 37 ) { $posttit = substr($posttit, 0, 35).'...';} ?>
/i', $imginpost, $matches);
if ($matches) preg_match_all('/(alt|title)=("[^"]*")/i',$matches[0],$match);
if (isset($match[0][0])) {$match[0][0] =' '.$match[0][0];} else {$match[0][0] = '';}
if (isset($match[0][1])) {$match[0][1] =' '.$match[0][1];} else {$match[0][1] = '';}
if ($matches) {
ereg('wp-image-([0-9]+)',$matches[0],$regs);
if ($regs) {
if (is_numeric($regs[1])) {
$image = wp_get_attachment_image_src($regs[1], $size, false);
if ($image) {
$image = '
';
} // if ($image)
} // if (is_numeric($regs[1]))
} // if ($regs)
else {
$image = '
';
}
} // if ($matches)
else { $image = '';}
$postprecontent = strip_shortcodes(get_the_content());
$postprecontent = strip_tags($postprecontent);
if (strlen($postprecontent) <= 300 ) { echo '
'.$image.$postprecontent.'
';}
else {$postprecontent = substr($postprecontent, 0, 300).'
...'; echo '
'.$image.$postprecontent.'
';}?>
flush();
if (is_page($postid)) $posttype = "'page'";
else $posttype = "'post'";
$my_nex = "SELECT * FROM wp_posts WHERE post_status = 'publish' AND post_password = '' AND post_type = $posttype AND ID > $postid ORDER BY ID ASC LIMIT 1";
$id_my_nex = $wpdb->get_results( $my_nex, OBJECT);
if ($id_my_nex) {
foreach ($id_my_nex as $post):
setup_postdata($post);
?>
= 37 ) { $posttit = substr($posttit, 0, 35).'....';} ?>
/i', $imginpost, $matches);
if ($matches) preg_match_all('/(alt|title)=("[^"]*")/i',$matches[0],$match);
if (isset($match[0][0])) {$match[0][0] =' '.$match[0][0];} else {$match[0][0] = '';}
if (isset($match[0][1])) {$match[0][1] =' '.$match[0][1];} else {$match[0][1] = '';}
if ($matches) {
ereg('wp-image-([0-9]+)',$matches[0],$regs);
if ($regs) {
if (is_numeric($regs[1])) {
$image = wp_get_attachment_image_src($regs[1], $size, false);
if ($image) {
$image = '
';
} // if ($image)
} // if (is_numeric($regs[1]))
} // if ($regs)
else {
$image = '
';
}
} // if ($matches)
else { $image = '';}
$postnexcontent = strip_shortcodes(get_the_content());
$postnexcontent = strip_tags($postnexcontent);
if (strlen($postnexcontent) <= 300 ) { echo '
'.$image.$postnexcontent.'
';}
else {$postnexcontent = substr($postnexcontent, 0, 300).'
...'; echo '
'.$image.$postnexcontent.'
';}?>