diff --git a/ads.js b/ads.js index 9dd2d3c..09b85d4 100644 Binary files a/ads.js and b/ads.js differ diff --git a/audit.js b/audit.js index 6f8f102..f5bf03a 100644 --- a/audit.js +++ b/audit.js @@ -36,8 +36,8 @@ async function run() { { const rows = await db.q('SELECT campaign_id, COUNT(DISTINCT day) d FROM camp_hours WHERE n>0 GROUP BY campaign_id'); const shown = {}; for (const r of rows) shown[r.campaign_id] = Number(r.d); const issues = []; - for (const c of byType('login').filter(c => !c.expires)) { const charged = Math.round((Number(c.spent) + Number(c.accrued || 0)) / 100), s = shown[c.id] || 0; if (charged > s) issues.push('#' + c.id + ' ' + c.name.slice(0, 30) + ': charged ' + charged + ' day(s), shown on ' + s); } - add('login ads: days charged vs days shown', issues, byType('login').filter(c => !c.expires).length + ' per-day campaigns compared (30-day slots are paid up front)'); + for (const c of byType('login').filter(c => !c.expires && !['queued', 'cancelled'].includes(c.status))) { const charged = Math.round((Number(c.spent) + Number(c.accrued || 0)) / 100), s = shown[c.id] || 0; if (charged > s) issues.push('#' + c.id + ' ' + c.name.slice(0, 30) + ': charged ' + charged + ' day(s), shown on ' + s); } + add('login ads: days charged vs days shown', issues, byType('login').filter(c => !c.expires && !['queued', 'cancelled'].includes(c.status)).length + ' per-day campaigns compared (30-day slots are paid up front)'); } // 4. featured: a live booking older than two hours must have views { diff --git a/chatbot.js b/chatbot.js index 42d2b2f..8b56d7f 100644 --- a/chatbot.js +++ b/chatbot.js @@ -50,7 +50,7 @@ const CANNED = [ a: 'Open Ads in your Control Room (' + SITE_URL + '/ads) and press Edit on the ad. You can change where the click goes, the banner image (upload a new one or paste a link), the headline and line of a text ad, and the ad name. A login ad shows your page itself, so its link is the whole ad. The first edit of every ad is free, your one correction; each edit after that costs a small credit fee (100 credits at the moment, shown before you save), taken from earned credits first. The type, size, budget, countries, schedule and audience stay as they are; for those, start a new ad. A new link is checked the same way as a new ad, so it has to load and, for banner and text ads, allow framing.' }, { id: 'login-ads', title: 'Login ad slots', q: ['How do login ads work?', 'How do I book a login ad?'], tags: ['login ad', 'slot', 'purchased credits'], re: /(log ?-?in|sign ?-?in) (ad|ads|spot|sponsor|slot|slots)|(ad|sponsor) (on|at) (the )?(log ?-?in|sign ?-?in)/i, - a: 'A login ad is a slot: 1,000 purchased credits buys 30 days of your page, full screen, to every member right after they sign in, with unlimited sign-in impressions and nothing charged per day. At most 6 member slots run at once because they share the same sign-ins, first come first served; when all 6 are taken the Ads screen says so and a place opens when a running slot ends its 30 days. Login ads spend purchased credits only, so earned credits go to banner and text ads instead. Buy one from Ads, New ad, Login ad.' }, + a: 'A login ad is a slot: 1,000 purchased credits buys 30 days of your page, full screen, to every member right after they sign in, with unlimited sign-in impressions and nothing charged per day. At most 6 member slots run at once because they share the same sign-ins. When all 6 are taken you can reserve the next one from the same place: you pay the 1,000 purchased credits now to get your place in line, first paid first served, and your 30 days start the moment a slot frees up (we tell you on the site and by email). The Ads screen shows your place and an estimated start date, which is only an estimate. While you wait you can edit the ad for free, and if you cancel before it starts you get the full 1,000 credits back. A paused slot can only resume when nobody is waiting, because a freed slot goes to the line first. Login ads spend purchased credits only, so earned credits go to banner and text ads instead. Buy or reserve one from Ads, New ad, Login ad.' }, { id: 'vs-iap', title: 'LinkSpin and InstantAdPay: the difference', q: ['What is the difference between LinkSpin and InstantAdPay?', 'Is this the same as InstantAdPay?', 'Why another site?'], tags: ['instantadpay', 'iap', 'sister site', 'network'], re: /(instant ?ad ?pay|[^a-z]iap[^a-z]|differen|same as|another (site|program|property)|why (two|another)|sister (site|property)|which (one|site) (should|do))/i, a: 'InstantAdPay is the ad marketplace: you buy ad packages there, earn credits by viewing ads, and get paid when your line buys. LinkSpin is the tool side of the same network: a link rotator, a page builder and ad zones for your own sites, free with an email address. Its packages buy ad delivery across the LinkSpin viewer, every member zone and the partner network, and they pay your sponsor line the same way, inside the purchase transaction. Same people above and below you, same wallet, and your InstantAdPay username and profile carry over when you sign in with the same email.' }, @@ -151,7 +151,7 @@ FACTS: - PACKAGES (priced in dollars, settled in POL at the live rate, 1 credit = 1 cent of ad delivery): $10 door = 1,000 credits, for trying the ads, does NOT count toward qualification; $25 Starter = 2,500; $50 Builder = 5,000; $100 Growth = 10,000; $250 Leader = 25,000; $500 Network = 50,000. Any package of $25 or more makes the buyer a qualifying buyer for their sponsor. - THE SPLIT, same transaction on Polygon, fixed in the contract: 50 percent direct sponsor, 20 percent level 2, 10 percent level 3, 10 percent + 10 percent to the two admin wallets. Level 1 pays from a referral's first qualifying purchase once the sponsor's payouts are on. Level 2 opens after two of the member's people buy a qualifying ($25 or larger) package, level 3 after five. An unfilled tier passes up the line to the next qualified member, then to the platform. Nothing is held, there are no withdrawals, no pending balances. Contract ${CONTRACT} on Polygon, verified on Polygonscan; plain-language review at ${SITE_URL}/contract; live ledger at ${SITE_URL}/ledger with a verify link on every row. - CREDITS VS POL: every member, free ones included, earns CREDITS (zones, the daily ad set with a claim streak, watch-to-earn videos, verified visits, a daily sign-in bonus). Credits buy the member's own banner and text ads (a login-ad slot takes purchased credits only) and NEVER cash out or convert to crypto. POL only reaches a wallet through the contract split when a package sells in the member's line. Never promise or estimate income. -- AD FORMATS members buy with credits: banner ads (standard sizes), text ads, full-screen login ads (a flat slot: 1,000 PURCHASED credits for 30 days of unlimited sign-in impressions, never charged per day; at most 6 member slots live at once (raised from 3 on 2026-10-23), first come first served, a 7th is refused until one ends; house login ads only show when no member slot is running; earned credits never fund login ads); EDITING AN AD (2026-10-18): the Edit button on each ad on the Ads screen changes the click link, the banner image (upload or https link), a text ad's headline and line, and the ad name; type, size, budget, countries, schedule and audience cannot change (start a new ad); the first edit of every ad is free, each later edit costs the campaignEditFee, 100 credits by default, earned credits first, then purchased; a new link and a new banner image get the same checks as a new ad, plus solo ads to member inboxes, watch-to-earn video, verified visits. Banner and text ads also run on member zones and the partner network. +- AD FORMATS members buy with credits: banner ads (standard sizes), text ads, full-screen login ads (a flat slot: 1,000 PURCHASED credits for 30 days of unlimited sign-in impressions, never charged per day; at most 6 member slots live at once (raised from 3 on 2026-10-23); PAID QUEUE (2026-10-23): when all 6 are taken a member can reserve the next slot by paying the full 1,000 purchased credits now, first paid first served, the 30 days start only when a slot frees (a slot ends or is paused) and the member gets an on-site notice and an email, the Ads screen shows the place in line and an ESTIMATED start date in Central time, edits are free while waiting, cancelling before the start refunds the full amount as purchased credits (a running slot is not refundable), and a paused slot can resume only when live plus waiting slots are under 6; house login ads only show when no member slot is running; earned credits never fund login ads); EDITING AN AD (2026-10-18): the Edit button on each ad on the Ads screen changes the click link, the banner image (upload or https link), a text ad's headline and line, and the ad name; type, size, budget, countries, schedule and audience cannot change (start a new ad); the first edit of every ad is free, each later edit costs the campaignEditFee, 100 credits by default, earned credits first, then purchased; a new link and a new banner image get the same checks as a new ad, plus solo ads to member inboxes, watch-to-earn video, verified visits. Banner and text ads also run on member zones and the partner network. - ACCOUNT: join at ${SITE_URL}/join with email only, a six-digit code, no password. Wallet linking happens inside the Control Room (Credits screen): one signature to link, then payouts switch on by activating (one transaction, gas only) or by buying any package. SafePal is the recommended wallet; MetaMask, Phantom (turn Polygon on first) and any WalletConnect wallet work; Trust Wallet blocks a buy that spends most of its POL. MoonPay card on-ramp from the Credits screen puts POL on Polygon into the member's own wallet. - SPONSOR: the invite link opened most recently sets the sponsor (30-day cookie), shown on the join page, locked when the account is created; the contract binds the buyer to that sponsor at the first purchase. CARRY-OVER: Crypto Team Build Network members who sign in with the email they use on InstantAdPay get their InstantAdPay sponsor from the network registry automatically when no invite link was used. Wrong sponsor before the first purchase: the admin can move the account. Members should switch on payouts before their people buy. - CONTROL ROOM screens: Links, Pages, Zones (with Audiences), Ads, Credits, Reports, Team (three levels, who has payouts on, who bought, qualifying-buyer counts), Wallet (what was paid to this wallet, payout history). More at ${SITE_URL}/tools: Promo tools, Training, Pipeline (a follow-up board for prospects and directs), My line (including the holding tank: members who joined with no sponsor wait there and can be adopted by a member with payouts on and their own qualifying package), Profile. diff --git a/content.js b/content.js index df2e6fd..a2858fc 100644 --- a/content.js +++ b/content.js @@ -122,8 +122,9 @@ async function collect(fresh) { detail: { adType: c.type, imageUrl: c.imageUrl, title: c.title, body, width: c.width, height: c.height, budget: c.budget, spent: c.spent, starts: c.starts, expires: c.expires, geo: c.geo, dailyCap: c.dailyCap, audience: c.audience, name: c.name, edits: c.edits || 0, editLog: (c.editLog || []).slice(-5).map(e => ({ ts: e.ts, by: e.by, fields: e.fields, from: e.from, to: e.to, fee: e.fee || 0 })) }, // member edits (first free) + the last few changes counts: { imps: c.imps, impsNas: c.impsNas, clicks: c.clicks }, hosts: [hostOf(c.targetUrl)].concat(urlsIn(c.body).map(hostOf)), flags, - actions: (c.status === 'active' ? [{ label: 'Pause ad', path: '/api/admin/campaigns/' + c.id + '/pause', body: {}, warn: 'Pause campaign #' + c.id + '? It stops serving until resumed.' }] : c.status === 'paused' ? [{ label: 'Resume ad', path: '/api/admin/campaigns/' + c.id + '/resume', body: {} }] : []) - .concat(c.status !== 'done' ? [{ label: 'Edit ad', edit: true, path: '/api/admin/campaigns/' + c.id + '/edit' }] : []), // free for the admin, the member's free edit untouched + actions: (c.status === 'active' ? [{ label: 'Pause ad', path: '/api/admin/campaigns/' + c.id + '/pause', body: {}, warn: 'Pause campaign #' + c.id + '? It stops serving until resumed.' }] : c.status === 'paused' ? [{ label: 'Resume ad', path: '/api/admin/campaigns/' + c.id + '/resume', body: {} }] + : c.status === 'queued' ? [{ label: 'Cancel + refund', path: '/api/admin/campaigns/' + c.id + '/cancel-reservation', body: {}, warn: 'Cancel login-slot reservation #' + c.id + '? The ' + c.budget + ' credits paid come back to the member in full and they leave the line.' }] : []) + .concat(!['done', 'cancelled'].includes(c.status) ? [{ label: 'Edit ad', edit: true, path: '/api/admin/campaigns/' + c.id + '/edit' }] : []), // free for the admin, the member's free edit untouched search: [c.type, c.targetUrl, c.imageUrl, c.title, body] }); } diff --git a/db.js b/db.js index fdc01fc..f2f7a0e 100644 --- a/db.js +++ b/db.js @@ -137,6 +137,19 @@ async function bootstrap() { await alterSafe("ALTER TABLE campaigns ADD COLUMN day_key CHAR(10) NULL"); await alterSafe('ALTER TABLE campaigns ADD COLUMN edits INT NOT NULL DEFAULT 0'); // member edits so far (the first is free), 2026-10-18 await alterSafe('ALTER TABLE campaigns ADD COLUMN edit_log MEDIUMTEXT NULL'); // JSON [{ts, by, fields, from, to, fee, paidFrom}], last 50 + // prepaid login-slot queue (Marty, 2026-10-23): paid at reserve time, status 'queued' until a slot frees + await alterSafe('ALTER TABLE campaigns ADD COLUMN queued_at BIGINT NULL'); // when the place in line was paid for (first paid, first served) + await alterSafe('ALTER TABLE campaigns ADD COLUMN promoted_at BIGINT NULL'); // when it left the line and its 30 days started + await alterSafe('ALTER TABLE campaigns ADD COLUMN refunded INT NOT NULL DEFAULT 0'); // credits handed back on a cancel before start + await q(`CREATE TABLE IF NOT EXISTS credit_log ( + id INT AUTO_INCREMENT PRIMARY KEY, + email VARCHAR(190) NOT NULL, + ts BIGINT NOT NULL, + delta INT NOT NULL, + reason VARCHAR(160) NOT NULL, + campaign_id INT NULL, + INDEX (email, ts) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4`); // linked positions: extra wallets owned by one email account (Qualified Start). // Each is its own on-chain member sponsored by the account's main member. await q(`CREATE TABLE IF NOT EXISTS positions ( diff --git a/public/admin.html b/public/admin.html index c74abb3..f67b804 100644 --- a/public/admin.html +++ b/public/admin.html @@ -177,6 +177,11 @@
Members pay in full when they reserve. The oldest reservation starts by itself within a minute of a slot freeing (a slot ends or is paused). Cancel before start refunds the whole amount as purchased credits.
+