Markdown Reader

xchange Documentation › XCHANGE_DOCUMENTATION_EN

Xchange Documentation En

Feature: Xchange #

User-to-user marketplace. Lets members sell, trade or give away items. Each listing has a transaction type, photos, a description, a status, and a transaction and rating system between members.

Installation and Configuration

Via FTP: Upload the xchange/ directory into /plugins/, then import xchange/sql/xchange.sql.

Via package manager: Select xchange from the available plugins list.

Paths:

  • Main plugin: /plugins/xchange/xchange.php
  • Library: /plugins/xchange/lib/xchange.lib.inc.php
  • AJAX handler: /plugins/xchange/handlers/xchange.mod.php
  • User profile: /plugins/xchange/profile/
  • CSS / JS: /plugins/xchange/css/, /plugins/xchange/js/

Configuration parameters:

| Variable | Default | Description |

|---|---|---|

| $basedatadisplay | 'yes' | Visible in the management interface |

| $basedisplevel | BASE_LEVEL_USER | Available to logged-in users |

| $ftype | 6 | Application module |

| XCHANGE_MAX_PHOTOS | 5 | Max photos per listing |

| XCHANGE_MAX_TITLE | 128 | Max title length |

| XCHANGE_MAX_DESCRIPTION | 5000 | Max description length |

| XCHANGE_ITEMS_PER_PAGE | 20 | Listings per page |

Transaction types: sell, trade, sell or trade, gift with shipping paid by the receiver, gift with local pickup.

Listing statuses: draft, active, under option, sold, traded, removed, gifted.

Transaction statuses: pending, accepted, completed, cancelled, disputed.

Rating: 1 to 5 stars between buyer and seller after a transaction.

SQL tables used: xchange_products, xchange_transactions, xchange_ratings, xchange_blacklist, users

Usage

Navigation tabs:

  • Browse (view=browse) — paginated list of active listings, filterable by category.
  • Detail (view=detail&pid=…) — full listing page, photos, seller, transaction actions.
  • My listings (view=my) — management of the logged-in user's listings.
  • My purchases (view=purchases) — transaction history on the buyer side.
  • New / Edit (view=new / view=edit) — create and edit a listing (sellers only).

The user profile embeds listings and history through the profile/ pages.

Hooks and Entry Points

text
?obj=xchange.php&view=browse              — Listings
?obj=xchange.php&view=detail&pid=ID       — Listing detail
?obj=xchange.php&view=my                  — My listings
?obj=xchange.php&view=purchases           — My purchases
?obj=xchange.php&view=new                 — New listing
?obj=xchange.php&view=edit&pid=ID         — Edit a listing
?obj=xchange.mod                          — AJAX endpoint (transaction actions)

Sitemap: conf/xchange.sitemap.json. Moderation: conf/xchange_products.moderation.json, conf/xchange_transactions.moderation.json.

Dependencies

  • Beamreactor\Database\SQL
  • Beamreactor\Sanitizer\Parser
  • BeamReactor moderation system (listings and transactions)

Security

Restricted to logged-in users (XCHANGE_LEVEL_BUYER). Creating listings requires the seller level (XCHANGE_LEVEL_SELLER). A blacklist (xchange_blacklist) allows members to be excluded. All input is sanitized through Parser::sanitize() and queries use bound parameters.