Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 201
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 269
Total: 269

Author Topic: Pretty Urls SEO Pro  (Read 1508 times)

0 Members and 1 Guest are viewing this topic.

Offline Toddie

  • Pretty Urls SEO Pro
  • Member
  • *****
  • Posts: 1
    • View Profile
Pretty Urls SEO Pro
« on: May 06, 2023, 05:13:22 am »
I would like to save the sitemap (automatically) daily in the root directory as sitemap.xml.
Does anyone have an idea how I could do that?


Thank you!
« Last Edit: May 06, 2023, 05:30:05 am by Toddie »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Pretty Urls SEO Pro
« Reply #1 on: May 06, 2023, 03:30:11 pm »
You would need to make changes.
Open themes/default/PrettyUrls.template.php
Find the function function template_pretty_xml_sitemap() and the code inside and replace with
Code: [Select]
function template_pretty_xml_sitemap()
{
global $context, $scripturl, $boarddir;

$data = '';

$data .= '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>' . fix_possible_url($scripturl) . '</loc>
<lastmod>' . $context['sitemap']['main']['time'] . '</lastmod>
<changefreq>always</changefreq>
<priority>1.0</priority>
</url>';

foreach ($context['sitemap']['items'] as $item)
$data .= '
<url>
<loc>' . $item['url'] . '</loc>
<lastmod>' . $item['time'] . '</lastmod>
<changefreq>' . (empty($item['changefreq']) ? 'daily' : $item['changefreq']) . '</changefreq>
<priority>' . $item['priority'] . '</priority>
</url>';

$data .= '
</urlset>';

echo $data;

file_put_contents($boarddir .'/sitemap.xml');
}

Then you can setup a task or cronjob to call
sitenamecom/index.php?action=sitemaps&xml=1
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
6371 Views
Last post September 11, 2010, 06:21:10 am
by Wickedgood
6 Replies
7363 Views
Last post July 15, 2018, 04:14:19 pm
by SMFHacks
7 Replies
4236 Views
Last post March 07, 2019, 11:23:09 pm
by SMFHacks
16 Replies
2297 Views
Last post December 27, 2022, 05:32:14 pm
by [chrisB]
11 Replies
2492 Views
Last post February 01, 2023, 05:18:47 pm
by [chrisB]

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal