[pmwiki-users] More answers to: More Wikiforms

John Rankin john.rankin at affinity.co.nz
Sun Aug 5 17:34:10 CDT 2007


On Friday, 3 August 2007 4:45 PM, Sameer Kumar <skumar at eharch.com> wrote:
>
><snip>
> 
>In your case it appears to be taking all the \ characters
>literally. I am guessing that it's a php configuration
>thing. You could try changing that line to:
> 
>            $v = preg_replace("/([\\\]+\\n)+$/",'',
>                implode("\\\\\n",$_REQUEST[$f[$i]['element']]));
> 
>and see what you get...
>
> I did the above and it is not adding \\ anymore. So, as of now, it works.
> 
You need 2 \\ characters at the end of each line to force a line
break. Otherwise, the text will automatically wrap, and the forms
recipe will not be able to take the lines apart for editing.

When you look at the page source (action=source), what
*exactly* do you get for these fields? You need to be
getting (for example):

aaaa\\
bbbb\\
cccc

If you are not getting any \\ characters, it is not working
correctly. Your problem is you appeared to be getting too
many. If instead of getting \\\\ you are now not getting
any, try the following:

        $v = preg_replace("/([\\\]+\\n)+$/",'',
            implode("\\\\\\\n",$_REQUEST[$f[$i]['element']]));

Adjust the number of \ characters until you get the markup
shown above. I don't know why it works for me and not
for you, I'm afraid.
>> 
>>4. The discussion page links.
>> 
>><snip>
> 
>>-------------------------------------------------------
><snip>
> 
>Because several people have wanted to link to a form-generated page
>using that page's title, I created the formtitle.php script. Let's come
>back to this when the other problems are resolved -- it adds another
>layer of complexity. I think we will be able to achieve what you want,
>*provided that* the authors always fill in the title field.
> 
>Yes, if I can now have some way for the people to easily link
>the pages using the (:title:), that would be the icing on the cake.
>
Try the following...

With  formtitle.php enabled, you get a new markup that
reads a RecentChanges page, with entries of the form:

* [[Group.Name]] < usual pmwiki stuff > [=title text=]

and uses "title text" to work out Group.Name.

For this to work, the author *must* supply a title. If the
title appears more than once on RecentChanges, it lists 
both page name options. To make this work, set the
name of the form new entry page to use in 
local/config.php:

$NewGlossaryPage = 'Projects.NewEntry';

This originated for a 'glossary' project, so the name
derives from that. With the above setting it will look 
for titles in Projects.RecentChanges.

To link to a project by its title, use this markup:

[[?title of page]]

The '?' markup tells it to invoke the title lookup.

If there is no corresponding title in the RecentChanges,
you get a link to the new entry page.

Because the function has to read and parse the entire
RecentChanges page, if you have a very large dataset
this could become a bit slow.

If you run into difficulties, check the layout of the
designated RecentChanges page -- does the title
appear in the change summary part of the page?

><snip>

-- 
JR
--
John Rankin






More information about the pmwiki-users mailing list