Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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

#88 2005-09-08 13:20:53

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

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

#90 2005-09-08 14:12:47

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

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

#91 2005-09-08 14:24:29

igner
Plugin Author
Registered: 2004-06-03
Posts: 337

Re: ign_password_protect

@vasanth – I caught a minor bug in Manfre’s plugin last night, he’s updated it to address that issue. It is working in the 0.6.1 release.

You can also use <mem_profile var=“RealName” /> to return the real name, rather than the login value. Note that this may cause some hinkiness with the “remember” functionality, so you might want to do as Vasanth suggested and hide the inputs for name and email, unless you want them to be able to change those values, of course.

regarding the show_login issues, to show the “logged in as” message, you’ll want to add verbose=‘1’ to the tag; I got enough questions on how to suppress that content that I decided to suppress it by default, and just show the user name. Probably should have called that out in the announcement, sorry.

As for the other item – there’s a little hinkiness going on there courtesy of sleep deprivation…I just posted version 0.4.1 which should solve those problems. Note that this version will return an error message on failed logins or bad cookies (not always the case in the previous versions) – you can suppress this with hide_login=‘1’. I’ve tested, but not extensively, so let me know if you see any odd behaviour.


And then my dog ate my badger, and the love was lost.

Offline

#92 2005-09-08 14:45:57

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: ign_password_protect

Thanx for the info Jeremy. I noticed manfre’s release and I have the most recent version.

I was using manfre’s tags without using txp:mem_user_edit_form or txp:mem_change_pass_form tags. That was the reason it had failed. So, My bad.

btw. The download link isnt working for me.


“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

#93 2005-09-08 15:16:29

davidraine
Member
Registered: 2005-08-25
Posts: 15

Re: ign_password_protect

Great stuff. The fixes in 0.4.1 work well and return functionality as expected. Thank you.

I find the addition by Vasanth (ign_username) very useful and have started using it in other places – I’ll definitely keep that one! What are the chances of adding a function to get any of the logged-in users details, along the lines of txp:ign_user_details name=“email”…

While I’m here – what is the value of having an alternate database?

Offline

#94 2005-09-08 15:23:37

igner
Plugin Author
Registered: 2004-06-03
Posts: 337

Re: ign_password_protect

Great stuff. The fixes in 0.4.1 work well and return functionality as expected. Thank you.

glad to hear it. I mentioned to Manfre that I need to quit my job so I can get more sleep. that way all this free code I’m writing would have fewer stupid mistakes in it :)

I find the addition by Vasanth (ign_username) very useful and have started using it in other places – I’ll definitely keep that one! What are the chances of adding a function to get any of the logged-in users details, along the lines of txp:ign_user_details name=“email”…

Short term, I wasn’t planning on including a lot of profile support, since it’s present in mem_self_register, and I don’t see the value in duplicating efforts. If there’s enough demand for it though, I could add in some basic tags along those lines.

While I’m here – what is the value of having an alternate database?

it keeps things entire separate from the admin-side logins, so you can provide varying levels of access to individuals without giving them access to the back end. Particularly handy for community-type sites, where you want to allow individuals to register before letting them at protected content. make sense?


And then my dog ate my badger, and the love was lost.

Offline

#95 2005-09-08 16:11:53

davidraine
Member
Registered: 2005-08-25
Posts: 15

Re: ign_password_protect

I just need the username and email address, but am loathe to install mem_self_register as I don’t need any other functionality from there. Forgive me being a complete TXP newb, but is there a general way to get a row from a db table given that I have the username? I know php and mysql pretty well, but the structure of the TXP environment is unfamiliar.

I understand the seperate db now, good idea if you don’t want registered users to also be able to add content. Nice.

Thanks for your help.

Offline

#96 2005-09-08 16:36:52

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: ign_password_protect

David, I really wish I could help you. But I am a pure noob as far as PHP/MYsql is concerned. The hack that I provided was a result of Igner’s help and some experimentation on my part.

You will be able to achieve what you want by grabbing the latest version of <a href=“http://manfre.net/project/627/mem-self-register”>mem_self_register</a>.

I used <code><input type=“text” name=“email” value=”<txp:mem_profile var=“email” />” size=“25” class=“comment_email_input” tabindex=“3” /></code> and it works nicely. Infact with Manfre’s plugin is a must have. You will be able to do lotsa other things. I insist that you check it out.

If you still arent satisfied. Just hang on. Someone here will help you out.

Regards,
Vasanth

Last edited by creativesplash (2005-09-08 16:39:41)


“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

Board footer

Powered by FluxBB