Login slots spell out the one-position rule (Michael Camire 2026-11-03: a reservation with 1,000 credits split 618 + 382 failed in a 2-second toast he never saw): GET /api/my/campaigns carries loginFunds (each position's free purchased credits); the composer shows "Paid from one position" with the per-position numbers and disables Launch/Reserve when no single position covers the slot; a login-specific 400 says nothing was charged and what to do; login failures open a dialog instead of a toast; chatbot fact; ads-screen.js?v=20261104lf, KNOWLEDGE_DATE 2026-11-04. loginqueue unit 13/13, e2e 36/36
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -25,7 +25,7 @@ let DATA_DIR = null;
|
||||
let chain = null;
|
||||
const MODEL = process.env.OPENROUTER_MODEL || 'deepseek/deepseek-v4-flash:nitro';
|
||||
const CONTRACT = '0x26Bdc556b94399bEdd69ae3ACA5aA6c54D946e8b';
|
||||
const KNOWLEDGE_DATE = '2026-11-01'; // the day the CANNED answers and FACTS below were last checked against the site
|
||||
const KNOWLEDGE_DATE = '2026-11-04'; // the day the CANNED answers and FACTS below were last checked against the site
|
||||
|
||||
function init(opts) {
|
||||
if (opts && typeof opts.refuelOn === 'function') REFUEL_ON = opts.refuelOn; DATA_DIR = opts.dataDir; chain = opts.chain; return kb.init({ dataDir: DATA_DIR, seeds: seeds() }); }
|
||||
@@ -60,7 +60,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. 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.' },
|
||||
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. The slot is paid from ONE of your positions, so one position needs the full 1,000 purchased credits free on its own; credits split across two positions do not add up for a login slot (the Ads screen shows what each position has free).' },
|
||||
{ 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.' },
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<script src="/assets/cr-shell.js?v=20261102a"></script>
|
||||
<script src="/assets/ads-screen.js?v=20261027nr"></script>
|
||||
<script src="/assets/ads-screen.js?v=20261104lf"></script>
|
||||
<script src="/assets/fuel.js?v=20261025ff"></script>
|
||||
<script src="/assets/engine-room.js?v=20261101t"></script>
|
||||
</body>
|
||||
|
||||
@@ -133,13 +133,21 @@
|
||||
if (t === 'login') { fb.dataset.keep = fb.dataset.keep || fb.value; fb.value = L.credits; fb.readOnly = true; } else { if (fb.readOnly && fb.dataset.keep) fb.value = fb.dataset.keep; delete fb.dataset.keep; fb.readOnly = false; }
|
||||
$('fGo').disabled = false; $('fGo').textContent = full ? 'Reserve the next slot' : 'Launch'; $('fGo').title = full ? 'All login-ad slots are taken: pay now for a place in line' : '';
|
||||
cost(); preview(); }
|
||||
// a login slot is paid from ONE position (2026-11-04): say what each position has free and stop the buy up front when none covers it
|
||||
const loginShort = () => { const F = D && D.loginFunds; return !!(F && F.best < slotInfo().credits); };
|
||||
function fundsLine() { const F = D && D.loginFunds; if (!F) return ''; const L = slotInfo();
|
||||
const per = (F.per || []).length > 1 ? ' (' + F.per.map(x => '#' + x.memberId + ': ' + fmt(x.avail)).join(', ') + ')' : '';
|
||||
return '<span style="display:block;line-height:1.7;margin-top:4px' + (loginShort() ? ';color:var(--bad,#c0392b)' : '') + '">Paid from one position. '
|
||||
+ (loginShort() ? 'None of yours has <b>' + fmt(L.credits) + '</b> purchased credits free on its own' + per + '. Buy a package on one position to bring it to ' + fmt(L.credits) + ', then come back.'
|
||||
: 'Your best-funded position has <b>' + fmt(F.best) + '</b> purchased credits free' + per + '.') + '</span>'; }
|
||||
function fundsGate() { if (TYPE !== 'login') return; const b = $('fGo'); b.disabled = loginShort(); if (loginShort()) b.title = 'No single position has ' + fmt(slotInfo().credits) + ' purchased credits free'; }
|
||||
function slotChip() { const ch = document.querySelector('#typeChips .chip[data-t="login"]'); if (!ch || !D) return; const L = slotInfo(); ch.textContent = 'Login ad' + (L.free ? ' (' + L.free + ' of ' + L.max + ' open)' : ' (full, reserve the next)'); }
|
||||
function cost() { const b = Math.floor(Number($('fBudget').value) || 0); const r = D ? D.rates : {}; let s = '';
|
||||
if (TYPE === 'banner') s = 'about ' + fmt(Math.floor(b / (r.bannerCreditsPerBatch || 2) * (r.bannerBatch || 10))) + ' timed views';
|
||||
else if (TYPE === 'text') s = 'about ' + fmt(Math.floor(b / (r.textCreditsPerBatch || 1) * (r.textBatch || 10))) + ' timed views';
|
||||
else { const L = slotInfo(); $('fCost').innerHTML = L.free
|
||||
else { const L = slotInfo(); $('fCost').innerHTML = (L.free
|
||||
? '<b>' + fmt(L.credits) + '</b> purchased credits for <b>' + L.days + '</b> days of unlimited sign-in impressions · <b>' + L.free + '</b> of ' + L.max + ' slots open'
|
||||
: '<span style="display:block;line-height:1.7">All <b>' + L.max + '</b> login-ad slots are taken' + (L.queued ? ', <b>' + L.queued + '</b> paid reservation' + (L.queued === 1 ? '' : 's') + ' in line' : '') + '. Reserve the next one: <b>' + fmt(L.credits) + '</b> purchased credits now and you would be <b>#' + nextPlace().place + '</b> in line. ' + esc(estText(nextPlace().estStartCt)) + ' Cancel before it starts for a full refund.</span>'; return; }
|
||||
: '<span style="display:block;line-height:1.7">All <b>' + L.max + '</b> login-ad slots are taken' + (L.queued ? ', <b>' + L.queued + '</b> paid reservation' + (L.queued === 1 ? '' : 's') + ' in line' : '') + '. Reserve the next one: <b>' + fmt(L.credits) + '</b> purchased credits now and you would be <b>#' + nextPlace().place + '</b> in line. ' + esc(estText(nextPlace().estStartCt)) + ' Cancel before it starts for a full refund.</span>') + fundsLine(); fundsGate(); return; }
|
||||
$('fCost').innerHTML = b >= 10 ? s.replace(/(about )([\d,]+)/, '$1<b>$2</b>') : 'minimum <b>10</b> credits'; }
|
||||
function preview() { const p = $('prev'); if (TYPE === 'banner' && IMG) { const sz = ($('fSize').value || '728x90').split('x'); p.innerHTML = '<div class="muted" style="margin-bottom:6px">Preview</div><img src="' + esc(IMG) + '" alt="" style="max-width:100%;width:' + sz[0] + 'px;height:auto;border:1px solid var(--chrome-line);background:var(--inset)">'; }
|
||||
else if (TYPE === 'text') p.innerHTML = '<div class="muted" style="margin-bottom:6px">Preview</div><div class="panel" style="max-width:420px"><b>' + esc($('fTitle').value || 'Your headline') + '</b><br><span class="ink2">' + esc($('fBody').value || 'One line under it.') + '</span><br><span class="mono muted" style="font-size:11px">' + esc(host($('fTarget').value || 'yoursite.com')) + '</span></div>';
|
||||
@@ -172,7 +180,10 @@
|
||||
$('fGo').disabled = true;
|
||||
try { const r = await api('/api/my/campaigns', body); const c = r.campaign || {};
|
||||
toast(c.status === 'queued' ? 'Reserved and paid. You are #' + (c.place || '?') + ' in line. We let you know when it starts.' : TYPE === 'login' ? 'Launched. Your login-ad slot runs for ' + slotInfo().days + ' days.' : 'Launched. It is live in rotation now.');
|
||||
$('composer').hidden = true; $('fName').value = ''; load(); } catch (e) { toast(e.message, true); } finally { $('fGo').disabled = false; }
|
||||
$('composer').hidden = true; $('fName').value = ''; load(); } catch (e) {
|
||||
// a login-ad failure stays on screen until read (the 2-second toast was missed, 2026-11-03)
|
||||
if (TYPE === 'login') await dialog({ title: body.reserve ? 'Your reservation did not go through' : 'Your login ad did not launch', text: e.message, ok: 'OK', no: 'Close' }); else toast(e.message, true);
|
||||
} finally { $('fGo').disabled = false; fundsGate(); }
|
||||
});
|
||||
CR.requireSession(load);
|
||||
})();
|
||||
|
||||
@@ -3743,6 +3743,10 @@ const server = http.createServer(async (req, res) => {
|
||||
out.loginSlots = await ads.loginSlots(); // { max, used, queued, free, credits, days }: the Ads screen shows how many are open
|
||||
out.loginQueue = await ads.myLoginQueue(s.email); // my paid reservations: place in line + estimated start (Central)
|
||||
out.loginNext = await ads.loginNext(); // the place and estimated start a new reservation would get
|
||||
// a login slot is paid from ONE position (Michael Camire 2026-11-03: 1,000 credits split 618 + 382 failed with a toast he never saw):
|
||||
// the screen shows each position's free purchased credits and stops the buy before it is tried
|
||||
try { const pool = await ads.balances((await myMemberIds(s)).ids, s.email);
|
||||
out.loginFunds = { best: (pool.best.avail || 0) + (pool.credited || 0), credited: pool.credited || 0, per: pool.per.map(x => ({ memberId: x.memberId, avail: x.avail })) }; } catch (e) { out.loginFunds = null; }
|
||||
out.creditLog = await ads.creditLog(s.email, 20); // credit activity (login slots, reservations, refunds)
|
||||
out.editFee = editFee(); // credits per edit after each campaign's free one (the editor says which this is)
|
||||
out.clickSources = await coach.clickSources(out.campaigns.map(c => c.id));
|
||||
@@ -3775,8 +3779,10 @@ const server = http.createServer(async (req, res) => {
|
||||
const fundId = pool.best.memberId || memberId;
|
||||
const earnedNow = String(b.type) !== 'login' ? pool.earned : 0;
|
||||
const budget = Math.floor(Number(b.budget) || 0);
|
||||
if (String(b.type) === 'login' && pool.per.length > 1 && budget > pool.best.avail + pool.credited && budget <= pool.total)
|
||||
return json(res, 400, { error: 'Nothing was charged. A login-ad slot costs ' + budget.toLocaleString('en-US') + ' purchased credits and is paid from ONE position. Your credits are spread across ' + pool.per.length + ' positions (' + pool.per.map(x => '#' + x.memberId + ': ' + x.avail.toLocaleString('en-US')).join(', ') + ' free), so none of them holds ' + budget.toLocaleString('en-US') + ' on its own. Buy a package on one position to bring it to ' + budget.toLocaleString('en-US') + ', or let a running campaign on it finish, then try again.', loginFunds: true });
|
||||
if (pool.per.length > 1 && budget > pool.best.avail + pool.credited + earnedNow && budget <= pool.total + earnedNow)
|
||||
return json(res, 400, { error: 'Your credits are spread across ' + pool.per.length + ' positions and one campaign spends from one of them. The largest single position holds ' + pool.best.avail + ' credits: set the budget to that or less, or run two campaigns.' });
|
||||
return json(res, 400, { error:'Your credits are spread across ' + pool.per.length + ' positions and one campaign spends from one of them. The largest single position holds ' + pool.best.avail + ' credits: set the budget to that or less, or run two campaigns.' });
|
||||
const r = await ads.createCampaign(s.email, fundId, b, ids);
|
||||
return json(res, r.error ? 400 : 200, r);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user