]> git.bts.cx Git - cx.git/blobdiff - cx/lib/posts.php
Fix CSS for images
[cx.git] / cx / lib / posts.php
index 3293ace514e3282867f390641c6cdd87053e9b3c..4d122dfe642ff2fb087af6a49b9c818138b2a4fc 100644 (file)
@@ -45,6 +45,14 @@ class Post {
                }
        }
 
                }
        }
 
+       public function get_permalink_path() {
+               $permalink = '/' . $this->slug;
+               if ($this->is_page == false) {
+                       $permalink = '/' . date('Y', $this->date) . '/' . date('m', $this->date) . '/' . $this->slug;
+               }
+               return $permalink;
+       }
+
        public function get_metadata() {
                $data = [];
 
        public function get_metadata() {
                $data = [];
 
@@ -99,7 +107,8 @@ function cx_posts_add_post($site_id, $title, $slug, $date, $page, $draft, $nav_i
                        post_data,
                        post_data_version)
                VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);';
                        post_data,
                        post_data_version)
                VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);';
-       cx_db_exec($sql, $site_id, $creation_time, $update_time, $slug, $date, $page, $draft, $nav_index, $title, $data, 1);
+       $id = cx_db_exec($sql, $site_id, $creation_time, $update_time, $slug, $date, $page, $draft, $nav_index, $title, $data, 1);
+       return $id;
 }
 
 function cx_posts_update_post($post_id, $title, $slug, $date, $page, $draft, $nav_index, $data) {
 }
 
 function cx_posts_update_post($post_id, $title, $slug, $date, $page, $draft, $nav_index, $data) {