Skip to content

Create PHP news site with admin dashboard and Shopee ad flow#35

Open
huzely wants to merge 1 commit intomasterfrom
codex/create-complete-news-website-41vzm5
Open

Create PHP news site with admin dashboard and Shopee ad flow#35
huzely wants to merge 1 commit intomasterfrom
codex/create-complete-news-website-41vzm5

Conversation

@huzely
Copy link
Copy Markdown
Owner

@huzely huzely commented Dec 29, 2025

Summary

  • Build public news site with slug-based routing, multi-theme UI, Shopee overlay ad flow, and caching
  • Add Vietnamese admin panel for login, CRUD bài viết, cài đặt, thống kê, copy link, và đổi theme/logo/banner
  • Implement PDO database schema, tracking API với rate-limit, Telegram queue, và cơ chế lỗi/log thân thiện
  • Refine Shopee overlay theo đặc tả (bypass ?ad=0, giữ affiliate, chạy trên click slug và truy cập trực tiếp), gộp thông báo click qua Telegram, truyền token để track ad_click không delay, và bổ sung bắt nút X để mở Shopee + tab bài
  • Cải thiện bố cục mobile cho trang public (cards 1 cột, header xếp dọc) và giữ cài đặt quảng cáo hiển thị gọn trên điện thoại

Testing

  • find public_html -name '*.php' -print0 | xargs -0 -n1 php -l

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +14 to +19
if (!$post) {
$stmt = $pdo->prepare('SELECT * FROM articles WHERE slug = :slug LIMIT 1');
$stmt->execute([':slug' => $slug]);
$post = $stmt->fetch();
if ($post) {
cache_set($cacheKey, $post, 45);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Filter out non‑public articles on slug view

The public post endpoint fetches any article by slug without checking status, so draft or otherwise unpublished posts become fully readable whenever someone guesses or retains the slug, even though the homepage only lists status='public'. This leaks content intended to stay hidden; consider enforcing status='public' (or an auth check) in this query before rendering.

Useful? React with 👍 / 👎.

Comment on lines +9 to +11
$id = (int)($_GET['id'] ?? 0);
$stmt = $pdo->prepare('DELETE FROM articles WHERE id = :id');
$stmt->execute([':id' => $id]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Protect delete endpoint with CSRF token

post_delete.php deletes an article directly from a GET parameter with no CSRF verification, so any logged-in admin can be forced to hit /admin/post_delete.php?id=... via a malicious link and silently delete content. Align this with the other admin forms by requiring POST plus a CSRF token before executing the delete.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant