From 0b1e7effc8987392a34fd178427b86dc0cbb0b48 Mon Sep 17 00:00:00 2001 From: ozhozh Date: Wed, 4 Aug 2010 19:37:36 +0000 Subject: [PATCH] "Social Toolbar" improvements with delicious button and meta tags (charset, robots) git-svn-id: http://yourls.googlecode.com/svn/trunk@477 12232710-3e20-11de-b438-597f59cd7555 --- user/plugins/sample-toolbar/css/toolbar.css | 13 ++++++++++--- user/plugins/sample-toolbar/js/toolbar.js | 10 ++++++++++ user/plugins/sample-toolbar/plugin.php | 15 ++++++++++++++- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/user/plugins/sample-toolbar/css/toolbar.css b/user/plugins/sample-toolbar/css/toolbar.css index 725aee3..358c143 100644 --- a/user/plugins/sample-toolbar/css/toolbar.css +++ b/user/plugins/sample-toolbar/css/toolbar.css @@ -27,7 +27,16 @@ body { z-index: 900000; } -#yourls-about, #yourls-topsy, #yourls-selfclose { +#yourls-bar a { + text-decoration:none; + color:#2A85B3; +} + +#yourls-bar a:hover { + text-decoration:underline; +} + +#yourls-about, #yourls-topsy, #yourls-delicious, #yourls-selfclose { margin-left:10px; float:left; display:block; @@ -40,14 +49,12 @@ body { padding-left:20px; color:inherit; font-weight:bold; - text-decoration:none; } #yourls-topsy { width:300px; } - #yourls-selfclose { float:right; margin-right:10px; diff --git a/user/plugins/sample-toolbar/js/toolbar.js b/user/plugins/sample-toolbar/js/toolbar.js index d047c67..7a65622 100644 --- a/user/plugins/sample-toolbar/js/toolbar.js +++ b/user/plugins/sample-toolbar/js/toolbar.js @@ -10,3 +10,13 @@ function yourls_cookie_no_toolbar_please() { document.cookie = "yourls_no_toolbar=1;expires="+exdate.toUTCString() ; } +// Get the number of delicious bookmarks +function yourls_get_books(json) { + if( json.length ) { + var books = json[0].total_posts.toString(); + if( books ) { + document.getElementById('yourls-delicious-link').innerHTML = ' '+books+' bookmarks'; + } + } +} + diff --git a/user/plugins/sample-toolbar/plugin.php b/user/plugins/sample-toolbar/plugin.php index 326d3a3..7084527 100644 --- a/user/plugins/sample-toolbar/plugin.php +++ b/user/plugins/sample-toolbar/plugin.php @@ -45,6 +45,8 @@ function ozh_toolbar_do( $args ) { } $www = YOURLS_SITE; + $ver = YOURLS_VERSION; + $md5 = md5( $url ); // When was the link created (in days) $diff = abs( time() - strtotime( yourls_get_keyword_timestamp( $ozh_toolbar['keyword'] ) ) ); @@ -67,6 +69,11 @@ function ozh_toolbar_do( $args ) { $pagetitle — YOURLS + + + + + @@ -75,6 +82,11 @@ function ozh_toolbar_do( $args ) { Short link powered by YOURLS and created $created. $hits. +
+ Delicious + Bookmark on Delicious +
+ + PAGE; -- 2.45.0