Tue 4th Jul 2006
Members Only Blog
Posted late in the morning, filed under Blogsome , Smarty Templates.I had a thought on the way home: how to make a blog that only registered users can see. Basically, it will use a similar method how the template decides whether or not to show the captcha. From the Blogsome site, and my comments.html:
{if $captcha_image_URL != "" && $blog_user_level == -1}
{$captcha_hidden_form_fields}
<p>
<input type="text" name="captcha_value_typed"><img src="{$captcha_image_URL}" align="center"><br>
Anti-spam measure: please retype the above text into the box provided.
</p>
{/if}
So, we should be able to use the following code:
{if $blog_user_level == -1}
This blog is members only. Please {wp_loginout}.
{else}
All content goes here.
{/if}
Of course, you’ll want do disable just anyone from registering, else it defeats the purpose of it…
I’ll try to test this on my test blog over the next couple of days.
am i first?
3 months, 4 weeks after the fact.
First what? Fuckwit who makes inane comments? Nah, you aren’t the first to do that.
Idiot.
3 months, 4 weeks after the fact.
Did you ever get round to testing this. I will have a play with it later but Im no coder so right now im not even sure which page I should put this in.
It would be handy for me as I want to setup a private blog for putting info in about a guide book im writing.
Cheers
Phil
9 months, 2 weeks after the fact.
Yeah, I think I got this working okay. I really don’t remember properly, since it wasn’t something I needed.
The code mentioned needs to go into the Posts.html template.
9 months, 2 weeks after the fact.
Where should I place the code ? In Post.html or Index.html ?
Thanks.
2 years, 1 month after the fact.