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:
+15
-4
@@ -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> · 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(' · '); };
|
||||
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> · 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(' · '); };
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user