Skip to content
This repository has been archived by the owner on Jul 13, 2018. It is now read-only.

Commit

Permalink
Layout tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mbabker committed Jul 27, 2011
1 parent 5ac465d commit 24b42c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
12 changes: 0 additions & 12 deletions media/css/default.css
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@
* *
*/ */


.active-1 {
width: 100%;
}

.active-2 {
width: 50%;
}

.active-3 {
width: 33%;
}

.yetanothersocial-facebook, .yetanothersocial-google, .yetanothersocial-twitter { .yetanothersocial-facebook, .yetanothersocial-google, .yetanothersocial-twitter {
float: left; float: left;
} }
7 changes: 4 additions & 3 deletions tmpl/default.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
<?php // Facebook Like button <?php // Facebook Like button
// @TODO: Param for count and size // @TODO: Param for count and size
if ($displayFacebook): ?> 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" /> <fb:like href="<?php echo JURI::base().$itemUrl; ?>" send="false" layout="button_count" width="450" show_faces="false" font="lucida grande" />
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php // Google +1 button <?php // Google +1 button
// @TODO: Param for count and size // @TODO: Param for count and size
if ($displayGoogle): ?> 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> <g:plusone size="standard" count="true" href="<?php echo JURI::base().$itemUrl; ?>"></g:plusone>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php // Twitter Share button <?php // Twitter Share button
// @TODO: Param for Twitter account, text, count // @TODO: Param for Twitter account, text, count
if ($displayTwitter): ?> if ($displayTwitter): ?>
<div class="yetanothersocial-twitter active-<?php echo $count; ?>"> <div class="yetanothersocial-twitter">
<a href="http://twitter.com/share" class="twitter-share-button" <a href="http://twitter.com/share" class="twitter-share-button"
data-url="<?php echo JURI::base().$itemUrl; ?>" data-url="<?php echo JURI::base().$itemUrl; ?>"
data-count="horizontal" data-count="horizontal"
Expand All @@ -38,5 +38,6 @@
</div> </div>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="clear">&nbsp;</div>


<?php echo $article->text; ?> <?php echo $article->text; ?>
10 changes: 2 additions & 8 deletions yetanothersocial.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ public function __construct(&$subject, $config)
public function onContentPrepare($context, &$article, &$params, $limitstart) public function onContentPrepare($context, &$article, &$params, $limitstart)
{ {
// Set the parameters // Set the parameters
$document = JFactory::getDocument(); $document = JFactory::getDocument();
$displayFacebook = $this->params->get('displayFacebook', '1'); $displayFacebook = $this->params->get('displayFacebook', '1');
$displayGoogle = $this->params->get('displayGoogle', '1'); $displayGoogle = $this->params->get('displayGoogle', '1');
$displayTwitter = $this->params->get('displayTwitter', '1'); $displayTwitter = $this->params->get('displayTwitter', '1');
$selectedCategories = $this->params->def('displayCategories', ''); $selectedCategories = $this->params->def('displayCategories', '');
$view = JRequest::getCmd('view'); $view = JRequest::getCmd('view');


// Check if the plugin is enabled // Check if the plugin is enabled
if (JPluginHelper::isEnabled('content', 'yetanothersocial') == false) { if (JPluginHelper::isEnabled('content', 'yetanothersocial') == false) {
Expand Down Expand Up @@ -107,25 +107,19 @@ public function onContentPrepare($context, &$article, &$params, $limitstart)
// Build the URL for the plugins to use // Build the URL for the plugins to use
$itemURL = JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catid)); $itemURL = JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catid));


// Counting the number of active buttons for CSS purposes
$count = '0';

// Declare the stylesheet // Declare the stylesheet
JHtml::stylesheet('plugins/content/yetanothersocial/media/css/default.css', false, false, false); JHtml::stylesheet('plugins/content/yetanothersocial/media/css/default.css', false, false, false);


// Check the scripts aren't already loaded and load if needed // Check the scripts aren't already loaded and load if needed
// @TODO: Handle multi-language situations as able // @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)) { 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>'); $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)) { 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>'); $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)) { 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>'); $document->addCustomTag('<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>');
$count++;
} }


// Get the content and merge in the template // Get the content and merge in the template
Expand Down

0 comments on commit 24b42c3

Please sign in to comment.