Car PortalUser Manual Visit Car Portal →
Help & reference

Developer guide

Car Portal is plain PHP with no framework, so changes are easy to find and safe to make.

Folder structure

PathPurpose
index.phpFront controller of the website
include/Core classes: DatabasePDO, PageController, PageModel, TemplateEngine, CarListing, ListingForm, PaymentGateway
extensions/One file per page module (?mod=search loads extensions/search.php) and template tags (*_tag.php)
templates/Themes: template.html, assets/css/style.css, theme.json
languages/Website and seller panel texts (en.php, es.php, de.php)
ADMIN/Admin panel; each menu item is a file category/action.php
USERS/Seller and dealer panel with the same structure
payments/Stripe and PayPal return and webhook endpoints
sql/schema.sql, base.sql, demo.sql
cron.php, sitemap.phpScheduled job and sitemap

Add a new page module

Create extensions/mypage.php; it is immediately available as ?mod=mypage (and with SEO URLs, if you add a rewrite rule).

Template tags

Templates contain tags such as <site footer/>. Each tag is implemented by a file in extensions/. Interface texts use {{ key }} placeholders resolved from the language files, with English as fallback.

Create your own theme

  1. Copy templates/default to templates/mytheme.
  2. Edit template.html and assets/css/style.css; adjust theme.json (name, description).
  3. Select it in Settings › Appearance.

Add a language

Add it in the admin panel (languages), or copy languages/en.php to languages/fr.php and translate the values.

CSS for panels

All admin and seller panel styling uses classes from ADMIN/assets/cp-admin.css and USERS/css/cp-users.css, with no inline styles in the car modules, so restyling is a CSS job.

Combining with Jobs Portal

Car Portal shares the architecture of Jobs Portal (same database class, page controller, template engine, admin and dashboard classes). Both can be merged into one site with separate table prefixes and one shared admin panel.

Always work on a copy of the site and keep a database backup before changing core files.

Last updated