diff --git a/accounts.js b/accounts.js index 7959233..deb9623 100644 --- a/accounts.js +++ b/accounts.js @@ -39,7 +39,9 @@ const pub = a => a ? { email: a.email, sponsorRef: a.sponsorRef || '', code: a.c bixPartnerLink: a.bixPartnerLink || null, // BixPay partner link (bixpay.js, 2026-10-29): one identity, follows the member to LinkSpin/CTB profileQuarantined: !!a.profileQuarantined, // 2026-10-30: first profile save of a brand-new free account planted a link; stored, never rendered publicly (spamscan.js) chatAvailable: a.chatAvailable === false ? false : true, lastSeen: a.lastSeen || 0, + theme: a.theme || null, // 2026-11-01 appearance: auto | light | dark, follows the member across browsers (common.js IAP.themeSync) address: a.address || null, created: a.created } : null; +const THEMES = new Set(['auto', 'light', 'dark']); const USER_RE = /^[a-zA-Z0-9_]{3,20}$/; const normUser = u => String(u || '').trim().toLowerCase(); @@ -130,6 +132,7 @@ const J = { }, async setBixLink(e, link) { const acct = this.db.byEmail[e]; if (!acct) return { error: 'No such account.' }; acct.bixPartnerLink = link || null; this.save(); return { ok: true, account: pub(acct) }; }, async touchSeen(e) { const a = this.db.byEmail[e]; if (a) { a.lastSeen = Date.now(); this.save(); } }, + async setTheme(e, t) { const a = this.db.byEmail[e]; if (!a) return { error: 'No such account.' }; a.theme = THEMES.has(t) ? t : null; this.save(); return { ok: true, account: pub(a) }; }, async setChatAvailable(e, v) { const a = this.db.byEmail[e]; if (!a) return { error: 'No such account.' }; a.chatAvailable = !!v; this.save(); return { ok: true, available: !!v }; }, async getMutes(e) { const a = this.db.byEmail[e]; return (a && Array.isArray(a.chatMutes)) ? a.chatMutes : []; }, async setMute(owner, target, muted) { @@ -233,7 +236,7 @@ const rowPub = r => r ? pub({ email: r.email, sponsorRef: r.sponsor_ref, code: r username: r.username, memberId: r.member_id || 0, joinedVia: r.joined_via || null, joinedRef: r.joined_ref || null, lineBannerUrl: r.line_banner_url, lineTargetUrl: r.line_target_url, wallOffers: r.wall_offers || null, avatarUrl: r.avatar_url, bio: r.bio, socials: r.socials, bixPartnerLink: r.bix_partner_link || null, profileQuarantined: !!r.profile_quarantined, - chatAvailable: r.chat_available === 0 ? false : true, lastSeen: Number(r.last_seen || 0), + chatAvailable: r.chat_available === 0 ? false : true, lastSeen: Number(r.last_seen || 0), theme: r.theme || null, address: r.address, created: Number(r.created) }) : null; const D = { async signup(e, password, ref) { @@ -296,6 +299,7 @@ const D = { }, async setBixLink(e, link) { const r = await db.q('UPDATE accounts SET bix_partner_link=? WHERE email=?', [link || null, e]); if (!r || !r.affectedRows) return { error: 'No such account.' }; return { ok: true, account: await this.byEmail(e) }; }, async touchSeen(e) { await db.q('UPDATE accounts SET last_seen=? WHERE email=?', [Date.now(), e]); }, + async setTheme(e, t) { await db.q('UPDATE accounts SET theme=? WHERE email=?', [THEMES.has(t) ? t : null, e]); return { ok: true, account: await this.byEmail(e) }; }, async setChatAvailable(e, v) { await db.q('UPDATE accounts SET chat_available=? WHERE email=?', [v ? 1 : 0, e]); return { ok: true, available: !!v }; }, async getMutes(e) { const r = await db.q('SELECT chat_mutes FROM accounts WHERE email=?', [e]); @@ -512,6 +516,7 @@ module.exports = { init, signup, login, ensure, onChange, isUnclaimedShell, byEm setProfile: async (e, a, bio, socials, quarantined) => { const r = await impl().setProfile(String(e || '').toLowerCase(), a, bio, socials, quarantined); if (!(r && r.error)) changed(String(e || '').toLowerCase()); return r; }, // profile edits reach LinkSpin too setBixLink: async (e, link) => { const r = await impl().setBixLink(normEmail(e), link ? String(link).slice(0, 300) : null); if (!(r && r.error)) changed(normEmail(e)); return r; }, // the BixPay partner link rides to LinkSpin in the profile row (lssync.js) touchSeen: e => impl().touchSeen(String(e || '').toLowerCase()), + setTheme: (e, t) => impl().setTheme(String(e || '').toLowerCase(), t), // appearance only: no changed() tap, LinkSpin does not mirror it either (its accounts.js says the same) adminSetAddress: (e, a) => impl().adminSetAddress(String(e || '').toLowerCase(), a ? normAddr(a) : null), positionByAddress: a => impl().positionByAddress(normAddr(a)), removeAccount: e => impl().removeAccount(String(e || '').toLowerCase()), diff --git a/blog.js b/blog.js index 4771ccc..1d2b370 100644 --- a/blog.js +++ b/blog.js @@ -6,6 +6,7 @@ const fs = require('fs'); const path = require('path'); const db = require('./db'); +const themehead = require('./themehead'); // light/dark theme head script (2026-11-01) let DATA_DIR = null; const SITE = 'https://instantadpay.com'; const AUTHOR = 'Marty Bostick'; @@ -97,19 +98,19 @@ async function bumpViews(slug) { try { await impl().bumpViews(slug); } catch (e) function head(o) { const url = SITE + o.path; const img = o.image ? (o.image.startsWith('http') ? o.image : SITE + o.image) : SITE + '/banners/iap-hero-1200x630.png'; - return '
' + return '' + '' + esc(p.excerpt) + '
'; diff --git a/chatbot.js b/chatbot.js index d8e14f6..19369e7 100644 --- a/chatbot.js +++ b/chatbot.js @@ -33,7 +33,7 @@ function key() { function enabled() { return !!key(); } // ---- canned answers: instant, free, always in voice ---- -const KNOWLEDGE_DATE = '2026-11-01'; // bump whenever the canned answers / prompt are brought up to date +const KNOWLEDGE_DATE = '2026-11-02'; // bump whenever the canned answers / prompt are brought up to date const SUPPORT_RE = /(contact|reach|email|e-mail|message|talk to|speak (to|with)|get hold of) (the )?(support|admin|administrator|owner|marty|staff|team at instantadpay|someone|a (human|person|real person))|support (email|address|ticket|team|desk)|help ?desk|(open|send|file|submit|raise) (a )?(support )?ticket|\b(human|real person|live (agent|person|chat|support))\b|customer (service|support)|support@|how (do|can) i get (help|support)/i; const CANNED = [ { id: 'support', title: 'Contact support or open a ticket', q: ['How do I contact support?', 'How do I talk to a real person?', 'How do I open a support ticket?'], tags: ['support', 'help', 'ticket', 'contact', 'help desk'], @@ -191,6 +191,9 @@ const CANNED = [ { id: 'banner-image', title: 'Banner image link and sizes', q: ['Why was my banner image refused?', 'What banner sizes are there?', 'How do I upload a banner?'], tags: ['banner', 'image', 'sizes', 'campaign'], re: /(banner (image|url|link|size|creative|file)|image (url|link|field)|broken (banner|image)|upload (a |my |the )?(banner|image|creative)|(png|jpg|jpeg) link|which sizes?)/i, a: 'The image field on a banner campaign needs a direct link to the picture itself, one that ends in .png, .jpg, .gif, .webp or .svg, or an upload. A web page link (your join page, an image-hosting page) is refused, because it would show a broken banner. Easiest source: Promo tools > Banners, pick the size you want and tap Copy image URL. Sizes are the standard ad sizes (728x90, 300x250, 160x600, 320x50 and more); the campaign form asks for the size too. Banner and text ads also run out on the wider network.' }, + { id: 'themes', title: 'Light and dark themes', q: ['Is there a light mode?', 'How do I switch themes?'], tags: ['theme', 'dark mode', 'light mode', 'appearance', 'accessibility'], + re: /(dark ?mode|light ?mode|dark theme|light theme|night mode|themes?|appearance|too bright|too dark|high contrast)/i, + a: 'InstantAdPay has light and dark themes (added 2026-11-02). In the member area use the Light, Dark or Auto control in the header, or the Appearance card on your Profile. Dark is the original look, Light is a bright green-grey workspace with the same layout, and Auto follows your device setting and switches with it. Your choice is saved on your account, so it follows you to any device once you sign in, and it applies to the public pages and your wall too. Nothing changes until you pick one. Both themes pass the accessibility contrast standard for text.' }, { id: 'promo-tools', title: 'Promo tools', q: ['What is in Promo tools?', 'Where are the email swipes and banners?'], tags: ['promo tools', 'social posts', 'swipes', 'banners', 'objections'], re: /(promo tools?|social posts?|email swipes?|banner kit|download banners?|promo banners?|text a friend|objection|share buttons?)/i, a: 'Promo tools (Members > Promo tools) has pill menus for each kit: Social posts (X, Facebook, LinkedIn, Telegram or WhatsApp, with post and share buttons), Text a friend (SMS-sized messages with Text it, WhatsApp, Telegram and Copy), Email swipes (short, standard, long, follow-up), Banners (every standard ad size plus square, story and Telegram sizes, download or copy URL), your Banner wall link, an Objection handling bank with the truth plus a ready-to-send reply, and a Games tab with a kit for every network game plus the EnjoyBestGames arcade (enjoybestgames.com, hundreds of free games; only the featured Polygon games pay, and your ?r= link cookies visitors as your referral for 30 days). Everything is personalized with your invite link.' }, diff --git a/db.js b/db.js index 830d6c9..ac9e954 100644 --- a/db.js +++ b/db.js @@ -346,6 +346,7 @@ async function bootstrap() { await alterSafe('ALTER TABLE accounts ADD COLUMN wall_offers VARCHAR(2000) NULL'); // JSON [{title,bannerUrl,targetUrl}] for wall positions 2-3 (unlock at 2 / 5 qualifying buyers) await alterSafe('ALTER TABLE accounts ADD COLUMN profile_quarantined TINYINT NOT NULL DEFAULT 0'); // 2026-10-30 link-farm rule: first profile save of a new free account carried a link (spamscan.js) await alterSafe('ALTER TABLE accounts ADD COLUMN bix_partner_link VARCHAR(300) NULL'); // BixPay partner link (bixpay.js, 2026-10-29); column name checked against MySQL 8 reserved words + await alterSafe('ALTER TABLE accounts ADD COLUMN theme VARCHAR(8) NULL'); // 2026-11-01 appearance: auto | light | dark (same column as LinkSpin) // help desk (2026-10-16, tickets.js): one shared desk for IAP and, later, LinkSpin; email_message_id threads inbound mail await q(`CREATE TABLE IF NOT EXISTS tickets ( id INT AUTO_INCREMENT PRIMARY KEY, diff --git a/leaderboard.js b/leaderboard.js index 6476cdf..bbdcadc 100644 --- a/leaderboard.js +++ b/leaderboard.js @@ -5,6 +5,7 @@ // rollover (checked hourly), announced to Telegram, and credit prizes are granted automatically. const fs = require('fs'); const path = require('path'); +const themehead = require('./themehead'); // light/dark theme head script (2026-11-01) let R = null; // { chain, accounts, ads, dataDir, siteConfig, notify(text), pushFeed(ev) } const TZ = 'America/Chicago'; let cache = { at: 0, rows: null }; @@ -131,9 +132,9 @@ async function renderPage() { + (v.top.length ? v.top.map(r => 'Referral contest
Ranked by ad packages sold to other people (your own positions never count, and the company account is not a contestant). Read from the chain, updated live. Weeks run Monday to Sunday, Central time.
The button opens a BixPay partner sign-up link.
Sign up on the page the button opens. Don’t install the BIX app first and don’t use the portal’s own Sign Up menu: your sponsor is lost and BIX shows the referrer as N/A.
-The BixPay card is not switched on for InstantAdPay members yet. Check back soon.
Available in 31 US states so far. Not in your state yet? You can still get the wallet and build. Elsewhere, availability varies by country.
@@ -164,7 +165,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 b0ab224..fa57b58 100644 --- a/public/earning.html +++ b/public/earning.html @@ -1,14 +1,15 @@ - +InstantAdPay · Advertise and earn on Polygon
- -Every ad package splits to real wallets in the same transaction it sells. No pending payouts, no withdraw button, and every payment is public.
-One purchase, one transaction, four payments. Open the real ledger →
- -Type your email and we send a 6-digit code. No password, no wallet needed today.
- - - - - - - - - - -Advertising, not investing. No income is guaranteed; results depend on your effort. Crypto carries risk of loss.
-The one crypto here is POL on the Polygon network: packages are paid in POL and every payout arrives as POL in your own wallet. Any Polygon wallet works (MetaMask, SafePal, Phantom, Coinbase Wallet). Never held crypto? Buy POL with a card inside the member area.
-Three steps. The first one takes a minute and costs nothing.
A 6-digit code, no password. You get an invite link and welcome credits to try real ads.
Seven ad formats. View ads to earn credits, or buy a package from $5 when you want reach.
Activate with the $20 starter package and switch on payouts, and anyone who buys through your link pays you 50 percent, on-chain, the moment it happens.
Priced in dollars, settled in POL at the live rate. One credit is one cent of ad delivery.
Every package pays 50 / 20 / 10 up the line the moment it sells, on a public ledger. Join free and look around first.
-InstantAdPay · Advertise and earn on Polygon
+ +Every ad package splits to real wallets in the same transaction it sells. No pending payouts, no withdraw button, and every payment is public.
+One purchase, one transaction, four payments. Open the real ledger →
+ +Type your email and we send a 6-digit code. No password, no wallet needed today.
+ + + + + + + + + + +Advertising, not investing. No income is guaranteed; results depend on your effort. Crypto carries risk of loss.
+The one crypto here is POL on the Polygon network: packages are paid in POL and every payout arrives as POL in your own wallet. Any Polygon wallet works (MetaMask, SafePal, Phantom, Coinbase Wallet). Never held crypto? Buy POL with a card inside the member area.
+Three steps. The first one takes a minute and costs nothing.
A 6-digit code, no password. You get an invite link and welcome credits to try real ads.
Seven ad formats. View ads to earn credits, or buy a package from $5 when you want reach.
Activate with the $20 starter package and switch on payouts, and anyone who buys through your link pays you 50 percent, on-chain, the moment it happens.
Priced in dollars, settled in POL at the live rate. One credit is one cent of ad delivery.
Every package pays 50 / 20 / 10 up the line the moment it sells, on a public ledger. Join free and look around first.
+The flow
Release notes and roadmap
' + esc(desc) + '
Nothing queued right now.
'; diff --git a/server.js b/server.js index 47431b6..a1fb018 100644 --- a/server.js +++ b/server.js @@ -16,6 +16,7 @@ const { URL } = require('url'); const chain = require('./chain'); const auth = require('./auth'); const accounts = require('./accounts'); +const themehead = require('./themehead'); // 2026-11-01 light/dark theme head script for server-rendered pages + its CSP hash const ads = require('./ads'); const mailer = require('./mailer'); const { emailIssue } = require('./emailcheck'); // typo / no-mail-domain check for NEW addresses (2026-10-22) @@ -851,7 +852,7 @@ const MIME = { '.html': 'text/html; charset=utf-8', '.css': 'text/css', '.js': ' '.png': 'image/png', '.jpg': 'image/jpeg', '.svg': 'image/svg+xml', '.webp': 'image/webp', '.ico': 'image/x-icon', '.json': 'application/json', '.mp4': 'video/mp4', '.woff2': 'font/woff2', '.gif': 'image/gif', '.webm': 'video/webm', '.vtt': 'text/vtt; charset=utf-8', '.txt': 'text/plain; charset=utf-8', '.xml': 'application/xml; charset=utf-8' }; -const CSP = "default-src 'self'; script-src 'self' https://cdn.jsdelivr.net https://www.networkadspace.com https://networkadspace.com https://polhunter.com 'sha256-NzvNrqk5jB9YZATwo5BF4JoRlJ02HsnFikbKXgEPdaQ='; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: blob: https:; media-src 'self' https: blob:; connect-src 'self' https://polhunter.com https://*.walletconnect.com wss://*.walletconnect.com https://*.walletconnect.org wss://*.walletconnect.org https://*.reown.com wss://*.reown.com https://*.reown.org wss://*.reown.org https://*.web3modal.org https://*.drpc.org https://*.publicnode.com https://*.coinbase.com https://linkspin.app; font-src 'self' data: https://fonts.gstatic.com https://fonts.reown.com; form-action 'self'; frame-src https: http:"; +const CSP = "default-src 'self'; script-src 'self' https://cdn.jsdelivr.net https://www.networkadspace.com https://networkadspace.com https://polhunter.com 'sha256-NzvNrqk5jB9YZATwo5BF4JoRlJ02HsnFikbKXgEPdaQ=' " + themehead.CSP_HASH + "; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: blob: https:; media-src 'self' https: blob:; connect-src 'self' https://polhunter.com https://*.walletconnect.com wss://*.walletconnect.com https://*.walletconnect.org wss://*.walletconnect.org https://*.reown.com wss://*.reown.com https://*.reown.org wss://*.reown.org https://*.web3modal.org https://*.drpc.org https://*.publicnode.com https://*.coinbase.com https://linkspin.app; font-src 'self' data: https://fonts.gstatic.com https://fonts.reown.com; form-action 'self'; frame-src https: http:"; function baseHeaders(extra) { return Object.assign({ 'Content-Security-Policy': CSP, 'X-Content-Type-Options': 'nosniff', 'Referrer-Policy': 'strict-origin-when-cross-origin' }, extra || {}); @@ -2323,7 +2324,7 @@ const server = http.createServer(async (req, res) => { const r = await drip.unsubscribe(u.searchParams.get('e'), u.searchParams.get('t')); const msg = r.error ? r.error : 'Done. You will not get any more emails from InstantAdPay, apart from sign-in codes you ask for and receipts for payments to or from your account. Your account is unchanged.'; res.writeHead(r.error ? 400 : 200, baseHeaders({ 'Content-Type': 'text/html; charset=utf-8', 'Cache-Control': 'no-store' })); - return res.end('' + 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 freeAdvertising with a performance referral program. Not an investment; no income is guaranteed.