diff --git a/blog.js b/blog.js index 96219f1..a1900b0 100644 --- a/blog.js +++ b/blog.js @@ -110,7 +110,7 @@ function head(o) { + '
'; } function tail() { - return '
'; + return ''; } const authorBox = () => '
InstantAdPay
' + AUTHOR + 'Founder of InstantAdPay 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 ee6daad..0d4c602 100644 --- a/leaderboard.js +++ b/leaderboard.js @@ -142,7 +142,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. Prizes are advertising credits or packages, never cash. No income is guaranteed.

'; - h += ''; + h += ''; return h; } module.exports = { init, view, compute, renderPage, rolloverTick, winners, periodBounds }; diff --git a/public/admin.html b/public/admin.html index 167d1dd..422072a 100644 --- a/public/admin.html +++ b/public/admin.html @@ -652,7 +652,7 @@ - + diff --git a/public/assets/common.js b/public/assets/common.js index 96ca350..b598d6b 100644 --- a/public/assets/common.js +++ b/public/assets/common.js @@ -70,19 +70,36 @@ 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 sponsor this visitor came in on + // (iap.sponsor 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 REF_RE = /^[A-Za-z0-9_.-]{1,40}$/; + const okRef = v => REF_RE.test(v) && !/^\d+$/.test(v) && !/^0x[0-9a-f]{40}$/i.test(v) && v !== 'company' && v !== 'top'; + const refCookie = () => { 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 : refCookie())).catch(() => refCookie()); + 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 = refCookie(); + const paint = () => { d.innerHTML = 'Part of the networkOne account across the network:' + list.map(s => (s.id === 'iap' || /instantadpay\.com/.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 9cbf920..e1b81de 100644 --- a/public/assets/netline.js +++ b/public/assets/netline.js @@ -4,6 +4,14 @@ var me = (document.currentScript && document.currentScript.getAttribute('data-site')) || 'iap'; 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 sponsor this visitor came in on + // (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 refCookie() { var m = document.cookie.match(/(?:^|;\s*)iap\.sponsor=([^;]*)/); try { var v = m ? decodeURIComponent(m[1]) : ''; return okRef(v) ? v : ''; } 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; @@ -12,13 +20,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 = refCookie(); + var paint = function () { box.innerHTML = (hasLegal ? '' : 'Terms · Earnings Disclaimer · Privacy · Contract · Ledger · Support') + '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/bixpay.html b/public/bixpay.html index 371b344..aae5235 100644 --- a/public/bixpay.html +++ b/public/bixpay.html @@ -165,7 +165,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees.
- + diff --git a/public/contract.html b/public/contract.html index 896daed..2e36c16 100644 --- a/public/contract.html +++ b/public/contract.html @@ -143,7 +143,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/conversion-tracking.html b/public/conversion-tracking.html index e87807f..f5791e2 100644 --- a/public/conversion-tracking.html +++ b/public/conversion-tracking.html @@ -265,8 +265,8 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees.
- + - + diff --git a/public/disclaimer.html b/public/disclaimer.html index f17f610..c64d45e 100644 --- a/public/disclaimer.html +++ b/public/disclaimer.html @@ -27,7 +27,7 @@

You decide whether, and how much, to spend. Never spend more than you can afford to lose.

- + diff --git a/public/earning.html b/public/earning.html index 7b5d4b2..6cb4015 100644 --- a/public/earning.html +++ b/public/earning.html @@ -97,7 +97,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees.
- - + + diff --git a/public/facts.html b/public/facts.html index 90674a7..29c0bbc 100644 --- a/public/facts.html +++ b/public/facts.html @@ -127,7 +127,7 @@ - + diff --git a/public/friday.html b/public/friday.html index 14eec51..949d51f 100644 --- a/public/friday.html +++ b/public/friday.html @@ -72,7 +72,7 @@ - - + + diff --git a/public/games.html b/public/games.html index 060a651..93b0cb1 100644 --- a/public/games.html +++ b/public/games.html @@ -79,7 +79,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 3c1c1eb..b7a7d94 100644 --- a/public/index.html +++ b/public/index.html @@ -506,7 +506,7 @@ - + diff --git a/public/join.html b/public/join.html index 03ca690..484eb0c 100644 --- a/public/join.html +++ b/public/join.html @@ -158,7 +158,7 @@ InstantAdPay · Contract · Terms · Privacy · Disclaimer - + diff --git a/public/launch.html b/public/launch.html index 08e0c2c..8b49722 100644 --- a/public/launch.html +++ b/public/launch.html @@ -106,7 +106,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 3267666..2299552 100644 --- a/public/ledger.html +++ b/public/ledger.html @@ -41,7 +41,7 @@
InstantAdPay is the Polygon hub of the Crypto Team Build Network.
- + diff --git a/public/my.html b/public/my.html index daee3a1..cfb4fea 100644 --- a/public/my.html +++ b/public/my.html @@ -1306,7 +1306,7 @@ - + diff --git a/public/partners.html b/public/partners.html index fce630d..8ab0abc 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 9295791..28b13f8 100644 --- a/public/plays.html +++ b/public/plays.html @@ -194,7 +194,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/presentation.html b/public/presentation.html index 15ea9d7..337bfb8 100644 --- a/public/presentation.html +++ b/public/presentation.html @@ -87,6 +87,6 @@
InstantAdPay is the Polygon hub of the Crypto Team Build Network.
- + diff --git a/public/privacy.html b/public/privacy.html index 11d3a71..8c146a9 100644 --- a/public/privacy.html +++ b/public/privacy.html @@ -32,7 +32,7 @@

We use reasonable safeguards, but no system is perfectly secure. Protect your email and your wallet.

- + diff --git a/public/refuel-guide.html b/public/refuel-guide.html index 36eee29..249c060 100644 --- a/public/refuel-guide.html +++ b/public/refuel-guide.html @@ -261,6 +261,6 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees.
- + diff --git a/public/support.html b/public/support.html index a146f48..cfbd95e 100644 --- a/public/support.html +++ b/public/support.html @@ -20,7 +20,7 @@

Loading…

We will never ask for your recovery phrase or private key, and nobody from InstantAdPay will message you first asking for money or wallet access.

- + diff --git a/public/terms.html b/public/terms.html index a516dc8..5a96998 100644 --- a/public/terms.html +++ b/public/terms.html @@ -42,7 +42,7 @@

See also the Disclaimer and Privacy Policy. Questions: the support page or support@instantadpay.com.

- + diff --git a/public/tx.html b/public/tx.html index 62889d1..5fa519b 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 e7ef2ed..92a643d 100644 --- a/public/wall.html +++ b/public/wall.html @@ -48,7 +48,7 @@ - + diff --git a/public/wallets.html b/public/wallets.html index ac7bbaf..b8bbafe 100644 --- a/public/wallets.html +++ b/public/wallets.html @@ -123,7 +123,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/public/wednesday.html b/public/wednesday.html index 4a0db53..0c389cc 100644 --- a/public/wednesday.html +++ b/public/wednesday.html @@ -65,7 +65,7 @@ - - + + diff --git a/releases.js b/releases.js index acd18fc..59480eb 100644 --- a/releases.js +++ b/releases.js @@ -65,7 +65,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 InstantAdPay 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 c8f9457..c9c261f 100644 --- a/server.js +++ b/server.js @@ -6321,7 +6321,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 InstantAdPay 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); }