WordPress.org

Ready to get started?Download WordPress

Forums

126

EzStatic Plugin (160 posts)

  1. Xyth
    Member
    Posted 10 years ago #

    Aww, man! Now I have to unkludge my handmade static pages.
    Seriously, worked great at 1.0 on a few pages, will test a few more. btw, it is not idiot proof yet, it didn't work at first, until I noticed that .html wasn't an option in the search path.
    idiot ---> Xyth

  2. usafdcc
    Member
    Posted 10 years ago #

    I take it that it is suppose to put the static page into the contents section. If that is the case it did not work for me. I installed it, and then activated it. I created an htm document. When I directed it to display the document I created the text was not situated in the content area but all over the page. I also tryed it with a php file.

  3. Xyth
    Member
    Posted 10 years ago #

    Ringmaster, I think your missing a division tag set: I manually added <div id="content"> at the top of my code and </div> at the end and all formating was fixed.

  4. debwire
    Member
    Posted 10 years ago #

    Which file did you put that in: the .html file or the existing index.php file? It already exists in my existing index.php file.

  5. debwire
    Member
    Posted 10 years ago #

    Thanks for clarifying Xyth!

  6. Xyth
    Member
    Posted 10 years ago #

    The .html file. The index.php remains unmodified. I created a .php file with no header or footer info, just tables and text. Also did a .htm file. .HTML is not a valid extension in this version, as it was not included in the search path, although it can be added.

  7. debwire
    Member
    Posted 10 years ago #

    I got it to work. I love this!

  8. Xyth
    Member
    Posted 10 years ago #

    I finally got around to validating XHTML 1.0 and noticed I had an extra closing tag </div> that wasn't needed. Looks like only the opening tag is missing. Sorry for the error.
    I suspect Ringmaster will edit the code to eliminate even the opening tag, but until 1.1, the work around seems valid.

  9. ringmaster
    Member
    Posted 10 years ago #

    Yeah, it was a quickie job, to be sure. About 40 minutes of coding and a rush to get it on-site before I left for a dinner engagement.
    If it's not working, I should mention that you need to have something close to the default index.php page. You need to have a div defined as <div id="content"> that contains your post content (duh) followed immediately by a div defined as <div id="menu">. The plugin basically cuts all of that out and replaces it with your static stuff. It should replace the content div, and if it's not, I'll need to fix that in 1.1. Everything the plugin writes should validate in the end - that is my goal.
    You can pretty easily add support for .html as an extension, and I'll include that in 1.1 too.

  10. Anonymous
    Unregistered
    Posted 10 years ago #

    What 1.0 seemed to do was take the index.php and cut out everything from and including the the <div id"content"> to the <div id="menu"> tag, putting back in the new content and the closing tags, but omitted adding back in the <div id"content"> tag.
    A great future enhacement would be the ability to add content between the head tags in addition to the content section. Some pages could use this, like adding temporary CSS info for that page only, or javascript.
    Great job.

  11. Xyth
    Member
    Posted 10 years ago #

    Bah, the post above is mine, forgot to log in.

  12. ringmaster
    Member
    Posted 10 years ago #

    What tags do you suggest that it capture from the source file for inclusion?
    Anything redundant (already appearing in the WP index.php) might have to be omitted - such as the Title tag. I could probably coerce the title into the page using Javascript, but I don't think I can remove the old title tag for technical reasons, and adding a second one would cause the page not to validate.
    I'll give it some thought before releasing the fixes in 1.1.

  13. ringmaster
    Member
    Posted 10 years ago #

    Ok, 1.1 is online.
    I fixed the div issue. You don't need to re-add this div to your own code.
    I added the ability to transplant the head from the static page to the WordPress output. It removes the <title> tag and uses Javascript to change the existing title based on the title in the static file.
    I added .html and .txt as static target files. If you didn't delete your license.txt from your WordPress install, you should be able to read it inside your WP template using:
    http://www.yourdomain.com/index.php?static=license

  14. chrisada
    Member
    Posted 10 years ago #

    same as Xyth

  15. ringmaster
    Member
    Posted 10 years ago #

    Oops. I zipped my test server code instead of the release server code.
    Try 1.1a for a copy with my debugging stuff removed.
    To use a title on the static page, you have to put the title in a head tag. You know, make a working HTML page with a title. EzStatic will take everything inside the head tag and put it in the head tag of your WP page.
    Here's an example of how it was designed to work, with links to the PHP source of the embedded page and XHTML checkers that show it's valid:
    http://www.asymptomatic.net/index.php?static=spin
    Of course, if you reference a file that doesn't have a <head> section then the head is not included. If you reference a file that does not have a <body> section, then it simply embeds the entire file. If you stick a <title> tag somewhere in a random text file, it does nothing - the <title> has to be in a <head> tag.
    Sorry I didn't make this clear before.

  16. RatFink
    Member
    Posted 10 years ago #

    Can't download the last versions of this or Adhesive, it requires authentication.

  17. Michiel
    Member
    Posted 10 years ago #

    Thanks for another great plugin! A feature request:-) It would be very handy to have the possibility to have the possibility to include static pages other than from the root directory.

  18. lazymonster
    Member
    Posted 10 years ago #

    ringmaster: i like you idea, i think it's brilliant, but sadly i can't use it as i modified the index.php too much :(

  19. Xyth
    Member
    Posted 10 years ago #

    Ringmaster, DL folder is still protected. The suspense is building....

  20. ringmaster
    Member
    Posted 10 years ago #

    It's always the stupid stuff that gets you.
    Files are unprotected.

  21. Xyth
    Member
    Posted 10 years ago #

    I have been unable to put an PHP include statement into the referenced file, even when the file has a .php extension. It seems to just ignore those lines. Everything else seems to work great. Assuming this plugin does not support php includes like <? include('showbook.php') ?> , and I'm doing something else wrong, It would be a nice feature.

  22. ringmaster
    Member
    Posted 10 years ago #

    I'm not sure what your issue is. Check out my sample. I changed it so that it uses an include to include a WP function.

  23. Xyth
    Member
    Posted 10 years ago #

    I was wrong, it is picking up the includes. If the include is simple text, it seems fine. I don't know enough about how wordpress works internally to know exactly what is happening, but I will explain the symptom and maybe someone will do some additional testing. I have several applications (a simple guestbook, Zfeeder, etc) that work fine in manually created static pages where I cut out everything in my index.php within the content division, and manually insert a php include statement in the empty content area. These pages work great. If I do the same thing using EZStatic, I get array errors, or nothing returned from the include. I'm guessing the difference is in how the final page is called (index.php ?static=newname.php, vs just linking to newnameplusindex.php)
    I know I'm not providing enough info to troubleshoot this, but there is atleast one other person getting the same error with Zfeeder if we use ezstatic, but no error in a manually created WP static page.
    I will try to find time this week to write a few simple routines that might give me more info to share with you.

  24. ringmaster
    Member
    Posted 10 years ago #

    How badass is ZFeeder? I'm looking for an RSS plugin anyway. If I'm convinced, I could troubleshoot it.

  25. ringmaster
    Member
    Posted 10 years ago #

    As it turns out, ZFeeder uses a ton of globals via includes, and doesn't encapsulate very well at all. I'll give you an example:
    A function contained in a file included by the main zfeeder.php, parseOpmlFile(), accepts an OPML filename parameter and returns a string value as a success result. In that function, it sets a global variable that is accessed by the main file. (This is kind of sloppy, IMO.)
    Because EzStatic includes the main ZFeeder file inside a function, the globals in the second-tier include aren't in the same scope as the main zfeeder.php file, therefore they can't be accessed correctly.
    This is a bug that should be reported to the ZFeeder folks, since they seem to be under the impression you can just drop their include statement anywhere and get working feeds. They should probably instead either return those global results by reference (that's kinda taboo in PHP, but doable), or return 'false' on error and the actual results on success, which is what most people seem to do.
    You might consider a different reader. Ever try FoF? That seems to work via EzStatic.

  26. Michiel
    Member
    Posted 10 years ago #

    Really a great plug-in! Is it somehow possible to display also static files that are not in the wp directory?

  27. ringmaster
    Member
    Posted 10 years ago #

    Yes, the latest version does this if you specify the path in addition to the file. For example:
    http://www.example.com/index.php?static=somepath/somefile

  28. Michiel
    Member
    Posted 10 years ago #

    Ok, indeed that seems to work! What about the following: I have my blog located in mysite.com/blog and some static HTML files in mysite.com/content. I am in the process of moving them to WP but that might take a while due to linking [yes... used front page:( ].
    I tried now: mysite.com/index.php?static=../content/file.htm but that does not seem to work. Any suggestions on this one?

  29. Xyth
    Member
    Posted 10 years ago #

    Zfeeder is pretty slick, so I will probably stick with it at the price of one manual static file to maintain after updates etc. Thanks for the great plugin, it will save lots of effort downstream.

  30. ringmaster
    Member
    Posted 10 years ago #

    Latest version (1.3) can include ZFeeder. Man, that was a task...
    Anyway, the links that ZFeeder makes are a little wonky when you use EzStatic, since it kills the querystring, which is what tells EzStatic to include ZFeeder in the first place. So, if you did use EzStatic to include ZFeeder, you would likely benefit from adding some stuff to your mod_rewrite rules that automatically added the required EzStatic querystring and appended the ZFeeder stuff to that.
    I leave this as an exercise for the reader. :)

126

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.