You are here

function theme_socialfeed_feed_structure in Social Feed 6

Themes the block.

1 theme call to theme_socialfeed_feed_structure()
socialfeed_build_the_feed in ./socialfeed.module
Builds the block using data based on settings.

File

./socialfeed.module, line 645
Module for fetching data from Facebook, Twitter, Youtube, and Foursquare. This module provides block content retrieved from a

Code

function theme_socialfeed_feed_structure($element, $feeditems, $feedname, $facebookprofile, $facebooknamecustom, $twitternamecustom, $youtubenamecustom, $foursquarenamecustom) {
  $output = '<div id="socialfeed">';
  if ($feeditems) {
    foreach ($feeditems as $fitem) {
      switch ($fitem->post_type) {
        case 'facebook':
          $output .= '<div class="fbitem">';
          $output .= l('<div class="socialtitle bpfacebook"><span>' . ($facebooknamecustom ? check_plain($facebooknamecustom) : check_plain($fitem->name)) . '</span></div>', 'http://www.facebook.com/' . check_plain($facebookprofile) . '', array(
            'attributes' => array(
              'target' => '_blank',
            ),
            'html' => TRUE,
          ));
          $output .= '<p>';
          $output .= l(t(check_plain($fitem->name)), 'http://www.facebook.com/' . check_plain($facebookprofile) . '', array(
            'attributes' => array(
              'target' => '_blank',
            ),
          )) . ' ';
          $output .= check_plain($fitem->message);
          $output .= '</p>';
          if ($fitem->picture) {
            $output .= '<img class="asmediaimg" src="' . check_url($fitem->picture) . '">';
          }
          $output .= '<p class="socialdate">';
          $output .= format_date(check_plain($fitem->time), 'custom', 'l F d, Y');
          $output .= '</p>';
          $output .= '</div>';
          break;
        case 'twitter':
          $output .= '<div class="fbitem">';
          $output .= l('<div class="socialtitle bptwitter"><span>@' . ($twitternamecustom ? check_plain($twitternamecustom) : check_plain($fitem->name)) . '</span></div>', 'http://www.twitter.com/' . check_plain($fitem->name) . '', array(
            'attributes' => array(
              'target' => '_blank',
            ),
            'html' => TRUE,
          ));
          $output .= '<p>';
          $output .= check_plain($fitem->message);
          $output .= '</p><p class="socialdate">';
          $output .= format_date(check_plain($fitem->time), 'custom', 'l F d, Y');
          $output .= '</p>';
          $output .= '</div>';
          break;
        case 'foursquare':
          $output .= '<div class="fbitem">';
          $output .= l('<div class="socialtitle bpfoursaquare"><span>' . ($foursquarenamecustom ? check_plain($foursquarenamecustom) : check_plain($fitem->title)) . '</span></div>', 'http://www.foursquare.com/user/' . check_plain($fitem->name) . '', array(
            'attributes' => array(
              'target' => '_blank',
            ),
            'html' => TRUE,
          ));
          $output .= '<p>';
          $output .= '@';
          $output .= check_plain($fitem->venue);
          $output .= '<br />';
          $output .= check_plain($fitem->shout);
          $output .= '</p><p class="socialdate">';
          $output .= format_date(check_plain($fitem->time), 'custom', 'l F d, Y');
          $output .= '</p>';
          $output .= '</div>';
          break;
        case 'youtube':
          $output .= '<div class="fbitem">';
          $output .= l('<div class="socialtitle bpyoutube"><span>' . ($youtubenamecustom ? check_plain($youtubenamecustom) : check_plain($fitem->name)) . '</span></div>', 'http://www.youtube.com/' . check_plain($fitem->name) . '', array(
            'attributes' => array(
              'target' => '_blank',
            ),
            'html' => TRUE,
          ));
          $output .= '<p>';
          $output .= check_plain($fitem->message);
          $output .= '</p><p class="socialdate">';
          $output .= format_date(check_plain($fitem->time), 'custom', 'l F d, Y');
          $output .= '</p>';
          $output .= '</div>';
          break;
      }
    }
  }
  $output .= '</div><br />';
  return $output;
}