WordPress.org

Ready to get started?Download WordPress

Forums

PHP to WordPress (12 posts)

  1. JohnthePilot
    Member
    Posted 1 year ago #

    Hi Guys,

    We use WordPress to publish articles submitted by authors on our main forum. These are written in PHP and normally we can do a straight copy-and-paste, but when an author has used the [php][/php] code, whereas in vBulletin it shows as scrollable boxes, WordPress shows the code as straight text without any of the original formatting. Any ideas how to overcome this would be appreciated.

    Regards,
    JohnthePilot.

  2. JohnthePilot
    Member
    Posted 1 year ago #

    Having just seen the note below, here are the links to the two versions of the article in question.

    http://www.techsupportforum.com/forums/f214/secure-apache-web-server-663153.html

    http://www.techsupportforum.com/5369-secure-apache-web-server/

  3. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 1 year ago #

    try using one of the many syntax highlighter plugins such as http://wordpress.org/extend/plugins/crayon-syntax-highlighter/

  4. JohnthePilot
    Member
    Posted 1 year ago #

    Thanks cubecolour but that didn't resolve the problem I'm afraid.

  5. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 1 year ago #

    I'm not sure of exactly what you are trying to achieve.

    Can you explain in more detail?

  6. JohnthePilot
    Member
    Posted 1 year ago #

    If you look at the links in post #2 these should explain. The first link is as the author wrote it in vBulletin. The scrollable boxes are created by surrounding the text with the BB tags [php][/php] The second link shows what happens when the post is copied to WordPress.

  7. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 1 year ago #

    The first link only shows a forum login screen so I cannot see the example

  8. JohnthePilot
    Member
    Posted 1 year ago #

    That's strange because they are public forums. Anyway, I've uploaded images of the two pages with ImageShack. I don't seem able to preview the post so I hope they are OK.

    [URL=http://imageshack.us/photo/my-images/194/apacheserverinhtml.jpg/][IMG]http://img194.imageshack.us/img194/350/apacheserverinhtml.jpg[/IMG][/URL]

    [URL=http://imageshack.us/photo/my-images/687/apacheserverinwp.jpg/][IMG]http://img687.imageshack.us/img687/3291/apacheserverinwp.jpg[/IMG][/URL]

  9. JohnthePilot
    Member
    Posted 1 year ago #

    Were you able to see the difference in the two images above?

  10. michael.mariart
    Member
    Posted 1 year ago #

    The [php][/php] shortcode isn't a standard WordPress one. If it's in your system now you'll need to track down where it's being added into your site and work from there. My guess is that you don't have a PHP formatter set up in WordPress, where your forum software does.

  11. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 1 year ago #

    There may already be a plugin that can do this. There are several codes that are tagged with ' BBCODE' http://wordpress.org/extend/plugins/tags/bbcode one of those may be appropriate, but the BBCODE plugins I have seen tend to provide basic BBCODE formatting ( bold, italic etc) but not the more specialised codes like PHP

    If there is no syntax highlighter or bbcode plugin that already provides what you require, you need to write or commission someone to write a custom plugin.

    There's a tutorial for creating a syntax highlighter at http://wp.tutsplus.com/tutorials/plugins/adding-a-syntax-highlighter-shortcode-using-prism-js/

    This might work as a starting point - ie change the [ code ] shortcode to a [ php ] shortcode and maybe include some css rules to format the container element for the php code at a fixed height with overflow: auto to give you the code within a scrolling box

  12. JohnthePilot
    Member
    Posted 1 year ago #

    OK. Many thanks for your help.

Topic Closed

This topic has been closed to new replies.

About this Topic