[pmwiki-users] FW: FW: FW: Difficulties to get 'fox' working

2008-01-20 Thread Peter K.H. Gragert
Thanks Hans
For the FoxCommentbox, this did the job ...

Greetings (after a busy Sunday)
  Peter

-Oorspronkelijk bericht-
Van: Hans [mailto:[EMAIL PROTECTED] 
Verzonden: zondag 20 januari 2008 15:31
Aan: Peter K.H. Gragert
CC: pmwiki-users@pmichaud.com
Onderwerp: Re: [pmwiki-users] FW: FW: Difficulties to get 'fox' working

Sunday, January 20, 2008, 2:09:31 PM, Peter K.H. Gragert wrote:

> Result changes now to
> ERROR: Found no form to add above

Is Fox.CommentBox included in another page and you are trying from
there, or do you try to post on Fox.CommentBox?
If the first is the case it won't work because #above means put=aboveform
but you have not got the form on the page. Put a (:foxprepend cbox:)
markup on the page, and don't specify #above in th e(:fox cbox markup.


  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] Small problem with changed default page

2008-01-20 Thread Patrick R. Michaud
On Sun, Jan 20, 2008 at 04:48:21PM -0500, Stirling Westrup wrote:
> Anke Wehner wrote:
> > This works on links inside the wiki - [[Group/]] links to Group.Main
> > and all - but one problem I noticed that when I change the url per
> > hand, say, removing the page name, so I have ...wiki.php/Group , it
> > looks for Group.Group rather than Group.Main.
> > 
> > Is there something obvious I missed? (I'm using  .beta65)
> 
> Alas, that is PmWiki's normal behaviour. $PagePathFmt is a /search/ path 
> that tells PmWiki where to look for an under-specified page (ie, Group 
> or Name part missing). It has no effect if no page is found at all. In 
> that case PmWiki is hardwired to call the page $Group.$Group.

This is no longer true (or at least it's supposed to be no longer
true).  PmWiki now uses either $Group.$Group or
$Group.$DefaultName, whichever appears first in $PagePathFmt.

Pm

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] cookbook "ShellTools" (was: Include specific lines of text on a page)

2008-01-20 Thread Patrick R. Michaud
On Sun, Jan 20, 2008 at 07:21:43PM +, Hans wrote:
> But seeing this I think a lines=n option is more friendly and useful:
> lines=5 would display the first 5 lines from  every page, and
> lines=-5 would display the last 5 lines from every page matching.
> This would be similar to the (:include PageName lines=... :) option
> (but would work on multiple pages).

FWIW, it's been my plan that lines=-5 would mean "the last
five lines of the file", similar to how count=-5 means "the
last five items in a pagelist".  I just haven't gotten around
to implementing it (nor had a request for it until now).

Pm

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] cookbook "ShellTools" (was: Include specific lines of text on a page)

2008-01-20 Thread Peter & Melodye Bowers
> I've tested it on files containing more and less lines than are in the n=x
> option.  I've tested it to a single level of nesting.  As mentioned, I
> have not tested it on text containing parentheses which might confuse the
> markupexpr.php parsing engine...

My apologies to Mr. Markupexpr.php -- he robustly handles parenthesis and
doesn't even blink at the nesting.  "Piping" seems to work effectively in
this simple test case.

{(tail n=5 (tail prefix="Lines from PAGENAME:" n=3 file1 file2 file3))}

This gives the last line of file2, a prefix line of "Lines from file3:" and
then the last 3 lines of file3 -- all that totals 5 which is the number of
lines the outer (tail...) was looking for.

I put lines at the end of file1, file2, and file3 that had parens and there
was no difficulty at all.  

-Peter


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


[pmwiki-users] FW: cookbook "ShellTools" (was: Include specific lines of text on a page)

2008-01-20 Thread Peter & Melodye Bowers
(this was originally sent off-list, but it's getting confusing having part
of the conversation on-list and part off-list)

> Peter, I think nesting does not work well when processing multiple
> pages. That was the reason I included into the grep.php script an
> option of cut= and hide=, rather than trying to make these into
> separate MXPs (markup expressions, is this a usable acronym???).
> It is enough processing just to open every page in the file list once.
> So I propose to do the same for a tail= option, if that is useful:
> tail=n, n being an integer, would display the last n lines from every
> page which  matches the wildcard pattern.

How would you differentiate between these 2 calls which do very different
things:

Tail -n 20 file1 file2 | grep 'mytext'

Grep 'mytext' file1 file2 | tail -n 5

The first one takes the last 20 lines of 2 different files and then searches
for "mytext" within those 40 lines.  The second searches for "mytext" in 2
different files and takes the last 5 matching lines.  Clearly the order of
processing is going to be VERY important in this and I'm afraid it's going
to get very difficult to control this order of processing...

Another option would be to implement something like this:

{(shell tail -n 20 file1 file2 | grep "mytext")}
{(shell grep "mytext" file1 file2 | tail -n 5)}

Obviously at this point we've moved into a whole, completely other world
where we are implementing a subset of a completely different language.
Powerful?  Yes.  But I'm not sure either of us is prepared to put in the
huge number of hours required to do something like that...

Pseudo-code:
Split by \n or ;
For each of these expressions
Split by | for piping
For each of these expressions
Access the appropriate function, saving the output
in an array and passing it on to the next function

Hmmm...  Maybe it's not that difficult after all...  Of course it would not
(could not) be as robust of a bash interpreter, but the basics might be
relatively easy to implement.  ParseArgs() unfortunately is going to be a
limiting factor because it's going to pick up any x=y anywhere in the line
and glump them all together into the $opt array - no way then to
differentiate which option was for which command...  It's a tool designed to
serve a single command and we would be implementing multiple commands within
the single call.

I suppose then you could look at a (!...!) markup or something to bypass
ParseArgs()...  Anyway, that's a different kettle of fish.

> But seeing this I think a lines=n option is more friendly and useful:
> lines=5 would display the first 5 lines from  every page, and
> lines=-5 would display the last 5 lines from every page matching.
> This would be similar to the (:include PageName lines=... :) option
> (but would work on multiple pages).

This implements and solves the immediate concern, but it takes away the
incredible power that comes from having a set of simple tools that the
user/administrator/author can then combine in ways far beyond the
toolsmith's plans and designs.  Basically if it's a one-tool-fits-all then
the person writing the tool would have to imagine each and every possible
combination and sequence and figure out how to do it - each new combination
would be a change to code instead of just a different application of the
existing tools.

I've spent a few minutes figuring out how ParseArgs() and markupexpr.php
work and now I've got a working {(tail ...)} which processes multiple files
and file patterns as well as handles the nesting situation.  I have not
tested the nesting when it has parentheses already in the text -- I'm afraid
it's going to cause problems.  In any event, the function is at the end of
this email...

It has 3 different options:

N=lines where "lines" is a number indicating how many pages from the end of
the file to be picked up.

Prefix="string" including automatically replaced strings PAGENAME and
PAGETITLE.  This prefix will come at the beginning of any set of lines
coming from each file.

Pipe=0 or non-zero - if this option is set to anything non-zero then it will
interpret the arguments as a nested call instead of as a series of
filenames.

I've tested it on files containing more and less lines than are in the n=x
option.  I've tested it to a single level of nesting.  As mentioned, I have
not tested it on text containing parentheses which might confuse the
markupexpr.php parsing engine...

Anyway, obviously (tail...) is the simplest possible tool to implement
(except head) but it does show the nesting and stuff...

> Looking again at the (:include ..:) options I realise that in the
> grep.php script I lost the ability to source text not just from whole
> pages, but from specified sections. I think it would be useful to gain
> that too.

This would be a very powerful feature - I have no idea how it's implemented,
but I've been reading enough of your stuff in the forum to know that you are
very experienced 

Re: [pmwiki-users] Small problem with changed default page

2008-01-20 Thread Stirling Westrup
Anke Wehner wrote:
> Hello.
> 
> I have the following in my config.php tp change the default name:
> $DefaultName = 'Main';
> $PagePathFmt = array('$Group.$1', '$1.$DefaultName');
> 
> This works on links inside the wiki - [[Group/]] links to Group.Main
> and all - but one problem I noticed that when I change the url per
> hand, say, removing the page name, so I have ...wiki.php/Group , it
> looks for Group.Group rather than Group.Main.
> 
> Is there something obvious I missed? (I'm using  .beta65)

Alas, that is PmWiki's normal behaviour. $PagePathFmt is a /search/ path 
that tells PmWiki where to look for an under-specified page (ie, Group 
or Name part missing). It has no effect if no page is found at all. In 
that case PmWiki is hardwired to call the page $Group.$Group.

There has been some talk lately of a general mechanism to give better 
control over this, but in the meantime one has to add some code to 
config.php if they want to override the default behaviour. Something 
like this should work (note that I haven't tested this):

$DefaultName = 'Main';
if( strpos($pagename, '.') === FALSE )
   $pagename .= ".$DefaultName";

This essentially just tacks on a '.Main' to the end of any pagename that 
doesn't have a dot in it. There may be edge cases where one needs more 
complicated processing (such as, what if the input name was '.Foo'?)

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] cookbook "ShellTools" (was: Include specific lines of text on a page)

2008-01-20 Thread Hans
Sunday, January 20, 2008, 7:21:43 PM, Hans wrote:

> But seeing this I think a lines=n option is more friendly and useful:
> lines=5 would display the first 5 lines from  every page, and
> lines=-5 would display the last 5 lines from every page matching.
> This would be similar to the (:include PageName lines=... :) option
> (but would work on multiple pages).

I updated the recipe and added a lines= parameter:
lines=n - display first n lines;
lines=-n display last n lines;
lines=n..m display lines from n to m.

http://www.pmwiki.org/wiki/Cookbook/TextExtract


  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] cookbook "ShellTools" (was: Include specific lines of text on a page)

2008-01-20 Thread Randy
Hans,

This is great stuff you're doing.

One suggestion:

"Hide" implies that the text is still present. I would rename what you  
are calling "Hide" to "Cut" and rename your old "Cut" to "CutLine".

For what it's worth,

Randy


On Jan 20, 2008, at 8:46 AM, Hans wrote:

> Sunday, January 20, 2008, 12:31:19 PM, Hans wrote:
>
>> I did some more work, and here is some code for a working grep markup
>> expression. Please try it. I will put it into a cookbook recipe, once
>> I know the markup syntax etc is okay.
>
> I uploaded it now as a cookbook recipe script grep.php, new cookbook  
> page
> http://www.pmwiki.org/wiki/Cookbook/TextExtract
>
> I added another optional parameter hide=PATTERN, which will remove
> text matching PATTERN given from the text line.
> So cut=PATTERN will remove the line with  amatch completely from
> output, and hide=PATTERN will remove the exact text match from the
> line, not the line of text itself. Not quite the Tail option, but in
> that direction.
>
>
>  ~Hans
>
>
> ___
> pmwiki-users mailing list
> pmwiki-users@pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] cookbook "ShellTools" (was: Include specific lines of text on a page)

2008-01-20 Thread Hans
Sunday, January 20, 2008, 6:23:57 PM, Peter & Melodye Bowers wrote:

> (When I put n=5 as the argument it somehow doesn't even appear in $args[0]
> -- how is that possible?)

For markup expression definitions follow this convention:

MarkupExpression['expr'] = 'CustomExprFunction(@$arg[0],@$arg[1],@$argp)';

This will be handled by the PmWiki MarkupExpression function, which
will read the option parameters and hands them to the
CustomExprFunction.

$arg[0], $arg[1] etc. are parameters given, in that order, without
keywords. $argp will cover all keyword parameters, like cut=...
hide=... etc. and are handed to the custom function as an array with
keyword and value pairs.

So for instance in
function Grep($pagename, $expr, $src, $opt = NULL) {... }
$expr is equal to $arg[0], $src to $arg[1], and $opt is an array:
$opt['cut'], $opt['hide'] etc. with the keywords and their associated
values from the markup expression.

I think this is th ebasic. I may have missed some details.

  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] Limiting authors to edit pages they created

2008-01-20 Thread Petko Yotov
On Sunday 20 January 2008 05:07:14 imoc wrote:
> I'm wondering if it is possible to limit the authors' edit right
> that they can only edit the pages created by themselves?

(Hello!)

See this message and thread in the mailing list archive:
http://www.pmichaud.com/pipermail/pmwiki-devel/2007-January/000612.html

The described recipe does exactly what you need.

Thanks,
Petko

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] cookbook "ShellTools" (was: Include specific lines of text on a page)

2008-01-20 Thread Hans
Sunday, January 20, 2008, 6:23:57 PM, Peter & Melodye Bowers wrote:

> One final question regarding the use of these MarkupExpressions: How does
> the nesting work?  Let's say I want to "tail" the result of a "grep" -- how
> does that happen?  (I would play with it, but I'm having too much trouble
> with the arguments to be able to figure it out with any confidence...)

Peter, I think nesting does not work well when processing multiple
pages. That was the reason I included into the grep.php script an
option of cut= and hide=, rather than trying to make these into
separate MXPs (markup expressions, is this a usable acronym???).
It is enough processing just to open every page in the file list once.
So I propose to do the same for a tail= option, if that is useful:
tail=n, n being an integer, would display the last n lines from every
page which  matches the wildcard pattern.

But seeing this I think a lines=n option is more friendly and useful:
lines=5 would display the first 5 lines from  every page, and
lines=-5 would display the last 5 lines from every page matching.
This would be similar to the (:include PageName lines=... :) option
(but would work on multiple pages).

Looking again at the (:include ..:) options I realise that in the
grep.php script I lost the ability to source text not just from whole
pages, but from specified sections. I think it would be useful to gain
that too.

What do you think?


  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] cookbook "ShellTools" (was: Include specific lines of text on a page)

2008-01-20 Thread Martin Fick

--- Peter & Melodye Bowers <[EMAIL PROTECTED]> wrote:
...
> But allowing regex instead of just a simple
> textual match and allowing
> n files (with patterns) are both nice additions.

...Lots of intersting ideas.  

Since wiki pages tend to be slightly more structured
than regular text files, almost like an XML file,
something more akin to XPATH might be more appropriate
->  check out the wikipath recipe, you may like some
of the ideas since it somewhat understands wiki
syntax,

-Martin



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] cookbook "ShellTools" (was: Include specific lines of text on a page)

2008-01-20 Thread Peter & Melodye Bowers
Based entirely on Hans' work on grep, I've put together a kludge of what
tail would look like (see at the bottom of this post).  This will
theoretically solve bialy663's earlier question although the n=10 argument
problem needs to be solved.

I much prefer swapping the option/filepattern order as options can be
relatively easily delineated from filepatterns -- then anything coming after
the last option is automatically called a filepattern and then there is the
option of having multiple filename/patterns.  Unfortunately my PHP ability
is just above nil and so I'm groping in the dark in terms of how to process
the arguments and etc...

(When I put n=5 as the argument it somehow doesn't even appear in $args[0]
-- how is that possible?)

Many of the shell tools follow this same basic pattern and so obviously a
lot of the early processing would want to be made into functions to process
the arguments, figure out a list of files, etc.

There's another interesting question to consider...  Should option names,
tool names, etc reflect their shell equivalents or should they be invented
from scratch?  Those with a linux background would find the transition much
eased by re-using the linux equivalents, but maybe working in the pmwiki
context maybe we should be maintaining consistency with a different
standard...

One final question regarding the use of these MarkupExpressions: How does
the nesting work?  Let's say I want to "tail" the result of a "grep" -- how
does that happen?  (I would play with it, but I'm having too much trouble
with the arguments to be able to figure it out with any confidence...)

-Peter

===(snip)===
# {(tail PAGEPATTERN OPTIONS)} 
# Options: 
# n=number - display n lines from the end of the file
# PAGEPATTERN - source pages from PageName or Group.Pagename 
#   allowing wiki wildcards * and ?
$MarkupExpr['tail'] = 'Tail($pagename, @$args[0], @$args[1])'; 
function Tail($pagename, $opt, $src) 
{
echo "Tail: opt=$opt, src=$src\n";
if ($src=='') return '';
$n = 10;
if (preg_match("/n=(\d*)/", $opt, $m)) $n = $m[1];
echo "Tail: n=$n \n";
$grp = PageVar($pagename, '$Group');
//check for group.name pattern
if (strstr($src,'.')) 
$pat = $src;
else $pat = $grp.".".$src;
//make preg pattern from wildcard pattern
$prpat = GlobToPCRE(FixGlob($pat));
//make list from preg name pattern
$sourcelist =   ListPages("/$prpat[0]/");
$newrows = array();
//process each source page in turn
foreach($sourcelist as $source) {
if ($source==$pagename) continue;
$page = RetrieveAuthPage($source, 'read', true);
if ($page) {
$m = 0;
$text = $page['text'];
$textrows = explode("\n",$text);
echo "Count=" . count($textrows) . "\n";
for ($i = count($textrows)-$n; $i <=
count($textrows); $i++) {
echo "i=$i, row=$textrows[$i]\n";
$newrows[] = $textrows[$i];
}
}
}
return implode("\n", $newrows);
}
===(snip)===

> -Original Message-
> From: Hans [mailto:[EMAIL PROTECTED]
> Sent: Sunday, January 20, 2008 1:31 PM
> To: Peter & Melodye Bowers
> Cc: pmwiki-users@pmichaud.com
> Subject: Re: [pmwiki-users] cookbook "ShellTools" (was: Include specific
> lines of text on a page)
> 
> Sunday, January 20, 2008, 11:58:03 AM, Peter & Melodye Bowers wrote:
> 
> > The initial suggestion is this:
> 
> > (:grep "regex" filename/pattern ...")
> 
> I did some more work, and here is some code for a working grep markup
> expression. Please try it. I will put it into a cookbook recipe, once
> I know the markup syntax etc is okay.
> 
> Text pattern can be a word or a regex expression.
> Cut pattern similar with cut=PATTERN option.
> Page pattern is  a PmWiki page name, allowing wildcards.
> The fmt= option works right now for fmt=link, which will place a
> pagelink on the line above the text extract, and a space afterwards.
> This will look more like a searchresult with text extract.
> More could be done there no doubt.
> There is no attempt yet to restrict procesing time. This markup
> expression can be expensive when processing lots of pages, since each
> page will be opened.
> 
> Suggestions most welcome!
> 
> Add to config.php or create new cookbook php file and include it in
> config.php:
> 
> # {(grep TEXTPATTERN PAGEPATTERN OPTIONS)}
> # TEXTPATTERN - display lines matching regex pattern
> # PAGEPATTERN - source pages from PageName or Group.Pagename allowing wiki
> wildcards * and ?
> # Otions:
> # fmt=link - display page link above extract
> # cut=PATTERN - do not display lines matching PATTERN
> $MarkupExpr['grep'] = 'Grep($pagename, @$args[0], @$args[1], @$argp)';
> function Grep($pagename, $expr,

Re: [pmwiki-users] Anchor links and CSS

2008-01-20 Thread Sandy
Sandy wrote:
> Patrick R. Michaud wrote:
>> On Sun, Jan 20, 2008 at 11:53:50AM -0500, Sandy wrote:
> 
>>> Is there a way I can give the anchors a class and hide them? Or do I 
>>> have to set the CSS for each of A.urllink, A.wikilink and A.selflink?
>> Yes, you can give anchors a class... try:
>>
>>   Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e',
>> "Keep(TrackAnchors('$1') ? '' : \"> class='anchor'>\", 'L')");
>>
>> Then you can do something like:
>>
>> A.anchor:hover { border:none; }
>>
>> Pm
> 
> Works great!
> 
> Thanks!
> 
> Sandy

Next question, so I can flesh out the manual a bit.

What other classes of links are there?

So far I've found:

.wikilink
A link to a page within the wiki

.urllink
A link to a page outside the wiki

.selflink
A link to the current page

Thanks!

Sandy



___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] Anchor links and CSS

2008-01-20 Thread Sandy
Patrick R. Michaud wrote:
> On Sun, Jan 20, 2008 at 11:53:50AM -0500, Sandy wrote:

>> Is there a way I can give the anchors a class and hide them? Or do I 
>> have to set the CSS for each of A.urllink, A.wikilink and A.selflink?
> 
> Yes, you can give anchors a class... try:
> 
>   Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e',
> "Keep(TrackAnchors('$1') ? '' : \" class='anchor'>\", 'L')");
> 
> Then you can do something like:
> 
> A.anchor:hover { border:none; }
> 
> Pm

Works great!

Thanks!

Sandy


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] How to include last lines?

2008-01-20 Thread Peter & Melodye Bowers
>From: bialy663 <[EMAIL PROTECTED]>

> 

>Hi,

> 

>How do I include last 5 lines of specified page? I've modified
$RecentChangesFmt to show updates in table '|| $CurrentTime 

>||[=$ChangeSummary=] || [[{$Group}.{$Name}|{$Namespaced}]]||

>$AuthorLink||' and it's annoying that the newer changes are added at the
end of page (before changes were added at the beginning of page). Other

>solution: How should I force pmwiki to add new changes above the older
once? Thanks

 

This is a classic example of the (:tail .:) markup I mentioned in the
quickly-becoming-reality-due-to-Hans's-vigilance "shelltools" cookbook.

 

In actual shell script it would be "tail -n 5 filename" to get the last 5
lines of the filename.  Presumably in pmwiki-ese it would be something like
(:tail n=5 filename/pattern .:)

 

-Peter

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] Anchor links and CSS

2008-01-20 Thread Patrick R. Michaud
On Sun, Jan 20, 2008 at 11:53:50AM -0500, Sandy wrote:
> I had the brilliant idea of setting
> 
> A:hover
> {
> border:1px solid blue;
> padding: 0px 2px 0px 2px;
> }
> 
> Now when I move the mouse around, an empty box appears around [[#name]].
> 
> Is there a way I can give the anchors a class and hide them? Or do I 
> have to set the CSS for each of A.urllink, A.wikilink and A.selflink?

Yes, you can give anchors a class... try:

  Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e',
"Keep(TrackAnchors('$1') ? '' : \"\", 'L')");

Then you can do something like:

A.anchor:hover { border:none; }

Pm


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


[pmwiki-users] Anchor links and CSS

2008-01-20 Thread Sandy
I had the brilliant idea of setting

A:hover
{
border:1px solid blue;
padding: 0px 2px 0px 2px;
}

Now when I move the mouse around, an empty box appears around [[#name]].

Is there a way I can give the anchors a class and hide them? Or do I 
have to set the CSS for each of A.urllink, A.wikilink and A.selflink?

Sandy



___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] printing and css

2008-01-20 Thread Sandy
[EMAIL PROTECTED] wrote:
> I wonder why margin-top and margin-bottom css-properties don't work for
> the print page. Margin-left and margin-right do work for the paragraph in
> print.css but not margin-top and margin-bottom.
> 
> Taavi

Are the margins combining? Vertical margins don't add, they overlap, so 
you only see the largest. (That one got me for a while.)

Sandy


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] MS Publisher file format upload

2008-01-20 Thread Tegan Dowling
On Jan 20, 2008 5:07 AM, Eemeli Aro <[EMAIL PROTECTED]> wrote:
> On Jan 19, 2008 5:03 AM, Tegan Dowling <[EMAIL PROTECTED]> wrote:
> > Hi, all:  What's the process for adding the ".pub" file format and
> > extension to the list of recognized and permitted file formats?
>
> 1. What you need to find is the correct MIME type for the file

Ah!  Thanks, Eemeli!  So, googling "MIME type", I find what I take to
the An Authoritative Source (yes?) --
http://www.w3schools.com/media/media_mimeref.asp -- which has a list
by extension on the lower part of the page.

And looking for where to put this information in the documentation, I
naturally then did find that instructions are available on
http://www.pmwiki.org/wiki/PmWiki/UploadsAdmin.  Since the reference
page already linked-to from there was too hard for me to navigate, I
added this w3schools.com link as well.

Thanks again!

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] Include specific lines of text on a page

2008-01-20 Thread Hans
Saturday, January 19, 2008, 7:54:03 PM, Hans wrote:

> The preg_match pattern in
> if (preg_match("/$expr/", $row)) {
> $newrows[] = $row;
> }
> is still not working quite well.
> any suggestions for improvement will be much appreciated.

well it was working fine, but in my test a textline with a directive
was included and fouled the output. The script version I released now
at http://www.pmwiki.org/wiki/Cookbook/TextExtract
is ignoring lines with directives, to be easier predictable.

The original question in this thread can be solved with the grep
markup expression like this:

{(grep Complete Group.MainPage hide=Complete)}

and it will display the text extract from MainPage as:

  Test A
  Test D  


Hope this helps!

  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] Foxreplace syntax

2008-01-20 Thread Hans
here is another working example of fox replace code:

This fox form uses the markup expression {(grep ...)}
see http://www.pmwiki.org/wiki/Cookbook/TextExtract for download and
installation.

The form offers to be a general text extraction tool. Here it is:

>>frame width=25em<<
(:fox form  foxaction=replace put=overwrite target={*$FullName}#extract:)
(:input default request=1:)
(:foxtemplate "{$$(grep '{$$search}' {$$pages} cut={$$cut} hide={$$hide} 
fmt=link )}":)
|| Search for:||(:input text search size=30:) ||
|| On pages:||(:input text pages size=30:) ||
|| Cut lines:||(:input text cut '' size=30:) ||
|| Hide text:||(:input text hide '' size=30:) ||
|| ||(:input submit post Enter:) (:input submit cancel Cancel:) ||
(:foxend form:)
>><<

[[#extract]]
dummy
[[#extractend]]

The form posts to the same page.
'dummy' will be replaced (overwritten) on first use with the output from the 
grep
markup expression. This will be evaluated when the form is posted.
Therefor it is in the template with the syntax {$$(grep .)} and is
populated from the form fields.


  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] cookbook "ShellTools" (was: Include specific lines of text on a page)

2008-01-20 Thread Hans
Sunday, January 20, 2008, 12:31:19 PM, Hans wrote:

> I did some more work, and here is some code for a working grep markup
> expression. Please try it. I will put it into a cookbook recipe, once
> I know the markup syntax etc is okay.

I uploaded it now as a cookbook recipe script grep.php, new cookbook page
http://www.pmwiki.org/wiki/Cookbook/TextExtract

I added another optional parameter hide=PATTERN, which will remove
text matching PATTERN given from the text line.
So cut=PATTERN will remove the line with  amatch completely from
output, and hide=PATTERN will remove the exact text match from the
line, not the line of text itself. Not quite the Tail option, but in
that direction.


  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] FW: FW: Difficulties to get 'fox' working

2008-01-20 Thread Hans
Sunday, January 20, 2008, 2:09:31 PM, Peter K.H. Gragert wrote:

> Result changes now to
> ERROR: Found no form to add above

Is Fox.CommentBox included in another page and you are trying from
there, or do you try to post on Fox.CommentBox?
If the first is the case it won't work because #above means put=aboveform
but you have not got the form on the page. Put a (:foxprepend cbox:)
markup on the page, and don't specify #above in th e(:fox cbox markup.


  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


[pmwiki-users] FW: FW: Difficulties to get 'fox' working

2008-01-20 Thread Peter K.H. Gragert
Result changes now to
ERROR: Found no form to add above


-Oorspronkelijk bericht-
Van: Hans [mailto:[EMAIL PROTECTED] 
Verzonden: zondag 20 januari 2008 14:57
Aan: Peter K.H. Gragert
CC: pmwiki-users@pmichaud.com
Onderwerp: Re: [pmwiki-users] FW: Difficulties to get 'fox' working

Sunday, January 20, 2008, 1:47:14 PM, Peter K.H. Gragert wrote:

> Maybe it is a "Vista"=problem? (I gave all * complete acces ??)
> Trying a comment again (with (:mssages:)) 
> Result:
> ERROR: Missing or wrong Access Code!

try setting in config.php;

$EnableAccessCode = false;


  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] FW: Difficulties to get 'fox' working

2008-01-20 Thread Hans
Sunday, January 20, 2008, 1:47:14 PM, Peter K.H. Gragert wrote:

> ERROR: Missing or wrong Access Code!

PS: Fox has $EnableAccessCode = false as a default.
It seems somewhere this is enabled for you?


  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] FW: Difficulties to get 'fox' working

2008-01-20 Thread Hans
Sunday, January 20, 2008, 1:47:14 PM, Peter K.H. Gragert wrote:

> Maybe it is a "Vista"=problem? (I gave all * complete acces ??)
> Trying a comment again (with (:mssages:)) 
> Result:
> ERROR: Missing or wrong Access Code!

try setting in config.php;

$EnableAccessCode = false;


  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


[pmwiki-users] FW: Difficulties to get 'fox' working

2008-01-20 Thread Peter K.H. Gragert
Maybe it is a "Vista"=problem? (I gave all * complete acces ??)
Trying a comment again (with (:mssages:)) 
Result:
ERROR: Missing or wrong Access Code!


-Oorspronkelijk bericht-
Van: Hans [mailto:[EMAIL PROTECTED] 
Verzonden: zondag 20 januari 2008 13:36
Aan: Peter K.H. Gragert
CC: pmwiki-users@pmichaud.com
Onderwerp: Re: [pmwiki-users] Difficulties to get 'fox' working

Sunday, January 20, 2008, 12:33:09 PM, Hans wrote:

> add (:messages:) markup to the page, it may give you some error
> message to help!

PS:

(:messages:)

needs to be at the start of a line!


  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


[pmwiki-users] Preserving line breaks from a directive in a ||-table

2008-01-20 Thread marc
Hi,

I'm trying to do the following:

(:input form '' post :)
(:input hidden action BlahAction:)
||width=100%
||Member:  ||{$AuthId}   ||
||Name:||(:Name:)||
||Address: ||(:Address:) ||(:input submit value='Change address':) ||
||Email:   ||(:Email:)   ||(:input submit value='Change email':)   ||
|| ||(:input submit value='Do it!':) ||
(:input end:)

The problem I have is that the (:Address:) directive has multiple lines 
and I can't figure out a way to return a value that preserves the line 
breaks in the table that PmWiki displays.

(Tech info: Currently the 'when' parameter for the directive's function 
is set to 'directives' and I am using the Keep() function on its 
output.)

Any help would be appreciated. Thanks.

-- 
Cheers,
Marc


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] PmWiki & Spambots Redux: Another Idea

2008-01-20 Thread Hans
Saturday, January 19, 2008, 11:23:25 PM, Patrick R. Michaud wrote:

>> (1) add another field to the edit form with a default value
>> (2) Hide the field using css
>> 
>> If the "hidden field" gets modified, it's most likely a bot, so reject
>> the submission.

> I implemented this approach on pmwiki.org a couple of days
> ago.  I don't know if it's reduced the spam appearing on the site,
> but it appears to have helped a little.  Perhaps one of our
> regular spam-cleaners could comment as to whether they're
> seeing a reduction in spam?

what needs to change in a custom EditForm so it works on pmwiki.org?
My Triad skin edit form is failing now.


  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] Difficulties to get 'fox' working

2008-01-20 Thread Hans
Sunday, January 20, 2008, 12:33:09 PM, Hans wrote:

> add (:messages:) markup to the page, it may give you some error
> message to help!

PS:

(:messages:)

needs to be at the start of a line!


  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] Difficulties to get 'fox' working

2008-01-20 Thread Hans
Sunday, January 20, 2008, 12:03:46 PM, Peter K.H. Gragert wrote:

> Looks promising, ok.  But activation nothing happens ???

add (:messages:) markup to the page, it may give you some error
message to help!


  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] cookbook "ShellTools" (was: Include specific lines of text on a page)

2008-01-20 Thread Hans
Sunday, January 20, 2008, 11:58:03 AM, Peter & Melodye Bowers wrote:

> The initial suggestion is this:

> (:grep "regex" filename/pattern ...")

I did some more work, and here is some code for a working grep markup
expression. Please try it. I will put it into a cookbook recipe, once
I know the markup syntax etc is okay.

Text pattern can be a word or a regex expression.
Cut pattern similar with cut=PATTERN option.
Page pattern is  a PmWiki page name, allowing wildcards.
The fmt= option works right now for fmt=link, which will place a
pagelink on the line above the text extract, and a space afterwards.
This will look more like a searchresult with text extract.
More could be done there no doubt.
There is no attempt yet to restrict procesing time. This markup
expression can be expensive when processing lots of pages, since each
page will be opened.

Suggestions most welcome!

Add to config.php or create new cookbook php file and include it in
config.php:

# {(grep TEXTPATTERN PAGEPATTERN OPTIONS)}
# TEXTPATTERN - display lines matching regex pattern
# PAGEPATTERN - source pages from PageName or Group.Pagename allowing wiki 
wildcards * and ?
# Otions: 
# fmt=link - display page link above extract
# cut=PATTERN - do not display lines matching PATTERN
$MarkupExpr['grep'] = 'Grep($pagename, @$args[0], @$args[1], @$argp)';
function Grep($pagename, $expr, $src, $opt = NULL) {
if ($expr=='' || $src=='') return '';
$fmt = (@$opt['fmt'] ? $opt['fmt'] : '');
$cut = (@$opt['cut'] ? $opt['cut'] : '');
$grp = PageVar($pagename, '$Group');
//check for group.name pattern
if (strstr($src,'.')) 
$pat = $src;
else $pat = $grp.".".$src;
//make preg pattern from wildcard pattern
$prpat = GlobToPCRE(FixGlob($pat));
//make list from preg name pattern
$sourcelist =   ListPages("/$prpat[0]/");
$newrows = array();
//process each source page in turn
foreach($sourcelist as $source) {
if ($source==$pagename) continue;
$page = RetrieveAuthPage($source, 'read', true);
if ($page) {
$m = 0;
$text = $page['text'];
$textrows = explode("\n",$text);
foreach ($textrows as $row) {
if (preg_match("/\\(:/", $row)) continue;
//check each row for $expr text pattern, 
exclude $cut pattern
if (preg_match("/($expr)/", $row) && ($cut=='' 
|| !preg_match("/($cut)/", $row))) {
if($fmt=='link' && $m==0) $newrows[] = 
"[[$source]]";
$newrows[] = $row;
$m = 1;
}
}
}
if ($fmt=='link' && $m==1) $newrows[] = " ";
}
return implode("\n", $newrows);
}




  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] Difficulties to get 'fox' working

2008-01-20 Thread Peter K.H. Gragert
Yes
Site.FoxConfig looks like

Fox.*: add,delete

At the beginning of the page first line .

 

 

 

 

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] Foxreplace syntax

2008-01-20 Thread Hans
Sunday, January 20, 2008, 11:41:21 AM, Randy wrote:

> Am I close? Can you show me a complete working sample of code to do
> the above task (a picture is worth a thousand words...)?

sorry I have not uploaded working examples to my site.

Here is a simple replace text form, in which you need to enter both
the text to be replaced and the replacement. I guess you can adapt
that to your example:

>>frame<<
(:fox form1 foxaction=replace put=string target={$FullName}:)
(:foxtemplate "{$$newstring}":)
Replace (:input text mark :) with (:input text newstring:) (:input submit post 
Post:) (:input submit cancel Cancel:)
(:foxend form1:)
>><<

foxaction=replace needs to be specified, since the default is 'add'.

I will add a note about foxaction to the cookbook page.

Any 'special markup' does not replace the basic
(:fox formname :)
...
(:foxend formname:)
markups. It will be in addition in between these two.
It is useful when using multiple times, for multi-page processing.
The above example could be written thus:

>>frame<<
(:fox form0 :)
(:foxreplace template=NewStringTemplate target={$FullName} put=string 
mark={$$oldstring}:)
Replace (:input text oldstring :) with (:input text newstring:) (:input submit 
post Replace:) (:input submit cancel Cancel:)
(:foxend form0:)
>><<

Note the parameters are moved to the (:foxreplace ... :) markup, and a
template page needed to be specified instead of
(:foxtemplate "{$$newstring}":)

Another way to write it is this:

>>frame<<
(:fox form0 :)
(:foxreplace NewStringTemplate=>{$FullName} put=string mark={$$oldstring}:)
Replace (:input text oldstring :) with (:input text newstring:) (:input submit 
post Replace:) (:input submit cancel Cancel:)
(:foxend form0:)
>><<

template= and target= are replaced with TmplPage=>TargetPage syntax.
This is just a shorthand syntax.

Hope this helps for a start!


  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] Difficulties to get 'fox' working

2008-01-20 Thread Randy
Do you have config.php or FoxConfig set up to allow Fox to do work on  
the page? It needs your permission. That lets you specify which pages  
can be changed how. Until you do that, nothing will get changed.


Randy


On Jan 20, 2008, at 6:03 AM, Peter K.H. Gragert wrote:


Hallo (and especially Hans)
I run beta 65
And in the cookbook
cookbook/fox/
-rw-rw-rw-   1 Peter0   48961 Jan 09 13:56 fox.php
  -rw-rw-rw-   1 Peter03691 Jan 17 16:46 foxdelete.php
  -rw-rw-rw-   1 Peter03636 Jan 09 14:05 foxedit.php
-rw-rw-rw-   1 Peter09889 Jan 09 13:58 foxnotify.php

All enabled in config .php
Trying FoxComment on page Fox.CommentBox
looks like this:

(:fox cbox put=#append template=Site.FoxCommentTemplate:)
|| Heading:||(:input text heading size=60:)
|| ||'''Your Message''' ||
|| ||(:input textarea comment cols=60 rows=6:) ||
|| Author:||(:input text author value='{$Author}' :) (:input submit  
post Enter:) ||

(:foxend cbox:)

Looks promising, ok.  But activation nothing happens ???
(notice: put= is missing? On the PmWiki site?)

Site.FoxCommentTemplate is this
#foxbegin#
(:div1 class=messagehead:)
>>rfloat<<
[-{$$(date d.m.Y - H:i)}-]   (:if auth edit:){[foxdelrange]} 
(:if:)

>><<
!{$$author}
(:div1end:)
>>messageitem<<
'''{$$heading}'''
>>messageitem<<
{$$comment}
>><<
#foxend#

(showing if saved eg. {$$author} ((without a : )

What do I do wrong?

Thanks if you know and let me know ;-)

PKHG



___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


[pmwiki-users] Difficulties to get 'fox' working

2008-01-20 Thread Peter K.H. Gragert
Hallo (and especially Hans)

I run beta 65

And in the cookbook 
cookbook/fox/

-rw-rw-rw-   1 Peter0   48961 Jan 09 13:56 fox.php

  -rw-rw-rw-   1 Peter03691 Jan 17 16:46 foxdelete.php

  -rw-rw-rw-   1 Peter03636 Jan 09 14:05 foxedit.php

-rw-rw-rw-   1 Peter09889 Jan 09 13:58 foxnotify.php

 

All enabled in config .php

Trying FoxComment on page Fox.CommentBox
looks like this:

 

(:fox cbox put=#append template=Site.FoxCommentTemplate:)

|| Heading:||(:input text heading size=60:)

|| ||'''Your Message''' ||

|| ||(:input textarea comment cols=60 rows=6:) ||

|| Author:||(:input text author value='{$Author}' :) (:input submit post
Enter:) ||

(:foxend cbox:)

 

Looks promising, ok.  But activation nothing happens ???

(notice: put= is missing? On the PmWiki site?)

 

Site.FoxCommentTemplate is this

#foxbegin#

(:div1 class=messagehead:)

>>rfloat<<   

[-{$$(date d.m.Y - H:i)}-]   (:if auth edit:){[foxdelrange]}(:if:)

>><< 

!{$$author}

(:div1end:) 

>>messageitem<< 

'''{$$heading}'''

>>messageitem<<

{$$comment} 

>><< 

#foxend#

 

(showing if saved eg. {$$author} ((without a : )

What do I do wrong?

Thanks if you know and let me know ;-)

 

PKHG

 

 

 

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] cookbook "ShellTools" (was: Include specific lines of text on a page)

2008-01-20 Thread Peter & Melodye Bowers
(NOTE: This was originally sent directly to Hans directly and he reminded me
to continue the discussion on the list.  I've edited slightly here to keep
up with later related posts...)

Sorry, I got a little carried away...

Basically grep stands for "general regular expression processor" and it is a
text searching utility.  (I think in the windows world "find" is the closest
utility available although it's a comparison between a chainsaw and a butter
knife...)

The initial suggestion is this:

(:grep "regex" filename/pattern ...")

In other words, search for a regular expression (this would be exactly like
your code except using the preg_match instead of the strstr call ... maybe
plus a bit of work to make the regex include whitespace although it's been
done in many places  throughout pmwiki and I'd be happy to submit a piece of
code I did recently that was fairly robust).  Do this search not on just a
single file, but on a list of filenames and file-name-patterns.  So I could
do this:

(:grep "Peter(?: L\.)? Bowers" Profiles.* Main.Sandbox MyGroup.*Suffix:)

And it would find all occurrences of "Peter Bowers" or "Peter L. Bowers" in
any of those pages represented by the 2 patterns and the 1 filename listed.

The (:pipe ...:) and (:cut ...:) and (:tail ...:) ideas are representative
of some of the shell tools available which are incredibly powerful in text
processing.  However, PHP itself is a very powerful (!!!) text processor
itself and perhaps these would be unnecessarily recreating the wheel.  IF it
was determined that these ideas would be helpful then something like this in
shell scripting:

Grep "Peter(?: L\.)? Bowers" Profiles.* | grep -v "don't like" | tail -n 3

(1) Finds the expected lines in the files
(2) from that list of lines it takes OUT any lines that have the text "don't
like" (because I don't want to see lines where someone says they don't like
me) (the -v option means reVerse the search semantics - search for lines
which do NOT match)
(3) from that list of lines we only take the last (tail) 3 lines (-n means
the Number of lines and then we specify 3 -- like --number=3)

The piping is represented (in shell) by that vertical bar -- it works in DOS
as well for the same reason -- take the stdout of one process and make it
the stdin of the next process.

[Ed. here I deleted my idea of how pipe might be implemented, because Hans'
suggestions of using the already-existing potential for nesting are better.
So for my example it would be like this:

(:tail -n 3 (:grep -v "don't like" (:grep "Peter(?: L\.)? Bowers"
Profile.*:):):)

It reverses the order of the "piping" and makes it a little more lisp-like
rather than shell-like, but it sounds like it's got the very significant
advantage of already being implemented...! ]

The thing that would probably be most helpful is perhaps the changes to the
immediate markup in hand and "grep" might be a bad choice if most in the
community are less linux-oriented -- perhaps your name is the best after
all.  But allowing regex instead of just a simple textual match and allowing
n files (with patterns) are both nice additions.

I like coming up with ideas, but I give no guarantee of their usefulness or
practicality (just ask John Rankin about the "irresponsible wikiforms"), so
please feel free to ignore my thoughts.  I may play with the idea myself
(giving you credit for the initial implementation) if you decide not to take
it to the next level... [Ed. Sounds like you're already moving on it -- this
is what's so great about the pmwiki community!]

-Peter


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] Foxreplace syntax

2008-01-20 Thread Randy
On Jan 20, 2008, at 4:10 AM, Hans wrote:
>
> please read http://www.pmwiki.org/wiki/Cookbook/Fox#parameters
> and let me know what you don't understand.

I've read that section numerous times. I find the whole page very  
confusing.  Here's a couple of examples:

1) Normally I would expect documentation to tell me the basic format  
and then the parameters referenced in the format. But it seems like  
there are "special markups" between those. I don't know what a special  
markup is. An alternate way of specifying a form?

Is (:fox formname etc.:) still required, or does (:foxreplace...:)  
takes its place?

2) It's not clear what "foxaction=replace" means. There's no mention  
of "foxaction" in the basic format. Is that something I literally put  
somewhere on some line?

Anyway, I can see that Fox is is a wonderful and powerful tool - if  
you know how to use it. I would like to learn.

Let's take a very simple case of replacement. Suppose I want to change  
all occurances of "Old" to "New" in MyGroup.Sandbox. To make it really  
easy, let's put the form on MyGroup.Sandbox too.

The page has:

[[#MySection]]
Old1
Old2
[[#MySectionend]]

Here's what I would guess is the first line of the form:

(:fox form1 put=all mark="Old" template=0  
target=MyGroup.Sandbox#MySection:)

I'd guess there is a (:foxreplace:) and a (:foxtemplate "New":) to  
specify before the final (:foxend form1:)

Am I close? Can you show me a complete working sample of code to do  
the above task (a picture is worth a thousand words...)?

Randy


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] MS Publisher file format upload

2008-01-20 Thread Eemeli Aro
On Jan 19, 2008 5:03 AM, Tegan Dowling <[EMAIL PROTECTED]> wrote:
> Hi, all:  What's the process for adding the ".pub" file format and
> extension to the list of recognized and permitted file formats?

1. What you need to find is the correct MIME type for the file, so
Google for it (mime type pub). One of the top results will tell you
it's "application/x-mspublisher".

2. Add the following to your config.php:

$UploadExts['pub'] = 'application/x-mspublisher';

eemeli

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] [Help] How to edit page by using Fox?

2008-01-20 Thread Hans
Saturday, January 19, 2008, 6:04:24 PM, imoc wrote:

> 3) Use Fox to open those pages in a way that every PTV got it's own 
>editform and the text in a textarea;
> 4) I can edit each PTV also the text separately;
> 5) Saving/updating the changes to the target page.

Install fox.php and foxedit.php.
Put a foxedit link on the page, which calls a custom edit form, like:
   {[foxedit form=Group.MyPTVEditForm]}

Create Group.MyPTVEditForm with this content, and then modify it to
your needs:

(:messages:)
(:fox editform target={$EditTarget} ptvtarget={$EditTarget} template=0 
redirect=1 :)
(:input hidden csum 'page update':)
(:input defaults source={$EditSource} :)
|| ||'''Edit Page: {$EditTarget}'''||
|| Var 1:||(:input text name=$:Var1 size=50:) ||
|| Var 2:||(:input text name=$:Var2 size=50:) ||
|| Var 3:||(:input text name=$:Var3 size=50:) ||
|| Text:||(:input textarea id=text name=$:text  cols=70 rows=10 :) ||
(:if enabled EnableAccessCode:)
|| ||Enter value {$AccessCode} (:input text access size=3 class=inputtext:)
(:input hidden accesscode {$AccessCode}:)  <- Have you entered the code 
number?||
(:if enabled EnablePostCaptchaRequired:)
|| ||Enter value {$Captcha} (:input captcha class=inputtext:) <- Have you 
entered the code number?||
(:if:)
|| Author:||(:input text author value='{$Author}' size=30 class=inputtext:) 
(:input submit post "Save":) (:input submit cancel "Cancel":) ||
(:foxend editform:)


This form has edit fields for page text variables Var1, Var2, Var3,
text. Add more and rename as required, corresponding to the
variables on your page. Note the syntax in the form fields for the
PTVs is
 name=$:Variable

The page text needs to be in a PTV called 'text', in order for it to
appear in the textarea form field. Enclose the page text in anchors,
and foxedit uses that as a PTV:

[[#text]]
text content
...
...
[[#textend]]

Some more explanations of the fox form:

(:input defaults source={$EditSource} :) will load the variables from
your target page, and not the form page.

{$EditTarget} is your target page, i.e. the page with the foxedit link
and your data, the calling page.

ptvtarget={$EditTarget} - this enables the PTV updating on the target
page.
template=0 - we only update PTVs, so we are not using a template for
adding content.
redirect=1 - when the edit form loads, its page gets opened, even
though the page title is the target page (the calling page). When the
form is submitted, the redirect makes sure the target page is shown.

(:input hidden csum 'page update':) - the value 'page update'  to appear
in RecentChanges pages.

Use the Accesscode or Captcha code lines as you need them, or delete
them.

Hope this helps!


  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] Foxreplace syntax

2008-01-20 Thread Hans
Sunday, January 20, 2008, 8:01:02 AM, Randy wrote:

> I have a challenge that seems ripe for Fox's powerful new string  
> replacement feature. Unfortunately, I haven't been able to figure out
> the syntax for that feature and I can't find any code examples.

please read http://www.pmwiki.org/wiki/Cookbook/Fox#parameters
and let me know what you don't understand.

> I want to put a form on a page that allows people to check one or more
> groups and one or more pages. The form would look like:

> [  ] GroupA
> [  ] GroupB

> [  ] Page1
> [  ] Page2
> [  ] Page 3

> 

> If someone checks all boxes, I would want output like this to replace
> another section on the page that contains the form:

>   |GroupA.Page1 |GroupA.Page2 |GroupA.Page3
>   |GroupB,Page1 |GroupB.Page2 |GroupB.Page3

> But if the user only checks GroupA, Page1, and Page3, I would want the
> target section to contain:

>   |GroupA.Page1 |GroupA.Page3

> This would all be easy if the form could restrict output to  
> permutations that contain both group and page. If that's possible, I
> don't know how to do it.

The simplest solution seems to me to use six checkboxes instead of
five:

 Group A:  Group B:
[ ] Page 1[ ] Page 1
[ ] Page 2[ ] Page 2
[ ] Page 3[ ] Page 3

Then you don't need to combine Group and Page values from the form.

Otherwise perhaps conditional markup can help.

To sanitise the output after the initial posting seems wrong to me.


  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


[pmwiki-users] Small problem with changed default page

2008-01-20 Thread Anke Wehner
Hello.

I have the following in my config.php tp change the default name:
$DefaultName = 'Main';
$PagePathFmt = array('$Group.$1', '$1.$DefaultName');

This works on links inside the wiki - [[Group/]] links to Group.Main
and all - but one problem I noticed that when I change the url per
hand, say, removing the page name, so I have ...wiki.php/Group , it
looks for Group.Group rather than Group.Main.

Is there something obvious I missed? (I'm using  .beta65)

Anke

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


[pmwiki-users] Foxreplace syntax

2008-01-20 Thread Randy
I have a challenge that seems ripe for Fox's powerful new string  
replacement feature. Unfortunately, I haven't been able to figure out  
the syntax for that feature and I can't find any code examples.

I want to put a form on a page that allows people to check one or more  
groups and one or more pages. The form would look like:

[  ] GroupA
[  ] GroupB

[  ] Page1
[  ] Page2
[  ] Page 3



If someone checks all boxes, I would want output like this to replace  
another section on the page that contains the form:

  |GroupA.Page1 |GroupA.Page2 |GroupA.Page3
  |GroupB,Page1 |GroupB.Page2 |GroupB.Page3

But if the user only checks GroupA, Page1, and Page3, I would want the  
target section to contain:

  |GroupA.Page1 |GroupA.Page3

This would all be easy if the form could restrict output to  
permutations that contain both group and page. If that's possible, I  
don't know how to do it.

In my trials, when the user selects all options, the output is what I  
want. But if the user only selects GroupA, Page1, and Page3, I get:
|GroupA.Page1|GroupA.|GroupA.Page3|
|.Page1 |. |.Page3

I've thought maybe I could use foxreplace to delete any incomplete  
strings to make it look better. But is there an easier way? And if  
not, what is foxreplace's syntax to delete the incomplete strings? And  
can that be done when the user presses submit, so I don't need to put  
a  button on the form to fix the results of ?

I hope that makes sense.

Randy

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users