| 1 | <script type="text/javascript" src="<$mt:Link template="<__trans phrase="JavaScript">"$>"></script> |
|---|
| 2 | <div class="widget-sign-in widget"> |
|---|
| 3 | <h3 class="widget-header"><__trans phrase="Sign In"></h3> |
|---|
| 4 | <div class="widget-content"> |
|---|
| 5 | <script type="text/javascript"> |
|---|
| 6 | /* <![CDATA[ */ |
|---|
| 7 | var name, id, url, blog_ids; |
|---|
| 8 | if (typeof(commenter_name) != 'undefined') |
|---|
| 9 | name = commenter_name |
|---|
| 10 | if (typeof(commenter_id) != 'undefined') |
|---|
| 11 | id = commenter_id; |
|---|
| 12 | if (typeof(commenter_url) != 'undefined') |
|---|
| 13 | url = commenter_url; |
|---|
| 14 | if (typeof(commenter_blog_ids) != 'undefined') |
|---|
| 15 | blog_ids = commenter_blog_ids; |
|---|
| 16 | |
|---|
| 17 | if (!name && !id) { |
|---|
| 18 | if ('<$mt:CGIHost exclude_port="1"$>' != '<$mt:BlogHost exclude_port="1"$>') { |
|---|
| 19 | document.write('<scr' + 'ipt src="<$mt:CGIPath$><$mt:CommentScript$>?__mode=cmtr_name_js">'); |
|---|
| 20 | document.write("</scr" + "ipt>"); |
|---|
| 21 | } else { |
|---|
| 22 | name = getCookie('commenter_name'); |
|---|
| 23 | ids = getCookie('commenter_id').split(':'); |
|---|
| 24 | id = ids[0]; |
|---|
| 25 | blog_ids = ids[1]; |
|---|
| 26 | url = getCookie('commenter_url'); |
|---|
| 27 | } |
|---|
| 28 | } |
|---|
| 29 | showMessage(name, id, url); |
|---|
| 30 | |
|---|
| 31 | function showMessage(commenter_name, commenter_id, commenter_url) { |
|---|
| 32 | static = location.href; |
|---|
| 33 | if ( commenter_name && |
|---|
| 34 | ( !commenter_id |
|---|
| 35 | || commenter_blog_ids.indexOf("'<$mt:BlogID$>'") > -1)) |
|---|
| 36 | { |
|---|
| 37 | var url; |
|---|
| 38 | if (commenter_id) { |
|---|
| 39 | url = '<$mt:CGIPath$><$mt:CommentScript$>?__mode=edit_profile&commenter=' + commenter_id + '&blog_id=<$mt:BlogID$>'; |
|---|
| 40 | url += '&static=' + static; |
|---|
| 41 | } else if (commenter_url) { |
|---|
| 42 | url = commenter_url; |
|---|
| 43 | } else { |
|---|
| 44 | url = null; |
|---|
| 45 | } |
|---|
| 46 | var content = '<__trans phrase="You are signed in as " escape="js">'; |
|---|
| 47 | if (url) { |
|---|
| 48 | content += '<a href="' + url + '">' + commenter_name + '</a>'; |
|---|
| 49 | } else { |
|---|
| 50 | content += commenter_name; |
|---|
| 51 | } |
|---|
| 52 | content += '. (<a href="<$mt:RemoteSignOutLink no_static="1"$>&static=' + static + '"><__trans phrase="sign out" escape="js"></a>)'; |
|---|
| 53 | document.write(content); |
|---|
| 54 | } else if (commenter_name) { |
|---|
| 55 | document.write('<__trans phrase="You do not have permission to sign in to this blog." escape="js"> (<a href="<$mt:RemoteSignOutLink no_static="1"$>&static=' + static + '"><__trans phrase="sign out" escape="js"></a>)'); |
|---|
| 56 | } else { |
|---|
| 57 | <mt:IfRegistrationAllowed> |
|---|
| 58 | document.write('<a href="<$mt:CGIPath$><$mt:CommentScript$>?__mode=login&blog_id=<$mt:BlogID$>&static=' + static + '"><__trans phrase="Sign In" escape="js"></a>'); |
|---|
| 59 | </mt:IfRegistrationAllowed> |
|---|
| 60 | } |
|---|
| 61 | } |
|---|
| 62 | /* ]]> */ |
|---|
| 63 | </script> |
|---|
| 64 | </div> |
|---|
| 65 | </div> |
|---|