manish202 / php_news_blog

php news blog website with custom cms | procedural method | There Is No Javascript Or Jquery |
4 stars 2 forks source link

Great cms test one bug #1

Open GrandM1961 opened 1 year ago

GrandM1961 commented 1 year ago

Hello, I am altering this cms to my own html5 with bootstrap 5 and I also altered the word so it is salted. Now here is my problem at the backend, $owner = $_SESSION['id']; if($_SESSION['role'] == 1){ $x = ""; }else{ $x = "WHERE pauthor = $owner"; } $limit = 3; $page = (!empty($_GET['page']) && is_numeric($_GET['page'])) ? $_GET['page']:1; $offset = ($page - 1) $limit; $query = "SELECT FROM posts p JOIN category c ON p.pcat = c.cid JOIN users u ON p.pauthor = u.uid $x ORDER BY pid DESC LIMIT $offset,$limit";

i have made myself as a admin but I don't and can't see all the posts only those that I made, which to me seems not right. I want to be able as a admin to see all the posts so I can alter whatever I like. I also extended the users so they can makeup their own profile settings like name, address and so on.

any idea why as a admin I don't see all posts??

GrandM1961 commented 1 year ago

Fixed it