Publisher program (/publishers + zone tiers), chatbot rewritten for LinkSpin, $25 qualification copy fixes

Publisher program (Marty's zone-owner offer for outside site owners):
- /publishers public page: what a zone is, the nine sizes, the waterfall (member ads, network ads, house),
  what pays (viewable only, bots never, warm-up 100 views at 40%, cap), what credits buy, install in four steps
  with the origin lock explained, Standard/Verified tiers, FAQ, and a live "Network right now" strip
- GET /api/public/publishers: zones installed/live, viewable impressions and credits paid in the last 7 days,
  live rates, sizes, warm-up; computed in zones.js and cached a minute
- zones.js: per-zone tier (default standard); verified zones earn network views at nasViewsPerCreditVerified
  (default 8) instead of nasViewsPerCredit (10); member-campaign views stay at viewsPerCredit (5) on both tiers;
  rateFor/tierOf exported; a pay log (zones.json "pay") so credits can be reported by day; publisherTotals(days)
  returns {zones, live, views, viewable, credits, byDay, byZone} with Central day keys for the Reports screen
- admin: Tier select per zone in the Zones pane, saved via POST /api/admin/zones/:id (tier) or the alias
  /api/admin/zones/:id/tier; the admin list carries the 7-day publisher totals
- Zones screen: first-run "Add your site" card (site, size, copy the tag, check it is live) for new accounts and
  for /zones?start=1 from the publisher page; Verified tag on zone rows; rate note mentions the verified rate
- /partners (downline-builder kit) keeps its URL, gets the real LinkSpin ladder ($10 door to $500 Network, $25
  qualifies), the 10% + 10% admin split, and a cross-link to the publisher program

Chatbot: every canned answer and the AI knowledge block now describe LinkSpin (spin links, pages, zones and the
publisher tiers, audiences, promo tools with the five hook angles, blog; the six packages, the 50/20/10/10+10 split,
$25 qualification, pass-ups, the contract; email codes, Control Room screens, sponsor carry-over from the network
registry, free activation). InstantAdPay-only mechanics removed (dormant-lead rescue, Five Dollar Friday, Wired
Wednesday, games, mint passes, surf earn tab); the holding tank stays because /tools > My line still runs it here.

Copy: "Level 2 opens after two of your people buy a $25 or larger package" on the home page, contract, launch,
earning, my, plays pages and promo.js (the $20 figures that remain are the $100 example split amounts).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-10 11:34:42 -05:00
parent 0938e89fbe
commit f63a37947a
18 changed files with 524 additions and 151 deletions
+9 -3
View File
@@ -479,14 +479,20 @@
if (d.error) throw new Error(d.error);
const n = v => Number(v || 0).toLocaleString();
$('znSub').textContent = n(d.totals.zones) + ' zones · ' + n(d.totals.views30) + ' views in 30 days · ' + n(d.totals.nas30) + ' network · ' + n(d.totals.credits) + ' credits paid';
$('znRules').textContent = 'Paid ads (LinkSpin campaigns, then Network Ad Space) serve only when the tag runs on the declared site; anywhere else shows the house banner and earns nothing. A zone earns after its first ' + d.warmup + ' on-site views with at least ' + Math.round(d.holdRatio * 100) + '% viewable, and goes on hold below that. Rates: 1 credit per ' + d.rates.viewsPerCredit + ' LinkSpin views, 1 per ' + d.rates.nasViewsPerCredit + ' network views, ' + d.rates.capPerVisitorDay + ' credited views per visitor per zone per day. Pause a zone to serve house only (brand safety).';
const pt = d.publishers || {};
$('znRules').textContent = 'Paid ads (LinkSpin campaigns, then Network Ad Space) serve only when the tag runs on the declared site; anywhere else shows the house banner and earns nothing. A zone earns after its first ' + d.warmup + ' on-site views with at least ' + Math.round(d.holdRatio * 100) + '% viewable, and goes on hold below that. Rates: 1 credit per ' + d.rates.viewsPerCredit + ' LinkSpin views, 1 per ' + d.rates.nasViewsPerCredit + ' network views (1 per ' + d.rates.nasViewsPerCreditVerified + ' on a Verified zone), ' + d.rates.capPerVisitorDay + ' credited views per visitor per zone per day. Pause a zone to serve house only (brand safety). Tier: every zone starts Standard; set Verified after reviewing the site (real content, real visitors, tag in view).' + (pt.days ? ' Publisher program, last ' + pt.days + ' days: ' + n(pt.live) + ' live, ' + n(pt.viewable) + ' viewable, ' + n(pt.credits) + ' credits paid.' : '');
const ago = t => t ? new Date(t).toLocaleString() : '';
$('znTable').innerHTML = '<tr><th>Zone</th><th>Owner</th><th>Site</th><th>Size</th><th>Views</th><th>Viewable</th><th>Mix<br><span class="muted">LinkSpin / network / house / off-site</span></th><th>Clicks</th><th>Credits</th><th>Status</th><th>Last view</th><th></th></tr>'
+ (d.zones.length ? d.zones.map(z => '<tr><td><b>' + esc(z.name) + '</b><br><span class="muted small">' + z.id + '</span></td><td>' + esc(z.owner) + '</td><td><a href="https://' + esc(z.site) + '" target="_blank" rel="noopener">' + esc(z.site) + '</a></td><td>' + z.size + '</td><td>' + n(z.views30) + '</td><td>' + (z.viewablePct == null ? '<span class="muted">-</span>' : z.viewablePct + '% ' + (z.grade || '')) + '</td><td>' + n(z.campaign30) + ' / ' + n(z.nas30) + ' / ' + n(z.house30) + ' / ' + n(z.offsite30) + '</td><td>' + n(z.clicks30) + '</td><td>' + n(z.credits) + '</td><td>' + esc(z.statusLabel) + (z.note ? '<br><span class="muted small">' + esc(z.note) + '</span>' : '') + '</td><td>' + ago(z.lastSeen) + '</td><td class="act"><button type="button" class="btn small ghost" data-znpause="' + z.id + '" data-on="' + (z.paused ? 0 : 1) + '">' + (z.paused ? 'Resume' : 'Pause') + '</button></td></tr>').join('') : '<tr><td colspan="12" class="muted">No zones yet.</td></tr>');
const tierSel = z => '<select class="small" data-zntier="' + z.id + '" aria-label="Tier">' + (d.tiers || ['standard', 'verified']).map(t => '<option value="' + t + '"' + ((z.tier || 'standard') === t ? ' selected' : '') + '>' + t.charAt(0).toUpperCase() + t.slice(1) + '</option>').join('') + '</select>';
$('znTable').innerHTML = '<tr><th>Zone</th><th>Owner</th><th>Site</th><th>Size</th><th>Tier</th><th>Views</th><th>Viewable</th><th>Mix<br><span class="muted">LinkSpin / network / house / off-site</span></th><th>Clicks</th><th>Credits</th><th>Status</th><th>Last view</th><th></th></tr>'
+ (d.zones.length ? d.zones.map(z => '<tr><td><b>' + esc(z.name) + '</b><br><span class="muted small">' + z.id + '</span></td><td>' + esc(z.owner) + '</td><td><a href="https://' + esc(z.site) + '" target="_blank" rel="noopener">' + esc(z.site) + '</a></td><td>' + z.size + '</td><td>' + tierSel(z) + '</td><td>' + n(z.views30) + '</td><td>' + (z.viewablePct == null ? '<span class="muted">-</span>' : z.viewablePct + '% ' + (z.grade || '')) + '</td><td>' + n(z.campaign30) + ' / ' + n(z.nas30) + ' / ' + n(z.house30) + ' / ' + n(z.offsite30) + '</td><td>' + n(z.clicks30) + '</td><td>' + n(z.credits) + '</td><td>' + esc(z.statusLabel) + (z.note ? '<br><span class="muted small">' + esc(z.note) + '</span>' : '') + '</td><td>' + ago(z.lastSeen) + '</td><td class="act"><button type="button" class="btn small ghost" data-znpause="' + z.id + '" data-on="' + (z.paused ? 0 : 1) + '">' + (z.paused ? 'Resume' : 'Pause') + '</button></td></tr>').join('') : '<tr><td colspan="13" class="muted">No zones yet.</td></tr>');
document.querySelectorAll('[data-znpause]').forEach(b => b.addEventListener('click', async () => {
const pausing = b.dataset.on === '1';
try { await api('/api/admin/zones/' + b.dataset.znpause, pausing ? { paused: true, note: 'Paused ' + new Date().toLocaleDateString() } : { paused: false, note: '' }, 'POST'); loadZones(); } catch (e) { IAP.status(e.message, 'bad'); }
}));
// publisher tier (2026-10-10): Verified zones earn network views at the better rate; saved through the zone update route
document.querySelectorAll('[data-zntier]').forEach(s => s.addEventListener('change', async () => {
try { await api('/api/admin/zones/' + s.dataset.zntier + '/tier', { tier: s.value }, 'POST'); IAP.status('Tier saved: ' + s.value, 'ok'); loadZones(); } catch (e) { IAP.status(e.message, 'bad'); loadZones(); }
}));
}
// ── traffic: referring domains / sources, landing pages, angles, by day ──
let trfDays = 30;