morenews

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Inge Knudsen

    morenews

    I try to use MoreNews 1.0 to get the latest headlines on my website. I
    really like the script (http://mberg.buildafrica.org/morenews/ can be
    seen in action here: http://www.handystart.com/morenews/news.php )
    published under GPL, but there is a bug that is really annoying me. When
    there is a subscription site in the xml feed, the news-link below will
    be like:


    ....while it's supposed to be just:


    Has anyone done any work on this script, or is there a genuis that knows
    how to correct it? I have tried to make some modefications, but just
    can't make it right...

    Inge

    --
    This website is for sale! handystart.com is your first and best source for all of the information you’re looking for. From general topics to more of what you would expect to find here, handystart.com has it all. We hope you find what you are searching for!


  • Janwillem Borleffs

    #2
    Re: morenews


    "Inge Knudsen" <antispam@eyepu blish.com> schreef in bericht
    news:09Qtb.3927 6$os2.575740@ne ws2.e.nsc.no...[color=blue]
    >
    > Has anyone done any work on this script, or is there a genuis that knows
    > how to correct it? I have tried to make some modefications, but just
    > can't make it right...
    >[/color]

    I have had a quick look at it, and since it is reading the content from the
    <url /> element and copying it directly in the output, I don't regard it as
    a bug from the script but just as an alternative format of the URL in the
    feed.

    As far as I can see, you can just leave it as is, but when you really don't
    want it, you could try the following workaround to fix the URL's:

    Replace the characterData function in the class.morenews. php file with the
    following:

    function characterData($ parser, $data) {
    if ($this->tags[$this->cur_tag]) {
    if ($this->cur_tag == "URL") {
    $strpos = strpos($data, "http://c.moreover.com" );
    if ($strpos !== false) {
    $this->cur_val .= ltrim(substr($d ata, $strpos));
    } else {
    $this->cur_val .= ltrim($data);
    }
    } else {
    $this->cur_val .= ltrim($data);
    }
    }
    }


    HTH,
    JW




    Comment

    • Inge Knudsen

      #3
      Re: morenews

      Janwillem Borleffs wrote:[color=blue]
      >
      > I have had a quick look at it, and since it is reading the content from the
      > <url /> element and copying it directly in the output, I don't regard it as
      > a bug from the script but just as an alternative format of the URL in the
      > feed.[/color]

      The problem is that it messes up the wrong link. If you click on 'Exxon
      fined $11.8bn in gas row' here
      (http://www.handystart.com/morenews/n...siness+stories)
      now, you will be redirected to www.fortune.com....

      [color=blue]
      > As far as I can see, you can just leave it as is, but when you really don't
      > want it, you could try the following workaround to fix the URL's:
      >
      > Replace the characterData function in the class.morenews. php file with the
      > following:
      >
      > function characterData($ parser, $data) {
      > if ($this->tags[$this->cur_tag]) {
      > if ($this->cur_tag == "URL") {
      > $strpos = strpos($data, "http://c.moreover.com" );
      > if ($strpos !== false) {
      > $this->cur_val .= ltrim(substr($d ata, $strpos));
      > } else {
      > $this->cur_val .= ltrim($data);
      > }
      > } else {
      > $this->cur_val .= ltrim($data);
      > }
      > }
      > }
      >
      >
      > HTH,[/color]

      Sorry, still couldn't make it work...

      Thanks,

      Inge (is rather stupid when it comes to PHP)

      --
      This website is for sale! handystart.com is your first and best source for all of the information you’re looking for. From general topics to more of what you would expect to find here, handystart.com has it all. We hope you find what you are searching for!


      Comment

      • Janwillem Borleffs

        #4
        Re: morenews


        "Inge Knudsen" <antispam@eyepu blish.com> wrote in message
        news:e80ub.3942 1$os2.577326@ne ws2.e.nsc.no...[color=blue]
        >
        > Sorry, still couldn't make it work...
        >
        > Thanks,
        >[/color]

        Saw the problem, the fix is even easier:

        In the class.morenews. php file, extend the $tags array to match the
        additional elements:

        $this->tags = array( "ARTICLE" => 1,
        "URL" => 2,
        "HEADLINE_T EXT" => 2,
        "SOURCE" => 2,
        "MEDIA_TYPE " => 2,
        "DOCUMENT_U RL" => 2,
        "HARVEST_TI ME" => 2,
        "TAGLINE" =>2,
        "CLUSTER" => 2,
        "ACCESS_REGISTR ATION" => 2,
        "ACCESS_STA TUS" => 2
        );


        JW



        Comment

        • Inge Knudsen

          #5
          Re: morenews

          Janwillem Borleffs wrote:
          [color=blue]
          > "Inge Knudsen" <antispam@eyepu blish.com> wrote in message
          > news:e80ub.3942 1$os2.577326@ne ws2.e.nsc.no...
          >[color=green]
          >>Sorry, still couldn't make it work...
          >>
          >>Thanks,
          >>[/color]
          >
          >
          > Saw the problem, the fix is even easier:
          >
          > In the class.morenews. php file, extend the $tags array to match the
          > additional elements:
          >
          > $this->tags = array( "ARTICLE" => 1,
          > "URL" => 2,
          > "HEADLINE_T EXT" => 2,
          > "SOURCE" => 2,
          > "MEDIA_TYPE " => 2,
          > "DOCUMENT_U RL" => 2,
          > "HARVEST_TI ME" => 2,
          > "TAGLINE" =>2,
          > "CLUSTER" => 2,
          > "ACCESS_REGISTR ATION" => 2,
          > "ACCESS_STA TUS" => 2
          > );
          >[/color]

          Thanks, you're my hero :-) It now works perkect. I somehow tried
          something like that, but must have missed a tag or two.

          Thanks,

          Inge

          --
          This website is for sale! handystart.com is your first and best source for all of the information you’re looking for. From general topics to more of what you would expect to find here, handystart.com has it all. We hope you find what you are searching for!


          Comment

          Working...