daily pastebin goal
77%
SHARE
TWEET

Untitled

a guest Jun 20th, 2016 126 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Text;
  3. using System.Text.RegularExpressions;
  4.  
  5. namespace PandoraBox
  6. {
  7.     public class CatMainIndexPlugin : IPluginMacro
  8.     {
  9.         Regex _block = new Regex(@"{CATINDEX}(.*?){/CATINDEX}", RegexOptions.Compiled | RegexOptions.Singleline);
  10.        
  11.         public string Execute(string template, PluginMacroArgs args)
  12.         {
  13.             template = _block.Replace(template, delegate(Match match)
  14.             {
  15.                 if(args.I == 0 && args.MacroType == MacroType.CATBLOCK)
  16.                     return match.Groups[1].Value;
  17.                 return "";
  18.             });
  19.             return template;
  20.         }
  21.        
  22.         public ushort Level
  23.         {
  24.             get { return 3; }
  25.         }
  26.        
  27.         public String Name
  28.         {
  29.             get { return "CatMainIndexPlugin: Вывод только на главной индексной странице"; }
  30.         }
  31.     }
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top