<?php
/**
 * @name          : Joomla Social Pinboard
 * @version	  : 1.5.0
 * @package       : apptha
 * @since         : Joomla 1.5
 * @author        : Apptha - http://www.apptha.com
 * @copyright     : Copyright (C) 2011 Powered by Apptha
 * @license       : http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
 * @abstract      : Social Pinboard Module twitter widget
 * @Creation Date : August 2013
 * @Modified Date : March 2014
 * */

	// no direct access
	defined('_JEXEC') or die;

?>
<div id="wds-container" class="tweetfeed-module">
    <h2 class="wwya-tweeticon"><i></i><?php echo JText::_('MOD_WISHLOGUE_TWITTER_FEED'); ?></h2>
	<div id="wds">
		<?php if($params->get('header', 1)) : ?>
		<!-- <div id="wds-header">
			<?php if($params->get('twitter_icon', 1)) : ?>
				<div id="wds-twitter-icon"><a href="http://twitter.com" target="_blank">twitter</a></div>
			<?php endif; ?>
			<?php if($params->get('type', 1)) : ?>
				<a href="https://twitter.com/<?php echo $data->tweets[0]->screenName; ?>" target="_blank">
					<img src="<?php echo $data->tweets[0]->profileImage; ?>" class="wds-avatar" />
					<span class="wds-display-name"><?php echo $data->tweets[0]->displayName; ?></span>
					<span class='wds-screen-name'> @<?php echo $data->tweets[0]->screenName; ?></span>
				</a>
				<div style="clear: both;"></div>
				<?php else: ?>
					<?php if($params->get('link_title', 1)) : ?>
						<a href="https://twitter.com/search/<?php echo $params->get('query', ''); ?>" target="_blank"><?php echo $params->get('title', '') ?></a>
					<?php else: ?>
						<?php echo $params->get('title', ''); ?>
					<?php endif; ?>
				<?php endif; ?>
		</div> -->
		<?php endif; ?>
		<div id="wds-tweets">
			<?php foreach($data->tweets as $key => $tweet): ?>
			<div class="wds-tweet-container <?php echo end(array_keys($data->tweets)) == $key?' wds-last':'';?>">
				<?php if($params->get('avatars', 1)): ?>
					<div>
						<a href="https://twitter.com/intent/user?screen_name=<?php echo $tweet->screenName; ?>" target="_blank">
							<img src="<?php echo $tweet->profileImage; ?>" class="wds-avatar" style="width: 35px;" />
						</a>
					</div>
					<div class="wds-tweet" style="padding-left: 40px;">
						<?php else: ?>
							<div class="wds-tweet">
						<?php endif; ?>
						<?php if($params->get('display_name', 1)): ?>
							<a href="https://twitter.com/intent/user?screen_name=<?php echo $tweet->screenName; ?>" target="_blank"><?php echo $tweet->screenName; ?></a> 
						<?php endif; ?>
						<?php echo $tweet->text; ?>
					</div>
					<div class="wds-tweet-data">
						<?php if($params->get('timestamps', 1)): ?>
							<a href="https://twitter.com/<?php echo $tweet->screenName; ?>/statuses/<?php echo $tweet->id; ?>" target="_blank"><?php echo $tweet->time; ?></a>
							<?php if($params->get('reply', 1) || $params->get('retweet', 1) || $params->get('favorite', 1)): ?>
								&bull;
							<?php endif; ?>
						<?php endif; ?>
						<?php if($params->get('reply', 1)): ?>
							<a href="https://twitter.com/intent/tweet?in_reply_to=<?php echo $tweet->id; ?>" target="_blank">reply</a>
							<?php if($params->get('retweet', 1) || $params->get('favorite', 1)): ?>
								&bull;
							<?php endif; ?>
						<?php endif; ?>
						<?php if($params->get('retweet', 1)): ?>
							<a href="https://twitter.com/intent/retweet?tweet_id=<?php echo $tweet->id; ?>" target="_blank">retweet</a>
							<?php if($params->get('favorite', 1)): ?>
								&bull;
							<?php endif; ?>
						<?php endif; ?>
						<?php if($params->get('favorite', 1)): ?>
							<a href="https://twitter.com/intent/favorite?tweet_id=<?php echo $tweet->id; ?>" target="_blank">favorite</a>
						<?php endif; ?>
					</div>
				</div>
			<?php endforeach; ?>
		</div>
	</div>
</div>

