function LBDP($row) { if ($row == null || $row == '0000-00-00 00:00:00') { return '-'; } if (isEnglish()) { return dateToGreg($row, '/', false); } else { return dateToJalali($row, '/', !isEnglish()); } }
$query = "SELECT * FROM c_posts WHERE ID = {$id} LIMIT 1"; $res = $conn->query($query); dbQueryCheck($res, $conn); $row = $res->fetch_assoc(); $title_text = htmlspecialchars($row['post_title']); $excerpt = $row['post_excerpt']; $content_text = htmlspecialchars($row['post_content']); $desc_text = htmlspecialchars($row['post_description']); $tags = $row['tags']; if (Language == 'fa') { $date = $row['post_date']; // separate date from time $time = explode(" ", $date); $get_time = $time[1]; // joining date and time $date = addZerosToShow_dash(dateToJalali($date, '-'), true) . ' ' . $get_time; } else { $date = $row['post_date']; } $post_status = $row['post_status']; $comment_status = $row['comment_status']; $link_title = urldecode($row['link_title']); $type = $row['post_type']; if ($type == 'post') { $type = 'Post'; } elseif ($type == 'page') { $type = 'Page'; } $query = "SELECT cat_id FROM c_posts_cats WHERE post_id = {$id}"; $res = $conn->query($query); $categories = [];