It's recommended that you edit theme files instead of core files so:
In your custom theme.php
you can add
/******************************************************************************
** Section <<<theme_display_image>>> - START
******************************************************************************/
function theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip)
{
global $CONFIG, $LINEBREAK, $CURRENT_PIC_DATA;
$superCage = Inspekt::makeSuperCage();
$width = $CONFIG['picture_table_width'];
echo '<a name="top_display_media"></a>'; // set the navbar-anchor
starttable();
echo $nav_menu;
endtable();
starttable();
echo $picture;
endtable();
// start adsense
$keywordlist = explode($CONFIG['keyword_separator'],$CURRENT_PIC_DATA['keywords']);
if (!in_array('triggerword', $keywordlist)) {
echo 'code to display adsense';
}
//end adsense
if ($CONFIG['display_film_strip'] == 1) {
echo $film_strip;
}
echo $votes;
$picinfo = $superCage->cookie->keyExists('picinfo') ? $superCage->cookie->getAlpha('picinfo') : ($CONFIG['display_pic_info'] ? 'block' : 'none');
echo $LINEBREAK . '<div id="picinfo" style="display: '.$picinfo.';">' . $LINEBREAK;
starttable();
echo $pic_info;
endtable();
echo '</div>' . $LINEBREAK;
echo '<a name="comments_top"></a>';
echo '<div id="comments">' . $LINEBREAK;
echo $comments;
echo '</div>' . $LINEBREAK;
}
/******************************************************************************
** Section <<<theme_display_image>>> - END
******************************************************************************/
This will display your ad under the image description on displayimage.php
// start adsense
$keywordlist = explode($CONFIG['keyword_separator'],$CURRENT_PIC_DATA['keywords']);
if (!in_array('triggerword', $keywordlist)) {
echo 'code to display adsense'
}
//end adsense
Is the code I added. edit triggerword to match the keyword and change code to display adsense to your adsense code.
Of Course you can move the whole adsense block to wherever you want. If your adsense code is in a different part of your page, you'll have to find the proper function (or ask) and add the code and make $CURRENT_PIC_DATA a global variable.