Re: [pmwiki-users] New recipe: PageListMultiTargets
tamouse mailing lists writes: > Any idea how it performs on large page sets? On my site I implemented an alternative version of this functionality as posted on http://www.pmwiki.org/wiki/PITS/00908 (with less functionality - no + operator and no wildcards), and I've also added this recipe. I have thousands of pages (>18000 files in wiki.d, work.d is elsewhere) and a 5.5MB .pageindex. Example searches, with cache=0 and a simple fmt to reduce rendering time: PageListMulti: http://www.smspower.org/?action=search&q=links%3D%2BTags.Action%2C%2BTags.Disney%2C-Tags.Movie+fmt%3D%23default+cache%3D0 ~1.4s My link= modification: http://www.smspower.org/?action=search&q=link%3DTags.Action%2CTags.Disney%2C-Tags.Movie+fmt%3D%23default+cache%3D0 ~0.5s Please don't hammer my server, though :) Maxim ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] WikiTitle
> what is your preferred way to use the HTML tag? I have it wiki-driven. In Site/TitleTag: (:if name {$DefaultName}:)(:else:){$Titlespaced} - (:ifend:)(:if group {$DefaultGroup}:)(:else:){$Group} - (:ifend:)SMS Power! Then, in config.php (should be in skin.php really...): function TitleTag($pagename) { $page = ReadPage('Site.TitleTag', READPAGE_CURRENT); echo trim(strip_tags(MarkupToHTML($pagename, $page['text']))); } Then, in my skin: It's not very efficient, and the wiki part should be more complex to suit all cases, but it does the trick for me. I find it vastly preferable to move the logic into a wiki page rather than be editing PHP whenever I decide to tweak it. Maxim ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] Site.AllRecentChanges lost
> Is your PmWiki installation in some way special/particular ? Well, it has a lot of recipes and tweaks to PmWiki settings. But nothing that should affect this (e.g. $RecentChangesFmt is unchanged). > By the way, your site runs fast ! Not fast enough... plenty of pages take multiple seconds... ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
[pmwiki-users] Site.AllRecentChanges lost
My Site.AllRecentChanges got wiped today. The page has ctime=1285935469 (today). This happened as I added a new page (same ctime), something I've done hundreds of times before without issues. Are there any known issues that might be related to this? ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] Conditional Question and PageList Question.
> I am trying to make a pagelist template that uses a conditional that > will detect whether the pagename has a "-" in it. Inside a pagelist, you can't use the regular (:if:) conditions in the way yuo want because they only reference the page being rendered. You need to test the currently iterated page using the {=$Name} variable. To do that, you'll need to install additional conditions like "matchstring" on http://www.pmwiki.org/wiki/Cookbook/ConditionalMarkupSamples and have a template like: (:if matchstring {=$Name} '/-/':) * %red%[[{=$FullName}]] (:else:) * %blue%[[{=$FullName}]] (:ifend:) (untested) > The second thing I am looking for is a way to have a pagelist style > directive that will list all of the anchors on a page. Pagelists can't do that (anchors are not pages). You could write a recipe to do it. Here's a start: Markup('listanchors', 'http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] No history for first page revision
I overwrote my 2.2.17 installation with a fresh download and it was fixed. I suspect some core files may have been edited somehow. Maxim ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
[pmwiki-users] No history for first page revision
I've noticed that newly-added pages to my wiki have a blank history. If I subsequently edit them, I see diffs as expected. I can see older pages show the first revision as a "diff from nothing". What could be causing this? Maxim ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] PVs in PTVs not resolved by PageTextVar()
>> I can't pass the string through FmtPageName because that doesn't >> handle this sort of string. > > Why not? It substitutes things like "$Name", not "{$Name}" or "{Group.Page$Name}", so I end up with something like "{Group.PagePage}.jpg". Parsing out the {...} seems like hard work. Here's what I get: PageTextVar($pagename, 'Filename') = "{Scans.AceOfAces-SMS-EU$Name}.jpg" FmtPagename(PageTextVar($pagename, 'Filename'), $pagename) = "{Scans.AceOfAces-SMS-EUAceOfAces-SMS-EU}.jpg" > Note that using FmtPagename() on user-supplied data opens potential > security holes I saw that at http://www.pmwiki.org/wiki/PmWiki/FmtPageName ; it's not a concern for me. Maxim ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
[pmwiki-users] PVs in PTVs not resolved by PageTextVar()
I have a page (e.g. named Scans.Foo) that contains a PTV with a page variable inside it: :Filename:{$Name}.jpg If I call PageTextVar('Scans.Foo', 'Filename') ...I get: "{Scans.Foo$Name}.jpg" ...when I want: "Foo.jpg" I can't pass the string through FmtPageName because that doesn't handle this sort of string. Right now my workaround is: $filename = strip_tags(MarkupToHTML($pagename, PageTextVar($pagename, 'Filename'))); This seems hacky, is there a better way? Maxim ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
[pmwiki-users] Getting source page name in custom markup in transcluded text
I want my custom markup to be able to get the page name of the page it is on, even when transcluded. In other words, Group/Page1: (:mymarkup:) Group/Page2: (:include Page1:) ...I want to somehow get "Page1" to show up on both pages. Is there a way to do this without requiring "{$Name}" to be present in Page1? Maxim ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
[pmwiki-users] Searching with Unicode ranges
If I attempt to search (or pagelist) using a range of characters in English, it works fine: http://www.pmwiki.org/wiki/PmWikiJa/PmWikiJa?action=search&q=name%3DPmWikiJa%2F[A-Z]* If I use Unicode characters in that range, things go wrong: http://www.pmwiki.org/wiki/PmWikiJa/PmWikiJa?action=search&q=name%3DPmWikiJa%2F[%E3%82%A2-%E3%82%A4]* Exact matches work fine: http://www.pmwiki.org/wiki/PmWikiJa/PmWikiJa?action=search&q=name%3DPmWikiJa%2F%E3%82%A2* It seems to be expanding the Unicode subrange that is searched. Any suggestions on how to tackle this? On http://php.net/manual/en/function.preg-match.php someone commented that one ought to pass the u modified to correctly match Unicode subranges. Where is the right place for that? Is it there or not? Maxim ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] Mini vs Thumblist2
> do you know how to make Lightbox displaying pictures zoomed down to > browser window size? I like the Highslide recipe: http://www.pmwiki.org/wiki/Cookbook/Highslide which can pick up the direct image links and/or be integrated by setting a class attribute on the links. By default it scales images to fit the browser viewport. You can see some large images using it with PmWiki here: http://www.smspower.org/maxim/Maps/SonicTheHedgehog Maxim ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] Attachment links with square brackets in both the filename and link text
On Sat, Oct 31, 2009 at 10:11 PM, Petko Yotov <5...@5ko.fr> wrote: > On Saturday 31 October 2009 22:32:45 Maxim wrote: >> I want to do: >> >> [[Attach:Filename [x].zip | Link Text [x] ]] >> >> I've made a page at >> http://www.pmwiki.org/wiki/Test/SquareBracketsInLink with various >> iterations of the markup while removing the square brackets. There's >> also a version linking to a regular page, although having a square >> bracket in the page name is less likely. In both, the parsing seems to >> fail for tests 1, 2, 5 and 7. How can I get a link like the one above? > > You cannot -- brackets, parentheses, and punctuation are not allowed in the > names of wiki pages or uploaded files, and trying to allow them could bring > more trouble than good. > > You can use a link like this: > [[Attach:Filename_x.zip | Link Text [x] ]] > > Clicking on the link will bring you the upload form with the correct filename > already selected. You can send a file with any name on your system > (like "Filename [x].zip"), it will be renamed to the correct filename > ("Filename_x.zip"). The square brackets in attachment names do not cause any problems otherwise. It is a fairly large problem for me to not have any brackets available, as the downloaded files' names are quite important, and it seems quite restrictive in the case of general http:// links. I added those to http://www.pmwiki.org/wiki/Test/SquareBracketsInLink and they are even more buggy... Notice also that [[ Link Text [x] -> Attach:Filename.zip ]] fails. Maxim ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
[pmwiki-users] Attachment links with square brackets in both the filename and link text
I want to do: [[Attach:Filename [x].zip | Link Text [x] ]] I've made a page at http://www.pmwiki.org/wiki/Test/SquareBracketsInLink with various iterations of the markup while removing the square brackets. There's also a version linking to a regular page, although having a square bracket in the page name is less likely. In both, the parsing seems to fail for tests 1, 2, 5 and 7. How can I get a link like the one above? Maxim ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
[pmwiki-users] Fwd: Custom markup accessing page variables in an included page
I have some custom markup. It is an evaluated function; in its markup, it wants to access the value of $Name for the page it is on. It does this like so: global pagename; $filename = PageVar($pagename, '$Name') . $desc . '.png'; This works fine but as soon as this custom markup is transcluded in another page, the value of $Name reflects that page, not the original. I don't really want to have {$Name} specified in the markup (which I think would allow (:include basepage= :) to work). Within the context of the markup function, is it possible for it to know the original (base) page name? Maxim ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] Getting a random page name inside a cookbook recipe
> $mypages = ListPages( array_merge( > $SearchPatterns['normal'], array('Sprites'=>'/^Sprites\\./'))); This was the magic part, I hadn't realised the $SearchPatterns arrays were actually the parameters to ListPages. Many thanks. Maxim ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
[pmwiki-users] Getting a random page name inside a cookbook recipe
Within a cookbook recipe I want to select a page at random from a particular group. The solution I came up with is: $pagename = trim(strip_tags(MarkupToHTML('', '(:pagelist fmt=#simple list=normal group=Sprites order=random count=1:)'))); This has the advantage of not needing any dedicated pagelist format. However, I'm a little worried that it's doing more than is necessary. Is there a nicer way? Maxim ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users