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.
Options

How to show PHP code in comments

edited December 2007 in Vanilla 1.0 Help
I've got the HTML Formatter add-on installed, but whenever I put bits of PHP within the <code> tags, they don't show up. Is there an add-on that will help?

Comments

  • Options
    edited December 2007
    HTML Formatter (or something else) strips out PHP code for security reasons. Same goes for JavaScript...

    Later...
    I think I misunderstood your question, did you set the format to HTML?
  • Options
    <em>did you set the format to HTML?</em> Not sure what you mean.
  • Options
    can you post some example of a code you want to be formatted?
  • Options
    edited December 2007
    <code><?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php the_content(); ?> <?php endwhile; endif; ?></code> -- Whenever I post the above code to my own forum, it comes up blank.
  • Options
    <em>did you set the format to HTML?</em>
    Not sure what you mean.
    Take a look at the comments box below mate, you have 2 options TEXT or HTML...
  • Options
    edited December 2007
    you could try to replace < by &lt; this sometimes works on some other forums
  • Options
    Take a look at the comments box below mate, you have 2 options TEXT or HTML...

    Right, I don't have those options in my own forum. And when I try to check the box for "Show the comment format type selector when adding comments", it unchecks itself.

    you could try to replace < by <

    Yes, but some folks are posting huge chunks of PHP, they'll probably not want to have to change all the brackets.
  • Options
    <code><?php echo "Hello world"; ?></code> produces:

    <?php "Hello world"; ?>
    if you have installed and enabled extension Html Formatter and you select Format comments as Html bellow the comment body input

    Here is copy&paste of your post from above formatted by Html formatter:
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php the_content(); ?> <?php endwhile; endif; ?>
    What's the problem? :-)
  • Options
    As I said above, even after installing & enabling HTML Formatter, there is no "Format comments as" option in my comment form.
  • Options
    The "Show the comment format type selector when adding comments" unchecks itself -- same problem as this guy:

    http://newwinnipeg.com/community/discussion/2118/
  • Options
    Can we see your forum?
  • Options
    http://www.darrenhoyt.com/forums/mimbo/
  • Options
    Sorry I dont' have time to really look into this, but it might have something to do with TinyMCE. Try disabling TinyMCE and see if that changes anything.
  • Options
    That worked great! Thanks Stash.
This discussion has been closed.