Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter pipelineae

    (@pipelineae)

    You are a life saver, thanks mate!

    That’s exactly what I was talking about, cheers.

    Thread Starter pipelineae

    (@pipelineae)

    Thanks for the suggestion, but no. I’ve already looked through all the hooks and filters for it. I’m fairly sure it’s a function not a hook.

    Running a filter to manipulate the content before it is displayed is my backup plan. I was originally under the the impression you could define a tag which, when placed in a post’s content, would execute a defined code.

    I am however having trouble finding it again.

    Cheers

    Forum: Plugins
    In reply to: Ajax Login

    Use the function wp_loginout().

    It takes no variables, but it displays the login link if not logged in, and the logout if they are.

    From a cleanliness and upgrading perspective, you’re better off storing them in plugins. If you wanted to upgrade with a modded functions.php file, you’ve gotta copy any differences into your file or copy your changes out. With plugins, it’s just a straight upgrade.

    As for efficiency, I can see no difference logically.

    Look at it this way:
    If you put all the functions into categories, and then make a plugin for each category (ie: sorted by what they do), then you can easily enable or disable them as needed, without having to mod the functions.php file.

    From what your saying, it doesn’t sound like you want to change the password that wp generates a user. If you do, read above, otherwise, read this:

    The person above me is right, that’s where the function you’re looking for is. But instead of changing the value of $plaintext_pass, I’m guessing you’re more looking to alter the email that is sent out to them, then below the lines:

    $message  = sprintf(__('Username: %s'), $user_login) . "\r\n";
    	$message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
    	$message .= get_option('siteurl') . "/wp-login.php\r\n";

    Add:
    $message .= __('Whatever your message is goes in here') . '\r\n';

    Forum: Plugins
    In reply to: Help creating first plugin

    Since the form tag obviously has attributes set, are you using the correct quotes (ie: ” and ‘).

    You need to alternate them in php. Like this:
    echo '<form action="something.php">';
    However, if you try something like the following, php will error:
    echo '<form action='something.php'>';
    In the 2nd example, the parser gets to the second apostrophe and thinks the echo is finished, but there’s no semicolon so it errors.

    If you are left in a situation where you HAVE to use the same quote that you used to open the echo, escape it with the backslash, that way php knows to ignore it.
    echo '<form action=\'something.php\'>';is functionally the same as echo '<form action="something.php">';

    The same goes for any php function.

    Hope that helps.

    Forum: Plugins
    In reply to: Ajax Login

    You can easily put a login field anywhere you want..
    1) Logout then go to the login page (without ajax plugin).
    2) Take note of the form details (ie: action, method, input details – both hidden and visible etc).
    3) Create a form anywhere, make it look however you want but make sure it has the same details as the login one or it wont work

    All done, though obviously you need some html knowledge.

    As for the redirect – You have 2 options here:
    1) If you’re going to use the original login page, just send the variable to the page under the redirect_to name – eg:

    wp-login.php?redirect_to=wp-content/

    2) If you’re adding in your own login form, change the hidden input that’s named redirect_to to whatever address you want them sent to.

    The login form in it’s raw state can be found in wp-login.php around line 273.

    Forum: Plugins
    In reply to: Setup Top Level Admin Menu

    @dazzer

    Why would you set the unique identifier to __FILE__?

    Creating custom admin menus is really very easy.

    __FILE__ refers to the file that will handle the display of the admin page you wish to create. The submenu’s unique identifier is just a name that will be sent via GET to the page that handles it, hence why it has to be unique, and not __FILE__…

    Forum: Plugins
    In reply to: Ajax Login

    Have you tried it without the plugin?

    Unless set otherwise, most browsers don’t delete cookies once they are closed.

    I find on my install, I’m never logged out unless I actually physically log out, even if I turn off my computer.

    Naturally you could hack the source and change the life of the cookie to something smaller, like 3 hours.

    I’ve never used the ajax login plug before, but I don’t think this is an issue with it.

    Forum: Plugins
    In reply to: AJAX Calls – Security?
    Thread Starter pipelineae

    (@pipelineae)

    Nevermind.

    After a little fooling around, I managed to include admin.php properly from the plugin folder, without wp-config.php being not-found.

    That allowed me to use the auth_redirect() function, which securely checks the cookies ensuring the user is logged in before accessing the php file.

    Took a bit of thinking, but I finally got there.

    Thread Starter pipelineae

    (@pipelineae)

    Alright, thanks for the reply.

    I don’t know much about widgets really, so I guess I’m left with plan B: Make my own plugin based loosely off the mod I made that uses the widget. Oh well, shouldn’t take too long.

    Thanks again

Viewing 11 replies - 1 through 11 (of 11 total)