From 0042bca9e56a647de06ccbd7a9a02b577abdf93f Mon Sep 17 00:00:00 2001 From: martbost Date: Sat, 1 Aug 2026 11:53:44 -0500 Subject: [PATCH] CBP ref fallback chain: own entry -> upline sponsor's entry -> company (Marty's rule) Endpoint walks one hop up ref_by when the member's own program-73 entry is empty; response carries source: self|sponsor. Calculator shows an adapted nudge on upline fallback (alignment held, but claim your own referrals). Hub invite still aligns to the SHARER either way. Co-Authored-By: Claude Fable 5 --- index.html | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 44e4e02..9537293 100644 --- a/index.html +++ b/index.html @@ -2370,9 +2370,16 @@ function updateHubLinks() { } } -function showSponsorNudge() { +function showSponsorNudge(kind) { const el = document.getElementById('sponsorNudge'); - if (el) el.style.display = 'block'; + if (!el) return; + if (kind === 'sponsor') { + // Endpoint resolved the CBP ref from the member's UPLINE sponsor's entry + // (fallback chain: own entry → upline's entry → company). Alignment held, + // but the sharer should still claim their own referrals. + el.innerHTML = '⚠️ This sponsor hasn’t added their own ClickBaitPays username in CryptoTeamBuild yet, so sign-ups credit their upline sponsor for now. Sponsors: log into CryptoTeamBuild → Downline Builder → ClickBaitPays → enter your ClickBaitPays username, and your links switch to you automatically.'; + } + el.style.display = 'block'; } async function resolveIdentity() { @@ -2387,6 +2394,7 @@ async function resolveIdentity() { if (r.found) { IDENT.cbp = r.cbpUsername; IDENT.ctb = r.ctbUsername; + if (r.source === 'sponsor') IDENT.uplineFallback = true; } else { const rv = await fetch(`${CTB_LOOKUP_URL}?cbp=${encodeURIComponent(ctbParam)}`).then(x => x.json()); if (rv.found) { @@ -2413,6 +2421,7 @@ async function resolveIdentity() { if (f.found) { IDENT.cbp = f.cbpUsername; IDENT.ctb = f.ctbUsername; + if (f.source === 'sponsor') IDENT.uplineFallback = true; } } } @@ -2423,6 +2432,7 @@ async function resolveIdentity() { updateSharedLinkBox(); updateHubLinks(); if (IDENT.fallback) showSponsorNudge(); + else if (IDENT.uplineFallback) showSponsorNudge('sponsor'); } function getBaseUrl() {