Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: ign_password_protect
> Anton wrote:
> hi, any ETA for the 0.4 version..? i’m so eager to try it out..also, do anyone have an idea of how to make just a selection of articles password protected? e.g if i want to have some articles subscribers-only and some not, how do i do it? all within the same section i mean. (override form..? but that destroys the listing/individual difference, doesn’t it?)
Anton…so I’m not sure if you got this one figured out, but like what others say…just create another form exactly like the one you use on the section, but just put the ign_password_protect tag around it. The only problem I’ve hit so far is that if you enable search, even though the article is password protected, it still comes up in the search results. I’m trying to figure out how to get around this, let me know if you manged to figure out this issue, or on that note if anyone else has got that one figured out.
Offline
Re: ign_password_protect
hi variaas, i think i’ll go with the category idea, that is having a category called “secret” or similar and use that to filter out/display one form or another.
Offline
#78 2005-09-05 00:32:48
- igner
- Plugin Author

- Registered: 2004-06-03
- Posts: 337
Re: ign_password_protect
I’ve mostly got it sorted out – was gonna write it up sometime this weekend, since some of the solution is dependent on features in the 0.4 release, most notably conditionals for logged / not logged state (though this can be partially emulated with the current version).
Assuming you’re using the protection tag at the section level (i.e. in the page template) here’s the solution in a nutshell -
in the search_results form use the following:
<blockquote><code>
<txp:if_section name=“name”>
<txp:ign_if_logged_in>
search output
<txp:else />
alternate output (or omit the else tag above to not output anything)
</txp:ign_if_logged_in>
<txp:else /> <!— else condition for if_section —>
search output
</txp:if_section>
</code></blockquote>
Of course, this only works if you’re protecting a single section. If you want to protect more than a single section, you’ll have to modify how if_section works…there’s a thread on how to do this on the forum if you search on it.
And then my dog ate my badger, and the love was lost.
Offline
#79 2005-09-06 09:26:09
- davidm
- Member

- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: ign_password_protect
I don’t know if this is adressed, but the DL link on textpattern.org is broken…
.: Retired :.
Offline
#80 2005-09-07 14:00:59
- igner
- Plugin Author

- Registered: 2004-06-03
- Posts: 337
Re: ign_password_protect
@davidm – fixed the dl link, thanks for the head’s up.
Anyway…after much teeth gnashing, late night coding, and many, many, many bugs squashed, others created and (hopefully) squashed once again…version 0.4 of ign_password_protect is hereby released to the world.
This version features a significantly re-written authentication mechanism, and more importantly, support for an alternate database. In addition, this version features a number of new tags:
<txp:ign_if_logged_in></txp:ign_if_logged_in> – conditional to test the state of the login, includes support for <txp:else />.
Accepts one parameter, privs.
<txp:ign_self_edit /> – displays a form to allow logged-in users to change their password.
Accepts the following parameters: class, title, onClick, size, tab, id
<txp:ign_page_privs /> – use at the top of a page to set page-wide privilege levels. Useful for enforcing privilege levels across multiple protected elements on a page, as opposed to specifiying privs on each element. Privs set on individual elements will override these global privs.
Accepts one parameter: privs
As always, any input is welcome.
[Edit]: Forgot to include the disclaimer:
This plugin is provided as is; side effects are generally mild. Test subjects complained of symptoms similar to those on sugar pills. Consult your webmaster before using this plugin. Frequent use of this plugin may cause the developer sleeplessness, headaches, and nausea.
Any similarity between this plugin and any other plugin, living or otherwise, is likely the result of blatant plagiarism.
And just like Carolyn Wheeler’s Birthday Present, this plugin is made entirely from the skins of dead Jim Morrisons.
Last edited by igner (2005-09-07 14:27:55)
And then my dog ate my badger, and the love was lost.
Offline
Offline
Re: ign_password_protect
Amazing!! Works flawlessley! An absolute “Dream Come True” ALL the way.
@the disclaimer- Crystal :)
“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”
— Albert Einstein
Offline
Offline
Re: ign_password_protect
variaas: it’s already been mentioned here in this thread. :) haven’t gotten the time to test it myself yet though..
Offline
#85 2005-09-08 04:20:11
- igner
- Plugin Author

- Registered: 2004-06-03
- Posts: 337
Re: ign_password_protect
@variaas – you can use that code snippet from abacus7 (credit where credit’s due, I just reposted his code to make it viewable), just put it on the search_result form.
BTW – for those that haven’t seen it, Manfre released version 0.6 of the mem_self_register plugin support for the alternate DB (and more juicy goodness than ever before!). Nice work, Manfre!
And then my dog ate my badger, and the love was lost.
Offline
#86 2005-09-08 10:44:48
- davidraine
- Member
- Registered: 2005-08-25
- Posts: 15
Re: ign_password_protect
@ign – fabulous plugin – many thanks.
Two problems for me right away – in the ign_show_login, the login_msg and logged_msg have stopped working. v0.3b1 showed the message at the top of the form if not logged in, v0.4 does not. In the same vein, v0.3b1 showed “logged in as <username>” when logged in but v0.4 just shows the user name…
Any help appreciated.
Last edited by davidraine (2005-09-08 10:45:50)
Offline
#87 2005-09-08 12:38:07
- davidraine
- Member
- Registered: 2005-08-25
- Posts: 15
Re: ign_password_protect
A request for a feature/addition, or instructions on how to do it…
I have comments wrapped in a ign_if_logged_in tag so that only logged-in users can post comments. I would like the comments box to default in my login name/email. Is there a way this can be done using the existing comments form?
Cheers
Offline
Re: ign_password_protect
I am not sure about the e-mail part of it. But i do have a solution to display the name inside a form..
Add this piece of code to your plugin (admin > plugin > ign_password_protect > edit)
<code>
function ign_username($atts)
{
global $ign_user;
extract(lAtts(array(
‘logged_msg’ => IGN_NOT_LOGGED_IN
), $atts));
$user = !empty($ign_user) ? $ign_user : ‘’;
return $user;
}
</code>
<br />
Add <code><input type=“text” name=“name” value=”<txp:ign_username />” size=“25” class=“comment_name_input” tabindex=“2” /></code> in the place of <code><txp:comment_name_input /></code>
if you want to hide the input box use <code><input type=“hidden” name=“name” value=”<txp:ign_username />” size=“25” class=“comment_name_input” tabindex=“2” /></code> instead of the above form.
I hope this will solve your problem partly!
Regards,
Vasanth
Last edited by creativesplash (2005-09-08 13:26:29)
“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”
— Albert Einstein
Offline
#89 2005-09-08 13:47:50
- davidraine
- Member
- Registered: 2005-08-25
- Posts: 15
Re: ign_password_protect
Thanks Vasanth – that works well for the name, though I need the email address to be able to submit the comment form.. Is there a way to get this using txp calls or do I need to query the db directly?
Offline
Re: ign_password_protect
You can use <code><txp:mem_profile var=“email” /></code> or something like that in <a href=“http://manfre.net/project/627/mem-self-register”>manfre’s plugin</a> to output a users profile (email, real name and pass individually) . It is compatible with this plugin. I just found out that it dint work for me. I have put a note in Manfre’s post. I’ll let you know how it goes.
Regards,
Vasanth
“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”
— Albert Einstein
Offline