ClassiPHPied is a simple, free, and open-source PHP Classified Ads System. Yes, this is not a “we have a load of features, but you won’t even use half of them” kind of system. This is just a basic one, with the raw essentials to you started quickly – Be it for a small business, or expanding on top of it.
TABLE OF CONTENTS
DOWNLOAD & NOTES
First, here are the download links and a quick “setup guide” for the impatient folks who don’t have the patience to read through everything.
REQUIREMENTS
- Apache Mod Rewrite
- PHP MYSQL PDO Extension
- Best to have at least PHP 7.4
- “Grade A” browser
ClassiPHPied has not been extensively tested, but it is developed and works on a WAMP8 (Apache MySQL PHP 8) server.
INSTALLATION
Just access index.php
in your browser and walk through the installer. Login at http://your-site.com/admin
.
LICENSE & DOWNLOAD
ClassiPHPied is released under the MIT License. You are free to use it for your own personal and commercial projects, modify it as you see fit. On the condition that there the software is provided “as-is”. There are no warranties provided and “no strings attached”. Code Boxx and the authors are not liable for any claims, damages, or liabilities.
Download ClassiPHPied | GitHub | SourceForge
HOW TO USE
So far so good? Let us now go through a quick crash course on how to use ClassiPHPied.
STEP 0) ACCESS ADMIN PANEL
The admin panel is deployed at http://your-site.com/admin
.
STEP 1) REGISTER CATEGORIES
Go to the “Manage Categories” section, register all your categories – Vehicles, jobs, properties, and whatever else you want.
STEP 2) UPLOAD IMAGES
Next, go to the “Manage Images” section and upload all your images.
STEP 3) CREATE CLASSIFIED ADS
Lastly, go to the “Manage Classifieds” section, register all the ads.
DONE!
That’s all! Head back to the front end and verify the listings.
QUICK REFERENCE
This section is for the developers, a quick walkthrough of the general system structures.
FOLDER STRUCTURE
api
API handlers.assets
Public images, CSS, Javascript, and whatever else.lib
Core library files.pages
HTML pages.
Yes, there are only 4 folders in the entire system.
THE DATABASE
Field | Description |
cat_id |
Category ID, primary key. |
cat_name |
Category name. |
cat_desc |
Category description, if any. |
Field | Description |
cla_id |
Classified ID, primary key. |
cla_title |
Title (255 characters max). |
cla_summary |
A short summary (255 characters max). |
cla_text |
The body text. |
cla_person |
Contact person (or company). |
cla_email |
Contact email. |
cla_tel |
Contact telephone number. |
Field | Description |
cla_id |
Partial primary key and foreign key. |
slot_id |
Partial primary key. |
img_file |
Image file attached to the ad. |
Field | Description |
cla_id |
Partial primary key and foreign key. |
cat_id |
Partial primary key and foreign key. |
Field | Description |
user_id |
The user ID, primary key. |
user_name |
The user name. |
user_email |
The user’s email address. |
user_password |
The password. Encrypted. |
THE FRAMEWORKS & CREDITS
ClassiPHPied is built using:
- Bootstrap
- TinyMCE
- Core Boxx. Believe it or not, the initial version of ClassiPHPied is built within 48 man-hours using:
Go ahead and check those out if you want… The other “pre-developed” modules of Core Boxx should also snap right in.
DEVELOPING CLASSIPHPIED
As simple as it may be, going through the entire system is still going to take some time. So instead of “explaining line-by-line”, here is a condensed version of “how to quickly customize and upgrade”.
STEP 1) CREATE/MODIFY DATABASE TABLES
Add your new tables or views, modify the existing ones.
STEP 2) ADD/UPDATE SYSTEM MODULE
class Report extends Core {
function getNewClassifieds () {
return $this->DB->fetchAll(
"SELECT * FROM `classifieds` ORDER BY `cla_date` DESC LIMIT 0, 20",
null
);
}
}
To add a new module, create lib/LIB-Module.php
. Define class Module extends Core
, and add functions inside. In this example, we add a new report module – lib/LIB-Report.php
and class Report extends Core
.
That’s all. This new module can now be loaded via $_CORE->load("Report")
and the function can be accessed via $_CORE->Report->getNewClassifieds()
.
STEP 3) ADD/UPDATE API ENDPOINT (OPTIONAL)
// (A) MUST BE SIGNED IN
if (!isset($_SESS["user"])) {
$_CORE->respond(0, "Please sign in first", null, null, 403);
}
switch ($_REQ) {
// (B) INVALID REQUEST
default:
$_CORE->respond(0, "Invalid request", null, null, 400);
break;
// (C) GET NEW CLASSIFIEDS REPORT
case "getNewClassifieds":
$_CORE->autoGETAPI("Report", "getNewClassifieds");
break;
}
Create api/API-Module.php
. For this example, access http://site.com/Report/getNewClassifieds/
to get the report – The API will reply with a JSON encoded string.
STEP 4) ADD/UPDATE HTML CSS JAVASCRIPT
- Add your new pages in
pages/
.- For example,
pages/PAGE-about.php
will be accessed fromhttp://site.com/about
. - For admin pages, it is
pages/ADM-report.php
andhttp://site.com/admin/report
instead. - Take note –
ADM-name.php
can only be accessed by users who are signed in.
- For example,
That’s about it. Just reverse engineer and copy from the existing libraries, API, and pages… You will see the development pattern here.
COMMON PROBLEMS & FIXING THEM
Storage Boxx is “not working”? Here are a few of the common problems and how to “fix” them.
I FORGOT THE PASSWORD OR DELETED ALL ADMIN ACCOUNTS
require "lib/CORE-go.php";
$_CORE->load("Users");
$_CORE->Users->save("NAME", "EMAIL", "PASSWORD", OPTIONAL-USER-ID);
Just create an “account recovery” script to create a new account (or update an existing one). Run and delete this afterward.
MIGRATING TO A NEW DOMAIN OR CHANGING THE URL PATH
- Simply update
HOST_BASE
inlib/CORE-config.php
. - Run
$_CORE->Route->init()
to update the.htaccess
andapi/.htaccess
files. - Clear the browser cache to prevent irritating cache redirects.
MANUAL INSTALLATION
- Create a database and import
lib/SQL-classiphpied.sql
. - Open
lib/CORE-config.php
, update the settings to your own.- The host settings.
- Database settings.
- If you want to develop mobile apps, consider enabling CORS.
- Generate your own JWT secret key, set the issuer to your domain or company name.
- Run
$_CORE->Route->init()
to create the.htaccess
andapi/.htaccess
files. - Create your own admin user, see “forgot password” above.
- Rename
lib/INSTALL-index.foo
toindex.php
.
UPGRADING
- If your existing copy has an
options
table – Just override all the files and accessindex.php
. The installer will take care of database updates (if any). - If not – Manually import the
options
table fromSQL-classiphpied.sql
, create aCLAPHP_VER
entry with a value of0
and group0
. Thereafter, just copy the new files and let the installer do the magic.
NOT WORKING. DON’T KNOW WHY.
Open the developer’s console, reload the page and see the error message.
It happened… Again…
Unable to connect to database – SQLSTATE[HY000] [1045] Access denied for user ‘root’@’localhost’ (using password: NO)
As it is. Access and permission issues on your server. Read up on basic MYSQL account management on your own.
https://code-boxx.com/faq/#help “Answers can be found all over the Internet”
Preview of this software?
https://code-boxx.com/faq/#nodemo
its showing fetch error why??
EDIT: Small bug in the installer addressed,
HOST_BASE
is not updated properly.