ATutor

Learning Management Tools







Pages:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


Can you put php in a content page


  • 2010-08-02 15:27:23

    Can you put php in a content page

    I have 2.0 installed and I was wondering if it was possible to put php code into a piece of content.

    Situation: I have my content dir. in the root of my site (not a web accessible area). In a piece of content, I want to link to a page in the content dir. Normal html links don't seem to be working. So I'd like to do something like...

    [php] a href="<?php echo AT_CONTENT_DIR . '/path_to_file_in_content_dir'?>/file.html">file in content dir.</a> [/php]


    Or perhaps there's a better way to do this?

    Thanks.

  • 2010-08-02 15:36:36

    Re: Can you put php in a content page?

    Php in content would be to dangerous to allow.

    You should just have to use a relative path. If you have a folder in your file manager called images, the path to its file would be something like:

    images/someimage.jpg

  • 2010-08-02 16:05:06

    Re: Can you put php in a content page?

    Greg,

    The content I'm referring to is video content in an html file.

    Uploading all of this via file storage would probably be unrealistic as we're talking a lot of files and large files at that.

    Can I manually create a dir. in the content folder and use a relative path somehow?

  • 2010-08-02 16:13:15

    Re: Can you put php in a content page?

    By the way, my installation is in a sub dir. of my site, if it matters.

    Thanks.

  • 2010-08-02 17:03:19

    Re: Can you put php in a content page?

    Upload files to any Web accessible directory, then create Weblink content pages that points to them. See content editing in the handbook. Or use the [media] tag to link directly to media files.

    You can't link to files in file storage, not to be confused with file manager.

    A sub directory makes no difference

    [reply][b]In reply to:[/b]
    Uploading all of this via file storage would probably be unrealistic as we're talking a lot of files and large files at that.
    [op]forums/view.php?fid=7;pid=20479;page=1#20481[/op][/reply]

  • 2010-08-02 19:29:03

    Re: Can you put php in a content page?

    Greg,

    As a security measure, I was wanting to place the dir. with the video content outside of the web accessible area so that people couldn't just link to them directly.

    Clearly, files in the content dir. that are outside of the web accessible area can be accessed via the content pages. I just need to make that happen for my files. Is there a place that explains how this happens?

    Can't use the media tag because I'm linking to a html page that loads and plays an mp4.

    In my earlier post I meant [b]subdomain[/b] not [b]subdirectory[/b], if it matters. I also was referring to the file manager instead of file storage.


    Thanks for your thoughts.

  • 2010-08-03 15:49:18

    Re: Can you put php in a content page?

    I'll point you to the get.php file. You'd need to create yourself something that works like it does.