[EventCalendar] Adding Meta Fields to MySQL Query?

Jeremy Carlson info at jeremycarlson.com
Mon Jul 31 04:46:04 UTC 2006


Hi there,

Hopefully someone can help out with this. I'm using Event Calendar 3, 
and it's great. But my site is using a variation on the Basic Bilingual 
plugin to handle two languages throughout. Other language titles are 
stored in a meta field 'other-title', and elsewhere I've been able to 
access them via something like:

get_post_meta($entry->ID, 'other-title', true);

I'm trying to add other language titles to the event calendar listings, 
which use this MySQL request:

     "SELECT
          p.id AS id,
          post_title,
          post_date,
          u.$user_nicename AS author
        FROM $tableposts p, $tablepost2cat p2c, $tableusers u
        WHERE post_status = 'publish'
          AND post_date_gmt > '$now'
          AND p.id = post_id
          AND p.post_author = u.id
          AND category_id = $ec3->event_category
        ORDER BY post_date
        LIMIT $limit"

I'm hoping to insert the other-title field into this array so I can 
access it lower down. Does anyone know how to do this? The MySQL query 
from the get_post_meta function looks like this, if this helps:

SELECT meta_value FROM $wpdb->postmeta WHERE post_id = '$post_id' AND 
meta_key = '$key'

Any help offered would be greatly appreciated. (Even if it's to tell me 
to post this to the more general WP forum...) Thanks!

-Jeremy




More information about the EventCalendar mailing list