Skip to content

Commit

Permalink
Added support for Gravatar. Removed the seyedi.json file improperly…
Browse files Browse the repository at this point in the history
… placed in the project root.
  • Loading branch information
evertton committed Apr 9, 2013
1 parent 4a02a4a commit 6d33a04
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 8 deletions.
1 change: 1 addition & 0 deletions LICENSE.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
</head>
<body>
<article>
{{gravatar}}
<h1>The MIT License (MIT)</h1>
<p>Copyright © {{info}}</p>

Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Available fields:
* url
* email
* format
* gravatar
* version
* theme

Expand Down Expand Up @@ -97,6 +98,21 @@ And if you want your license to appear as plain text, just add the
"format": "txt"
}

### gravatar

And if you want to show your gravatar, just add the `gravatar`
property (allowed values are `on` or `off`):

{
"copyright": "Remy Sharp, http://remysharp.com",
"url": "http://remysharp.com",
"email": "[email protected]",
"gravatar": "on"
}

*Depends of email property. You need to check the compatibility of the
chosen theme. Currently, only the default theme supports Gravatar.*

### License version targeting

License version targeting allows you to link your MIT license to a
Expand Down Expand Up @@ -141,7 +157,8 @@ Current available themes:

* default - [preview](http://mit-license.org) (by
[@remy](http://github.com/remy) &
[@raphaelbastide](http://github.com/raphaelbastide))
[@raphaelbastide](http://github.com/raphaelbastide) &
[@evertton](http://github.com/evertton))
* flesch - [preview](http://jsbin.com/ufefid/3) (by
[@flesch](http://github.com/flesch))
* afterdark - [preview](http://jsbin.com/ivufon/4) (by [@rmartindotco](http://github.com/rmartindotco))
Expand Down Expand Up @@ -191,6 +208,7 @@ Development contributions from:
* [batuhanicoz](http://github.com/batuhanicoz)
* [georgebashi](http://github.com/georgebashi)
* [mathiasbynens](http://github.com/mathiasbynens)
* [evertton](http://github.com/evertton)

### 1. Donate domain years

Expand Down
6 changes: 6 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@

if (property_exists($user, 'email')) {
$holder = $holder . ' &lt;<a href="mailto:' . $user->email . '">' . $user->email . '</a>&gt;';

if(property_exists($user, 'gravatar') && $user->gravatar === "on"){
$gravatar = '<img id="gravatar" src="http://www.gravatar.com/avatar/'.md5(strtolower(trim($user->email))).'" />';
}

}

if (property_exists($user, 'format')) {
Expand Down Expand Up @@ -135,6 +140,7 @@
$info = $year . ' ' . $holder;
$license = str_replace('{{info}}', $info, $license);
$license = str_replace('{{theme}}', $theme, $license);
$license = str_replace('{{gravatar}}', $gravatar, $license);

// if we want text format, strip out the license from the article tag
// and then strip any other tags in the license.
Expand Down
6 changes: 0 additions & 6 deletions seyedi.json

This file was deleted.

2 changes: 1 addition & 1 deletion themes/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ a:active { color:#000; }
:-moz-any-link:focus {color:#000; border:0;}
::selection {background:#ccc;}
::-moz-selection {background:#ccc;}

#gravatar{position:relative;float:right;}
1 change: 1 addition & 0 deletions users/evertton.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"copyright": "Evertton de Lima",
"email": "[email protected]",
"format": "html",
"gravatar": "on",
"theme": "default"
}

0 comments on commit 6d33a04

Please sign in to comment.