Welcome to the archive of the old FlatPress support forum. Browse more than a decade of FlatPress wisdom! Login is disabled.

The current FlatPress support forum is available here: forum.flatpress.org
Flatpress to 1.0.1 to 1.0.2 ???
  • Hi, if I go to Control Panel, Maintain and Check for updates it shows:
    FlatPress version 1.0

    Unable to retrieve updates.
    But I'm sure to have updagraded versions of my 2 websites to 1.0.1 (updating 1 or 2 files only if I remember well).
    Now the question is:
    It's possible to update this version only to know which files have been rewritten in new version ?
    Or, what is the correct procedure to updated all website ?
    Before to update all my 2 websites with at least thousands of articles, I prefer to be sure (obviously I've a backup....but...you know it's better to update 2-3 files than entire version of flatpress).
    Thank you.
  • As long as you don't replace fp-content or change the permissions of a working install, you can safely replace everything else.

    The best way to be absolutely sure of changes in files from one version to another is to do a diff.  Be careful of things you don't replace and compatibility with the things you do especially if you want to use the git version.  You'll see file changes there that aren't in the official release download so make sure you are getting things from the right place.  For instance, Nowhereman just merged four file changes by me into git that work very well but if you use a different theme than default you will have to look at what was changed in the default themes css files and incorporate those changes into your theme otherwise things won't behave as expected.  That's the nature of small projects like this, things change and can break other things.

    1.0.2 works very well but I've been running into permissions problems with my local webserver but I'm sure that it's just things on my end.  I'm working on a way to make sure things work at 0644 and 0755 but it may take some time.  It doesn't help that I have three forks running right now.

    You got the first rule of computers right though, backup, backup, backup.
  • I've found this page on wiki:
    there's all, but I believe that if how has version 1.0.1 and want to upgrade 1.0.2 is more easy to replace new files of that version, without upgrade all flatpress. It's enough easy to replace 4 or 10 files than replace all. This because I've more than 700 users every day on my websites and I don't loose time and money.
    Thank you.
  • Like I said, the easiest way to check for changed files is to do a diff.  Just download 1.0.1 and 1.0.2, extract them to different folders and do a diff on the folders and you'll see what's changed.  I'm not sure I would ever use this for a site with 700 users myself but if you're really worried about breaking things, set up a local server and import your site and test locally first before updating things.  700 users on a flat file structure would evenutally become untenable, this is what databases are designed for.  I may have a different opinion than the other devs but my take on Flatpress is that it is designed for a single user site as a personal blog and not production commercial environments with thousands of users.  Your using the wrong tool for the job.
  • I follow your advise......and it worked.
    So if someone want to upgrade version from 1.0.1 to 1.0.2 have to:

    1) Make a backup of website

    2) Overwrite these files:

    After that go to Administration area  --> Maintain --> Check for updates  --> and you'll see 1.0.2 
  • I'm glad it worked out for you.  Flatpress is small enough that it's relatively easy to maintain and small enough to hack on as well.  Oddly enough, the biggest parts of this is the smarty template engine itself.  Take that away and the thing is really small for what it can do.  Kudos to the devs for this.
  • After update, when I write a new article, the date is back of 1 hour, even though I go to Control Panel, Options,  (Time should differ by) and I set time 1 or 2 or 3 or 4 hours. UTC time is back of 1 hour respect the date of my computer. So, every time I write and article I've impost the hour manually, before upgrade all worked well. So, where is the problem, why the date of articles is set 1 hour back ?
    Thank you  
  • Hi Panther, as I remember in the new version of Flatpress introduced the compulsory timezone setting.
    You can fix your timezone going to Options panel.
  • Did you backup your original files before changing them? If you did, try and do a diff on core.date.php with https://github.com/evacchi/flatpress/blob/master/fp-includes/core/core.date.php and see what changes have been implemented, there could be an error. Two months ago they updated this function to use UTC by default. I've found that with system time stuff, the fault is usually on my end. I just did a lot of research into unix time so I'm in the unique position of having the info you might need to fix this. See the conky plugin I just wrote to understand why I can say this. I haven't lost a second in 6 months.
  • Yes, good, it was this file core.date.php.
    So, who will have the same problem (article with 1 or 2 hours in less), have to editi that file /fp-includes/core/core.date.php  and delete the first line:
    Overwrite the file (without this line) and it will be all ok.

  • Please note that each upgrade of that file, you'll have to change it again.
    I think that we should ask NoWhereMan to change the old setting of difference between localtime and UTC with a new field to specify your timezone...
  • I think the best way to do this would be to allow input of the timezone as a stored variable instead of hardcoding UTC.  On that note, don't just delete the line and be done, change it to a useful value based on the timezone where the server is located.  Your timezone value can be gotten from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones or even your own system if you're running the server locally with linux.  Use  'date' for the full date/time or 'date +%Z' for just the timezone.  This is one of those cunundrums where you need to think about whether to use your timezone or the servers.
  • «I think the best way to do this would be to allow input of the timezone as a stored variable instead of hardcoding UTC.»

    It is what a meant, too ;-)

    «Your timezone value can be gotten from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones or even your own system if you're running the server locally with linux.  Use  'date' for the full date/time or 'date +%Z' for just the timezone.  This is one of those cunundrums where you need to think about whether to use your timezone or the servers.»

    Do you mean the date command? In that case system() would be needed, but it is disabled in most of configuration, I think.
    There are different format characters in the date function, the PHP date command, but they are modified in the PHP.ini and it wouldn't be needed to change it.
    We'd better use date_default_timezone_get() to check if the timezone is set, then, if it isn't, change it to UTC, and if set in the configuration, set the user defined timezone.

    DateTimeZone::listIdentifiers is quite interesting to create a timezone list, but it needs PHP 5.2.0.

    What is the current minimum PHP version for FP? 5.0?
  • I've php 5,33
    I have modified from this:

    to this:

    and it works.

  • I didn't mean to have php get the date/tz from the system, I meant that the user can manually get the timezone from the system and use that in place of UTC (for instance America/New York), localtime works as Panther stated.  Localtime would work for the config if you wanted to have the server set the timestamps but wouldn't if your server were in a different timezone, as most of the time it is when you have hosting, and you wanted to show your local timezone instead.  I believe that's what the offset is intended for but doesn't seem to be working in Panther's case for some reason.  I haven't tested this yet because I'm involved in a rewrite and have too many (6) versions to be switching in and out of for testing.  I tend to try and stay in one per day at that most.
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion