πDocs for Toplist Script
Install, configure, and run your toplist site. 18 sections covering admin, content, affiliates, and troubleshooting.
Quick start
New to Toplist Script? Upload the files, edit config/config.php, run install/install.php, delete the install folder, and log in at /admin/. Change the default password before you publish anything.
Introduction
A self-hosted PHP CMS built specifically for ranked comparison and affiliate toplist sites.
Toplist Script is a PHP-based toplist CMS for ranked comparison and directory sites. The public site shows a category grid homepage, category listing pages, and individual review pages for each ranked entry. The admin panel handles content, layout, affiliates, analytics, and AI-assisted publishing.
What you get out of the box:
- Homepage grid layout with drag-and-drop editor
- Categories and ranked entries (manual sort order)
- Per-entry review pages with pros, cons, ratings, and thumbnails
- Affiliate link fields and site-wide outbound tracking
- Self-hosted analytics (pageviews and outbound clicks)
- AI Generator for categories and website discovery
- Light/dark theme, color schemes, popups, and info pages
There is no Composer install and no .env file. Configuration is config/config.php plus a MySQL settings table managed from admin.
Server requirements
What your host needs before you upload the script.
| Requirement | Details |
|---|---|
| PHP | 8.0 or higher (8.3+ recommended). Uses strict types, PDO, curl, GD |
| Database | MySQL 5.7+ or MariaDB with InnoDB, utf8mb4 |
| Web server | Apache with mod_rewrite (or equivalent URL rewriting) |
| PHP extensions | pdo_mysql (required), curl (AI, thumbnails, favicons), gd (image uploads) |
| Writable folders | assets/images/thumbs/, assets/uploads/, storage/favicons/ |
Optional: OpenAI API key for AI Generator; ScreenshotOne or Site-Shot keys for thumbnail capture on protected sites.
Installation
From ZIP upload to first admin login β typically under five minutes on standard shared hosting.
- Upload the script to your web root (e.g.
public_htmlorhtdocs/toplist). - Edit
config/config.phpβ setDB_HOST,DB_NAME,DB_USER,DB_PASS. - If the site is not in a subfolder, ensure
RewriteBasein.htaccessmatches your path (default/toplist/). - Visit
https://yourdomain.com/install/install.php(adjust path if not in/toplist/). - The installer creates the database from
database/schema.sql, seeds sample content if empty, creates default settings, and adds an admin user if none exists. - Delete the
install/folder when installation succeeds. - Log in at
/admin/login.phpand change the default password immediately.
Default credentials (first install only): username admin, password admin123. Change this under Account β Password before going live.
Example β edit before running the installer
// config/config.php
define('DB_HOST', '127.0.0.1');
define('DB_NAME', 'toplist_cms');
define('DB_USER', 'your_db_user');
define('DB_PASS', 'your_db_password');
After updates to the script, run /install/migrate.php once to apply database migrations (v2 through v11).
Configuration
File-based database credentials plus admin-managed site settings.
config/config.php
File path: config/config.php
DB_HOST,DB_NAME,DB_USER,DB_PASSβ database connectionAPP_NAME,APP_TAGLINEβ defaults; usually overridden by admin settingsBASE_PATHandBASE_URLβ auto-detected from the request (strips/admin,/install,/api)
Settings table (admin-managed)
Most site behavior is stored in the settings table and edited under Admin β Settings and related Site screens. Key groups:
- Site identity β site name, meta description, contact email, Telegram, social follow URL
- Outbound link tracking β query parameter name (default
ref) and value; leave value empty to disable - Analytics β enable/disable, retention days (7β365)
- Thumbnails β screenshot API keys, proxy list, capture preferences
- AI β OpenAI API key (stored encoded), model selection
Admin panel
Everything you manage after install β content, layout, affiliates, and site settings.
URL: {your-site}/admin/
Navigation is grouped into four areas:
| Group | Screens |
|---|---|
| Content | Dashboard, Categories, Entries, Reports, Analytics, Layout editor |
| Tools | AI Generator |
| Site | Settings, Links, Appearance, Site images, Colors, Homepage, Pages, Info pages, Popups |
| Account | Password |
Dashboard shows setup health, recent entries, KPIs, and a short analytics chart. Use it to spot missing thumbnails, descriptions, or meta fields before launch.
Reports lists problems visitors submit from entry pages (broken links, outdated info, etc.). Requires the entry_reports table from migrations β run install/migrate.php if the screen shows a setup warning.
Top bar actions: View site, + New entry, username menu.
Categories
Homepage grid blocks β each category is a ranked list with its own URL.
Categories are the homepage grid blocks and listing sections (e.g. βBest VPNsβ, βProject management toolsβ). Each category has its own public URL: /{slug}/
Admin β Categories β Add category
Important fields:
- Name and Slug β public title and URL
- Description and Intro headline β category page copy
- Icon β CSS icon class or emoji
- Accent / title line / button colors β RGB values for the block
- Grid column (1β4) and Sort order β homepage position
- Visible rows β how many entries show on the homepage block
- Meta title and Meta description β SEO for the category page
- Active β hide without deleting
Entries
Individual ranked sites with reviews, thumbnails, and affiliate outbound links.
Entries are the ranked sites inside a category. Ranking is controlled by Sort order (lower number = higher rank). There is no public voting β order is set in admin.
Admin β Entries β + New entry or use the layout editor / AI Generator.
Important fields:
- Category, Name, Slug
- URL β destination website
- Affiliate link β optional; overrides outbound URL when valid (see Affiliates)
- Thumbnail β auto-captured screenshot or manual upload
- Description β short summary
- Review content β full HTML review (rich editor)
- Rating, Pros, Cons
- NEW / Featured badges
- nofollow on outbound links (default on)
- Meta title / Meta description
- Active, Skip snapshot
Public URLs:
- Review page:
/{entry-id}/{slug}/ - Outbound βVisit siteβ uses affiliate URL when set, otherwise the entry URL
Entries list supports filtering by category, completeness flags (missing thumb, description, review, etc.), drag reorder when filtered to one category, and bulk AI fill.
Layout editor
Drag-and-drop homepage editing on the live site β no separate builder screen.
The layout editor is not a separate admin page β it runs on the live homepage while you are logged in as admin.
Open it: Admin β Layout editor (or visit the homepage while logged in).
You will see a βHomepage layoutβ bar with:
- Drag category blocks to reposition and resize on the 4-column grid
- Drag β Ώ handles on entry rows to reorder rankings
- Hover entry row β Γ to remove from the block
- Category colors β bulk overwrite line and button colors
- Background β light/dark page patterns
- Footer block, social icons, and footer links at the bottom of the page
- Previews β welcome modal, promo bubble, chat widget, and other overlays
- Save layout β commits grid position, visible rows, colors, and entry order
Changes are saved via POST /api/admin-layout.php. Always click Save layout before leaving.
AI Generator
Discover categories, find websites, and enrich copy with OpenAI β directly in admin.
Admin β AI Generator (/admin/ai.php)
Setup
Add your OpenAI API key and choose a model (GPT-5.4 mini is recommended in the UI for cost/quality). Test connection, then save.
Categories tab
- Discover categories β enter topic/niche, language, count (3β20)
- Review proposals β approve, skip, or regenerate
- Enrich with content β slug, headline, description, meta fields
- Save to site
Entries tab (Website Finder)
- Select a category and enter site topic context
- AI discovers real URLs, or paste your own URL list
- Accept or reject each site
- Enrich β descriptions, reviews, pros/cons, meta
- Save entries β optional Publish immediately; thumbnails capture in background
You can also enrich a single category from Category form or fill entry gaps from the Entries list. Prompt chips (e.g. βNo AI slopβ, βKeyword-richβ) adjust generation style.
Affiliate links & tracking
Per-entry partner URLs plus optional site-wide outbound click tagging.
Per-entry affiliate links
On each entry, set Affiliate link to your tracking URL from Impact, CJ, ShareASale, or a direct program. When valid, every βVisit siteβ button uses this URL instead of the plain destination URL.
Affiliate links are marked so site-wide ref tracking is not appended on top of partner URLs (avoids broken double tracking).
Site-wide outbound tracking
Admin β Settings β Site identity β Outbound link tracking
- Query parameter name β default
ref - Parameter value β e.g. your site identifier; leave empty to disable
When enabled, external clicks on category links get ?ref=yourvalue appended client-side. This is separate from affiliate network links and from self-hosted analytics.
Analytics
Built-in pageview and outbound click tracking β no third-party script required.
Admin β Analytics β self-hosted pageview and click tracking. No Google Analytics required.
- Enable under Settings β Site identity β Enable analytics tracking
- Set Raw data retention (7β365 days)
- View trends for pageviews, outbound clicks, and top pages/entries
Data is collected via POST /api/analytics-collect.php from the front-end. Admin pages are not indexed and use noindex, nofollow.
Appearance, colors & themes
Light/dark mode, color schemes, logos, and UI image overrides.
Light / dark mode
Visitors can toggle light/dark theme. Configure separate background patterns for each mode under Appearance or from the layout editor Background control.
Color schemes
Admin β Colors β preset schemes (Classic Orange, Ocean Breeze, Forest Trust, Royal Violet, Ember Sunset, Graphite Pro, etc.) plus per-token overrides for brand, footer, browser chrome, and more.
Logos & images
Appearance β site logo, mobile logo, favicon, backgrounds, footer banner.
Site images β replace UI sprites, badges, OG default image, toggle icons.
Homepage footer block
Admin β Homepage β rich HTML footer/FAQ section, gradient colors, bottom bar styling.
Info pages & popups
Legal pages, footer links, and on-site overlays like welcome modals and chat widgets.
Info pages
Admin β Info pages β About, FAQ, legal pages at /{slug}/ (routed via route.php). Each page has title, slug, HTML body, and meta fields.
Pages (entry templates)
Admin β Pages β entry disclaimer text, mobile toolbar, bottom promo block settings.
Popups
Admin β Popups β welcome modal, promo bubble, chat widget, language suggest, review disclaimer, report review, saved drawer, βBuy this Scriptβ overlay. Preview from the layout editor Previews menu.
Links
Admin β Links β footer social icons, footer link columns, promo/copyright JSON config.
SEO
Clean URLs, per-page meta, canonical tags, and Open Graph out of the box.
Built-in SEO features:
- Clean URLs:
/{category-slug}/,/{id}/{entry-slug}/ - Per-page meta title and meta description on homepage, categories, entries, and info pages
<link rel="canonical">on all public pages- Open Graph tags (
og:title,og:description,og:url,og:image) - BreadcrumbList schema on category pages
- Configurable
nofollowon outbound entry links - On-site search (
/search.php) - Related entries β a "Sites like {entry}" module on every review page, linking to other entries in the same category
- Performance: critical CSS, deferred stylesheets, cache-busted assets
Not included: automatic XML sitemap generator or robots.txt file β add these at server level if needed.
URL structure
How public routes map to pages and JSON APIs.
| URL | Page |
|---|---|
/ | Homepage (category grid) |
/{slug}/ | Category listing or info page |
/{id}/{slug}/ | Entry review page |
/search.php?q= | Search results |
/admin/ | Admin dashboard |
/json/{slug}/ | Category entries JSON API |
Rewrite rules live in .htaccess. If you deploy to domain root instead of /toplist/, update RewriteBase accordingly.
Updates & migrations
How to safely update the script and apply database changes.
After uploading a new version of the script:
- Back up your database and
assets/uploads/folder - Overwrite PHP files (keep
config/config.phpand uploaded assets) - Visit
/install/migrate.phponce - Confirm admin dashboard loads and run a quick front-end check
Migrations add features incrementally (entry pros/cons, affiliate URLs, info pages, analytics tables, skip snapshot, etc.).
Troubleshooting
The most common setup issues and where to look first.
| Problem | What to check |
|---|---|
| 404 on all pages except homepage | mod_rewrite enabled; RewriteBase in .htaccess matches install path |
| Blank page / 500 error | PHP version β₯ 8.0; PDO MySQL enabled; check server error log |
| Database connection failed | config/config.php credentials; MySQL user privileges on database |
| Thumbnails not generating | curl enabled; outbound HTTP allowed; optional screenshot API keys in Settings β Thumbnails |
| AI Generator errors | OpenAI key saved in AI Generator β Setup; server can reach api.openai.com |
| Layout changes not saving | Logged in as admin; click Save layout; check browser console for API errors |
| Affiliate links not used | Affiliate URL field valid on entry; clear site ref conflict β affiliate links exclude double params automatically |
Key files reference
Important paths when debugging or deploying updates.
| Path | Purpose |
|---|---|
config/config.php | Database and base URL config |
database/schema.sql | Full database schema |
install/install.php | One-time installer |
install/migrate.php | Migration runner |
.htaccess | URL rewriting |
admin/login.php | Admin login |
admin/ai.php | AI Generator UI |
api/admin-layout.php | Layout editor save API |
api/admin-ai.php | AI Generator API |
includes/ai.php | AI generation logic |
includes/analytics.php | Analytics rollup logic |
Questions after purchase? Email [email protected] with your license email.