From: <al...@us...> - 2008-09-30 16:07:27
|
Revision: 715 http://sciret.svn.sourceforge.net/sciret/?rev=715&view=rev Author: alpeb Date: 2008-09-30 16:06:57 +0000 (Tue, 30 Sep 2008) Log Message: ----------- added 'share this article' section Modified Paths: -------------- trunk/classes/Library.php trunk/style.css trunk/templates/footer.tpl trunk/views/View.php Added Paths: ----------- trunk/images/icon-blinklist.png trunk/images/icon-delicious.png trunk/images/icon-digg.png trunk/images/icon-facebook.png trunk/images/icon-furl.png trunk/images/icon-google.png trunk/images/icon-magnolia.png trunk/images/icon-mixx.png trunk/images/icon-myweb.png trunk/images/icon-reddit.png trunk/images/icon-stumbleupon.png trunk/images/icon-technorati.png trunk/images/icon-twitter.png trunk/images/icon-windowslive.png Modified: trunk/classes/Library.php =================================================================== --- trunk/classes/Library.php 2008-09-30 15:41:28 UTC (rev 714) +++ trunk/classes/Library.php 2008-09-30 16:06:57 UTC (rev 715) @@ -69,6 +69,17 @@ return $url; } + + /** + * @return string + */ + public static function getBaseURL() + { + $url = 'http://'.$_SERVER['HTTP_HOST'] + .substr($_SERVER['REQUEST_URI'], 0, strrpos($_SERVER['REQUEST_URI'], '/')); + + return $url; + } } ?> Property changes on: trunk/images/icon-blinklist.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/images/icon-delicious.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/images/icon-digg.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/images/icon-facebook.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/images/icon-furl.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/images/icon-google.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/images/icon-magnolia.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/images/icon-mixx.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/images/icon-myweb.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/images/icon-reddit.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/images/icon-stumbleupon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/images/icon-technorati.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/images/icon-twitter.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/images/icon-windowslive.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/style.css =================================================================== --- trunk/style.css 2008-09-30 15:41:28 UTC (rev 714) +++ trunk/style.css 2008-09-30 16:06:57 UTC (rev 715) @@ -643,6 +643,11 @@ float: left; } +#shareArticle img { + border: none; + margin: 5px; +} + /* end panel_right */ Modified: trunk/templates/footer.tpl =================================================================== --- trunk/templates/footer.tpl 2008-09-30 15:41:28 UTC (rev 714) +++ trunk/templates/footer.tpl 2008-09-30 16:06:57 UTC (rev 715) @@ -49,6 +49,32 @@ </div> </div> <div class="panel_bottom"></div> + + <!-- BEGIN shareArticle_block --> + <div class="panel" id="shareArticle"> + <div class="panel_title"> + <a>[l]Share this article[/l]</a> + </div> + <div class="inside_panel"> + <a href="http://digg.com/submit?url={articleURL}&title={articleTitle}" rel="nofollow" title="Digg"><img alt="Digg" height="16" src="images/icon-digg.png" width="16"/></a> + <a href="http://reddit.com/submit?url={articleURL}&title={articleTitle}" rel="nofollow" title="Reddit"><img alt="Reddit" height="16" src="images/icon-reddit.png" width="16"/></a> + <a href="http://del.icio.us/post?url={articleURL}&title={articleTitle}" rel="nofollow" title="Del.icio.us"><img alt="Del.icio.us" height="16" src="images/icon-delicious.png" width="16"/></a> + <a href="http://ma.gnolia.com/bookmarklet/add?url={articleURL}&title={articleTitle}" rel="nofollow" title="Ma.gnolia"><img alt="Ma.gnolia" height="16" src="images/icon-magnolia.png" width="16"/></a> + <a href="http://www.stumbleupon.com/submit?url={articleURL}&title={articleTitle}" rel="nofollow" title="Stumble Upon"><img alt="Stumble Upon" height="16" src="images/icon-stumbleupon.png" width="16"/></a> + + <a href="http://www.facebook.com/sharer.php?u={articleURL}" rel="nofollow" title="Facebook"><img alt="Facebook" height="16" src="images/icon-facebook.png" width="16"/></a> + <a href="http://twitter.com/home?status={articleURL}" rel="nofollow" title="Twitter"><img alt="Twitter" height="16" src="images/icon-twitter.png" width="16"/></a> + <a href="http://www.google.com/bookmarks/mark?op=edit&bkmk={articleURL}&title={articleTitle}" rel="nofollow" title="Google"><img alt="Google" height="16" src="images/icon-google.png" width="16"/></a> + <a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u={articleURL}&t={articleTitle}" rel="nofollow" title="Yahoo! MyWeb"><img alt="Yahoo! MyWeb" height="16" src="images/icon-myweb.png" width="16"/></a> + <a href="http://furl.net/storeIt.jsp?u={articleURL}&t={articleTitle}" rel="nofollow" title="Furl"><img alt=Furl" height="16" src="images/icon-furl.png" width="16"/></a> + <a href="http://blinklist.com/index.php?Action=Blink/addblink.php&Url={articleURL}&Title={articleTitle}" rel="nofollow" title="BlinkList"><img alt="BlinkList" height="16" src="images/icon-blinklist.png" width="16"/></a> + <a href="http://www.technorati.com/faves?add={articleURL}" rel="nofollow" title="Technorati"><img alt="Technorati" height="16" src="images/icon-technorati.png" width="16"/></a> + <a href="http://www.mixx.com/submit?page_url={articleURL}" rel="nofollow" title="Mixx"><img alt="Mixx" height="16" src="images/icon-mixx.png" width="16"/></a> + <a href="https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url={articleURL}&top=1" rel="nofollow" title="Windows Live"><img alt="Windows Live" height="16" src="images/icon-windowslive.png" width="16"/></a> + </div> + </div> + <div class="panel_bottom"></div> + <!-- END shareArticle_block --> <!-- BEGIN favoritesLink_block --> <div class="panel" id="favorites"> Modified: trunk/views/View.php =================================================================== --- trunk/views/View.php 2008-09-30 15:41:28 UTC (rev 714) +++ trunk/views/View.php 2008-09-30 16:06:57 UTC (rev 715) @@ -181,7 +181,20 @@ 'advancedSearchLink' => Library::getLink(array('view' => 'AdvancedSearch')), )); + $this->tpl->set_block('footer', 'shareArticle_block', 'shareArticle'); $this->tpl->set_block('footer', 'favoritesLink_block', 'favoritesLink'); + if (strtolower(get_class($this)) == 'viewarticle' + && !$this->article->isBookmark() + && $this->configuration->getConfigValue('publishKB')) + { + $this->tpl->set_var(array( + 'articleURL' => Library::getBaseURL() . urlencode('/index.php?view=ViewArticle&id=' . $this->article->getId()), + 'articleTitle' => urlencode($this->article->getTitle()) + )); + $this->tpl->parse('shareArticle', 'shareArticle_block'); + } else { + $this->tpl->set_var('shareArticle', ''); + } if (!$this->user->isAnonymous()) { $this->tpl->parse('favoritesLink', 'favoritesLink_block'); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |