]> git.bts.cx Git - cx.git/blobdiff - cx/lib/images.php
Use the correct file request call
[cx.git] / cx / lib / images.php
index dbe55bf4b23fed11610799cf6a4f90f8348bd5b5..358a1ba7f5e5cea6a5466c60a96ce36848b4f178 100644 (file)
@@ -17,6 +17,11 @@ class Image {
                $this->alt_text = $dict['image_alt_text'];
                $this->url = $this->uid . '.' . $dict['image_type'];
        }
+
+       public function get_permalink_path() {
+               $permalink = '/data/images/' . $this->url;
+               return $permalink;
+       }
 }
 
 function cx_images_add_image($site_id, $alt_text, $image_path, $image_original_filename) {
@@ -95,5 +100,8 @@ cx_setup_register(1, function() {
                        FOREIGN KEY(image_site_id) REFERENCES sites(site_id)
                );');
 
-       mkdir(cx_user_data_path('images'), recursive: true);
+       $image_dir = cx_user_data_path('images');
+       if (is_dir($image_dir) == false) {
+               mkdir($image_dir, recursive: true);
+       }
 });