title: Wordpress: Use PHP Function based on Blog URL & Adding To MU-Plugins
body: <p>I am developing a plugin for an MU site. The MU site has about a few hundred blogs, but there are three types of blogs and they are named as:</p>
  
  <p>blogname/sportstype1
  blogname/sportstype2
  blogname/sportstype3
  blogname/celebritytype1
  blogname/celebritytype2
  etc.</p>
  
  <p>I need to make two functions, one for type1, and the other function for the rest (type2/3). I have a function I made, wanted to ask is this the right/best way to do this:</p>
  
  <pre><code>    $whatistype = &lt;?php get_bloginfo('site_url'); ?&gt;
      $type = &lt;?php substr( $whatistype, -4);
      &lt;?php if ( $type == "type1 ) 
  { include 'type1list.php'; 
     /* Or code */
  }
  
  else 
  
  { include 'typelistother.php
      /* Or code */
   }
  ?&gt;
  </code></pre>
  
  <p>Also, I would want this to run only when a blog is created. I will check under the hood at Cets Default plugin, but would it be best to make this a plugin and activate sitewide or make into an MU-plugin? How would I go about making a plugin for the mu-folder (can't find much documentation on it).</p>