From 86007f0784c68b619c3231a89131414ad9cb0fb5 Mon Sep 17 00:00:00 2001 From: martbost Date: Sun, 15 Nov 2026 07:59:33 -0600 Subject: [PATCH] Footer network links carry a referral username (Marty 2026-11-15): the signed-in member's own (/api/me), else the referral the visitor came in on (?ref= on the page, remembered for the visit, then the iap.sponsor join cookie; usernames only, never a member number or wallet). 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 + netline.js ?v=20261115nr. NOT deployed (another lane owns the LinkSpin deploy). Co-Authored-By: Claude Opus 5.5 --- blog.js | 2 +- leaderboard.js | 2 +- public/admin.html | 2 +- public/assets/common.js | 28 ++++++++++++++++++++++++---- public/assets/netline.js | 23 +++++++++++++++++++---- public/contract.html | 2 +- public/conversion-tracking.html | 2 +- public/credits.html | 2 +- public/disclaimer.html | 2 +- public/earning.html | 4 ++-- public/index.html | 2 +- public/join.html | 4 ++-- public/launch.html | 2 +- public/ledger.html | 4 ++-- public/my.html | 2 +- public/partners.html | 4 ++-- public/plays.html | 2 +- public/privacy.html | 2 +- public/publishers.html | 2 +- public/refuel.html | 2 +- public/support.html | 4 ++-- public/terms.html | 2 +- public/tx.html | 2 +- public/wall.html | 2 +- public/wallets.html | 2 +- releases.js | 2 +- server.js | 2 +- 27 files changed, 73 insertions(+), 38 deletions(-) diff --git a/blog.js b/blog.js index 0c2d8a3..b134fa7 100644 --- a/blog.js +++ b/blog.js @@ -110,7 +110,7 @@ function head(o) { + '
'; } function tail() { - return '
'; + return ''; } const authorBox = () => '
LinkSpin
' + AUTHOR + 'Founder of LinkSpin and the Crypto Team Build Network. Twenty-plus years of internet marketing, and a habit of writing down what actually worked.
'; const cardHtml = p => '' + (p.cover ? '' : '') + '

' + esc(p.title) + '

' + esc(p.excerpt) + '

' + fmtDate(p.publishedAt || p.created) + ' · ' + readMinutes(p.body) + ' min read' + (p.tags.length ? ' · ' + p.tags.map(esc).join(', ') : '') + '

'; diff --git a/leaderboard.js b/leaderboard.js index 7ba7fa9..507d51d 100644 --- a/leaderboard.js +++ b/leaderboard.js @@ -146,7 +146,7 @@ async function renderPage() { const w = winners(); if (w.length) h += '

Past winners

' + w.slice(0, 12).map(x => '
' + (x.kind === 'week' ? 'Week of ' : 'Month of ') + fmtD(x.start) + ': ' + (x.top[0] ? esc(x.top[0].name) + ' (' + x.top[0].sales + ' sold, $' + x.top[0].usd + ')' : 'no sales') + (x.granted && x.granted.length ? ' · awarded: ' + x.granted.map(g => esc(g.name) + ' +' + g.credits.toLocaleString()).join(', ') : (x.prize ? ' · prize ' + esc(x.prize) : '')) + '
').join(''); h += '

Sales are $ of packages bought by members you directly sponsor. Weekly and monthly prizes are advertising credits or packages, never cash. No income is guaranteed.

'; - h += ''; + h += ''; return h; } function setLaunchPanel(fn) { if (R) R.launchPanel = fn; } diff --git a/public/admin.html b/public/admin.html index f100e83..f2d6108 100644 --- a/public/admin.html +++ b/public/admin.html @@ -548,7 +548,7 @@ - + diff --git a/public/assets/common.js b/public/assets/common.js index 582e33c..6b0ed09 100644 --- a/public/assets/common.js +++ b/public/assets/common.js @@ -70,19 +70,39 @@ window.IAP = (function () { if (!netList) netList = fetch('/api/network-sites').then(r => r.json()).then(l => (Array.isArray(l) && l.length ? l : NET_FALLBACK)).catch(() => NET_FALLBACK); return netList; } + // the footer links carry a referral username (Marty 2026-11-15): the signed-in member's own, else the referral this visitor came in on + // (?ref= on this page, remembered for the visit, then the iap.sponsor join cookie; usernames only, never a member number or wallet). + // Tracked links get it as s1 (LinkSpin sends it on as ?ref=), plain links as ?ref=. Earners Corner takes none. + const okRef = v => /^[A-Za-z0-9_.-]{1,40}$/.test(v) && !/^\d+$/.test(v) && !/^0x[0-9a-f]{40}$/i.test(v) && v !== 'company' && v !== 'top'; + const arrivedRef = () => { + try { const q = String(new URLSearchParams(location.search).get('ref') || '').trim().toLowerCase(); if (okRef(q)) { try { sessionStorage.setItem('ls.netref', q); } catch (e) {} return q; } } catch (e) {} + try { const v = sessionStorage.getItem('ls.netref') || ''; if (okRef(v)) return v; } catch (e) {} + const m = document.cookie.match(/(?:^|;\s*)iap\.sponsor=([^;]*)/); try { const v = m ? decodeURIComponent(m[1]) : ''; return okRef(v) ? v : ''; } catch (e) { return ''; } + }; + let netRef = null; + function networkRef() { + if (!netRef) netRef = fetch('/api/me', { credentials: 'same-origin' }).then(r => r.json()).then(m => (m && m.signedIn && m.username && okRef(m.username) ? m.username : arrivedRef())).catch(() => arrivedRef()); + return netRef; + } + function withRef(s, ref) { + const href = s.go || s.url; 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 renderNetworkLine(host) { if (!host || host.querySelector('.netline')) return; const d = document.createElement('div'); d.className = 'netline'; d.style.cssText = 'margin-top:10px;display:flex;gap:6px 14px;justify-content:center;flex-wrap:wrap;align-items:baseline;font-size:12.5px'; host.appendChild(d); const esc = s => String(s).replace(/[&<>"]/g, ch => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[ch]); - const paint = list => { + let list = NET_FALLBACK, ref = arrivedRef(); + const paint = () => { d.innerHTML = 'Part of the networkOne account across the network:' + list.map(s => (s.id === 'linkspin' || /linkspin\.app/.test(s.url)) ? '' + esc(s.name) + ' (you are here)' - : '' + esc(s.name) + '').join(''); + : '' + esc(s.name) + '').join(''); }; - paint(NET_FALLBACK); - networkSites().then(paint); + paint(); + networkSites().then(l => { list = l; paint(); }); + networkRef().then(r => { if (r !== ref) { ref = r; paint(); } }); } // pages with their own footer (the members area) get the network line too function decorateFooters() { document.querySelectorAll('footer.bo-pagefoot').forEach(f => { const w = document.createElement('div'); w.style.width = '100%'; f.appendChild(w); renderNetworkLine(w); }); } diff --git a/public/assets/netline.js b/public/assets/netline.js index c51afa5..9dc73da 100644 --- a/public/assets/netline.js +++ b/public/assets/netline.js @@ -4,6 +4,19 @@ var me = (document.currentScript && document.currentScript.getAttribute('data-site')) || 'linkspin'; var FALLBACK = [['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(function (a) { return { id: a[0], name: a[1], url: a[2] }; }); + // the links carry a referral username (Marty 2026-11-15): the signed-in member's own, else the referral this visitor came in on + // (?ref= here, remembered for the visit, then the iap.sponsor cookie; usernames only). Tracked links get it as s1 (LinkSpin sends it + // on as ?ref=), plain links as ?ref=; Earners Corner none. + function okRef(v) { return /^[A-Za-z0-9_.-]{1,40}$/.test(v) && !/^\d+$/.test(v) && !/^0x[0-9a-f]{40}$/i.test(v) && v !== 'company' && v !== 'top'; } + function arrivedRef() { + try { var q = String(new URLSearchParams(location.search).get('ref') || '').trim().toLowerCase(); if (okRef(q)) { try { sessionStorage.setItem('ls.netref', q); } catch (e) {} return q; } } catch (e) {} + try { var v = sessionStorage.getItem('ls.netref') || ''; if (okRef(v)) return v; } catch (e) {} + var m = document.cookie.match(/(?:^|;\s*)iap\.sponsor=([^;]*)/); try { var c = m ? decodeURIComponent(m[1]) : ''; return okRef(c) ? c : ''; } catch (e) { return ''; } + } + function withRef(s, ref) { + var href = s.go || s.url; if (!ref || s.id === 'earnerscorner') return href; + try { var u = new URL(href); u.searchParams.set(s.go ? 's1' : 'ref', ref); return u.toString(); } catch (e) { return href; } + } function esc(s) { return String(s).replace(/[&<>"]/g, function (c) { return { '&': '&', '<': '<', '>': '>', '"': '"' }[c]; }); } function run() { var f = document.querySelector('footer'); if (!f || f.querySelector('.netline')) return; @@ -11,13 +24,15 @@ var box = document.createElement('div'); box.className = 'netline'; box.style.cssText = 'flex-basis:100%;width:100%;margin-top:10px;display:flex;gap:6px 14px;flex-wrap:wrap;align-items:baseline;font-size:12.5px'; host.appendChild(box); - var paint = function (list) { + var list = FALLBACK, ref = arrivedRef(); + var paint = function () { box.innerHTML = 'TrustClickz · 615 Green Valley Drive, Moody, AL 35004Part of the networkOne account across the network:' + list.map(function (s) { - return s.id === me ? '' + esc(s.name) + ' (you are here)' : '' + esc(s.name) + ''; + return s.id === me ? '' + esc(s.name) + ' (you are here)' : '' + esc(s.name) + ''; }).join(''); }; - paint(FALLBACK); - fetch('/api/network-sites').then(function (r) { return r.json(); }).then(function (l) { if (Array.isArray(l) && l.length) paint(l); }).catch(function () {}); + paint(); + fetch('/api/network-sites').then(function (r) { return r.json(); }).then(function (l) { if (Array.isArray(l) && l.length) { list = l; paint(); } }).catch(function () {}); + fetch('/api/me', { credentials: 'same-origin' }).then(function (r) { return r.json(); }).then(function (m) { if (m && m.signedIn && m.username && okRef(m.username)) { ref = m.username; paint(); } }).catch(function () {}); } if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run); else run(); })(); diff --git a/public/contract.html b/public/contract.html index 5c453de..e2d75ce 100644 --- a/public/contract.html +++ b/public/contract.html @@ -149,6 +149,6 @@ - + diff --git a/public/conversion-tracking.html b/public/conversion-tracking.html index e1f932c..d61edff 100644 --- a/public/conversion-tracking.html +++ b/public/conversion-tracking.html @@ -284,6 +284,6 @@ - + diff --git a/public/credits.html b/public/credits.html index 5c12147..b31c59b 100644 --- a/public/credits.html +++ b/public/credits.html @@ -81,7 +81,7 @@ - + diff --git a/public/disclaimer.html b/public/disclaimer.html index 159ef0a..0b1aeed 100644 --- a/public/disclaimer.html +++ b/public/disclaimer.html @@ -47,6 +47,6 @@ a Crypto Team Build Network property - + diff --git a/public/earning.html b/public/earning.html index a9051d0..a9d56bb 100644 --- a/public/earning.html +++ b/public/earning.html @@ -69,7 +69,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees.
- - + + diff --git a/public/index.html b/public/index.html index 0e887a3..ef18ce0 100644 --- a/public/index.html +++ b/public/index.html @@ -225,6 +225,6 @@ - + diff --git a/public/join.html b/public/join.html index fcbe0c3..e80011c 100644 --- a/public/join.html +++ b/public/join.html @@ -106,8 +106,8 @@ body.squeeze .card{position:sticky;top:16px} a Crypto Team Build Network property - + - + diff --git a/public/launch.html b/public/launch.html index 10d00ee..fb84b57 100644 --- a/public/launch.html +++ b/public/launch.html @@ -102,7 +102,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees.
- + diff --git a/public/ledger.html b/public/ledger.html index 11e42fb..5bf667d 100644 --- a/public/ledger.html +++ b/public/ledger.html @@ -65,8 +65,8 @@ a Crypto Team Build Network property - + - + diff --git a/public/my.html b/public/my.html index 2ecbe80..ed2a030 100644 --- a/public/my.html +++ b/public/my.html @@ -1015,7 +1015,7 @@ - + diff --git a/public/partners.html b/public/partners.html index 7cd9cea..025401d 100644 --- a/public/partners.html +++ b/public/partners.html @@ -131,8 +131,8 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never spend what you cannot afford to lose.
- + - + diff --git a/public/plays.html b/public/plays.html index d5b99a4..2b3148c 100644 --- a/public/plays.html +++ b/public/plays.html @@ -193,7 +193,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never spend what you cannot afford.
- + diff --git a/public/privacy.html b/public/privacy.html index c3e8217..6b7bc45 100644 --- a/public/privacy.html +++ b/public/privacy.html @@ -56,6 +56,6 @@ a Crypto Team Build Network property - + diff --git a/public/publishers.html b/public/publishers.html index 50554eb..6717e74 100644 --- a/public/publishers.html +++ b/public/publishers.html @@ -289,6 +289,6 @@ - + diff --git a/public/refuel.html b/public/refuel.html index 6121dfa..042b6d8 100644 --- a/public/refuel.html +++ b/public/refuel.html @@ -281,6 +281,6 @@ - + diff --git a/public/support.html b/public/support.html index c88c28b..985f2df 100644 --- a/public/support.html +++ b/public/support.html @@ -67,8 +67,8 @@ a Crypto Team Build Network property - + - + diff --git a/public/terms.html b/public/terms.html index 865b5fe..3823ddf 100644 --- a/public/terms.html +++ b/public/terms.html @@ -62,6 +62,6 @@ a Crypto Team Build Network property - + diff --git a/public/tx.html b/public/tx.html index b31c99b..2b6b00e 100644 --- a/public/tx.html +++ b/public/tx.html @@ -35,7 +35,7 @@

← Back to the live ledger · Read the contract review

- + diff --git a/public/wall.html b/public/wall.html index 7b81d89..41401fa 100644 --- a/public/wall.html +++ b/public/wall.html @@ -49,7 +49,7 @@ - + diff --git a/public/wallets.html b/public/wallets.html index ebf7ffb..feb2c13 100644 --- a/public/wallets.html +++ b/public/wallets.html @@ -120,7 +120,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never share your recovery phrase.
- + diff --git a/releases.js b/releases.js index 2c21b7f..fab6233 100644 --- a/releases.js +++ b/releases.js @@ -66,7 +66,7 @@ function renderPage() { h += '

Release notes

'; h += v.notes.length ? v.notes.map(n => '

' + esc(n.title) + n.tags.map(tagChip).join('') + '

' + fmt(n.date) + '

' + bodyHtml(n.body) + '
').join('') : '

No notes yet.

'; h += '

Suggestions and bug reports: the chat bubble on any page, or the LinkSpin Telegram group.

'; - h += ''; + h += ''; return h; } module.exports = { init, notes, roadmap, saveNote, saveRoadmap, remove, publicView, renderPage, bodyHtml, TAGS, STATUSES }; diff --git a/server.js b/server.js index 548c4c8..cdb62e2 100644 --- a/server.js +++ b/server.js @@ -4498,7 +4498,7 @@ const server = http.createServer(async (req, res) => { + '' + '
' + esc(label) + ' badge for @' + esc(un) + '

@' + esc(un) + ' unlocked ' + label + '

' + esc(sub.charAt(0).toUpperCase() + sub.slice(1)) + '. On LinkSpin every ad package that sells pays the sponsor in the same transaction, straight to their wallet, on-chain.

' + 'Join @' + esc(un) + '\u2019s line free

Advertising with a performance referral program. Not an investment; no income is guaranteed.

' - + ''; + + ''; res.writeHead(200, baseHeaders({ 'Content-Type': 'text/html; charset=utf-8', 'Cache-Control': 'public, max-age=300' })); return res.end(html); }