« MT Protection test... | Main | Standard Password protection test (password=test). »

Movable Type

June 28, 2005

Typekey, restricted comments and protected entries.

"The secret to creativity is knowing how to hide your sources."

Albert Einstein

I'll be damned. I'm actually finding myself curious as to how all this works.

I see interesting things. I've set up typekey identification for comments, which will be automatically approved. Non-typekey comments will be manually vetted.

Update -

Actually, even though both options may be checked simultaneously in the config, it seems it's an either-or thing. You must have a typekey ID to leave comments for the moment.

But how?

For this, you need to register for a typekey account, if you haven't already. Make sure you add the blog host URL to the Weblog preferences (do not use your account name) - http://www.moreblogsofroleplay.com/, not http://www.moreblogsofroleplay.com/Meathe. The trailing slash is important.

Once you're all registered, to set this up on your blog, go to the blog config, Preferences, check the Accept Comments from Registered Visitors. Paste in your typekey token (available from your account at TypeKey).

Having done that, I thought I'd try something new. There is one feature I'm quite interested in, though I never had managed to make it work. Strega, you did set it up correctly! Password and TypeKey protection for entries.

Update-

It seems MTProtect has SQL issues when using it's own password access control. I'm looking into where it goes wrong in the source, however, it's probably better to save yourself the headache and stick with TypeKey authentication. Bug squished.

It's the documentation that's incorrect (and incomplete). <MTProtectEntry> (recomended by them) simply does not work. <MTProtected> does.

So now you must fiddle with your templates - main index, master archive index, Category Archive, Date Based Archive, Individual Entry Archive, index.rdf, etc.

As the first line in each of these templates, add <MTProtectInclude>. This includes all the code needed to make it work.

Somewhere after <MTEntries>
...
<MTProtected>
<MTEntryBody>
....
</MTProtected>
<MTEntries>

This will display the title of the protected entry, but no content and no comments to people who have not logged in and are not approved.

For the individual entry archive, add the <MTProtected> </MTProtected> tags inside the <body></body> tags to hide all protected content.

Now the templates are working, it's time to protect an entry. Any entry you protect must be saved (as a draft is best) before you click the protect button. Then add the list of Typekey IDs you want to be able to read your entry. Any changes to these require a whole site rebuild.



Update: 29/06/2005

As these MT tags insert PHP code, you will need to change your weblog config preferences so that "Extension for Archive Files" is PHP, not HTML, and rebuild your site. Otherwise, the PHP code will not be interpretted correctly (or, indeed, at all). You also have to change your template extensions from html to php. It may take a little while for this to be fully refreshed, as it also alters your .htaccess file to make index.php the default file.

Apologies for the omission.


Scrawled illegibly by Meathe at June 28, 2005 11:26 AM

Comments

Hello WebKittyn. You do not have the rights to access this entry. Sorry! (Sign Out)

It doesn't like me.

Posted by: WebKittyn at June 28, 2005 01:45 PM



That's because each entry is individually protected and I didn't know your TypeKey name (it's also case sensitive).

The best way I've found to discover it is, after a comment is posted, clicking on Commenters in MT Manage.

You're all added now, and the MT Protection Test entry should be available to you. It's not really interesting beyond the fact that the protection works.

Posted by: Meathe at June 28, 2005 02:38 PM



Hi there, after speaking with Strega, she referred me to you/your site with aid setting up the protected entries.

I've been toying with it on and off for the last few weeks with no luck. So glad to see you have it working. I've tried following through what you have here a few times but still not getting any joy. If you could look at my site, and see if you recognise the errors when viewing... if you could offer any suggestions on what might be going wrong, it would be greatly appreciated. My blog: http://www.moreblogsofroleplay.com/Venice/

Posted by: nyssa at June 29, 2005 07:58 AM



I think I have a good guess. The code that's inserted by (and, it appears, MTProtected) is PHP, not perl. It looks like that is not being parsed properely by the server.

Could you check in weblog config/preferences/archive preferences and see if File "Extension for Archive Files:" is html? If it is, you'll need to change it to PHP and do a site rebuild.

My apologies, as I'm a bit of a PHP fan, I'd set that for mine when I first got the account and hadn't given it a second thought.

Posted by: Meathe at June 29, 2005 10:24 AM



Okay, tried that and seemed to get a little bit further. Have set it so file extension for archive types is php.

Though unfortunately the main webpage was still being interpreted as html, so set the index template to save as index.php (not sure if this is right to do or not). going to www.moreblogsofroleplay.com/Venice yields still the un-interpreted php stuff. Going to www.moreblogsofroleplay.com/Venice/index.php shows it being interpreted properly but the formating etc all messed up. However if I sign in or submit password (Depending on which one I try) I get the following error:

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/moreblog/public_html/Venice/index.php:2) in /home/moreblog/public_html/Venice/typekey_lib.php on line 2

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/moreblog/public_html/Venice/index.php:2) in /home/moreblog/public_html/Venice/typekey_lib.php on line 2

Warning: Cannot modify header information - headers already sent by (output started at /home/moreblog/public_html/Venice/index.php:2) in /home/moreblog/public_html/Venice/typekey_lib.php on line 69

Any further thoughts/suggestions?

Posted by: nyssa at June 29, 2005 12:14 PM