Quote plugin

= $cd_qotd_time ) { // if current time > expiring time
// reset expiring time to start of next day.
$cd_qotd_time = mktime(0, 0, 0, date(“m”), date(“d”)+1, date(“Y”));
$cd_qotd_order = “ORDER BY RAND(NOW()) LIMIT 1”;
} else {
$cd_qotd_order = “AND qid=’$cd_qotd_quote'”;
}
} elseif ($cd_qotd_freq == ‘2’) { // if freq = hourly.
if ( $cd_qotd_now >= $cd_qotd_time ) { // if current time > expiring time
// reset expiring time to start of next hour.
$cd_qotd_time = mktime(date(“H”)+1, 0, 0, date(“m”), date(“d”), date(“Y”));
$cd_qotd_order = “ORDER BY RAND(NOW()) LIMIT 1”;
} else {
$cd_qotd_order = “AND qid=’$cd_qotd_quote'”;
}
} else { // expiration = each page.
// reset expiring time back to start of current hour.
$cd_qotd_time = mktime(date(“H”), 0, 0, date(“m”), date(“d”), date(“Y”));
$cd_qotd_order = “ORDER BY RAND(NOW()) LIMIT 1”;
}

$qotd_query = “SELECT * FROM cd_qotd WHERE blog_id=’$blog_id’ “.$cd_qotd_order;
$result = $wpdb->get_results($qotd_query, OBJECT);
// save current quote id.
update_option(‘cd_qotd_quote’, $result[0]->qid);
// reset expiration time.
update_option(‘cd_qotd_time’, $cd_qotd_time);

if ($cd_qotd_type == ‘1’) {
$qotd_type = ‘blockquote’;
} else {
$qotd_type = ‘q’;
}

echo ‘

‘;
echo ‘<'.$qotd_type.' cite="'.stripslashes($result[0]->cite).'”>’;
echo ‘‘.stripslashes($result[0]->quote).’‘;
echo ‘‘;
echo ‘

‘;
$output .= ‘<'.$qotd_type.' cite="'.stripslashes($cd_quote->cite).'”>’;
$output .= ‘‘.stripslashes($cd_quote->quote).’‘;
$output .= ‘‘;
$output .= ‘

Posted in Latest News