Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 30

Thread: Writing My First Plugin

  1. #11
    Xarzu's Avatar
    Xarzu is offline Hello World
    Join Date
    Oct 2009
    Posts
    68

    Default

    Are there, in fact, two areas where a user can log in?

    I noticed that if a user clicks on "log in" from the home page, he goes to a page that looks something like this:
    http://i67.photobucket.com/albums/h292/Athono/login.jpg
    But if he clicks to respond to a blog, he goes to the bottom of the blog like so:
    http://i67.photobucket.com/albums/h2.../arguemax2.jpg

    Is this just a feature of my theme ("INove")?

    So what you are saying is that using a plugin is not the way to go.
    I am guessing that the best way to do this is to not use a plug in at all but to edit the comments.php page but, before I read this here, I played around with some plugins and I noticed that there seemed to be a collison between the plugin and the theme.

    So are we saying that currently there are limits to what a plugin should do and I should focus on editing the themes comments.php file?

  2. #12
    andrea_r's Avatar
    andrea_r is offline WordPress Rockstar
    Join Date
    Jan 2009
    Location
    Eastern Canada
    Posts
    1,325

    Default

    "But if he clicks to respond to a blog, he goes to the bottom of the blog like so:
    http://i67.photobucket.com/albums/h2.../arguemax2.jpg"
    That's normal. This is what shows for any user who is not logged in. If they were logged in, the box to leave a comment would look different.

    "I am guessing that the best way to do this is to not use a plug in at all but to edit the comments.php page"
    Yes. :D Three people have said that so far.

  3. #13
    Xarzu's Avatar
    Xarzu is offline Hello World
    Join Date
    Oct 2009
    Posts
    68

    Default

    Well, I have had some success thanks to this post. I have been able to add extra content to the comments.php file.

    Are there two areas where a user can log in?

    I have modified my theme. I have added a button to the comments.php so that when the user wants to add a comment and he is required to register or log in, he is given the option to click on a button (It is part of my design and requirements for my specific web design).

    Here is my question. Are there, in fact, two areas where a user can log in?
    I noticed that if a user clicks on "log in" from the home page, he goes to a page that looks something like this:

    http://i67.photobucket.com/albums/h292/Athono/login.jpg

    But if he clicks to respond to a blog, he goes to the bottom of the blog like so:

    http://i67.photobucket.com/albums/h2.../arguemax2.jpg

    One of the places can be modified by the comments.php page, where can the other area be modified?

  4. #14
    andrea_r's Avatar
    andrea_r is offline WordPress Rockstar
    Join Date
    Jan 2009
    Location
    Eastern Canada
    Posts
    1,325

    Default

    No, there's only the one login page. Even if you DO have the "must log in to comment" the user still will get redirected to the login form.

    that area you keep looking at to fill in the comment (at the bottom of the blog) is NOT a login.

  5. #15
    Xarzu's Avatar
    Xarzu is offline Hello World
    Join Date
    Oct 2009
    Posts
    68

    Default

    Quote Originally Posted by andrea_r View Post
    No, there's only the one login page. Even if you DO have the "must log in to comment" the user still will get redirected to the login form.

    that area you keep looking at to fill in the comment (at the bottom of the blog) is NOT a login.
    I am accustomed to the logic of a forum. Blogs are different, it seems. In order to post on a forum, you have to register. Are you saying that someone can post a comment on a blog without registering?

    If that is the case, I first need to know how to change that. In order to post a comment on my blog, I must insist that the person registers.

    How do I do that?

    They seem to be tied together somehow. I tried a plugin for captcha (it did not work for my theme) that included these screen shots:

    http://i67.photobucket.com/albums/h2...reenshot-1.jpg
    http://i67.photobucket.com/albums/h2...reenshot-2.jpg

    Can you include the wp-login.php in a theme just like you can for the comments.php or do you need to use a plugin?
    Can you force the user to register if they want to post a comment on your blog?
    If they register, does that mean that they can create new blogs just like the blog author?
    What is the difference between signing up to post a comment and registering to login?
    Last edited by Xarzu; 02-27-2010 at 06:44 PM.

  6. #16
    andreasnrb's Avatar
    andreasnrb is offline Kegger
    Join Date
    Jun 2009
    Posts
    594

    Default

    Are you saying that someone can post a comment on a blog without registering?
    Not to insult or anything but have you actually visited a blog and tried to comment? It seems you need to learn what a blog is and what it is used for. Your doing a lot of customizations there needs to be a reason for it. Maybe there are better solutions to the problem you are trying to solve? And by problem I don't mean registration.
    What are you trying to do with your website? Create a members only site. sell content etc?

    If that is the case, I first need to know how to change that. In order to post a comment on my blog, I must insist that the person registers.
    How do I do that?
    You use various wp functions.
    PHP Code:
    <?php if(is_user_logged_in()):?>
    comment form goes here
    <?php else: ?>
    You must register to comment. Link to register form or include one here.
    A login form.
    <?php endif; ?>
    The register code you can get from either the wp-login.php or some other plugin. Login for likewise.
    Can you include the wp-login.php in a theme just like you can for the comments.php or do you need to use a plugin?
    You would need to make a custom solution.
    Can you force the user to register if they want to post a comment on your blog?
    Yes but mostly you don't because its annoying as hell and people wont do it.
    What is the difference between signing up to post a comment and registering to login?
    Signing up is the same as registering. Sign in is the same as login. In order to be able to login you must have a user account and to get a user account you need to register.

  7. #17
    andrea_r's Avatar
    andrea_r is offline WordPress Rockstar
    Join Date
    Jan 2009
    Location
    Eastern Canada
    Posts
    1,325

    Default

    Are you saying that someone can post a comment on a blog without registering?
    Yes, that's exactly what I'm saying.

    If that is the case, I first need to know how to change that. In order to post a comment on my blog, I must insist that the person registers.
    Don;t bother with Andreas' code above - you don;t NEED to code anything. Visit the backend of WordPress, in the admin area. Go to the Settings menu, and pick the Discussion submenu. There's a checkbox there called "must be registered to comment". Click it & save.

    Everything will happen automatically. The user will be told to register to leave a comment, and will be directed to the signup page. This looks exactly the same as the login page, because it IS the same page.

    Can you include the wp-login.php in a theme just like you can for the comments.php or do you need to use a plugin?
    The login page is outside of any theme. There are plugins available to make it look different.

    http://wordpress.org/extend/plugins/...gin+page&sort=

    If they register, does that mean that they can create new blogs just like the blog author?
    No, not unless you are using WordPress MU. Wordpress is a single blog, with many posts. Users who sign up in WordPress have various levels. They only need Subscriber level to leave comments while logged in. They have to have a higher level (set by you) to be able to write posts on the blog.

    Visit the front of this site (wptavern.com) and look at the blog. Now read any entry from the front page and notice the comment area. Look at how it is different than this area, which is the forum.

  8. #18
    Ryan's Avatar
    Ryan is offline WordPress Legend
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    2,797

    Default

    Quote Originally Posted by andrea_r View Post
    The login page is outside of any theme. There are plugins available to make it look different.
    Alternatively, you can include the login form on another part of the site. IIRC there is a default widget which allows you to do this.

    You can also register members from the front-end as well rather than sending them off to some foreign looking administration panel.

  9. #19
    Xarzu's Avatar
    Xarzu is offline Hello World
    Join Date
    Oct 2009
    Posts
    68

    Default

    Good advice, andrea and others.
    I took the advice to require users to log on in order to post.

    This takes things in a different direction. And I have a new set of questions. To begin with, I noticed that when I set thing up this way, the blog uses the term "Log in" instead of "Register" (I wonder if this has something to do with cookies. Does the server check to see if a user has already Registered and thus he is told to log in rather than Register?). Why is the user prompted to Log In instead of Register?

    I experimented by deleting my cookies first and I noticed that it still says to Log In and the user is sent to the log In page. How do I send a new user to a Registration Page instead of a Log In page?

  10. #20
    andrea_r's Avatar
    andrea_r is offline WordPress Rockstar
    Join Date
    Jan 2009
    Location
    Eastern Canada
    Posts
    1,325

    Default

    I noticed that when I set thing up this way, the blog uses the term "Log in" instead of "Register" (I wonder if this has something to do with cookies. Does the server check to see if a user has already Registered and thus he is told to log in rather than Register?). Why is the user prompted to Log In instead of Register?
    Yes, because you checked that box. so it just assumes the person leaving a comment has registered but hasn't logged in.

    Even if there's not a register link, that's fine - as they will be directed to the login form, where there is a register link. So, if they go to login & haven't registered, they will be directed to do so.

    The login page is the same page as the register page.

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •