Socialengine Tutorial – Disable default css from being loaded

I’ve been working on creating a custom homepage which uses twitter bootstrap however I’ve found the default css being generated by the socialengine is interferring with the bootstrap css.

In order to stop socialengine from adding in the default theme css files head to

Application > Modules > Core > Layouts > Scripts > default-simple.tpl

This default simple is what is loaded on every page and then injected with the page’s content. However I didn’t want any of that to load on my landing page so I’ve done the following;

(In this file look for line 75 where the ‘linking’ of css files begins and I’ve wrapped it in an if statement which says if the current url string == the default home page (e.g. /) then don’t bother loading the rest of the php)

<?php // LINK/STYLES ?>
  $uri = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
  if(trim($uri, '/') !=  trim($this->baseUrl(), '/')):
      'rel' => 'favicon',
      'href' => ( isset($this->layout()->favicon)
        ? $this->baseUrl() . $this->layout()->favicon
        : '/favicon.ico' ),
      'type' => 'image/x-icon'),
    $themes = array();
    if( !empty($this->layout()->themes) ) {
      $themes = $this->layout()->themes;
    } else {
      $themes = array('default');
    foreach( $themes as $theme ) {
    // Process
    foreach( $this->headLink()->getContainer() as $dat ) {
      if( !empty($dat->href) ) {
        if( false === strpos($dat->href, '?') ) {
          $dat->href .= '?c=' . $counter;
        } else {
          $dat->href .= '&c=' . $counter;
  <?php endif; ?>

Hope this helps 🙂

PHP – Extract youtube id from youtube url / link

Today I wanted to be able to extract the youtube unique id for the video so that I could automatically embed any youtube video in my webpage.

What I wanted to be able to do was let the user copy + paste in a youtube url such as and extract the value of the key ‘v’ which is obviously the video id.

After a short while I ran into a stackoverflow question which had an awesomely simple answer;

$url = "";
parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars );
echo $my_array_of_vars['v'];    
  // Output: C4kxS1ksqtw

So what this means is that I can now just do the following to embed any youtube video in to a page;

$url = ";feature=relate"; 
parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars ); 
<i frame src="<?php echo $my_array_of_vars['v']; ?>" frameborder="0" width="560" height="315">
</i frame>

*remove space between i frame (was to stop it from showing in the post)