OK, put this in your functions.php file, if you have one.
function is_by_author($test_id) {
global $wpdb, $id;
$actual_id = $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE id = $id");
if ( $actual_id == $test_id ) {
return true;
} else {
return false;
}
}
If you don't have one, create a blank text file, and put this into it:
<?php function is_by_author($test_id) {
global $wpdb, $id;
$actual_id = $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE id = $id");
if ( $actual_id == $test_id ) {
return true;
} else {
return false;
}
} ?>
Now save this text file as functions.php and upload it to where all your other theme files are.
Now you can use the code I gave you above, but instead of using is_author use is_by_author, so:
<!-- display flag for author 1 -->
<?php elseif ( is_by_author(2) ) : ?>
<!-- display flag for author 2 -->
<?php elseif ( is_by_author(3) ) : ?>
... etc