diff --git a/account/welcome/function.php b/account/welcome/function.php index ca87dc9..25f0fd6 100644 --- a/account/welcome/function.php +++ b/account/welcome/function.php @@ -421,4 +421,16 @@ function ReviewPost($con, $id, $reason){ } -?> \ No newline at end of file +function getMonthlyPublishedPosts($con, $month, $year) { + $query = "SELECT * FROM posts WHERE status='Published' AND MONTH(created_at) = $month AND YEAR(created_at) = $year ORDER BY created_at DESC"; + $run = mysqli_query($con, $query); + $data = array(); + + while($d = mysqli_fetch_assoc($run)) { + $data[] = $d; + } + + return $data; +} + +?> diff --git a/account/welcome/index.php b/account/welcome/index.php index 793a670..9421a66 100644 --- a/account/welcome/index.php +++ b/account/welcome/index.php @@ -1943,6 +1943,70 @@ function logout() { +
| Title | Category | Published Date |
|---|---|---|
| {$post['title']} | "; + echo "" . getCategory($con, $post['category_id']) . " | "; + echo "{$post['created_at']} | "; + echo "