|
|
6 روز پیش | |
|---|---|---|
| admin | 6 روز پیش | |
| css | 6 روز پیش | |
| includes | 6 روز پیش | |
| public | 6 روز پیش | |
| setup | 6 روز پیش | |
| README.md | 6 روز پیش |
A simple, clean web publication system built with PHP and MariaDB. This system allows you to create, manage, and publish articles or blog posts with categories, search functionality, and a responsive admin interface.
Create a database and user for the system:
CREATE DATABASE webpub;
CREATE USER 'webpub_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON webpub.* TO 'webpub_user'@'localhost';
FLUSH PRIVILEGES;
Place the files in your web root or a subdirectory. For example:
/var/www/html/web-pub-system/
setup/ directory is accessible via web browserhttp://your-domain.com/web-pub-system/setup/After successful installation:
Delete the setup directory for security:
rm -rf /path/to/web-pub-system/setup/
Set proper file permissions:
chmod 755 /path/to/web-pub-system/
chmod 644 /path/to/web-pub-system/includes/config.php
web-pub-system/
|-- admin/ # Admin interface files
| |-- index.php # Dashboard
| |-- login.php # Login page
| |-- edit.php # Create/edit publications
| |-- logout.php # Logout handler
| |-- publications.php # Publication management
| |-- categories.php # Category management
|-- public/ # Public-facing pages
| |-- index.php # Homepage with publication list
| |-- publication.php # Individual publication view
| |-- search.php # Search results
| |-- categories.php # Category listings
|-- includes/ # Core PHP classes
| |-- config.php # Configuration (created during setup)
| |-- database.php # Database connection class
| |-- auth.php # Authentication class
| |-- publication.php # Publication model class
|-- css/ # Stylesheets
| |-- style.css # Main stylesheet
|-- setup/ # Installation files (delete after use)
| |-- setup.php # Setup wizard
| |-- database.sql # Database schema
|-- README.md # This file
http://your-domain.com/web-pub-system/admin/The public site is available at: http://your-domain.com/web-pub-system/public/
Features:
The main configuration is stored in includes/config.php and is created during setup. Key settings include:
// Database configuration
define('DB_HOST', 'localhost');
define('DB_NAME', 'webpub');
define('DB_USER', 'your_db_user');
define('DB_PASS', 'your_db_password');
// Site configuration
define('SITE_TITLE', 'Web Publication System');
define('SITE_URL', 'http://your-domain.com/web-pub-system/');
define('ADMIN_EMAIL', 'admin@example.com');
setup/ directory after installationEdit css/style.css to customize the appearance. The CSS is organized with clear sections for:
The database schema is defined in setup/database.sql. You can extend it by:
The system is built with an object-oriented approach, making it easy to extend:
includes/ directoryadmin/ directorypublic/ directoryDatabase Connection Error
includes/config.phpBlank Pages
Login Issues
Enable PHP error logging for debugging:
// Add to top of index.php or config.php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
This project is open source and available under the MIT License.
For issues and questions: