Topic: Content Plugin not working...so I fixed it...

0 Members and 1 Guest are viewing this topic.

June 08, 2010, 06:44 PM

Offline tpadmin

  • Newbie
  • *
  • Posts: 1
    • View Profile
The plugin didn't work on galleries that had more than one digit, so I altered the regex on line 34 of the plugin to:
$regex   = '/{jphoto\sgal=([0-9]\d)}/si';
and it works fine now.

December 17, 2010, 01:22 AM

Offline harikaram

  • Newbie
  • *
  • Posts: 11
  • 'corePHP' - Unlock your Full Potential!
    • View Profile
Won't that regex only work with galleries with 2 digits? 
[0-9] matches 1 digit
\d (the same thing) will match 1 digit

I think you'd be better with
'/{jphoto\s+gal=(\d+)\s*}/si';

This will be a bit more flexible with the whitespace too...

December 17, 2010, 05:38 AM

Offline Rafael Corral

  • Administrator
  • Sr. Member
  • *****
  • Posts: 320
    • View Profile
The latest version of the content plugin has this:
$regex   = '/{jphoto\sgal=([0-9]+)}/si';

Which will accept any amount of digits.