Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4260
Latest: Verrick
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 43323
Total Topics: 7527
Most Online Today: 262
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 265
Total: 265

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

0 Members and 1 Guest are viewing this topic.

Offline Toddie

  • 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: 16464
    • 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
6 Replies
7736 Views
Last post July 15, 2018, 04:14:19 pm
by SMFHacks
15 Replies
10680 Views
Last post May 13, 2024, 10:28:54 am
by SMFHacks
7 Replies
4583 Views
Last post March 07, 2019, 11:23:09 pm
by SMFHacks
16 Replies
2882 Views
Last post December 27, 2022, 05:32:14 pm
by [chrisB]
11 Replies
3290 Views
Last post February 01, 2023, 05:18:47 pm
by [chrisB]

+- Recent Topics

Failed to open stream: File name too long by Randem
June 21, 2024, 10:40:41 am

Attachment images Upsidedown or Sideways by SMFHacks
June 18, 2024, 10:53:24 am

JSON decode error: The maximum stack depth has been exceeded by SMFHacks
June 14, 2024, 10:15:16 pm

“Insert from Gallery” by donk
June 10, 2024, 01:26:57 pm

Pretty Urls extras by SMFHacks
May 13, 2024, 10:28:54 am

Mod question by Verrick
May 11, 2024, 02:42:50 pm

i have paid but cant download ad pro. by SMFHacks
May 02, 2024, 11:29:38 pm

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Powered by EzPortal