Пример #1
0
	public function prepMarkup($tweet) {
		$tmp_profile_img = $tweet->user->profile_image_url;
		if ($tmp_profile_img == 'http://static.twitter.com/images/default_profile_normal.png') {
			$tmp_profile_img = 'http://a2.twimg.com/sticky/default_profile_images/default_profile_' . rand(0, 6) . '_normal.png';
		}
		$innermarkup = "<div class=\"cashmusic_social cashmusic_twitter\"><img src=\"$tmp_profile_img\" class=\"cashmusic_twitter_avatar\" alt=\"avatar\" />"
		. "<div class=\"cashmusic_twitter_namespc\"><a href=\"http://twitter.com/" . $tweet->user->screen_name . "\">@" . $tweet->user->screen_name . "</a><br />" . $tweet->user->name . "</div><div class=\"cashmusic_clearall\">.</div>"
		. "<div class=\"tweet\">" . $tweet->text . '<div class="cashmusic_social_date"><a href="http://twitter.com/#!/' . $tweet->user->screen_name . '/status/' . $tweet->id_str . '" target="_blank">' . CASHSystem::formatAgo($tweet->created_at) . ' / twitter</a> </div></div>';
		/*
		The CSS to go along with the twitter markup:
		
		From our stuff up on http://marketairglovamusic.com/
		
		.cashmusic_social {margin:10px 0 20px 0;padding:15px;background-color:#fff;border-top-left-radius:5px 5px;border-top-right-radius:5px 5px;border-bottom-right-radius:5px 5px;border-bottom-left-radius:5px 5px;}
		.cashmusic_social a {color:#cdcdcd;}
		.cashmusic_twitter {font:14.5px/1.75em georgia,'times new roman',times,serif;}
		.cashmusic_twitter_avatar {float:left;margin:1px 8px 8px 0;}
		.cashmusic_twitter_namespc {color:#cdcdcd;font:11px/1.5em helvetica,"helvetica neue",arial,sans-serif;}
		.cashmusic_twitter_namespc a {color:#007e3d;font:bold 15px/1.85em helvetica,"helvetica neue",arial,sans-serif;}
		.cashmusic_twitter a {color:#007e3d;}
		.cashmusic_tumblr h2, .cashmusic_tumblr h2 a, #topmenu * a, h2 {color:#111;font:28px/1em 'IM Fell English',georgia,'times new roman',times,serif;}
		.cashmusic_social_date {margin-top:10px;color:#cdcdcd;font:11px/1.75em helvetica,"helvetica neue",arial,sans-serif;}
		.cashmusic_clearall {clear:both;height:1px;overflow:hidden;visibility:hidden;}
		*/
	}
Пример #2
0
	public function prepMarkup($post) {
		if ($post->type == 'regular') {
			$textbody = '';
			$textbodyarray = explode('.',strip_tags($post->{'regular-body'}));
			if (count($textbodyarray) > 3) {
				$textbodyarray = array_slice($textbodyarray,0,3);
			}
			$textbody = implode('.',$textbodyarray) . '...';

			$innermarkup = "<div class=\"cashmusic_social cashmusic_tumblr\">"
			. '<h2><a href="' . $post->{'url-with-slug'} . '" target="_blank">' . $post->{$post->type . '-title'} . '</a></h2><div>' . $textbody . '</div><div class="cashmusic_social_date"><a href="' . $post->{'url-with-slug'} . '" target="_blank">' . CASHSystem::formatAgo($post->{'unix-timestamp'}) . ' / tumblr</a> </div>'
			. '<div style="clear:both;overflow:hidden;visibility:hidden;height:1px;">.</div></div>';
		} else if ($post->type == 'photo') {
			$innermarkup = "<div class=\"cashmusic_social cashmusic_tumblr\">"
			. '<div><img src="' . $post->{'photo-url-500'} . '" width="100%" alt="" /><br />' . $post->{'photo-caption'} . '</div><div class="cashmusic_social_date"><a href="' . $post->{'url-with-slug'} . '" target="_blank">' . CASHSystem::formatAgo($post->{'unix-timestamp'}) . ' / tumblr</a> </div>'
			. '<div style="clear:both;overflow:hidden;visibility:hidden;height:1px;">.</div></div>';
		} else if ($post->type == 'video') {
			$innermarkup = "<div class=\"cashmusic_social cashmusic_tumblr\">"
			. '<div><div class="cashmusic_social_video_container">' . $post->{'video-player'} . '</div><br />' . $post->{'video-caption'} . '</div><div class="cashmusic_social_date"><a href="' . $post->{'url-with-slug'} . '" target="_blank">' . CASHSystem::formatAgo($post->{'unix-timestamp'}) . ' / tumblr</a> </div>'
			. '<div style="clear:both;overflow:hidden;visibility:hidden;height:1px;">.</div></div>';
		}
		/*
		The CSS to go along with the video container:
		
		Thanks to http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
		
		echo '<style type="text/css">';
		echo '.cashmusic_video_container {position:relative;padding-bottom:56.25%;padding-top:30px;height:0;overflow:hidden;}';
		echo '.cashmusic_video_container iframe, .cashmusic_video_container object, .cashmusic_video_container embed {position:absolute;top:0;left:0;width:100%;height:100%;}';
		echo '</style>';
		*/
	}