[Mod] Skull Classifieds

Started by Deaks, Dec 05, 2026, 02:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Deaks

Skull Classifieds 1.1.1
A marketplace for SMF 2.1.x from BoredSkull.net
ISC licence • Build your forum, your way!



Requirements
  • SMF 2.1.x
  • PHP 7.0 or newer with GD (photos) and cURL (Stripe)
  • A transactional database (InnoDB on MySQL/MariaDB, or PostgreSQL)

Installing or upgrading
Upload the ZIP under Admin → Package Manager and install it. Settings live under Configuration → Skull Classifieds (General, Categories, Payments).

Upgrading from 1.0.0 or 1.1.0: uninstall the old version without ticking "remove data", then install 1.1.1. The installer:
  • adds the new columns and tables
  • moves categories from the old comma-separated setting into a table, so renaming one never orphans listings
  • converts stored text to SMF's normal escaped form
  • moves base64 photos out of the database into re-encoded files, which strips EXIF and GPS data
It is safe to run the installer more than once.



What's new in 1.1.1
  • No double payments: if a seller reopens or closes a reserved ad, or a moderator hides it, any checkout the buyer still has open is cancelled. A late payment can never sell an ad twice. If one slips through anyway, it is logged so the admin can refund it.
  • Unhide restores the ad's state: a sold, reserved or pending ad goes back to that state instead of going back on sale.
  • Longer text is checked properly: titles, towns, reports and category names full of quotes or ampersands no longer cause a database error.
  • Report alerts: moderators are alerted only once the report has been saved.



Trading
  • Listing types: fixed price, auction, wanted, swap and giveaway.
  • Photos: up to 20 per listing (the default is 6), as JPEG, PNG or WebP. Each photo is re-encoded with GD. That drops EXIF and GPS data, applies the camera orientation, caps the image at 1600 px and makes a thumbnail. Files are stored in [tt]skc_photos/[/tt] with random names and are served through a permission check.
  • Descriptions: written in the standard SMF editor, so BBCode, smileys and editor mods all work.
  • Buy now: reserves a fixed-price ad for the buyer at the asking price.
  • Private offers: either side can counter, and accepting reserves the ad. A reserved buyer has a set number of hours to pay (the default is 48). After that the ad goes back on sale and both sides are alerted.
  • Auctions: there's a minimum bid increment (the default is 1.00), a bid history and an optional soft close.
  • Relist and bump: a seller can relist an expired or closed ad. A seller can also bump a live ad once per interval (the default is 24 hours; 0 turns bumping off).
  • Featured listings: moderators can feature an ad for free. Sellers can also buy featured placement through Stripe when the admin sets a price. Featured ads show first in Browse with a highlight.
  • Closing deals: sellers can close a finished deal even after the ad has expired.



Payments (Stripe Connect)
  • Turn this on under Configuration → Skull Classifieds → Payments.
  • Enter your Stripe secret key.
  • Add a webhook endpoint at [tt]https://YOUR-FORUM/skc_stripe_webhook.php[/tt] for these events: [tt]checkout.session.completed[/tt], [tt]checkout.session.async_payment_succeeded[/tt], [tt]checkout.session.expired[/tt] and [tt]charge.refunded[/tt]. Paste its signing secret into the settings.
  • Optional: add a Connect endpoint for [tt]account.updated[/tt] with its own secret. This keeps each seller's status current.
  • Set the forum fee (0–50%) and, if you want, a price for featured placement.
Sellers connect a Stripe Express account under Classifieds → Payouts. When the seller is ready, the reserved buyer or auction winner sees Pay by card. Checkout is hosted by Stripe, and the money goes straight to the seller minus the forum fee (destination charges). An order is only marked paid from data that Stripe signed or that the forum fetched from Stripe itself. On paid, the ad becomes Sold and both sides get an alert. Refunds are made in the Stripe dashboard and are picked up by the webhook. If a seller reopens or closes a reserved ad, or a moderator hides it, any checkout the buyer still has open is cancelled, so an ad can never be paid for twice.



Alerts
Members get SMF alerts for:
  • offers, counter-offers, accept, decline, withdraw and Buy now
  • bids, being outbid, auction results, and auctions that end without bids
  • expiry, approval, hiding and featuring
  • payments and refunds
  • reports and pending listings (moderators only)
Members can switch each group on or off under Profile → Alerts. A scheduled task runs every 15 minutes to end auctions and release unpaid reservations. Classifieds pages also do the same catch-up, so quiet forums stay correct.



Administration
There are three permissions, in their own "Skull Classifieds" group. Guests can only ever have Browse.

Moderators can:
  • approve listings (the listing's clock starts on approval)
  • edit any listing that has no bids (it keeps its current status)
  • hide and unhide listings (unhiding puts the ad back in the state it was in)
  • feature listings
  • dismiss reports
The classifieds also show up in Who's Online and on the credits page.

A normal uninstall removes the files, hooks and scheduled task, and keeps your data. Ticking SMF's "remove data" box also removes listings, photos, orders, sellers, alerts, settings and permissions.



For companion mods
Text fields (title, town, description, report and category names) are stored escaped, the same way SMF stores message subjects. [tt]skc_public_listing($id)[/tt] returns a listing only if the current member is allowed to see it.

HookArgumentsWhen it fires
[tt]integrate_skull_classifieds_saved[/tt]Listing ID, resulting statusAfter a listing is created or edited
[tt]integrate_skull_classifieds_changed[/tt]Listing ID, action, acting member IDAfter a bid, Buy now, a state change, moderation or payment



Testing before you go live
Use separate seller, buyer, second-buyer and moderator accounts. Use Stripe test mode with the Stripe CLI:
stripe listen --forward-to https://YOUR-FORUM/skc_stripe_webhook.phpGo through:
  • Onboard a seller.
  • Buy now, then pay with card [tt]4242 4242 4242 4242[/tt].
  • Make an offer, counter it and accept it.
  • Let a reservation time out.
  • Run an auction, outbid, win, then pay.
  • Make a refund.
  • Buy featured placement.
  • Bump a listing and relist one.
  • Upload a phone photo and confirm its GPS data is gone.
  • Start a checkout, have the seller make the ad available again, and confirm the old checkout page can no longer be paid.
  • Uninstall keeping data, then reinstall.
  • 0 reactions

    Members who reacted