Footer network links carry a referral username (Marty 2026-11-15): the signed-in member's own network username, else the sponsor the visitor came in on. /api/me now also answers username (signed in) and refName (the sponsor's network username via nameOf; never the wallet, so the bl.ref cookie is not read client side). Tracked links get it as s1 (LinkSpin sends it on as ?ref=), plain links as ?ref=, none for Earners Corner. Same approach as VBB 6798503. common.js?v=20261115nr. Smoke 127/127

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-15 08:03:31 -06:00
parent 5e42a48eaa
commit 6d277171ca
13 changed files with 32 additions and 17 deletions
+15 -4
View File
@@ -48,12 +48,23 @@ window.BL = (function () {
// "Part of the network": the list comes from the hub through /api/network-sites, the built-in copy if it does not answer
const NET = [['iap', 'InstantAdPay', 'https://instantadpay.com'], ['linkspin', 'LinkSpin', 'https://linkspin.app'], ['dlb', 'Downline Banners', 'https://downlinebanners.com'],
['vbb', 'Viral Banner Blitz', 'https://viralbannerblitz.com'], ['stackpol', 'Stack POL', 'https://stackpol.com'], ['earnerscorner', 'Earners Corner', 'https://earnerscorner.com']].map(a => ({ id: a[0], name: a[1], url: a[2] }));
// the footer links carry a referral username (Marty 2026-11-15): the signed-in member's own network username, else the sponsor this
// visitor came in on (/api/me names both; the bl.ref cookie holds a wallet, so it is never used here). Tracked links get it as s1
// (LinkSpin sends it on as ?ref=), plain links as ?ref=. Earners Corner takes none.
const REF_RE = /^[A-Za-z0-9_.-]{1,40}$/;
const okRef = v => !!v && REF_RE.test(v) && !/^0x[0-9a-f]{40}$/i.test(v);
function netRef(href, s, ref) {
if (!ref || s.id === 'earnerscorner') return href;
try { const u = new URL(href); u.searchParams.set(s.go ? 's1' : 'ref', ref); return u.toString(); } catch (e) { return href; }
}
function netLine(el) {
if (!el) return;
const paint = list => { el.innerHTML = '<b>Part of the network</b> &middot; One account across the network: ' + list.map(s => (s.id === 'dlb' || /downlinebanners\.com/.test(s.url))
? '<span class="here" aria-current="page">' + esc(s.name) + '</span>' : '<a href="' + esc(s.go || s.url) + '" target="_blank" rel="noopener nofollow">' + esc(s.name) + '</a>').join(' &middot; '); };
paint(NET);
fetch('/api/network-sites').then(r => r.json()).then(l => { if (Array.isArray(l) && l.length) paint(l); }).catch(() => {});
let list = NET, ref = '';
const paint = () => { el.innerHTML = '<b>Part of the network</b> &middot; One account across the network: ' + list.map(s => (s.id === 'dlb' || /downlinebanners\.com/.test(s.url))
? '<span class="here" aria-current="page">' + esc(s.name) + '</span>' : '<a href="' + esc(netRef(s.go || s.url, s, ref)) + '" target="_blank" rel="noopener nofollow">' + esc(s.name) + '</a>').join(' &middot; '); };
paint();
fetch('/api/network-sites').then(r => r.json()).then(l => { if (Array.isArray(l) && l.length) { list = l; paint(); } }).catch(() => {});
fetch('/api/me', { credentials: 'same-origin' }).then(r => r.json()).then(m => { const r = m && m.signedIn && okRef(m.username) ? m.username : (m && okRef(m.refName) ? m.refName : ''); if (r) { ref = r; paint(); } }).catch(() => {});
}
// one spot tile; href goes through the /go relay, which counts the click
function tile(t, opts) {
+1 -1
View File
@@ -31,7 +31,7 @@
<div class="card"><h3>The line so far</h3><div id="stats" class="grid2"></div></div>
<div id="status" class="note" hidden></div>
</main>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/board.js?v=1"></script>
</body>
</html>
+1 -1
View File
@@ -35,7 +35,7 @@
<li>Open any sale in the <a href="/ledger">live ledger</a> and look at its <b>Logs</b>: one SpotBought event, then one Paid event per payment.</li></ol></div>
<div id="zContract"></div>
</main>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/contract.js?v=z1"></script>
</body>
</html>
+1 -1
View File
@@ -33,7 +33,7 @@
<div class="card"><h2>Your decision</h2><p>Only spend what you can afford to lose completely. This is not financial, legal or tax advice. You are responsible for any taxes on what you receive.</p></div>
<div class="card"><h2>Contact</h2><p>Questions, problems or a request about your data: <a href="https://instantadpay.com/support" target="_blank" rel="noopener">network support</a>, or write to TrustClickz, 615 Green Valley Drive, Moody, AL 35004.</p></div>
</main>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/legal.js?v=1"></script>
</body>
</html>
+1 -1
View File
@@ -39,7 +39,7 @@
<div class="card"><h3>The momentum fund</h3><p>When no spot has sold for 4 hours, the fund buys one (at most 12 a day). It gifts the spot to an active member who owns a paid spot and has not had a gift in 7 days, members who referred someone recently first. If nobody qualifies, the fund keeps the spot and its line money goes back into the fund.</p></div>
<div class="card"><h3>The rest of the network</h3><p>Open board slots show network sites such as InstantAdPay and LinkSpin. On InstantAdPay, ad credits buy advertising, not income.</p></div>
</main>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/how.js?v=z1"></script>
<script src="https://polhunter.com/embed.js" data-slots="5" data-selector="main.wrap > .card" async></script>
</body>
+1 -1
View File
@@ -52,7 +52,7 @@
</section>
<div id="status" class="note" hidden></div>
</main>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/gate.js?v=1"></script>
</body>
</html>
+1 -1
View File
@@ -48,7 +48,7 @@
<div id="status" class="note" hidden></div>
<div class="card" id="doneCard" hidden><h3>Your spot is in the line</h3><p>Next: add your image and link in My Spots. One free signature signs you in (it cannot move funds).</p><div class="row"><button class="btn" id="toMyBtn">Open My Spots</button></div><p class="small mono" id="txLink"></p><div id="zBought"></div></div>
</main>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/wallet.js?v=1"></script>
<script src="/assets/join.js?v=20261114h"></script>
</body>
+1 -1
View File
@@ -30,7 +30,7 @@
<div class="card"><div class="row" style="justify-content:space-between"><h3 style="margin:0">Spot sales</h3><span class="muted small" id="upd"></span></div>
<div id="rows"><p class="muted">Loading the ledger...</p></div><div id="zLedger"></div><div id="rows2"></div></div>
</main>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/ledger.js?v=z1"></script>
</body>
</html>
+1 -1
View File
@@ -41,7 +41,7 @@
</div>
<div id="status" class="note" hidden></div>
</main>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/wallet.js?v=1"></script>
<script src="/assets/my.js?v=z1"></script>
</body>
+1 -1
View File
@@ -34,7 +34,7 @@
<div class="card"><h2>Your choices</h2><p>You can ask us to delete your account data on this site or on the network hub. Records on the blockchain cannot be deleted by anyone. You can clear the cookies in your browser at any time; you will need to sign in again.</p></div>
<div class="card"><h2>Contact</h2><p>Questions, problems or a request about your data: <a href="https://instantadpay.com/support" target="_blank" rel="noopener">network support</a>, or write to TrustClickz, 615 Green Valley Drive, Moody, AL 35004.</p></div>
</main>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/legal.js?v=1"></script>
</body>
</html>
+1 -1
View File
@@ -33,7 +33,7 @@
<div id="status" class="note" hidden></div>
<div id="kit"><p class="muted">Loading the kit...</p></div>
</main>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/kitpage.js?v=2"></script>
<script src="/assets/promote.js?v=1"></script>
</body>
+1 -1
View File
@@ -39,7 +39,7 @@
<div class="card"><h2>Limits</h2><p>As far as the law allows, we are not responsible for losses caused by the blockchain, your wallet, the price of POL, third-party websites in banners, or events outside our control, and our total responsibility to you is limited to what you paid for the purchase in question. These terms are governed by the laws of the State of Alabama, USA.</p></div>
<div class="card"><h2>Contact</h2><p>Questions, problems or a request about your data: <a href="https://instantadpay.com/support" target="_blank" rel="noopener">network support</a>, or write to TrustClickz, 615 Green Valley Drive, Moody, AL 35004.</p></div>
</main>
<script src="/assets/common.js?v=20261114ns"></script>
<script src="/assets/common.js?v=20261115nr"></script>
<script src="/assets/legal.js?v=1"></script>
</body>
</html>
+6 -2
View File
@@ -447,9 +447,13 @@ const server = http.createServer(async (req, res) => {
return json(res, 200, { ok: true }, { 'Set-Cookie': [cookie('bl.sid', '', 0, true), networksso.offCookie()] }); // signed out stays signed out here for 12 hours
}
if (p === '/api/me' && req.method === 'GET') {
const s = session(req); if (!s) return json(res, 200, { signedIn: false, sponsor: await sponsorFor(req) });
// username / refName (Marty 2026-11-15): the footer's network links carry a referral username, the member's own network
// username when signed in, else the sponsor's (usernames only, never the wallet)
const nm = async a => (a ? await nameOf(a).catch(() => null) : null);
const s = session(req); if (!s) { const sp = await sponsorFor(req); return json(res, 200, { signedIn: false, sponsor: sp, refName: await nm(sp) }); }
store.touch(s.address);
return json(res, 200, { signedIn: true, address: s.address, member: chain.isMember(s.address), sponsor: await sponsorFor(req) });
const sp = await sponsorFor(req); const [username, refName] = await Promise.all([nm(s.address), nm(sp)]);
return json(res, 200, { signedIn: true, address: s.address, member: chain.isMember(s.address), sponsor: sp, username, refName });
}
// -- member API (signed in)