Browse files

Layout tweaks

  • Loading branch information...
1 parent 5ac465d commit 24b42c3a2cf77fc8736b3827b9fc6f4a1709c0ba @mbabker mbabker committed Jul 27, 2011
Showing with 6 additions and 23 deletions.
  1. +0 −12 media/css/default.css
  2. +4 −3 tmpl/default.php
  3. +2 −8 yetanothersocial.php
View
12 media/css/default.css
@@ -6,18 +6,6 @@
*
*/
-.active-1 {
-width: 100%;
-}
-
-.active-2 {
-width: 50%;
-}
-
-.active-3 {
-width: 33%;
-}
-
.yetanothersocial-facebook, .yetanothersocial-google, .yetanothersocial-twitter {
float: left;
}
View
7 tmpl/default.php
@@ -15,21 +15,21 @@
<?php // Facebook Like button
// @TODO: Param for count and size
if ($displayFacebook): ?>
- <div class="yetanothersocial-facebook active-<?php echo $count; ?>">
+ <div class="yetanothersocial-facebook">
<fb:like href="<?php echo JURI::base().$itemUrl; ?>" send="false" layout="button_count" width="450" show_faces="false" font="lucida grande" />
</div>
<?php endif; ?>
<?php // Google +1 button
// @TODO: Param for count and size
if ($displayGoogle): ?>
- <div class="yetanothersocial-google active-<?php echo $count; ?>">
+ <div class="yetanothersocial-google">
<g:plusone size="standard" count="true" href="<?php echo JURI::base().$itemUrl; ?>"></g:plusone>
</div>
<?php endif; ?>
<?php // Twitter Share button
// @TODO: Param for Twitter account, text, count
if ($displayTwitter): ?>
- <div class="yetanothersocial-twitter active-<?php echo $count; ?>">
+ <div class="yetanothersocial-twitter">
<a href="http://twitter.com/share" class="twitter-share-button"
data-url="<?php echo JURI::base().$itemUrl; ?>"
data-count="horizontal"
@@ -38,5 +38,6 @@
</div>
<?php endif; ?>
</div>
+<div class="clear">&nbsp;</div>
<?php echo $article->text; ?>
View
10 yetanothersocial.php
@@ -44,12 +44,12 @@ public function __construct(&$subject, $config)
public function onContentPrepare($context, &$article, &$params, $limitstart)
{
// Set the parameters
- $document = JFactory::getDocument();
+ $document = JFactory::getDocument();
$displayFacebook = $this->params->get('displayFacebook', '1');
$displayGoogle = $this->params->get('displayGoogle', '1');
$displayTwitter = $this->params->get('displayTwitter', '1');
$selectedCategories = $this->params->def('displayCategories', '');
- $view = JRequest::getCmd('view');
+ $view = JRequest::getCmd('view');
// Check if the plugin is enabled
if (JPluginHelper::isEnabled('content', 'yetanothersocial') == false) {
@@ -107,25 +107,19 @@ public function onContentPrepare($context, &$article, &$params, $limitstart)
// Build the URL for the plugins to use
$itemURL = JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catid));
- // Counting the number of active buttons for CSS purposes
- $count = '0';
-
// Declare the stylesheet
JHtml::stylesheet('plugins/content/yetanothersocial/media/css/default.css', false, false, false);
// Check the scripts aren't already loaded and load if needed
// @TODO: Handle multi-language situations as able
if ($displayFacebook && !in_array('<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>', $document->_custom)) {
$document->addCustomTag('<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>');
- $count++;
}
if ($displayGoogle && !in_array('<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>', $document->_custom)) {
$document->addCustomTag('<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>');
- $count++;
}
if ($displayTwitter && !in_array('<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>', $document->_custom)) {
$document->addCustomTag('<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>');
- $count++;
}
// Get the content and merge in the template

0 comments on commit 24b42c3

Please sign in to comment.