Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 12:10:34 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155533 Posts in 21713 Topics by 7738 Members
Latest Member: Pattieardathfe
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Getting site to Validate  (Read 664 times)
PJW

Offline Offline

Posts: 31


« on: September 20, 2009, 09:57:33 PM »

Hi,

I hope this isn't the first of many posts on this subject, but I have a feeling it may be undecided

I'd like to get my site to validate (http://validator.w3.org/docs/help.html#validation_basics), and some of the modules are breaking validation.

One of the problems is (I think) with the News Reader module, generated links look like this in the code:
Quote

It's the alt="" part that the validator doesn't like, and I don't think this is normal in <a> links anyway?  I've looked through the newsreader PHP files, and removed some instances where it looked like alt was being inserted, but it hasn't made any difference, so I'm obviously missing something somewhere.

Any help will be much appreciated,
Paul
Logged

Paul
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2296



WWW
« Reply #1 on: September 20, 2009, 10:42:00 PM »

Never used the module myself, but..

Looks to me the output is generated in the functions.php.
Line 49 (function output) says:

Code: (line 49)
<a href="' . $nf['img_link'] . '" alt="' . $nf['img_title'] . '" title="' . $nf['img_title'] . '" target="_blank"><img src="' . $nf['img_uri'] . '" alt="' . $nf['img_title'] . '" title="' . $nf['img_title'] . '" border="0" /></a>

change that to:

Code: (modified line 49)
<a href="' . $nf['img_link'] . '" title="' . $nf['img_title'] . '" target="_blank"><img src="' . $nf['img_uri'] . '" alt="' . $nf['img_title'] . '" title="' . $nf['img_title'] . '" border="0" /></a>

and it should be over.

Ruud
Logged

Professional WebsiteBaker Solutions
PJW

Offline Offline

Posts: 31


« Reply #2 on: September 20, 2009, 11:01:09 PM »

Hi Ruud,

Thanks for your reply.  I have already completely removed that line a few days ago, it was generating a link to a non-existent image, and with the css style for images in the template I was getting a border with no image inside!

If you look at the code, it's referring to image (alt="' . $nf['img_title'] . '"), which would be fine, but I'm getting the alt in a normal URL link, which won't validate.

Other references to alt are in newsparser.php and preview.php, but I've taken it out of those files and it hasn't made any difference  rolleyes
Logged

Paul
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2296



WWW
« Reply #3 on: September 21, 2009, 08:56:45 AM »

Looking a bit deeper in the module it seems it is really a v0.1 version.   rolleyes

The ouptut expects an image to be present in the feed, but somewhere else in the code it is possible to skip images from loading.
(Note: I did not install the module, just trying to read the code here.)

Maybe someone reading this thread already has a better working version, or maybe someone likes to pick up this module and improve it a bit.

Ruud
Logged

Professional WebsiteBaker Solutions
PJW

Offline Offline

Posts: 31


« Reply #4 on: September 21, 2009, 09:24:29 AM »

Hi Ruud,

Thanks again for taking an interest.  As I mentioned, the images are not really an issue for me, I overcame that problem.

The issue I'm experiencing is that the code is inserting an alt="" ref in a normal <a href=""> link, where it should only have <a href="" title=""></a>.

BFN,
Logged

Paul
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2296



WWW
« Reply #5 on: September 21, 2009, 09:38:38 AM »

It seems that is done in the newsparser.php at line 414:
The "content" part is pre-built in there.

Code:
$this->output .= "\t\t" . '<li><a href="' . $this->item["link"] . '" alt="' . $this->item["link"] . '" title="' . $this->item["link"] . '" target="_blank">' . $this->item["title"] . '</a>';

Replace that one with:
Code:
$this->output .= "\t\t" . '<li><a href="' . $this->item["link"] . '" title="' . $this->item["link"] . '" target="_blank">' . $this->item["title"] . '</a>';

Ruud
Logged

Professional WebsiteBaker Solutions
PJW

Offline Offline

Posts: 31


« Reply #6 on: September 21, 2009, 01:15:15 PM »

Ruud,

Thanks.  As I posted before, I had already found that, and done as you suggest:
newsparser.php and preview.php, but I've taken it out of those files and it hasn't made any difference  rolleyes

It didn't make any difference last night, BUT, I think it might be a caching issue.  I've just gone back to the site I was working on last night, and the alt reference is gone.  Unfortunately I tried so many things last night I can't be certain which one has done it, however, when I was working on it then, nothing appeared to make any difference, and now it has.

I've just edited newsparser.php and uploaded it to a different site with the same configuration as the first site, and again, there's no difference (even if I forcibly refresh the page, clear cache. restart browser, try a different browser etc.).

However the fact that it is gone from the first site gives me hope that perhaps this is a server cache issue, so I'll try again later and/or through a different connection and report back my findings!
Logged

Paul
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2296



WWW
« Reply #7 on: September 21, 2009, 02:08:30 PM »

Ahh.. yes that will be the case.

The processed data is stored so the server will not need to call the XML feed on every pageload.

If you set the update_cycle (DE->Update-Turnus) to a low value (seconds) it should reload the data immediately.
The default value is set to 86400, meaning only once per day the content is refreshed.
Seems to me a bit high value anyway.

Ruud
Logged

Professional WebsiteBaker Solutions
PJW

Offline Offline

Posts: 31


« Reply #8 on: September 21, 2009, 05:22:35 PM »

Ruud,

Exactly so.  I changed the time to 60s, just to test this out and everything worked as expected.

Thanks for your help tracking this down  smiley

About to post about the next validation issue wink
Logged

Paul
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!