Archive for December, 2011


$querystr = ”
SELECT *
FROM $wpdb->posts
LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID = $wpdb->term_relationships.object_id)
LEFT JOIN $wpdb->term_taxonomy ON($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
LEFT JOIN $wpdb->terms ON($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id)
WHERE $wpdb->posts.post_type = ‘message’
AND $wpdb->posts.post_status = ‘publish’
AND $wpdb->term_taxonomy.taxonomy = ‘taxonomy_name’
AND $wpdb->terms.slug = ‘term_name’
ORDER BY $wpdb->posts.post_date DESC
LIMIT 10
“;

$pageposts = $wpdb->get_results($querystr, OBJECT);

Advertisements

$creds = array();

$creds[‘user_login’] = $_POST[‘log’];
$creds[‘user_password’] = $_POST[‘pwd’];
$creds[‘remember’] = true;
$user = wp_signon( $creds, false );
if ( is_wp_error($user) )
if( $user->get_error_message() ){
$content .=’ERROR: Invalid username. Lost your password?‘;
}