Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Quoting?

124

Comments

  • ok you seemed to ignore my post, and more importantly, the one by Karthick on the first page of this discussion. using his bit of javascript you get a button next to the block buttons and when you click on it, the text is placed into the comments box!
  • Ah, I must have missed it. Thanks timberford for pointing that out.
  • if you look back a few posts i postulated the same method. wasn't the blockquote tag deffered in xhtml 1.0? or am i going mad, it's been bothering me for ages. I can't remember why i stopped using it.
  • edited December 2005
    Timberford: I think I'd prefer an all-javascript solution (i.e. one that uses javascript to render the buttons instead of php).

    Then again, the all-javascript method wouldn't work very well with BBCode, unless I wrote an InnerHTML replacement (which I suppose I should do anyway, since it's not standard at all and apparently breaks with true XHTML).
  • edited December 2005
    planet-tolkien: I could argue that the difference between "blockquote" and "q" is presentational, and therefore the blockquote tag should be deprecated.

    If I did, however, I would be an idiot.
  • edited December 2005
    Bergamot: I am happy to use another solution if you feel you can get another one going that would be more suitable. Is there anyway of getting it working with the comment formatted as text?
  • It's pretty easy:
    1. Have a quote link linking to quote.php?id=4534535 or something
    2. Make it fetch it from the database and do it in "QuoteFormat" - something like bbcode with q- prefixed, like [q-b] which gets converted to your current format when you successfully post
    3. Fill the form with it
    4. Done
  • edited January 2006
    I got a mostly-javascript version working on 0.9.3. When you call quote(this), it adds the post to the comment text field. There is no database access, no need to store the post code, and it's easily modifiable to work with BBCode or another markup language. The only thing it won't do is add the quote links at runtime; I had to do that manually by modifying the templates. It should be pretty easy to make an extension out of it though. http://pong.uwstout.edu/forum/js/quote.js
  • edited January 2006
    I forget now who had the solution with pure JS. There were a lot of issues with it, one they included the function in every post (highly redundant) and they basically printed out the entire post into the JS (again, highly redundant and increases page load). I attempted to fix these things and use innerHTML, but that really screwed things up. Problems occur if: The user used bbcode, html, or had line breaks (the <br> would get put in as plain text) in their original post. The user quotes someone who was quoted. The quote tag gets mixed up. I haven't tried Bergamot's script yet but I wanted to mentioned some problems I have ran into. These problems became such a headache I disabled the quote button. I think the best way of handling quotes is to make a call to the database, that way you can get the unformatted text correctly. Since you have the ID you could use JS to make the DB call and then bring back the good stuff. I was going to attempt doing this with an AJAX solution, but fell short on time. I know you could make the argument that additional DB calls take time (perhaps more time than pure JS), but with AJAX I don't think it's an issue.
  • edited January 2006
    Yeah I wrote my own because: 1. InnerHTML isn't standard 2. InnerHTML doesn't work with strict XHTML 3. I wanted more control over which tags got serialized and which did not 4. I wanted it to support BBCode 5. I hate accessing databases if I can help it 6. I hate using AJAX if I can help it Right now, getting my grad school application in before the deadline is more important than making an extension out of my script, but sometime soon I'll give it a shot.
  • Bergamot, can I hug you?
  • Bergamot, any idea what kind of php extension file to use along with that?

    Thanks
  • edited February 2006
    EDIT: Fixed it
  • Anyone? This really is the only thing keeping it from being done.
  • edited February 2006
    Ok, finally got it!

    Extension for 0.9.3 revision 196 and above

    Extension for 0.9.3 revision 195 and below

    (I have no idea how to write 0.9.2 extensions)

    Give it a try and see if it works!

    Does not work on 0.9.2!!!!
  • works great for me =)
  • Awesome :) Which one were you using?
  • >=196
  • Cool, that's the one I hadn't tested :)
  • yep, like a charm

    thanks!
This discussion has been closed.