• Resolved nemo-maritime

    (@nemo-maritime)


    I was wondering how I can add text to a comment after it has been submitted. Kind of like a signature. What I want is to have the comment field look normal when someone is posting, and have the text field empty at first. Then after they post the comment, a block of text would be automatically added a paragraph or two below their comment, but in their comment area. If that makes sense. So have the comment field empty when someone is typing, and after they submit their comment, a block of text gets added a line or two below their comment text, but still in the same comment.

Viewing 15 replies - 46 through 60 (of 60 total)
  • Nice, will take a look in a couple hours. Took a glance and it’s going to be fun seeing what you did. Already have a question or two so I may post back again. ??

    Good point on the user_level. Woops.

    Re: Session and token bits. Explain a little? I’m in the dark on this one.

    Re: Sanitization – Like running it through wp_filter_kses? Was just reading an old thread on that today. My question is how much sanitization does update_options do?

    Sessions and tokens just help make sure the submissions are valid by storing some information inside the session and form (tokens), these will only match once, so this makes it alot harder for cross-site-scripts to exploit etc..

    Sanitizing data is important though, again this just ensures no naughty code is plonked into the form…

    You can do that any number of ways, but you have to decide what can and can’t be put in the field before you go invalidating submissions..

    preg_match, strip_tags…etc.. it all depends what level of filtering you want…

    Yes like filter_kses … (i’ve not used that one, though did actually find a page on that the other day)…

    I’ll send you the plugin i’ve been playing with if you want something to toy with, if you like… (it’s a bit of a mess, but it’s been a learning experience, and the jquery was quite fun to)…

    I’m still learning to… ??

    Yep please send. I just like to read through the code and tinker around with stuff. ??

    Ok, going to be cryptic with the link here, and i’m only going to keep it active a little while…

    I don’t want this link found by bot spiders and the like, so please don’t post the decoded link… it’ll be down soon anyway…

    Take the following…

    aHR0cDovL3d3dy50MzFvcy5jby51ay93cC1jb250ZW50L3VwbG9hZHMvc25pcHBldHMucmFy

    Use PHP and run base64_decode on that string….

    You’ll then have your link.. ??

    Got it, you can shut it off. Thanks.

    Okies ?? …

    Be as critical as you like with it…. i’m dying for some feedback, since it’s a constantly ongoing project….

    Was intending to release the plugin for others soon, but i’ve not had time to work out the final bits and pieces just yet… (spending too much time here)… ??

    Want me to post to your site once I have a chance to look at it? Or keep it in this thread?

    I don’t mind mate, whichever you prefer… ?? here is good..

    Finally getting a chance to pick this back up. Hey t31os (or anyone else reading)…

    So we can grab the user agent a comment was made from with $comment->comment_agent.

    BUT, I don’t see anything similar for a post. Am I missing it?

    What exactly are you after? I’m still reading.. ??

    Well, something like post_agent. Except that doesn’t seem to exist. On the comment side of things, WordPress stores the user agent that was used when the comment was published (obviously, since you and I have been working with this).

    Buuuuuut, I can’t find anything similar for a post. Obviously we can grab the user agent of a user, but I just figured if we had a comment_agent we’d have a post_agent or something similar.

    Otherwise I’m stuck needing to write a function(s) that detects an author’s user_agent at the time of post publish and stores that information in connection with the post, right?

    P.S. – Started looking at your plugin code. It’s really a pretty interesting concept, though some of it is way over my head yet. Still picking through it, though. ??

    No there doesn’t appear to be anything in the post’s table that stores the user agent..

    I’d at least recommend if you’re going to hook a function to post publish that you use a seperate DB table. Otherwise you’d have to modify the posts table, and i’d say avoid doing this where possible, just to keep things simple if the person using the plugin wants to remove it, they’ve not got to drop additional columns or work with a modified post table.

    RE: the plugin
    It’s admittedly not all my work, it’s a mod of the connections plugin, but i’ve changed quite a bit… it’s been fun playing with it…

    Any suggestions? General comments? … bugs?

    Haven’t actually installed it yet, just opened it in my code editor and spent some time looking at the functions. I hadn’t even looked at our plugins in over a week. Been too busy.

    But I’ll be trying it out this weekend.

    For those that come across this thread and are looking for this functionality, I developed a small plugin to append user-defined text to comments made from a mobile phone.

    The plugin is called Mobile Comments Signature, and can also be downloaded at the Mobile Comments Signature plugin page on my website.

    help I have the wrong post on the front page and need to know how to fix that on the free wordpress blog.

Viewing 15 replies - 46 through 60 (of 60 total)
  • The topic ‘Automatically adding text to comment after comment is submitted’ is closed to new replies.