Log in

View Full Version : Very clever news ideas required



divtag33
09-05-2006, 02:43 PM
Ok here's the background - I need a genius to start me off:

I'm using several asp servers that will not allow php, mysql etc. However javascript, asp, xml etc are fine.

Every day we publish news to the main news site and, where relevant this is published to sub-newssites.

For example if I have the main server with general news and publish three articles, one on football, one on knitting and one on ducks - I then need to go to the sport server and just add the football article and so on...

This creates huge amount of work as you can imagine.

Now I'm trying to think of a clever way to do this where I can have a single page or source that I post news too and then each page accesses this and retrieves and displays only the relevant content.

Does anyone have any ideas/examples of how this could be done - given the technological constraints I've already covered?

Many thanks for any smart ideas! :)

mburt
09-05-2006, 02:50 PM
I use AJAX for this. I save all of my info in a .txt file. Seperate each information field by the "=" sign.

Take a look at this: (.js file)


function getFile(filename)
{ oxmlhttp = null;
try
{ oxmlhttp = new XMLHttpRequest();
oxmlhttp.overrideMimeType("text/xml");
}
catch(e)
{ try
{ oxmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{ return null;
}
}
if(!oxmlhttp) return null;
try
{ oxmlhttp.open("GET",filename,false);
oxmlhttp.send(null);
}
catch(e)
{ return null;
}
return oxmlhttp.responseText;
}

function getData(param){
return getFile('data.txt').split(param+'=', 2)[1].split('\n', 1)[0]
}

I could call this function like this:


<script type="text/javascript">
document.write(getData('variable1'))
</script>


and data.txt would be as follows:



variable1=This is variable one text
variable2=This is variable two text
myVar=this is the myVar text


So all you have to do is edit the .txt file.

Twey
09-05-2006, 02:59 PM
RSS is ideal for this sort of thing. All your pages can simply grab the RSS feed, and it has the added advantage of allowing your users to do so directly as well.

Unfortunately, I don't know ASP, so I can't help you implement it.