// SZ 2025-11-30 — override SMF expandPages for "..." pagination function expandPages(spanEl, base_link, first_page, last_page, per_page) { try { var per = parseInt(per_page, 10) || 1; // Try to derive the real maximum page count by inspecting the pagination links. var maxPage = 1; var container = spanEl && spanEl.closest ? spanEl.closest(".pagelinks") : null; if (container) { var links = container.querySelectorAll("a.nav_page"); var maxStart = 0; links.forEach(function (a) { var href = a.getAttribute("href") || ""; // Match the last . segment, e.g. topic=15206.7650 var m = href.match(/\.([0-9]+)(?:$|[^0-9])/); if (m) { var n = parseInt(m[1], 10); if (!isNaN(n) && n > maxStart) maxStart = n; } }); if (maxStart > 0) maxPage = Math.floor(maxStart / per) + 1; } // Fallback to SMF-provided last_page if DOM inspection failed. if (!maxPage || maxPage < 1) { var last = parseInt(last_page, 10); maxPage = Math.floor(last / per) + 1; if (!maxPage || maxPage < 1) maxPage = 1; } var input = prompt("Go to page (1-" + maxPage + "):"); if (input === null) return; var page = parseInt(input, 10); if (!page || page < 1 || page > maxPage) return; var start = (page - 1) * per; if (start < 0) start = 0; var url = base_link; // base_link may be an HTML string contain an tag; try to extract href try { var tmp = document.createElement("div"); tmp.innerHTML = base_link; var a = tmp.querySelector("a"); if (a && a.getAttribute("href")) { url = a.getAttribute("href"); } } catch (err) { url = base_link; } // Replace common SMF patterns with the computed offset if (url.indexOf("%1$d") !== -1) { url = url.replace("%1$d", start); } else if (url.indexOf(";start=") !== -1) { url = url.replace(/;start=\d+/, ";start=" + start); } else if (/\.0(?!\d)/.test(url)) { url = url.replace(/\.0(?!\d)/, "." + start); } window.location.href = url; } catch (e) { // fail silently } }

adventures of the inhabitants of mobius

Started by darkness shadow, Nov 5, 2008 12:14 PM

Previous topic - Next topic

1 Guest

Tavy

"Fine... ppl who think I am a friend are way to inferior to me..." Sem sayed
Signature
I like to be called 'fat coon', ain't that true? ^^

Gleech

Arrow raced across the ocean and reached land, "AURUM!" he yelled.
Signature

Quote from: SonicFan47 on Dec 16, 2008 08:00 PM
I don't care in the Ryan/Jason debate. I can't tell the difference
but I favor JALEEL WHITE!

darkness shadow

aurum: hey arrow, where's... WATCH OUT FOR THE TREE!!!
Signature
supa emeraldz

thnx rival, again
shineh emeraldz =D

Tavy

If they go back they won't find Sem, he isn't there anymore

(you forgot he can fly? :P)
Signature
I like to be called 'fat coon', ain't that true? ^^

darkness shadow

Signature
supa emeraldz

thnx rival, again
shineh emeraldz =D

Gleech

Arrow hit the tree with a SMASH, "Next time... tell me sooner..."
Signature

Quote from: SonicFan47 on Dec 16, 2008 08:00 PM
I don't care in the Ryan/Jason debate. I can't tell the difference
but I favor JALEEL WHITE!

darkness shadow

aurum: ouch... sorry, but i'm not fast like you, anyway, where's sem?

OOC: lol, that made me lol loud
Signature
supa emeraldz

thnx rival, again
shineh emeraldz =D

Gleech

Arrow got off the tree and turned into Alex, "He wanted to stay... i have no idea why..."
Signature

Quote from: SonicFan47 on Dec 16, 2008 08:00 PM
I don't care in the Ryan/Jason debate. I can't tell the difference
but I favor JALEEL WHITE!

darkness shadow

aurum: IS HE NUTS!!! WE WERE LUCKY WE DIDN'T RUN IN2 ANYTHIN THEN!
Signature
supa emeraldz

thnx rival, again
shineh emeraldz =D

Gleech

Alex looked at Aurum with  puzzled look, "Why would he be nuts...?" He asked
Signature

Quote from: SonicFan47 on Dec 16, 2008 08:00 PM
I don't care in the Ryan/Jason debate. I can't tell the difference
but I favor JALEEL WHITE!

darkness shadow

aurum: there are creatures there that cna over power even the toughest of people there
Signature
supa emeraldz

thnx rival, again
shineh emeraldz =D

Gleech

Alex wasnt in the best mood, so without thinking he said something really stupid, "Well he can DIE there for all i care!"
Signature

Quote from: SonicFan47 on Dec 16, 2008 08:00 PM
I don't care in the Ryan/Jason debate. I can't tell the difference
but I favor JALEEL WHITE!

darkness shadow

Signature
supa emeraldz

thnx rival, again
shineh emeraldz =D

Tavy

Thunder, echo, powerful voice: I hope you where not talking about me...
Signature
I like to be called 'fat coon', ain't that true? ^^

darkness shadow

aurum: sem? but... oh yeah, well, i'm glad your ok
Signature
supa emeraldz

thnx rival, again
shineh emeraldz =D