Psionicist

Morrus

Well, that was fun
Staff member
Got a question for you! (And for anyone else who might know).

I've had loads of people asking me if there was a syndicated version of my news. I used to just say "no", but there are so many people asking now that I'm considering looking into it.

What would be the best way to do this? I thought of using an includes file (http://www.enworld.org/news.inc for example) which people could easily use. Does that work OK from another server?

The main problem I see with that is that people would have to use an ASP pages rather than an html one. Not a big deal - they just rename their page to .asp instead of .htm or .html.

Alyernatively, is there a way I can include a code snippet they could put on a regular html page? Any advice appreciated! :)
 
Last edited:

log in or register to remove this ad

That appears to be a good idea, however you must rename the index.html file to index.asp or index.shtml (either is fine, normal html work in both versions) for the script to work. The user will not notice anything if they just use the www.enworld.org url, however you must probably rename some of your links to the frontpage to match the new name.

Then the actual code is (THIS WILL WORK)
Code:
[color=#FFFFFF]<!--#include file="news.inc"-->
you can also use a full url:
<!--#include file="http://www.enworld.org/news.inc"-->
[/color]
not (THIS WILL NOT WORK)
Code:
[color=#FFFFFF]<!-- #include file="news.inc" -->[/color]
(note that the only space in the above line should be in between "#include" and "file")

I recommend you to not not name the include file news.inc, but to inc_news.html, news.inc.html or antything with an .html extension. This is because normal web browsers cannot proceed .inc files so the user have to download the file to view it.
 
Last edited:

Oh. The above scripting language is known as SSI and there might be some servers not supporting the language. Here are some other versions that will work:

PHP (file need an .php extension):

<?php
include "http://www.enworld.org/file.inc";
?>

Javascript (file can use any extension, such as .html. Note that lots of people turn of javascripts because of the annoying things you can code with the language, such as popup loops):

:):):):):):):):) language="JavaScript" src="http://www.enworld.org/file.inc"></script>
 


I have to say, I'm not keen at all on the Slash/PHP-Nuke etc. style of web page. Gaming Report uses a system like that, and I find the site impersonal and cold. I also don't like that "Here's the first few sentences, click to read more" approach. It's all far too.... I dunno. Press-release-y. Automated-looking.

I think using the includes files is the way to go! :)
 

Btw, a note:

<!--include file="file.xxx"--> can only include a file in the current directory. <!--#include virtual="../../file.xxx"--> can include files from anywhere.
 

I'm a bit confused, now, Psionicist.

Can't I just have a file called news.inc and people could just include it in their asp pages with:

<!--#include file="http://www.enworld.org/news.inc"-->

Like you said?
 

Morrus said:
I'm a bit confused, now, Psionicist.

Can't I just have a file called news.inc and people could just include it in their asp pages with:

<!--#include file="http://www.enworld.org/news.inc"-->

Like you said?

You can, but it's better to use a HTML extension. If I undestand this correctly, you want people to put your news on their site. This will work great if they put the above line of code in a HTML document, but if they only link to it from, say, a frame, the web browser will prompt you to download the file, not view it.

Try this:
http://psionicist.online.fr/stuff/incnews.html
http://psionicist.online.fr/stuff/news.inc

As you can see, it looks odd when you press the news.inc file. It will of course look perfectly if you include the file in an asp och shtml document, but in case you just want to put the thing in a frame, it will look odd.
 
Last edited:

If I didn't use includes, what would you ideal recommendation be? PHP-NUke or something similar?
 

I think Psi's just telling you to rename your include files news_inc.html so other sites can use it wholesale. I wouldn't bother, since they can either use the include file or link to your whole news page.
 

Remove ads

Top