vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Sitemap Syntax Help Please (https://vborg.vbsupport.ru/showthread.php?t=324000)

Budget101 12-10-2016 06:06 PM

Sitemap Syntax Help Please
 
Currently the sitemap pulls "updated dates" for the CMS from the cms_node field.

I'd like to remove the current line from the sitemap:

Code:

$content .= "\n\t" . '<lastmod>' . gmdate(DATE_W3C, $sitemap['lastmod']) . '</lastmod>';
and replace it with code that forces the <lastmod> date to be the CURRENT Date (as of the moment of sitemap generation)

Would this one work?
Code:

$content .= "\n\t" . '<lastmod>' .Y-m-d\TH:i:s+00:00. '</lastmod>';
Could someone help me out with the correct syntax please??

Dave 12-10-2016 06:22 PM

http://php.net/manual/en/function.gmdate.php
Quote:

Originally Posted by PHP.net
timestamp
The optional timestamp parameter is an integer Unix timestamp that defaults to the current local time if a timestamp is not given. In other words, it defaults to the value of time().

So if the second parameter is left out, it will default to the current time. Simply use this:

PHP Code:

$content .= "\n\t" '<lastmod>' gmdate(DATE_W3C) . '</lastmod>'


Budget101 12-10-2016 06:25 PM

Quote:

Originally Posted by Dave (Post 2579307)
http://php.net/manual/en/function.gmdate.php


So if the second parameter is left out, it will default to the current time. Simply use this:

PHP Code:

$content .= "\n\t" '<lastmod>' gmdate(DATE_W3C) . '</lastmod>'



Thank you Sir!

Any idea what I should change this one to?

PHP Code:

$data .= $l '<lastmod>' htmlspecialchars_uni(gmdate(DATE_W3C$lastmod)) . '</lastmod>'

would it be this???

PHP Code:

$data .= $l '<lastmod>' htmlspecialchars_uni(gmdate(DATE_W3C)) . '</lastmod>'


Dave 12-10-2016 06:37 PM

Exactly.

Budget101 12-10-2016 06:43 PM

Quote:

Originally Posted by Dave (Post 2579309)
Exactly.

:up: Thank you again Dave, you Rock! :up:

RichieBoy67 12-11-2016 12:32 PM

Dave definitely rocks.


All times are GMT. The time now is 10:01 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01047 seconds
  • Memory Usage 1,729KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (4)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete