• Hello. I have a unique problem I want to solve.

    I have begun logging an IRC channel for a site of mine, and would like to post the logs as a page off the blog.

    The logging software dumps the HTML output of the logger to my a subdirectory of my site, ie. http://www.domain.com/irclogs

    The HTML files have the following structure:

    http://www.domain.com/irclogs/index.html
    http://www.domain.com/irclogs/2006-12-07.html
    http://www.domain.com/irclogs/2006-12-06.html

    where index.html displays a calendar which lets the user navigate to the desired day to view the log of. Each YYYY-MM-DD.html file is the log of that specific day.

    Now I would like to be able to access these in WordPress, ie, access them as pages from within wordpress, integrate them into the rest of the site etc.

    Is there any way I can read the contents of the index.html into a page, and then treat each of the daily log dumps as pages within WordPress?

    I’m sorry if it is a bit of a vague question – I will try to be more specific wherever I can!

    Thank you in advance for your help!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter caydel

    (@caydel)

    Ok, let me rephrase:

    I want to create a page template that reads in content from an external HTML file… ok, I can do that.

    Is there any way I can set it so that any links contained within the read in HTML file will also open in the same page template?

    ie, so I have a page template which reads in the index.php. I want to be able to click on a link to go to the previous month, and have that as well open within the page template… is this making any better sense?

    Bumping every 15 minutes is not productive. On the contrary… In this way you just successfully removed your post from the “no reply” topics queue where every helper starts when coming online.
    Patience is very much valued around here!

    Thread Starter caydel

    (@caydel)

    Moshu – it was not meant as an intentional bump – rather, I saw a few things about templates, and decided to rephrase my question in light of what I had just learned.

    Say… are you able to configure your web site so that directory browsing is ENabled on that directory with the logs in it?

    Thread Starter caydel

    (@caydel)

    yes, I alreaady have

    so, you could, arguably, include a link to the directory as part of your blog’s page navigation?

    (search here for the plugin “redirectify” to see where I’m headed)

    Thread Starter caydel

    (@caydel)

    ok, but I am not looking to redirect to an external page. I want to import this constantly changing dynamic directory so that they act exactly like part of wordpress.

    I can easily do what I need for the index.html file by using a custom page template and <?php include(‘irclogs/index.html’)?> or whatever in place of the blog post.

    The problem lies in that a new file for this is created daily. Perhaps even more often. And I can’t create a new page template with an include for every generated HTML dump.

    This doesn’t even get into the fact that I would be forced then to create a new page for every page template/html dump…

    Ideally, what I want to do is create a single page template which will pull in the index.html file. What I can’t figure out is where to go from there. I need it to work so that every link I click on in the index.html file opens the next file, again included into a WordPress page template again.

    This way, I don’t have to worry about updating these etc. across thousands of manual pages every time I make a minor update…

    Hmm. So, basically you want the hundreds of html files to act as a “database” so that they would be pulled into a WP Page template…

    Well, the page template creation seems to be something you’ve actually already done.

    So I’m wondering if there’s some way to use a cron job for part of the rest of it?

    And really, I don’t have any idea – just that it seems as if a cron job could dump stuff out to file for you, and perhaps then a “grab” in php (heh…. I’m not a programmer!) would pull that output into your page template. Which you would of course style using css….

    Just thinking….

    Thread Starter caydel

    (@caydel)

    moshu – for now. The software I am using dumps them to these files.

    Ideally, I want something that will create a IRCLogs->Year->Month->Day structure by automatically creating a new page in the database, and directly adding the information…

    Algorithm something like

    begin:

    If page.thisyear does not exist
    create page.thisyear
    if page.thismonth does not exist
    create page.thismonth
    If page.today does not exist
    create page.today

    while (notEnding){
    page.today.append(latestmessage)
    }

    I have a library to connect to and monitor the chatroom. So, I want to write a program which will use this library, and dump each line directly onto the end of the page for the day, and creating the heirarchy of pages as it needs to…

    I guess I will need to start looking into how to create pages via database manipulation…

    Does WP have an API?

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Include External HTML as Pages’ is closed to new replies.