Skip to content

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

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

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

Conversation

@huzely
Copy link
Copy Markdown
Owner

@huzely huzely commented Dec 26, 2025

Summary

  • restructured to required public_html layout with root config.php, cache folder, updated rewrite rules, and direct includes on all files
  • enforced default admin/admin567 credentials in SQL seed, safer uploads, and ad overlay close button matching Shopee flow requirements
  • refreshed stats/README/config paths for dataonline.vn, keeping tracking, telegram queueing, and rate limiting intact

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 +19 to +21
if ($article['status'] !== 'public' && $_POST['status'] === 'public') {
require_once __DIR__ . '/../app/lib/telegram.php';
sendTelegramMessage('Bài mới: '.$_POST['title'].' - '.BASE_URL.'/'.$slug);
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 Publishing posts fails due to bad Telegram include

When changing a draft to public, the code attempts to require_once __DIR__ . '/../app/lib/telegram.php', but that path does not exist (only public_html/lib/telegram.php is present). PHP will raise a fatal error before redirecting or sending notifications, so saving an edit that promotes a post to public currently 500s instead of completing.

Useful? React with 👍 / 👎.

Comment on lines +14 to +16
if (!rate_limit($event, $slug, $window)) { echo json_encode(['ok'=>false,'rate_limited'=>true]); exit; }
log_event($event, $slug, $token);
if ($event==='ad_click') { require_once __DIR__ . '/../app/lib/telegram.php'; queue_click_notify(1); flush_telegram_queue(); }
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 Ad click tracking 500s from missing Telegram include

The ad click endpoint pulls in ../app/lib/telegram.php, but that file is not in the repo (the Telegram helpers live at public_html/lib/telegram.php). Any ad_click request will hit a fatal require error, so the sendBeacon/fetch calls from the overlay return 500 and clicks are neither recorded nor queued for Telegram notification.

Useful? React with 👍 / 👎.

Comment on lines +1 to +5
<?php
require_once __DIR__ . '/../config.php';
require_once __DIR__ . '/../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 Logout does not terminate session

The logout endpoint calls admin_logout() (which just wraps session_destroy()) without first starting the session. Without session_start(), PHP will not destroy the active session or clear the cookie, so hitting /admin/logout.php leaves the admin session intact and the user remains logged in on the next request.

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