Results 1 to 3 of 3

Thread: Very clever news ideas required

  1. #1
    Join Date
    Sep 2006
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Very clever news ideas required

    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!

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    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)

    Code:
    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:

    Code:
    <script type="text/javascript">
    document.write(getData('variable1'))
    </script>
    and data.txt would be as follows:

    Code:
    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.
    - Mike

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •