Skip to content

Build shared-hosting news site with ad flow and themes#29

Open
huzely wants to merge 1 commit intomasterfrom
codex/develop-complete-news-website-source-code-f9qtl1
Open

Build shared-hosting news site with ad flow and themes#29
huzely wants to merge 1 commit intomasterfrom
codex/develop-complete-news-website-source-code-f9qtl1

Conversation

@huzely
Copy link
Copy Markdown
Owner

@huzely huzely commented Dec 25, 2025

Summary

  • rebuild news portal into required public_html layout with slug routing, three switchable frontend themes, Shopee overlay flow, and cached home/article rendering
  • implement admin auth/CRUD/settings/stats with safer uploads, per-type stats reset, top-post metrics, and config-driven ads/themes/telegram
  • add MySQL schema with seeds, tracking API with rate limiting and hashed fingerprints, telegram queue/flush, and deployment README for dataonline.vn

Testing

  • php -l on all PHP files

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 +1 to +4
<?php
require_once __DIR__ . '/../app/lib/auth.php';
admin_logout();
header('Location: ' . BASE_URL . '/admin/login.php');
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 Start session before destroying on logout

The logout handler calls admin_logout() (which only runs session_destroy()) without ever starting the session. Without session_start(), PHP ignores the destroy request and leaves the existing admin_id session cookie intact, so hitting /admin/logout.php does not actually log the user out—subsequent admin pages still see the old session. Start the session (and ideally clear session data) before destroying it to ensure logout works.

Useful? React with 👍 / 👎.

Comment on lines +4 to +8
$id = (int)($_GET['id'] ?? 0);
if ($id) {
$stmt = db()->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

post_delete.php performs destructive deletion on a GET request with no CSRF validation. A logged-in admin who follows a crafted link can trigger an article delete without confirmation, bypassing the CSRF protections used elsewhere. This should be converted to a POST action guarded by csrf_verify() (and ideally removed from GET links) to prevent cross-site deletion.

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