/**
  * adds tweetthis, dentthis and "check tweetbacks" (if logged in) to footer
  */
 function display_entry(&$eventData, $addData)
 {
     global $serendipity;
     if ($addData['preview']) {
         return false;
     }
     $do_tweetbacks = serendipity_db_bool($this->get_config('do_tweetbacks', false));
     $do_tweetthis = serendipity_db_bool($this->get_config('do_tweetthis', false));
     $do_identicathis = serendipity_db_bool($this->get_config('do_identicathis', false));
     $do_smartify = serendipity_db_bool($this->get_config('tweetthis_smartify', false));
     $show_shorturl = serendipity_db_bool($this->get_config('show_shorturl', false));
     //if (!$do_tweetbacks && !$do_tweetthis && !$do_identicathis) return false;
     if (!is_array($eventData)) {
         return false;
     }
     $pluginurl = $serendipity['baseURL'] . $serendipity['indexFile'] . '?/' . TwitterPluginFileAccess::get_permaplugin_path();
     if ($do_tweetthis || $do_identicathis) {
         $tweetthis_format = $this->get_config('tweetthis_format', '#title# #link#');
         $tweetthis_button = $this->get_config('tweetthis_button', 'black');
         $tweetthis_target = '';
         if (serendipity_db_bool($this->get_config('tweetthis_newwindow', false))) {
             $tweetthis_target = ' target="_blank"';
         }
     }
     $event_index = 0;
     foreach ($eventData as $entry) {
         // Test for nonsense data (or static pages)
         if (!isset($entry['id']) || !is_numeric($entry['id']) || (int) $entry['id'] < 1) {
             continue;
         }
         $entryurl = $this->generate_article_url($entry);
         // Show tweetback check link only logged in users
         //if ($do_tweetbacks && $_SESSION['serendipityAuthedUser'] && $addData['extended']) {
         if ($_SESSION['serendipityAuthedUser'] && $addData['extended']) {
             $checkurl = $pluginurl . '/tweetback=' . $this->urlencode($entryurl);
             $tweetback_check_msg = '<div class="serendipity_tweetback_check"><a target="_blank" href="' . $checkurl . '">check tweetbacks</a></div>';
             $eventData[$event_index]['add_footer'] .= $tweetback_check_msg;
         }
         // add shorturl to entryfooter
         if ($show_shorturl) {
             $shorturl = $this->default_shorturl($entryurl);
             $onclick = function_exists('serendipity_specialchars') ? serendipity_specialchars(PLUGIN_EVENT_TWITTER_SHORTURL_ON_CLICK) : htmlspecialchars(PLUGIN_EVENT_TWITTER_SHORTURL_ON_CLICK, ENT_COMPAT, LANG_CHARSET);
             if ($do_smartify) {
                 // emit smarty tag only
                 $eventData[$event_index]['url_shorturl'] = $shorturl;
             } else {
                 $eventData[$event_index]['add_footer'] .= '<div class="serendipity_shorturl_link"><a class="serendipity_shorturl_link" rel="nofollow" title="' . $onclick . '" href="' . $shorturl . '" onclick="alert(\'' . $onclick . '\');return false">' . PLUGIN_EVENT_TWITTER_SHORTURL_TITLE . '</a></div>';
             }
         }
         if ($do_tweetthis || $do_identicathis) {
             $update = $update = $this->create_update_from_entry($eventData[$event_index], $tweetthis_format);
             if ($do_tweetthis) {
                 $url_tweetthis = 'http://twitter.com/intent/tweet?text=' . urlencode($update);
                 if ($do_smartify) {
                     // emit smarty tag only
                     $eventData[$event_index]['url_tweetthis'] = $url_tweetthis;
                 } else {
                     // http://twitter.com/home/?status=Tweet+This%2C+a+WordPress+Plugin+for+Twitter+http://richardxthripp.thripp.com/?p=646
                     $button_url = $this->get_config('plugin_rel_url') . '/img/tt-micro-' . $this->get_config('tweetthis_button', 'black') . '.png';
                     $tweetthis = '<a class="serendipity_tweetthis_img" href="' . $url_tweetthis . '"' . $tweetthis_target . '><img src="' . $button_url . '" alt="' . PLUGIN_EVENT_TWITTER_TWEETTHIS_TITLE . '" /></a>';
                     $eventData[$event_index]['add_footer'] .= $tweetthis;
                 }
             }
             if ($do_identicathis) {
                 $url_dentthis = 'http://identi.ca/notice/new?status_textarea=' . urlencode($update);
                 if ($do_smartify) {
                     // emit smarty tag only
                     $eventData[$event_index]['url_dentthis'] = $url_dentthis;
                 } else {
                     // http://twitter.com/home/?status=Tweet+This%2C+a+WordPress+Plugin+for+Twitter+http://richardxthripp.thripp.com/?p=646
                     $button_url = $this->get_config('plugin_rel_url') . '/img/it-micro-' . $this->get_config('tweetthis_button', 'black') . '.png';
                     $tweetthis = '<a class="serendipity_tweetthis_img" href="' . $url_dentthis . '"' . $tweetthis_target . '><img src="' . $button_url . '" alt="' . PLUGIN_EVENT_TWITTER_TWEETTHIS_TITLE . '" /></a>';
                     $eventData[$event_index]['add_footer'] .= $tweetthis;
                 }
             }
         }
         $event_index++;
     }
 }