function get_language_flag($code) { $flag = strtolower(substr($code, 3)); return store_url() . '/images/worldflags/' . $flag . '.png'; }
function jd_twit_comment($comment_id, $approved) { $_t = get_comment($comment_id); $post_ID = $_t->comment_post_ID; $commenter = $_t->comment_author; $jd_tweet_this = get_post_meta($post_ID, '_jd_tweet_this', TRUE); if ($jd_tweet_this != 'no' && $_t->comment_approved == 1) { // comments only tweeted on posts which are tweeted $post_info = jd_post_info($post_ID); $sentence = ''; $sentence = stripcslashes(get_option('comment-published-text')); if ($post_info['shortUrl'] != '') { $shrink = $post_info['shortUrl']; } else { $shrink = jd_shorten_link($post_info['postLink'], $post_info['postTitle'], $post_ID); store_url($post_ID, $shrink); } $sentence = jd_truncate_tweet($sentence, $post_info, $shrink, $post_ID); $sentence = str_replace("#commenter#", $commenter, $sentence); if ($sentence != '') { $sendToTwitter = jd_doTwitterAPIPost($sentence); } } return $post_ID; }