473,323 Members | 1,560 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

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:
http://www.latimes.com/services/site...pl?x102503623&

....while it's supposed to be just:
http://c.moreover.com/click/here.pl?x102503623&

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

--
http://www.handystart.com/

Jul 17 '05 #1
4 2084

"Inge Knudsen" <an******@eyepublish.com> schreef in bericht
news:09********************@news2.e.nsc.no...

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...


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($data, $strpos));
} else {
$this->cur_val .= ltrim($data);
}
} else {
$this->cur_val .= ltrim($data);
}
}
}
HTH,
JW


Jul 17 '05 #2
Janwillem Borleffs wrote:

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.
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....

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($data, $strpos));
} else {
$this->cur_val .= ltrim($data);
}
} else {
$this->cur_val .= ltrim($data);
}
}
}
HTH,


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

Thanks,

Inge (is rather stupid when it comes to PHP)

--
http://www.handystart.com/

Jul 17 '05 #3

"Inge Knudsen" <an******@eyepublish.com> wrote in message
news:e8********************@news2.e.nsc.no...

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

Thanks,


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_TEXT" => 2,
"SOURCE" => 2,
"MEDIA_TYPE" => 2,
"DOCUMENT_URL" => 2,
"HARVEST_TIME" => 2,
"TAGLINE" =>2,
"CLUSTER" => 2,
"ACCESS_REGISTRATION" => 2,
"ACCESS_STATUS" => 2
);
JW

Jul 17 '05 #4
Janwillem Borleffs wrote:
"Inge Knudsen" <an******@eyepublish.com> wrote in message
news:e8********************@news2.e.nsc.no...
Sorry, still couldn't make it work...

Thanks,

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_TEXT" => 2,
"SOURCE" => 2,
"MEDIA_TYPE" => 2,
"DOCUMENT_URL" => 2,
"HARVEST_TIME" => 2,
"TAGLINE" =>2,
"CLUSTER" => 2,
"ACCESS_REGISTRATION" => 2,
"ACCESS_STATUS" => 2
);


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

--
http://www.handystart.com/

Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Darius Blaszijk | last post by:
Hello, I have the following problem; In my application I have certain items that have properties. Item Property --------- -----------------------...
4
by: Mario | last post by:
Hello everybody, Does anybody know how i make a script to make a poll? I mean a small poll when you can choose yes or no? -- -------"""------- ---()--- °?----(_)-----?° | Greetz Mario|
5
by: Craig Keightley | last post by:
Please help, i have attached my page which worksin IE but i cannnot get the drop down menu to fucntion in firefox. Any one have any ideas why? Many Thanks Craig ...
5
by: logicgates | last post by:
Dear fellows i have a problem in bulding a content switching script .. i dont know what exact word should be used for that i have a link which contains the example..i want to make the same as there.....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.