True-a-Day -- SSI/PHP Version
For more advanced webmasters, we also offer the True-a-Day feed in a format for servers set up for SSI and PHP. That way, the stories work even if your visitors don't have browsers capable of displaying javascript-generated content. SSI (Server-Side Include) allows your server to do the integration of the TAD feature with your page, rather than the end-user's browser. Weekly Weird News If this is confusing to you, just use the javascript version on the main TAD page -- it works for nearly everyone. Sorry, but we cannot help you implement this free feature on your server. Again with the default settings (plus centering), it looks like this (PHP): This is done by simply adding the line: <? readfile ("http://thisistrue.net/cgi-bin/tad.pl?ssi=1"); ?> to a PHP-based page. The "ssi=1" flag tells the True-a-Day application on our server to present its output in HTML, rather than javascript document.write calls. For pure SSI applications, the above invocation may or may not work -- the very common Apache web server's SSI function does not allow includes from remote servers unless you use PHP! It can easily be made to work, however, using a proxy on your server, which is great if you don't want to use PHP. Here's how:
Naturally, we don't have the resources to support all possible configurations, so you're pretty much on your own implementing these advanced versions of TAD. However, if you suspect a problem with TAD itself, we'd appreciate hearing about it. If you're interested in the technical background on how these advanced SSI topics work, see this article on the subject. Customization OptionsAs with the javascript version, you don't need to use any of these, but they are available to customize TAD's look for your site. Note the syntax is slightly different from the javascript version.
How to add the parameters to the script call: Include one or more, without spaces, after the tad.pl part. The first parameter is the "ssi=1" and must start with "?". Any additional parameters are separated with a simple "&". Example: A Note Regarding XHTML Validation Our tad.pl program outputs a stylesheet reference. While this works properly, it is technically not valid XHTML because it happens in your page's <body>, and may cause your page to fail to validate. If validation is a concern for you:
|
1 Comments on This Entry
All comments on this site are reviewed prior to being published. Spammers: don't waste your time. The posting criteria are simple: if a comment is worth visitors' time to read, it's approved. If not, it's not.
Posted by Matt (Florida) on June 26, 2011:
How do I fix it so that your apostrophes don't appear as odd glyphs on my browser (Firefox 4) I'm using the unmodified include virtual line.
---
That seems to be caused by the hosting site specifying a character set other than normal Roman characters. I do have an idea for fixing that in the long term, but it unfortunately means updating every story in the data base. It'll be a bit to write the routine to do that, and validate it, before it's applied to the live data base. -rc