Content last modified Monday 6 March 2017
hop to #bottom
Categories:
Author:
About It:
Rate it:
  • Helpful?
  • 0 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!

Self-register on a Textpattern site

This will simply add a bit of text and a link on the login page to let people know to register if they don’t already have a login.

(You can see it here on this site; if you are already logged in, you’ll need to log out to see the login page..)

If you’ve used Mod Self Register to make it possible for visitors to register themselves to add articles/edit your Textpattern site, you may find you’d like to add a bit of text on the login page, to let people know they can register on the site (and link them to the registration page). This is how I’ve been did mine:

  1. in your /textpattern directory, open up lang/en-gb.txt (or your other language files)
  2. add the following line (you may customize the text after the => ):

    need_a_login => Need a login? <a href="?event=register">Register</a>.
  3. open include\txp_auth.php and find
    function doLoginForm($message)
    and add
    tr(
    td().td(graf(gTxt('need_a_login')))
    ).
    
    in the proper spot so that the whole function turns out like so:
    // -------------------------------------------------------------
    function doLoginForm($message) 
    {
    global $txpcfg;
    include $txpcfg['txpath'].'/lib/txplib_head.php';
    pagetop('log in');
    echo
    form(
    startTable('edit').
    tr(
    td().td(graf($message))
    ).
    tr(
    fLabelCell('name').fInputCell('p_userid')
    ).
    tr(
    fLabelCell('password').
    td(fInput('password','p_password','','edit'))
    ).
    tr(
    td().td(graf(checkbox('stay',1,1).gTxt('stay_logged_in').
    popHelp('remember_login')))
    ).
    tr(
    td().td(graf(gTxt('need_a_login')))
    ).
    tr(
    fLabelCell('').td(fInput('submit','',gTxt('log_in_button'),'publish'))
    ).
    endTable()
    );
    exit("</div></body></html>");
  4. all done

Note: These instructions are in regard to Textpattern RC1 / RC2.. and though they’ll probably work with earlier versions of Textpattern, I expect they will not work for RC3.

Article Request Count:
Posted here:
03 Mar 2005
Article modified:
17 Mar 2005

Comments/questions? Leave a message in the form.

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Commented (2)

Jérémie:
Why is there a HTML table in that code ? Tsssk tsssk

Is there any option for an admin approval before a register user can post an article?

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.
Published with Textpattern