Yii Social Share Box
ShareBox allows you to easily share a URL on your Yii powered site with social networking sites.
Developed and tested on Yii 1.1.7, should work on all 1.1.x branch.
Extract to your extensions folder.
Alternatively, you can check out from GitHub right in your Git enabled project:
$ git submodule add git@github.com:digitick/yii-sharebox.git extensions/sharebox $ git submodule init $ git submodule update
Include the widget in a view file as follows:
$this->widget('ext.sharebox.EShareBox', array( // url to share, required. 'url' => $this->createAbsoluteUrl('/'), // A title to describe your link, required. // Some services will ignore this value. 'title'=> 'My Awesome web site !!', // Size of the icons to display, in pixels. // Default is 24px, available sizes : 16, 24, 32, 48. //'iconSize' => 32, // Whether to animate the links. // Default is true //'animate' => false, // Social networks to include, excluding all others. // The exclude filter is still run. //'include' => array('technorati', 'digg'), // Social networks to exclude from display. // By default none are excluded. //'exclude' => array('technorati', 'digg'), // Use your own icons! Note that you will need to have // a subfolder of the appropriate icons sizes. // ie: /myimages/social/16px /myimages/social/24px ... //'iconPath' => '/myimages/social', // HTML options for the UL element. //'ulHtmlOptions' => array('class' => 'myCustomUlClass'), // HTML options for all the LI elements. //'liHtmlOptions' => array('class' => 'myCustomLiClass'), ));
ShareBox uses the following resources internally :
Original idea and CSS from Beautiful Social Bookmarking Widget by Harish. The extension uses the CSS only version, no jQuery involved.
16, 24, 32 and 48 px icons from IconDock
Note: the company logos in the icons are copyright of their respective owners.
v 1.3 — 2012-09-27 :
v 1.2.2 — 2011-09-27 :
v 1.2.1 — 2011-07-13 :
v 1.2 — 2011-06-09 :
v 1.1 — 2011-05-24 :
v 1.0 — 2011-05-23 : initial release.
Total 3 comments
This is line 148 in the extension. First, I would add a "}" just before the last double quote to close the CSS block. I don't know if there is a rule that this is not needed for the last CSS-block.
However, the existence of in-line style within the body causes the XHTML-validator to cast an error when this extension is loaded.
Here is a patch that fixes the problem: yii_sharebox_style_fix.patch The patch was made against version 1.2 of sharebox using hg.
thanks very much for the extension, very useful
a little change shoud be made in line 70 of EShareBox.php:
name=>'Twitter' instead of name=>'Tweeter'
just a misspelling i think
:)
regards!
Hello there. Great extension, thanks for sharing. I wanted to add some htmlOptions to the
ulcreated by this extension and I added htmlOptions as an argument. Bellow is the diff with the original 1.0 version as well as theEShareBox.phpfile I have.Changes
I Added 2 newparams
This 2 array merge at the end of
EShareBox::init()like:And this is the changes to the
EShareBox::run()function:Leave a comment
Please login to leave your comment.