Skip to:
Content
Pages
Categories
Search
Top
Bottom

Replacing "You must log in to post" with login form

  • @richcon

    Member

    Is there any way to replace that “You must log in to post.” text that appears to non-logged-in visitors with a more friendly login / registration form?

    I’m a pretty skilled PHP coder and theme author, but from looking through the bbpress source that line seems to be hard-coded? I’m hesitant to start mucking with bbpress’s core files themselves (makes upgrading a pain), so is there any way to change that with a plugin?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • @neilogic

    Member

    I did have the same problem but in different context where I never wanted to dive into the code because the theme I was making was to be used by someone else and thus I just wanted the person place it and activate it and it should worked rather then him diving into the code and replacing the files.

    In the end what I did was , as BBPRESS 1.0+ supports the use of functions.php in theme files . so i just copied the function from the function.bb-template.php and changed the funciton name a bit and then replaced it in theme files.

    Example : like “You must login to post.” is in post_form function in function.bb-template.php file. I copied the function to functions.php in my bbpress template. renamed the function from post_form -> post_form_edited and made the replacements I wanted and then in my theme files where ever it was using the old function of post_form() i replaced it with my new edited function post_form_edited().

    like in your functions.php after you copy the post_form function and change it to post_form_edited you can find the line “__(‘You must log in to post.’),” and change it to anything you want. And use the new function in your theme. Like this you won’t have problems upgrading the bbpress installation too in future.

    then I dived in the theme files and replaced all the post_form() with post_form_edited() and voila it worked. But in my case I knew what I was using like the plugins and stuff and thus i tested it with everything first.

    I hope this helps you out . Some of the stuff I told above has been applied to the postform in http://forum.ubuntu-in.info.

    @spadilla

    Member

    I know this is way old but it helped me tons and I wanted to thank you neil!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar