GithubHelp home page GithubHelp logo

Last modified variable about wet-boew-php HOT 2 CLOSED

wet-boew avatar wet-boew commented on July 19, 2024
Last modified variable

from wet-boew-php.

Comments (2)

upsonp avatar upsonp commented on July 19, 2024

@crochefort Actually I do something similar on the website I manage.

On my site I separate the "boilerplate" from the "content" file. The boilerplate makes all the required variant includes and sets all the required variables $_PAGE['lang1'], $_PAGE['left_menu_gauche'], $PAGE['title'.$_PAGE['lang1']], etc...

I have a strict file structure and naming scheme where content files are always in an "includes/" folder in the same directory as the boilerplate. Then I use PHP to get the last modified date of the content file, if it exists, as once a page is setup I rarely change the boilerplate.

if( file_exists($_PAGE['content']) ) {
    $_PAGE['modified'] = date ("Y-m-d", filemtime($_PAGE['content']));
} else {
    $_PAGE['modified'] = date ("Y-m-d", getlastmod());
}

I didn't include the method in the variant because I wasn't sure if it could be considered a good standard method of acquiring the last modified date, I figured some people might like to keep content and boilerplate in the same file while others might do what I do and have them separated.

I'm all for adding the method to the demos-php files if it's a desirable feature. You're also free to do what I did and create your own template files that have the required includes and variables and implement the last modified feature for your specific site.

from wet-boew-php.

nschonni avatar nschonni commented on July 19, 2024

The Last Modified should reflect the date that the content was changed, which usually isn't related to the filesystem timestamp. There is a built in worker that will update the bottom of the page values as long as the meta tags are up to date.

from wet-boew-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.