Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
php newbie help
#12
RobA Wrote:Though regexping wold be a bit tricker as it would require preg_quote.... so your example from a plugin could be:

Code:
$tmpContent = preg_replace('/'.preg_quote(GSPLUGINTAGSTART).'(.*)googlemap(.*)'.preg_quote(GSPLUGINTAGEND ).'/i',$div,$tmpContent);

-Rob A>

Not only that - the end tag might be legally embedded within the tag, thus it is nearly impossible to make the tags configurable e.g.
Code:
(% myplugin percentindicator="(%)" %)

BTW: the googlemap regular expression shown above is really bad and should rather be something like:

Code:
'/\(%(\s*)googlemap(.*?)\s*%\)/i'

otherwise it can not coexist with other similar plugins and match the following texts, too:

Code:
(% mybettergooglemap %)

Code:
(% googlemap %) some text (% searchform %) (% searchresults %)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply


Messages In This Thread
php newbie help - by h-sen - 2011-03-24, 14:42:42
php newbie help - by yojoe - 2011-03-25, 08:33:18
php newbie help - by h-sen - 2011-03-28, 18:04:19
php newbie help - by yojoe - 2011-03-29, 00:05:50
php newbie help - by h-sen - 2011-03-30, 19:56:54
php newbie help - by h-sen - 2011-04-03, 15:15:37
php newbie help - by Connie - 2011-04-03, 16:40:34
php newbie help - by h-sen - 2011-04-04, 16:40:07
php newbie help - by RobA - 2011-04-05, 02:08:03
php newbie help - by Connie - 2011-04-05, 02:25:27
php newbie help - by RobA - 2011-04-05, 08:36:01
php newbie help - by mvlcek - 2011-04-05, 16:24:41
php newbie help - by h-sen - 2011-04-08, 15:04:56
php newbie help - by mvlcek - 2011-05-04, 17:15:28



Users browsing this thread: 1 Guest(s)