Re: [pmwiki-users] Retain markup expressions inside i nput and textareas

2008-12-29 Thread Hans
Sunday, December 28, 2008, 4:30:27 AM, Petko Yotov wrote:

 If you really want to allow directives with (: and :) in posts of PmForm,
 you can define another PTV Pattern, and remove the existing one:

 unset($PmFormPostPatterns); # or each one individually
 unset($PageTextVarPatterns['(:var:...:)']);
 $PageTextVarPatterns['(==var:...==)'] =
   '/(\\(== *(\\w[-\\w]*) *:(?!\\))\\s?)(.*?)(==\\))/s';

 Thus, your multiline PageTextVariables will be stored in fields like this:
 (==name:value==)

Dave, I don't know if this is of use to you:

FoxForum (in foxforum.php) uses a custom PTV markup
(::var:multiline value::) for posting text area content
including directives as a PTV.
Defined like this:

# add new PTV pattern for text PTV (::var:...::)
$PageTextVarPatterns['(::var:...::)'] =
'/(\\(:: *(\\w[-\\w]*) *:(?!\\))\\s?)(.*?)(::\\))/s';

The PTV pattern (:var:value:) is not unset, to stay useful.

Security is dealt with within Fox by setting a variable
$EnablePostDirectives = true;
If it is false, the default, Fox will defuse any directives found in variables
posted (similar to adding an extra space).
See also function FoxDefuseItem in fox.php

Hope this helps, nothing more frustrating than to abandon efforts
after days of work!

Happy New Year to all of you!

  ~Hans


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


Re: [pmwiki-users] pmwiki edit problem

2008-12-29 Thread Tegan Dowling
On Sun, Dec 28, 2008 at 10:49 PM, pokhrel
pokh...@rainbow.iis.u-tokyo.ac.jp wrote:
 Hello!

 Recently my pmwiki started showing an error message when I edit any pages. I
 haven't made any changes and it was all of a sudden.

 The error message looks like:

 PmWiki can't process your request

 Cannot write page to Main.Home (wiki.d/Main.Home)...changes not saved

 We are sorry for any inconvenience.

 When I press the save button it creates a new file in wiki.d named as
 file_name,new.

 The permissions are all fine, for eg. I did 'chmod 777 ' to the wiki.d
 directory, still can't edit anything……

 Any suggestions or idea to resolve this problem would be really appreciated.
 I tried googling but could not find any good solutions..


Has your host just changed versions of php, by any chance?

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


Re: [pmwiki-users] pmwiki edit problem

2008-12-29 Thread ABClf
I'm not expert... but if I were you :
-test a copy of your wiki localy, or elsewhere (on a free host for example)
to see wether you get same trouble or not (so you could determine if the
trouble is caused by your server or by your pmwiki install).
-try installing a new pmwiki, last beta, in another folder and copy your
wiki.d in the relevant folder ? Some file may have been corrupted ?
___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


[pmwiki-users] page include without anchor in html source

2008-12-29 Thread noskule
hi list
Is it somehow possible to supress the anchors which pmwiki creates in the html 
source. It would be nice if it could be set by an option in the include 
markup.

Any Ideas?
grz nos

 

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


Re: [pmwiki-users] page include without anchor in html source

2008-12-29 Thread Hans
Monday, December 29, 2008, 5:50:20 PM, noskule wrote:

 Is it somehow possible to supress the anchors which pmwiki creates in the html
 source. It would be nice if it could be set by an option in the include
 markup.

What anchors are you referring to? Can you give an example?


  ~Hans


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


Re: [pmwiki-users] page include without anchor in html source

2008-12-29 Thread noskule
  Is it somehow possible to supress the anchors which pmwiki creates in
 the html
  source. It would be nice if it could be set by an option in the include
  markup.
 
 What anchors are you referring to? Can you give an example?
 
 
   ~Hans

I made an example: http://www.pmwiki.org/wiki/Test/IncludeAndAnchor
the behavior is:
* if a block of a page is included, the first include creates an anchor with 
the name of the included page 
* pmwiki seams to take care that an anchor name apears only ones, so if an 
anchor with the same name exists bevore, no anchor gets created.
* if a anchor (manualy set) exists after, it gets deleted

I don't no what the reasons of this anchors are and normally they don't  affect 
anything, but in I using includes mainly  for templateing.And there, it 
puts anchors between thead/tbody and bevore headers.



-- 
Pt! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: 
http://www.gmx.net/de/go/multimessenger

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


Re: [pmwiki-users] page include without anchor in html source

2008-12-29 Thread Hans
Monday, December 29, 2008, 9:32:05 PM, noskule wrote:

 I made an example: http://www.pmwiki.org/wiki/Test/IncludeAndAnchor
 the behavior is:
 * if a block of a page is included, the first include creates an
 anchor with the name of the included page

If an anchored section is specified within the (:include :) markup,
then PmWiki will add an anchor of the same name above it.

 * pmwiki seams to take care that an anchor name apears only ones,
 so if an anchor with the same name exists bevore, no anchor gets created.
 * if a anchor (manualy set) exists after, it gets deleted

PmWiki tracks anchor names used, so repeats are automatically avoided.

 I don't no what the reasons of this anchors are and normally they
 don't  affect anything, but in I using includes mainly  for
 templateing.And there, it puts anchors between thead/tbody and bevore 
 headers.

The addition of an anchor for an included anchored section is
hardcoded as far as I can see, in function IncludeText (which gets
called by the (:include:) markup directive), ca line 1239 in
pmwiki.php:

  $itext = TextSection($itext, $v, array('anchors' = 1));

changing this slightly to

  $itext = TextSection($itext, $v, array('anchors' = 0));

will avoid the addition of the anchor to an included section.

But I do not recommend changing pmwiki.php other than temporarily for
testing and gaining better understanding.

Obviously for your desired purpose you want an include directive
which does not add anchors. So perhaps you should create a custom
include markup and a custom IncludeText function which has the
array('anchors' = 0)
as argument in the call to TextSection.

Let's call the new markup (:includex ...:)

## (:includex:) 
markup('include', 'if',
 '/\\(:includex\\s+(\\S.*?):\\)/ei',
 PRR(IncludeTextX(\$pagename, PSS('$1';

function IncludeTextX($pagename, $inclspec) {
 global $MaxIncludes, $IncludeOpt, $InclCount;
 SDV($MaxIncludes,50);
 SDVA($IncludeOpt, array('self'=1));
 $npat = '[[:alpha:]][-\\w]*';
 if ($InclCount++=$MaxIncludes) return Keep($inclspec);
 $args = array_merge($IncludeOpt, ParseArgs($inclspec));
 while (count($args['#'])0) {
   $k = array_shift($args['#']); $v = array_shift($args['#']);
   if ($k=='') {
 if ($v{0} != '#') {
   if (isset($itext)) continue;
   $iname = MakePageName($pagename, $v);
   if (!$args['self']  $iname == $pagename) continue;
   $ipage = RetrieveAuthPage($iname, 'read', false, READPAGE_CURRENT);
   $itext = @$ipage['text'];
 }
 $itext = TextSection($itext, $v, array('anchors' = 0));
 continue;
   }
   if (preg_match('/^(?:line|para)s?$/', $k)) {
 preg_match('/^(\\d*)(\\.\\.(\\d*))?$/', $v, $match);
 @list($x, $a, $dots, $b) = $match;
 $upat = ($k{0} == 'p') ? .*?(\n\\s*\n|$) : [^\n]*(?:\n|$);
 if (!$dots) { $b=$a; $a=0; }
 if ($a0) $a--;
 $itext=preg_replace(/^(($upat){0,$b}).*$/s,'$1',$itext,1);
 $itext=preg_replace(/^($upat){0,$a}/s,'',$itext,1);
 continue;
   }
 }
 $basepage = isset($args['basepage']) 
 ? MakePageName($pagename, $args['basepage'])
 : $iname;
 if ($basepage) $itext = Qualify(@$basepage, @$itext);
 return FmtTemplateVars(PVSE($itext), $args);
 }


 You see, the only difference in the function is the use of anchors = 0
 instead of anchors = 1


  ~Hans


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


Re: [pmwiki-users] page include without anchor in html source

2008-12-29 Thread Hans

PS: the anchor is added by function TextSection,
where the 'anchors' argument is checked, and if found,
the anchor is added.



  ~Hans


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


[pmwiki-users] PmForms and Saving Select Values

2008-12-29 Thread DaveG
Does anyone happen to know if PmForms supports setting variable values 
with select lists?

It seems to show the list fine. But when saving it saves only the 
default value. Changing the underlying data values in the saved-data 
page (the saveto), and then reopening in the form shows the correct 
value in the list.

But trying to save a new value chosen from the list doesn't work -- the 
existing value stays the same, or if not already saved it uses the default.

I tried removing the default setting, but no change in behavior:
(:input default $:status value1:)

Anyone successfully used a select with PmForms?

  ~ ~ Dave

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