VBB v1 skeleton: off-chain loop engine, verified visitors, members, banners, leaderboards, admin; docstore + networksso from Downline Banners

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-13 15:24:34 -06:00
commit 9d0dde4b57
28 changed files with 2374 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
// Weekly leaderboards: top 10 by verified visitors sent, top 10 by distinct traffic sources (Central time week).
(async function () {
VBB.renderNav('/leaders'); VBB.renderFooter();
const $ = VBB.$, esc = VBB.esc;
const d = await VBB.getJSON('/api/leaders');
if (d.error) return VBB.status(d.error, 'err');
const wk = new Date(d.week + 'T12:00:00Z').toLocaleDateString('en-US', { month: 'long', day: 'numeric', timeZone: 'UTC' });
$('weekLbl').textContent = 'Week of Monday ' + wk + ', Central time. Resets every Monday at 12:00 AM. Only verified visitors count: a real browser, on the page a few seconds, once a day per visitor.';
const table = (rows, main) => rows.length ? '<table class="t"><tr><th>#</th><th>Member</th><th class="n">' + (main === 'visitors' ? 'Visitors' : 'Sources') + '</th><th class="n">' + (main === 'visitors' ? 'Sources' : 'Visitors') + '</th></tr>'
+ rows.map((r, i) => '<tr><td><span class="rank">' + (i + 1) + '</span></td><td>' + esc(r.name) + '</td><td class="n"><b>' + VBB.n(r[main]) + '</b></td><td class="n">' + VBB.n(main === 'visitors' ? r.sources : r.visitors) + '</td></tr>').join('') + '</table>'
: '<p class="muted">Nobody yet this week. Share your link from <a href="/my">My Banners</a> and take the top spot.</p>';
$('lbVisitors').innerHTML = table(d.visitors, 'visitors');
$('lbSources').innerHTML = table(d.sources, 'sources');
})();