News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

SEO sitemap and XML sitemap

Started by mkress, May 09, 2012, 09:15:24 PM

Previous topic - Next topic

maarawoe

Hi all,

My error log is being filled with
http://gamestickers.net/index.php?board=12.0&action=kitsitemap;xml
Apply Filter: Only show the errors with the same message
8: Undefined index: ID_TOPIC
Apply Filter: Only show the errors from this file File: /web/htdocs2/gamestickersnet/home/www/Sources/Subs-KitSitemap.php
Line: 80 or Line: 79


The line corresponds to:
while($row = $smcFunc['db_fetch_assoc']($query))
77: {
78: // fill topic array
==>79: $context['topics'][$row['ID_TOPIC']] = $row;
==>80: $context['topics'][$row['ID_TOPIC']]['href'] = $scripturl.'?topic='.$row['ID_TOPIC'].'.0';
81: }



Any advise please?


Thanks!!

maarawoe

Same issue with ID_TOPIC here...
Any fix please?

kokett

#82
Modification to export all URL's

In /Sources/Subs-KitSitemap.php Line 52 - 82 replace:
// list board topics
if ( !empty($board_info['id']) )
{
$start = (int) $_REQUEST['start'];
$context['topics'] = array();
if ( $xmlView )
{
$context['sub_template'] = 'kitsitemap_xml_board';
// maximum entries per sitemap
$context['topics_per_page'] = 50000;
$query= $smcFunc['db_query']('', "
SELECT
t.ID_TOPIC
FROM {db_prefix}messages AS m, {db_prefix}topics AS t
WHERE m.ID_BOARD = {int:id_board} AND m.ID_MSG = t.ID_FIRST_MSG
ORDER BY t.ID_LAST_MSG DESC
LIMIT {int:start}, {int:limit}",
array(
'id_board' => $board_info['id'],
'start' => $start,
'limit' => $context['topics_per_page']
)
);

while($row = $smcFunc['db_fetch_assoc']($query))
{
// fill topic array
$context['topics'][$row['ID_TOPIC']] = $row;
$context['topics'][$row['ID_TOPIC']]['href'] = $scripturl.'?topic='.$row['ID_TOPIC'].'.0';
}
}


with

// list board topics
if ( !empty($board_info['id']) )
{
$start = (int) $_REQUEST['start'];
$context['topics'] = array();
if ( $xmlView )
{
$context['sub_template'] = 'kitsitemap_xml_board';
// maximum entries per sitemap
$context['topics_per_page'] = 50000;
$query= $smcFunc['db_query']('', "
SELECT
t.ID_TOPIC, t.num_replies
FROM {db_prefix}messages AS m, {db_prefix}topics AS t
WHERE m.ID_BOARD = {int:id_board} AND m.ID_MSG = t.ID_FIRST_MSG
ORDER BY t.ID_LAST_MSG DESC
LIMIT {int:start}, {int:limit}",
array(
'id_board' => $board_info['id'],
'start' => $start,
'limit' => $context['topics_per_page']
)
);

$row2 = 0;
while($row = $smcFunc['db_fetch_assoc']($query))
{
// fill topic array
if (count($row2) == $context['topics_per_page']) break;
$context['topics'][$row2] = $row;
$context['topics'][$row2]['href'] = $scripturl.'?topic='.$row['ID_TOPIC'].'.0';
$row2++;
if (intval($row['num_replies'] / $modSettings['defaultMaxMessages']) > 1) {
$board_indexes = intval($row['num_replies'] / $modSettings['defaultMaxMessages']);
$topic_page = 1;
while ($topic_page <= $board_indexes)
{
$context['topics'][$row2] = $row;
$context['topics'][$row2]['href'] = $scripturl.'?topic='.$row['ID_TOPIC'].'.'.$topic_page * $modSettings['defaultMaxMessages'];
$topic_page++;
$row2++;
if (count($row2) == $context['topics_per_page']) break;
}
}
}
}



Sitemap will look like:

<url>
<loc>http://www.your-forum.xyz/index.php?topic=3831.0</loc>
</url><url>
<loc>http://www.your-forum.xyz/index.php?topic=3831.20</loc>
</url><url>
<loc>http://www.your-forum.xyz/index.php?topic=3831.40</loc>
</url><url>
<loc>http://www.your-forum.xyz/index.php?topic=3831.60</loc>
</url><url>
<loc>http://www.your-forum.xyz/index.php?topic=3831.80</loc>
</url><url>
<loc>http://www.your-forum.xyz/index.php?topic=3831.100</loc>
</url><url>
<loc>http://www.your-forum.xyz/index.php?topic=3831.120</loc>
</url><url>
<loc>http://www.your-forum.xyz/index.php?topic=3831.140</loc>
</url><url>
<loc>http://www.your-forum.xyz/index.php?topic=3831.160</loc>
</url><url>
<loc>http://www.your-forum.xyz/index.php?topic=5086.0</loc>
</url><url>
<loc>http://www.your-forum.xyz/index.php?topic=4951.0</loc>
</url><url>
<loc>http://www.your-forum.xyz/index.php?topic=5072.0</loc>
</url><url>

romanos8


kokett

Which URL did you post to google?

/index.php?action=kitsitemap;xml

this works for me fine.

swaggaderby


njtweb

Checking to see if this is still supported.

I have this installed on my site but I don't see an real benefit from it, specifically in Google search results. What is the objective of the mod? If there is no sitemap.xml to submit to Google webmaster tools, isn't the mod basically doing nothing but duplicating links that are already created?

Thank you, any assistance and/or instruction would be greatly appreciated.

Julian F

Hello, this mod support large forums? I mean when a section from forum have 12000 posts for example.

Andreso

One question, if i hide the Sitemap button, the Sitemap will not be showed to Search engines? or only hides the button? please answer my doubth  ???

Dwev

I have absolutely nothing to do with the Mod, but I see a few questions to which I think I have the answer.

@ njtweb: use this links for the XML sitemap: URL-of-your-forum/index.php?action=kitsitemap;xml
You register your site with Google Webmaster Tools and enter this URL.

@ Julian F: as far as I can see the answer is yes.

@ Andreso: if you follow the instructions I wrote for njtweb above it will work.

nadeem34

I got an error for my xml sitemap even when i type all adress with http in google nothing to show


Please see the attachment of error.

Help needed must please
Creative ways to make money fast
https://gotryus.com/

smartmouse

Hi, if I visit URL-of-my-forum/index.php?action=kitsitemap;xml what should I see inside?
I see only the urls of the sections of my forum. Is it right?

In addition I use PrettyUrls mod... shouldn't I get a sitemap with friendly urls?

jamesandersonicb

I also try this kind of method for sitemap.xml.

justpaulo

Seems that Google can't fetch this sitemap...

I tried all links in the topic including "/index.php?action=kitsitemap;xml"

Any other solutions?

njtweb

Quote from: justpaulo on July 18, 2019, 06:50:04 AM
Seems that Google can't fetch this sitemap...

I tried all links in the topic including "/index.php?action=kitsitemap;xml"

Any other solutions?

Optimus - https://custom.simplemachines.org/mods/index.php?mod=2659

daveb47

What am i doing wrong please

Google sitemaps error
https://daveb47.co.uk

A Slinky is like Jeremy CorbynWinehouse,Weird looking,Not really of any use to anybody.
But its really funny when it falls down the stairs!!:D:D

-Rock Lee-

Quote from: daveb47 on November 15, 2019, 09:03:56 AM
What am i doing wrong please

Google sitemaps error


I have it that way it takes it correctly, see if via robots.txt you are blocking it but verify that google can access that file.


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

daveb47

QuoteI have it that way it takes it correctly, see if via robots.txt you are blocking it but verify that google can access that file.

I dont seem to have a robots.txt.
https://daveb47.co.uk

A Slinky is like Jeremy CorbynWinehouse,Weird looking,Not really of any use to anybody.
But its really funny when it falls down the stairs!!:D:D

-Rock Lee-

Quote from: daveb47 on November 16, 2019, 01:54:24 AM
QuoteI have it that way it takes it correctly, see if via robots.txt you are blocking it but verify that google can access that file.

I dont seem to have a robots.txt.

I can access without problems Sitemap Try resending it.


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

daveb47

It has come up with "success" message now.
Thanks for help.
https://daveb47.co.uk

A Slinky is like Jeremy CorbynWinehouse,Weird looking,Not really of any use to anybody.
But its really funny when it falls down the stairs!!:D:D

Advertisement: