Manuals
RU EN

Products · 67

Photos in PHP Script Listings

Products 6 min read

Photos in a PHP classifieds script are the card gallery: original, feed preview, frame order, and sometimes watermark. Without mobile uploads, the board looks empty even when descriptions are good. During acceptance, I first upload a jpeg from an Android camera, not an 80 KB demo image.

Folder permissions: chmod. VIP with broken previews is useless: VIP.

What storage must handle

  • Accept jpeg/png/webp within sane limits, often 5-10 MB per file.
  • Create previews for list and card views, with different sizes.
  • Preserve order: first photo becomes the feed cover.
  • Delete one frame without breaking the whole gallery.
  • Reject php/phtml disguised as an image.

As a reference, 8-12 photos per listing is enough for goods; cars and real estate may need more. Unlimited "50 frames" kills disk space and moderator patience.

Server settings behind "the button does not work"

Symptoms: spinner and silence, 413, or empty response. Check:

  1. upload_max_filesize and post_max_size in PHP; the latter must exceed the total file set.
  2. Nginx client_max_body_size if a proxy is used.
  3. Permissions on upload/ or storage/; www-data must write.
  4. Disk space, banal but real.
  5. GD/Imagick; without them previews are not built and huge originals remain in the feed.
Mobile HEIC. iPhones sometimes upload HEIC. Either implement conversion or show a clear error asking for jpeg. Silent failure on iOS loses half the authors.

Posting wizard flow

  1. File selection or camera.
  2. Client preview if available plus progress.
  3. Server response with file id.
  4. Drag-and-drop sorting before form submission.
  5. After saving the listing, the same files appear in the card and moderation queue.

Moderators need previews in the queue without opening every 5 MB original. Otherwise the queue stalls.

Watermark and borrowed photos

A platform watermark reduces simple theft but ruins the view if opacity is too high. Put it in a corner, not across the center. Photos with other marketplaces' watermarks should be rejected by a template; this is common spam when launching an Avito-like site.

Feed performance

Serve small previews in lists, not originals. Lazy-load images below the first screen on mobile. Webp as a derived format is a plus, but keep jpeg fallback. Broken paths after domain migration are fixed by URL replacement script or symlink, not one card at a time.

  • Home and category: only thumb.
  • Card: medium size plus lightbox original/large image.
  • Image sitemap if desired when there is a lot of content.

Typical production mistakes

  • Upload works for admin in the panel but not for authors on the frontend because handlers differ.
  • After editing a listing, old files stay forever as disk orphans.
  • Cover does not update because CDN cache keeps old thumb; use a query version or new filename.
  • The VIP block uses another template without onerror, leaving blank holes.

I do not consider board launch complete without checking photos: board. Marketplace: turnkey.

Implement mobile upload, previews, frame order, and sane limits. Then moderation and VIP make sense because people have something to look at in the feed. Text-only classifieds are rarely opened.

Photo moderation: fast rules

To keep the queue from becoming an art board, give moderators four rejection reasons:

  • no photo of the item or premises;
  • another platform's watermark;
  • collage with phone numbers and "write on WhatsApp" over the frame;
  • too blurred to recognize; ask for a retake.

Do not reject based on taste such as a weak angle, or authors leave. Minimum: it is clear what is being sold. For real estate, ask for at least 3 frames; for services, a result or workplace photo is better than stock from image search.

Disk, CDN, migration

After six months, upload/ becomes the heaviest part of the backup. Policy:

  1. Compress the original by the long side, for example 1920px, if 4K is not needed.
  2. Store previews separately and never serve originals in the feed.
  3. When deleting a listing, clean files or mark orphans and run garbage cron.
  4. After domain migration, check the database for absolute URLs to the old host.

I add CDN when the main server starts serving images slowly over mobile LTE. Before that, normal thumbs and browser cache are enough. If CDN is used, changing a cover must create a new filename or query version, or the old sofa remains on the home page for a week.

Finally, make photos required in key categories. Text-only lots can remain for jobs and services if you decide so, but for goods and cars I require an image. Otherwise "with photo" becomes the only usable filter, and the unfiltered feed looks like an old forum.

Errors the user sees

Write clear messages: "file is larger than 8 MB", "jpeg or png required", "could not save, try again". Abstract "upload error" creates repeat tickets. Show progress on slow internet; if a request breaks, do not consider the listing submitted without photos when the category requires them. The author should be able to add photos from the account without starting over.

Photos are half of a classifieds product. Close permissions, limits, previews, mobile HEIC/jpeg, and moderation templates. Then VIP, filters, and advertising begin to make sense: the feed has visuals, not empty placeholders and text rows.

Frame order and cover

The first frame decides whether the card is opened. Let the author explicitly choose the cover, not only accept upload order. In a VIP block, cover quality matters twice as much: a blurry image in a highlighted slot looks worse than a normal preview. In moderation, look at the cover first; sometimes asking to set a better first frame is enough.

Enable EXIF auto-rotation if the script supports it; phone photos otherwise appear sideways and look broken. Photos in a PHP classifieds script are product hygiene. Limits, previews, permissions, clear errors, and required frames in product categories. Close this, and other features work for trust instead of hiding empty squares.

FAQ

Photos in listings php script?

Without proper photo upload, a board looks empty; check upload and permissions.

How long does “Photos in PHP Script Listings” take?

About 6 minutes to read. In practice it depends on your hosting and database setup.

Do I need a dedicated server?

For most scripts, shared hosting or a VDS with PHP and MySQL is enough. See the VDS section and PHP/MySQL requirements.

Php classifieds board script?

See the related manual for this query. php classifieds board script

Buy a turnkey classifieds script?

See the related manual for this query. buy a turnkey classifieds script

Section
Classifieds board script

Launch and configure a classifieds marketplace on your own domain.