The update time of the content page generated by a single phpcms editing article is 1970.

Source: Internet
Author: User

Update Time: 1970

This is because the phpcms update time field does not get the value when editing the update time of the article, but it does set the value of each field (including the update time) when editing) when a static page is generated while the database is saved, the update time of the generated static page is 1970 because no value is assigned to the update time.

Solution:

The code is as follows: Copy code

$ _ POST ['info'] ['updatetime'] = SYS_TIME;

Add the above code to the edit method (submit) of the content controller of the content module.


Appendix, released on August 1, January 01, 1970

The tag is "called through custom SQL", and the original SQL statement is:

The code is as follows: Copy code

Select distinct c. contentid, c. title, c. style, c. url FROM 'phpcmscom _ content' c, 'phpcmscom _ content_tag't WHERE c. contentid = t. contentid and c. 'status' = 99 AND t. 'Tag' IN (". get_ SQL _in ($ r [keywords]). ") order by c. contentid DESC

There is no execution function for release time. You only need to add the function for release time to display the actual release time. The modified statement is as follows:

The code is as follows: Copy code

Select distinct c. contentid, c. title, c. inputtime, c. style, c. url FROM 'phpcmscom _ content' c, 'phpcmscom _ content_tag't WHERE c. contentid = t. contentid and c. 'status' = 99 AND t. 'Tag' IN (". get_ SQL _in ($ r [keywords]). ") order by c. contentid DESC

Note: add the following code:

The code is as follows: Copy code

C. inputtime,

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.