slug . '.md'; if (file_exists($url)) { $content = file_get_contents($url); $oldtitle = get_content_tag('t', $content, $p->slug); $olddescription = get_content_tag('d', $content, remove_html_comments($content)); $oldcontent = remove_html_comments($content); $oldmd = $p->slug; } else { $content = $p->body; $oldtitle = $p->title; $olddescription = $p->description; $oldcontent = $p->body; $oldmd = $p->slug; } } else { if (isset($p->file)) { $url = $p->file; } else { $url = $oldfile; } $content = file_get_contents($url); $oldtitle = get_content_tag('t', $content, 'Untitled'); $olddescription = get_content_tag('d', $content); $oldcontent = remove_html_comments($content); if (isset($_GET['destination'])) { $destination = _h($_GET['destination']); } else { $destination = 'admin'; } $dir = pathinfo($url, PATHINFO_DIRNAME); $oldurl = pathinfo($url, PATHINFO_BASENAME); $fn = explode('.', pathinfo($url, PATHINFO_FILENAME)); if (isset($fn[1])) { $oldmd = $fn[1]; } else { $oldmd = pathinfo($url, PATHINFO_FILENAME); } if (isset($p->url)) { $delete = $p->url . '/delete?destination=' . $destination; } else { if(empty($sub)) { $delete = site_url() . $oldmd . '/delete?destination=' . $destination; } else { $delete = site_url() . $static .'/'. $sub . '/delete?destination=' . $destination; } } } $images = image_gallery(null, 1, 40); $fields = array(); if ($type == 'is_page' || $type == 'is_frontpage') { $field_file = 'content/data/field/page.json'; if (file_exists($field_file)) { $fields = json_decode(file_get_contents($field_file, true)); } } elseif ($type == 'is_subpage') { $field_file = 'content/data/field/subpage.json'; if (file_exists($field_file)) { $fields = json_decode(file_get_contents($field_file, true)); } } elseif ($type == 'is_profile') { $field_file = 'content/data/field/profile.json'; if (file_exists($field_file)) { $fields = json_decode(file_get_contents($field_file, true)); } } ?>