Jump to content

[SOLVED]how to change pages created/modifie


picarica
 Share

Recommended Posts

so i am getting date from external DB like so 

$page_created = strtotime($row['date_create']);

output echo of this is 
 

echo "Datum vytvorenia: " . $page_created. "<br>";
Datum vytvorenia: 1440074105

but when i save the page 
 

          $p = new Page();
          $p->setOutputFormatting(false);
          $p->template = 'clanok';
          $p->parent = wire('pages')->get('/clanky/');
          $p->name = $page_slug;
          $p->title = $page_title;
          $p->created = $page_created;
          $p->modified = $page_modified;
          $p->clanok = $page_body;
          $p->tags = $page_category_name;
          $p->autor = $page_author;
          $p->pocet_klikov = $page_popularity;
          $p->save();

          $p->obrazok->add($page_image_path);
          $img = $p->obrazok->first();
          $img->description = $page_image_description;

          $p->save();

but when i take a look at the page in PW its still created and modified 5 seconds ago, never my date supplies, how is it possible ?

Link to comment
Share on other sites

  • picarica changed the title to [SOLVED]how to change pages created/modifie

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...