Jump to content


Photo

Etomite parsing fails after putting in a listing of social bookmarks


  • Please log in to reply
15 replies to this topic

#1 Christiane

Christiane

    Etomite Forum Fan

  • Member
  • Pip
  • 124 posts

Posted 07 September 2009 - 08:06 AM

I've written a little snippet, which is creating some links to social networks with the calling URL.
Previously I've tested my whole site with "Markup Validation Service" and some other tests and passed.
After putting in the snippet, obviously all seems all right and all is shown in usual manner when i'm calling pages via browser.
But inside etomite i get heavy parsing errors on most pages. Testing with "Markup Validation Service" i get the messages:

The following notes and warnings highlight missing or conflicting information which caused the validator to perform some guesswork prior to validation. If the guess or fallback is incorrect, it could make validation results entirely incoherent. It is highly recommended to check these potential issues, and, if necessary, fix them and re-validate the document.

1.

Warning Unable to Determine Parse Mode!

The validator can process documents either as XML (for document types such as XHTML, SVG, etc.) or SGML (for HTML 4.01 and prior versions). For this document, the information available was not sufficient to determine the parsing mode unambiguously, because:
* the MIME Media Type (text/html) can be used for XML or SGML document types
* No known Document Type could be detected
* No XML declaration (e.g <?xml version="1.0"?>) could be found at the beginning of the document.
* No XML namespace (e.g <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">) could be found at the root of the document.

As a default, the validator is falling back to SGML mode.
2.

Warning No DOCTYPE found! Checking with default HTML 4.01 Transitional Document Type.

No DOCTYPE Declaration could be found or recognized in this document. This generally means that the document is not declaring its Document Type at the top. It can also mean that the DOCTYPE declaration contains a spelling error, or that it is not using the correct syntax.

The document was checked using a default "fallback" Document Type Definition that closely resembles "HTML 4.01 Transitional".

Learn how to add a doctype to your document from our FAQ.
3.

Info No Character encoding declared at document level

No character encoding information was found within the document, either in an HTML meta element or an XML declaration. It is often recommended to declare the character encoding in the document itself, especially if there is a chance that the document will be read from or saved to disk, CD, etc.

See this tutorial on character encoding for techniques and explanations.


I especially don't understand, that the snippet e.g. is running on the entrypage "Home" with passing "Markup Validation Service", but is failing by parsing error also in etomite by calling the editor on the most other pages, while they are passing all tests and running well without that snippet. :wacko:
And it seems, that my text-to-speech tool is failing in result of that parsing errors (that was my first hint reffering to a heavy malfunction).

// Initialisierung
$output = "";

// URL bestimmen
$id = $etomite->documentObject['id'];
$url = $etomite->makeURL($id);

// URL anpassen
$url = str_replace(":", "%3A", $url);
$url = str_replace("/", "%2F", $url);

// Titel und Beschreibung auslesen
// $id             = $etomite->documentObject['id'];
$tbl             = $this->dbConfig['dbase'].".".$this->dbConfig['table_prefix']."site_content";
$sql             = "SELECT pagetitle, description FROM $tbl WHERE $tbl.id = $id";
$query             = $etomite->dbQuery($sql);
$result         = $etomite->fetchRow($query);
$title             = $result['pagetitle'];
$description         = $result['description'];

// Titel und Beschreibung bereinigen
$signs             = array("," => "", ";" => "", "." => "", ":" => "", "-" => "", "!" => "", "?" => "");
$title          = strtr($title, $signs);
$description          = strtr($description, $signs);

// Titel und Beschreibung in TextArray umwandeln
$titleArray         = explode ( ' ', $title );
$descriptionArray     = explode ( ' ', $description );

// TextArray wieder zu Titel und Beschreibung umwandeln mit + als Trenner
$title             = implode ( '+', $titleArray );
$description         = implode ( '+', $descriptionArray );

// Anhang zusammenstellen
$suffix = "Pieces-of-Poetry%3A+".$title."+-+".$description;

$output .= "<ul class='socialNetworks_ul'>\r\n";

$output .= "<li class='socialNetworks_li'>\r\n";
$output .= "<a title='Externer Link zu Twitter' href='http://twitter.com/home?status=".$url."' target='_blank'>\r\n";
$output .= "<img class='socialNetworks_img' src='templates/images/SocialNetworks/twitter.gif' width='16' height='16' border='0' hspace='0' alt='Twitter' title='Externer Link zu Twitter' />\r\n";
$output .= "</a>\r\n";
$output .= "</li>\r\n";
.
.
.
$output .= "<li class='socialNetworks_li'>\r\n";
$output .= "<a title='Externer Link zu Yigg' href='http://www.yigg.de/neu?exturl=".$url."&amp;exttitle=".$suffix."' target='_blank'>\r\n";
$output .= "<img class='socialNetworks_img' src='templates/images/SocialNetworks/yigg.gif' alt='Yigg' title='Externer Link zu Yigg' align='left' border='0' height='16' hspace='0' width='16' />\r\n";
$output .= "</a>\r\n";
$output .= "</li>\r\n";

$output .= "</ul>\r\n";

return $output;


Edited by Christiane, 07 September 2009 - 08:07 AM.


#2 Cris D.

Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts

Posted 07 September 2009 - 08:47 PM

Do you have a link to the URL where we can see this error? Or can you post some source code from the page? I'm not really sure what you are describing. It seems straight forward, until you start talking about edit areas which makes me think you are trying to validate within the manager (a bad idea). Therefore, unless someone else understands what this post may be referring to, I personally will need further clarification regarding what exactly is going on.

Best guess: Most snippets do not have the ability to remove a doc type from a template unless the whole snippet is throwing an error and the error is being read by the validation markup service as the first few lines of the html page. However, if this is the case, then the snippet is clearly broken and no amount of markup will fix the page untill the snippet no longer throws errors. Have a look at your source code and see if the snippet is throwing an error that is being hidden by your template. If so, identify the line number in the snippet where an error should be fixed.

#3 Christiane

Christiane

    Etomite Forum Fan

  • Member
  • Pip
  • 124 posts

Posted 08 September 2009 - 10:14 AM

Hi Chris,

I did not validate within the manager, but my attempt to edit the concerning page in Etomite ended with a parsing-/SQL-Error.

I activated the snippet below http://www.pieces-of-poetry.com/
You can find it at the bottom of each content field below the headline "Social Networks".
The links, where you can directly test the pages with a validator will be also find at the bottom below the index on the left side.

e.g.
The validation of http://www.pieces-of-poetry.com/ or http://www.pieces-of...m/PoP_Home.html passes the test
Either the validation of http://www.pieces-of...om/PoP_FAQ.html or others fails the test or calling the page sometimes stops with « Execution of a query to the database failed »

The code around the snippet:
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
.
.
.
</head>

<body>
.
.
.

<div id="contentFrameBox" class="backgroundBox">
 <div id="decoBoxOrnamentContent" class="backgroundOrnamentBox"></div>
 <div id="contentBox" title="[*longtitle*]">
  <p><a name="skipHeader"></a></p>
<script type="text/javascript" src="http://vozme.com/get_text.js"></script>
  <dfn title="JavaScript"><span style="font-size: 20px; color:#ff0000; font-weight:bold;">&diams;</span></dfn>
  <a href="http://wr.readspeaker.com/webreader/webreader.php?cid=9ac5f83384335c5f71cf60e266407a5a&amp;t=web_free&amp;title=readspeaker&amp;url=" onclick="readpage(this.href+escape(document.location.href),1); return false;">
   <img src="http://media.readspeaker.com/images/webreader/listen_de_de.gif" style="border-style: none;"  title="Vorlesen mit webReader" alt="Vorlesen mit webReader" />
  </a>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <dfn title="JavaScript"><span style="font-size: 20px; color:#ff0000; font-weight:bold;">&diams;</span></dfn>
  <dfn title="Externer Link">&rarr;</dfn>
  {{Seitzeichen.html}}
  <div id="WR_1"></div>
  <!-- RSPEAK_START -->
   [*content*]
<hr />
<h3>Social Networks</h3>
[!PoPSocialNetworks!]
<p>&nbsp;</p>
  <!-- RSPEAK_STOP -->

 </div>
</div>
.
.
.
</body>

</html>


Please have a look in the next two days because my site is not really working with that snippet.

#4 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 08 September 2009 - 01:07 PM

Where is the suspect menu coming from and why isn't it being rendered dynamically...??? Some of those errors appear to be parser related but it's hard to say for sure without manager access... The snippet code above could be simplified... I'll try to modify it if I have time today...

#5 mikef

mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 08 September 2009 - 02:55 PM

what happens if you turn off visitor logging? its also failing on write to one of the logging tables; maybe these are getting too large?

#6 Christiane

Christiane

    Etomite Forum Fan

  • Member
  • Pip
  • 124 posts

Posted 08 September 2009 - 05:56 PM

@Chris:
As menu at the left I'm using [!ListMenu!] and [!Breadcrumbs!] in the middle of the top.
If you need manager access, please give me an mail adress to send for.

@mikef:
I've cleared log table

Edited by Christiane, 08 September 2009 - 05:59 PM.


#7 Cris D.

Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts

Posted 08 September 2009 - 08:58 PM

I think it's the use of the
$id = $etomite->documentObject['id']; This has issues when a page is cached.
The database error is shwing that the page id is blank.

Try
$id=$etomite->documentIdentifier; This is dynamically pulled from the class not the cache if it exists.
This also explains why it works on some pages and not others.


#8 Christiane

Christiane

    Etomite Forum Fan

  • Member
  • Pip
  • 124 posts

Posted 08 September 2009 - 09:48 PM

I think: Thats it :):Applause:

After changing code i got no parsing errors on some few tested pages. I'll try it in deep tomorrow.
If code is interesting for others i'll completely publish it together with css. Feedback is welcome.

Many many thanks for that well done job.^_^

Edited by Christiane, 08 September 2009 - 09:49 PM.


#9 cathode

cathode

    Loves Etomite Forums!

  • Staff
  • 663 posts

Posted 25 September 2009 - 07:21 PM

It may also be worth noting that this has been all done before: http://www.etomite.c...ocial bookmarks

#10 Christiane

Christiane

    Etomite Forum Fan

  • Member
  • Pip
  • 124 posts

Posted 26 September 2009 - 10:17 AM

@cathode:
Its not my intention to compete with you for the best or golden snippet price. :blink:

But after the second rebuke from your side ( http://www.etomite.c...ppet-tag-cloud/ ) i have to put you straight on one or two things.
Sometimes its a little bit hard to find the right snippet, which works in the wanted way. And if changes are to bulky or code is to incomprehensible for me, then its easier i try it for my own. And as i see, the way to realize some is always a bit different.
I retired some years ago. Therefore I've no benefit in publishing, to see my name written in so many places as possible. Publishing my snippets is my only way to give Etomite something back. But if Etomite project does not wish to live in diversity and the results of my work are not interesting for etomite i can spent the time for publishing and support in my own projects. :angry:

Nevertheless i wish you a good time to find similar duplicates and unnecessary stuff and in composing hints, that you've done it also before. B)

Edited by Christiane, 26 September 2009 - 10:27 AM.


#11 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 26 September 2009 - 02:02 PM

I don't think Cathode had ill intent with his comment, Christiane, and some of your comments were unwarranted... We quite often point members to previously created Snippets, primarily to give working examples from which ideas can be gleaned... I am forever looking at existing code and rewriting it with what I see as improvements... They don't all make it into the Snippet Library, however...

#12 Christiane

Christiane

    Etomite Forum Fan

  • Member
  • Pip
  • 124 posts

Posted 26 September 2009 - 02:59 PM

Maybe thats some of the issues are translation and interpretation problems, but i find it lower helpful, if a member tells me its "some pointless page decoration". Thats deprecative. As written in my posting the use of a snippet ever belongs to the point of view. I've written the "TagCloud"-snippet, because it has sense for me and my website. And i believed, it could be expedient to publish it at Eto.

If I've some trouble, help is welcome at any time and therefore i love this forum for its good founded postings. And refering to this i'm very glad and thankful about good comments. And if its common to refer to earlier developments, then thats a very good idea. But not with that words "this has been all done before". Also deprecative and totally turns me off.

Just professional web developers should be a little bit encouraging to not so versatile programmers.

If my criticism offended sensibilities, i beg for pardon.

Edited by Christiane, 26 September 2009 - 03:02 PM.


#13 cathode

cathode

    Loves Etomite Forums!

  • Staff
  • 663 posts

Posted 28 September 2009 - 08:47 PM

@cathode:
Its not my intention to compete with you for the best or golden snippet price. :blink:

But after the second rebuke from your side ( http://www.etomite.c...ppet-tag-cloud/ ) i have to put you straight on one or two things.
Sometimes its a little bit hard to find the right snippet, which works in the wanted way. And if changes are to bulky or code is to incomprehensible for me, then its easier i try it for my own. And as i see, the way to realize some is always a bit different.
I retired some years ago. Therefore I've no benefit in publishing, to see my name written in so many places as possible. Publishing my snippets is my only way to give Etomite something back. But if Etomite project does not wish to live in diversity and the results of my work are not interesting for etomite i can spent the time for publishing and support in my own projects. :angry:

Nevertheless i wish you a good time to find similar duplicates and unnecessary stuff and in composing hints, that you've done it also before. B)


I just want to make sure you've seen that there is another option. Don't be so easily offended, no one "rebuked" you.

#14 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 29 September 2009 - 03:27 AM

no one "rebuked" you.


Not even "buked", let alone "rebuked"...:lol:

#15 cathode

cathode

    Loves Etomite Forums!

  • Staff
  • 663 posts

Posted 29 September 2009 - 02:22 PM

Maybe thats some of the issues are translation and interpretation problems, but i find it lower helpful, if a member tells me its "some pointless page decoration". Thats deprecative. As written in my posting the use of a snippet ever belongs to the point of view. I've written the "TagCloud"-snippet, because it has sense for me and my website. And i believed, it could be expedient to publish it at Eto.

If I've some trouble, help is welcome at any time and therefore i love this forum for its good founded postings. And refering to this i'm very glad and thankful about good comments. And if its common to refer to earlier developments, then thats a very good idea. But not with that words "this has been all done before". Also deprecative and totally turns me off.

Just professional web developers should be a little bit encouraging to not so versatile programmers.

If my criticism offended sensibilities, i beg for pardon.


I am here to make the web a better, more useful place, not to coddle the feelings of people with low self-esteem. If you find my comments about your snippet depreciative, then your snippet could use some improvement. Nothing personal.

I'll give you a boost in the right direction:
(via http://en.wikipedia.org/wiki/Tag_cloud )

A tag cloud or word cloud (or weighted list in visual design) is a visual depiction of user-generated tags, or simply the word content of a site, used typically to describe the content of web sites. Tags are usually single words and are typically listed alphabetically, and the importance of a tag is shown with font size or color.[1] Thus both finding a tag by alphabet and by popularity is possible. The tags are usually hyperlinks that lead to a collection of items that are associated with a tag.


Edited by Ralph, 29 September 2009 - 09:19 PM.
Fixed URL


#16 huafeihua116

huafeihua116

    Etomite Forum Newbie

  • Member
  • 3 posts

Posted 28 April 2010 - 10:46 AM

Not even "buked", let alone "rebuked"...:lol:

GreaT1




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users