Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.7k views
in Q2A Core by
Get the following error:

Notice: Undefined index: all in /homepages/.... on line 18

When submitting to google webmastertools:

Big red cross

Parsing erroron line 4439
We were unable to read your Sitemap. It may contain an entry we are unable to recognize. Please validate your Sitemap before resubmitting.

and..

several times line 7, line 8 not valid xml tag.

Should be about 2000 entries, google just finds 511 of 738 ?

I saw others had similar problems, but no where I found the solution.

I tried the original script by Frerichs, and the other one by sama55.

Any info would be welcome...

Thank You so far

1 Answer

0 votes
by
i've just updated my script to address some bugs:

http://www.morphhome.net/sitemap-generator-fur-question2answer

maybe try it again.
by
Now, the first mentioned error must have been related to some encoding. Using the first part of Your old code works , I took the old first lines up to

@mysql_select_db(QA_MYSQL_DATABASE) or die( "Unable to select database");

took off error reporting line 6 and added the rest of Your new code.

Now it hangs at line 25

Notice: Undefined index: all in /homepages/44/12345678/htdocs/yourquestion/sitemap.php on line 19

Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /homepages/44/12345678/htdocs/yourquestion/sitemap.php on line 25
by
Ok, the nmrow problem was because i had to change my tableprefix in line 21

Now again all entries are listed if i call sitemap.php in the server but the second line still shows:

Notice: Undefined index: all in /homepages/44/12345678/htdocs/yourquestion/sitemap.php on line 19

I will upload the sitemap again now, and be back in 10 minutes with the result
by
Ok, finally it works, google accepted the sitemap and shows all the urls .

There are just 2 details still not perfect:

Line 2 in sitemap.php in browser: Notice: Undefined index: all in /homepages/44/12345678/htdocs/yourquestion/sitemap.php on line 19

And the google  warnings:

Sitemap errors and warnings
Line    Status    Details
    7   
Invalid XML tag
This tag was not recognized. Please fix it and resubmit.   
Parent tag: urlset
Tag: br
Problem detected on: Sep 28, 2010
    8   
Invalid XML tag
This tag was not recognized. Please fix it and resubmit.   
Parent tag: urlset
Tag: b
Problem detected on: Sep 28, 2010
    8   
Invalid XML tag
This tag was not recognized. Please fix it and resubmit.   
Parent tag: urlset
Tag: b
Problem detected on: Sep 28, 2010
    8   
Invalid XML tag
This tag was not recognized. Please fix it and resubmit.   
Parent tag: urlset
Tag: b
Problem detected on: Sep 28, 2010
    8   
Invalid XML tag
This tag was not recognized. Please fix it and resubmit.   
Parent tag: urlset
Tag: br
Problem detected on: Sep 28, 2010

Just for info.

However, thank You so much for this sitemap generator !

Vielen Dank für diesen super SItemap Generator !

For others as inforamtion: Be careful with the Encoding of this script, it must be utf8 , if it does not work try it again.
And if localhost does not work for You, You can use instead
mysql_connect(QA_MYSQL_HOSTNAME,QA_MYSQL_USERNAME,QA_MYSQL_PASSWORD);

and if You use another table-prefix than qa_ You have to change it in line 21  where it says:  qa_posts  in


$query = "select postid, type, parentid, title, content, created from qa_posts where (type = 'Q') order by created desc";
by
Thanks for creating a sitemap plugin!  Looking at the code, I was wondering about a few things.

1) You've hardcoded the date ("lastmod") for the main URL, would it be better to do a lookup for the day when the site was last updated and use that instead?

2) Is there a way to do a query for category and/or tag urls and display those as well?  (And set a priority of say 0.7)

3) If a site isn't super active, is it better to set the check frequency to weekly from daily?
...