Designer? Programmer? Enthusiast? Join Open Designs Now!

Open Designs Forum » General Talk

Need help tweaking something in PHP

(6 posts)
  • Started 2 years ago by Ecko
  • Latest reply from uberlemurguy

Tags:

  1. Ecko
    Member

    So I found this framework called framefront (http://www.m1k3.net/playground/framefront/) which pretty much is a super simple frontend framework. What I want to do is to save all my content in text files, but using markdown syntax. So it loads the *.txt file and parses the markdown using PHP Markdown (http://michelf.com/projects/php-markdown/).

    Can someone help me get this working?

    check out the code @ pastebin
    http://pastebin.com/m22caac17

    Posted 2 years ago #
  2. uberlemurguy
    Moderator

    What part isn't working?

    I think you are giving the Markdown function the path to the file, you have to get the content of the file useing file_get_contents or something similar.

    Posted 2 years ago #
  3. Ecko
    Member

    The problem is that it displays the contents of the file, but its not parsing the markdown.

    Posted 2 years ago #
  4. pseudoxiah
    Member

    I think what he means is that it outputs the source code without compiling it. That is normal, file_get_contents treats a php file like a normal text file.

    I'm also in need of importing content from another file, precisely I want to output the contents of a wordpress installation on a different page in a different directory, is that possible?

    Posted 2 years ago #
  5. uberlemurguy
    Moderator

    you have to add the Markdown function to your template. Instead of include($content) use Markdown(eval('?>'.file_get_contents($content)))

    Posted 2 years ago #
  6. uberlemurguy
    Moderator

    @pseudoxiah
    you can just manually query the database.

    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in to post.