Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- using System.Text.RegularExpressions;
- namespace PandoraBox
- {
- public class CatMainIndexPlugin : IPluginMacro
- {
- Regex _block = new Regex(@"{CATINDEX}(.*?){/CATINDEX}", RegexOptions.Compiled | RegexOptions.Singleline);
- public string Execute(string template, PluginMacroArgs args)
- {
- template = _block.Replace(template, delegate(Match match)
- {
- if(args.I == 0 && args.MacroType == MacroType.CATBLOCK)
- return match.Groups[1].Value;
- return "";
- });
- return template;
- }
- public ushort Level
- {
- get { return 3; }
- }
- public String Name
- {
- get { return "CatMainIndexPlugin: Вывод только на главной индексной странице"; }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement