[Vim-l] Tip templates project
Santhalus
santhalus at gmail.com
Thu Oct 25 10:29:06 UTC 2007
John Beckett wrote:
>
>> Just one minor issue regarding the navigation: when I press
>> 'Random page' I am sometimes directed to a OriginalMissing
>> page.
>
> Ugh. I'm afraid that is an unforeseen side effect of what I did earlier. The
> current plan will have no effect.
>
> My guess is that "random page" picks any page in the main namespace. If that
> page is a redirect, another is picked.
>
> Previously, the 200 missing tips had no wiki page. For example, the VimTip56
> redirect page previously redirected to a single "tip is missing" page. All
> missing tips redirected to the same "tip is missing" page, so there was a
> low probability that "random page" would hit it.
>
> My previous efforts have greatly improved tip navigation. If you are at
> VimTip55 you can press 'Next tip' to go to VimTip56, which is NOT a
> redirect, but is an individual page explaining that tip 56 is missing, with
> a link to the original vim.org location so a persistent reader could verify
> that tip 56 really did not exist. There are also links to the previous and
> next tips.
>
> However, because VimTip56 is now a real page rather than a redirect, it is
> available for "random page". I don't know if we can overcome that problem. I
> was going to investigate it later. I imagine one would need to either read
> the wikia source code (I assume it's available somewhere), or find someone
> who understood it. Then you could see how "random page" works, and whether
> there is some way to disqualify pages from being a random target. There are
> 200 missing tips, 15 missing because they were duplicates, and we have
> removed another 60. That's 275 pages for "random page" to hit.
Does the Wikia use the mediawiki engine or it's own custom engine?
Here is fragment from mediawiki source (1.11.0)
(includes\SpecialRandompage.php), in case they use it.
$extra = $wgExtraRandompageSQL ? "AND ($wgExtraRandompageSQL)" : "";
$sql = "SELECT page_title
FROM $page $use_index
WHERE page_namespace = $ns
AND page_is_redirect = $redirect
AND page_random >= $randstr
$extra
ORDER BY page_random";
As you can see, there is a parameter for filtering the results
($wgExtraRandompageSQL) but I suspect it's global for the whole wiki.
But it seems that putting those missing pages on another namespace
could solve the problem.
Perhaps we would not even need Next/Prev tags in the template then,
but instead go to nearest next/prev page in our namespace?
How can the administrators control what's called on pressing
Next/Prev? Is it possible to embed some custom php functions/sql
queries there?
Regards,
Santhalus
More information about the Vim-l
mailing list