[pmwiki-users] Markup Question

Petko Yotov 5ko at 5ko.fr
Mon May 4 01:03:11 CDT 2009


On Monday 04 May 2009 05:33:58 Dave Brockman wrote:
> Petko Yotov wrote:
> > On Saturday 02 May 2009 06:12:10 Dave Brockman wrote:
> >> Users on my site are allowed to edit pages in three
> >> groups. I would like to disallow pictures in these groups. I read about
> >> the use of "DisableMarkup('img') in the documentation for Images. I
> >> *think* I should create a "groupname.php" file in /local containing that
> >> markup for each group. Is this correct? Thanks in advance for any help.
> >>
> >> <?php
> >>    DisableMarkup('img');
> >
> > Hello. Yes, this is the way to disable some markup rule. (Only the group
> > customization file is named "Groupname.php" and not "groupname.php".)
> >
> > See also a related discussion at :
> >   http://www.pmwiki.org/wiki/PITS/01096

>
> Hi Petko,
>
> Thanks! I tried it, and it doesn't seem to work. I created a file named
> CommentPages.php which matches the group name. The contents are:
>
> <?php if (!defined('PmWiki')) exit();
>
> ## Suppress images.
> DisableMarkup('img');
>
> I then added an image to a page in the group with  the page edit window as:
>
> A test to see if images are blocked.
>
> http://www.perrymasontvseries.com/wiki/images/AbsentArtist-095.jpg
>
> Upon saving, I find that the image shows up and is a link to itself.

Right, I didn't know. When we DisableMarkup('img'), the "http://www...jpg" 
thing is treated not as an image, but as a regular external link. But the 
MakeLink function re-checks it to see if it seems like an image, regardless 
of the markup rules.

You should also add to CommentPages.php this line :
  $ImgExtPattern = "$^";

This line will cause MakeLink to skip the "check image" part, and instead to 
display the link, like any other http://... link.

I just tested it here :
  http://www.pmwiki.org/wiki/Test/DisableMarkup

Thanks,
Petko



More information about the pmwiki-users mailing list