IMPORTANT!

Snipt is going open source. We've toyed with this idea for quite a while, and have finally decided it's the right way to move forward.

A few things:
  • The entire Snipt source code will be released on GitHub under the 3-clause BSD License on Friday, September 10th.
  • While we'd like to think we're perfect, we realize we're only human. By open sourcing the software that runs this website, certain bugs or security flaws may be discovered that could compromise the privacy of your snipts.
  • Only the Lion Burger team will be able to push commits to the Snipt.net site. Contributors should send a pull request to add new features or submit patches.
  • By using this site, you agree not to be too angry or take any legal action against Lion Burger should this whole thing go up in flames some day.
  • Follow us on Twitter for updates.
I agree, close this message
Sign up to create your own snipts, or login.

Latest 100 public snipts » robertbanh's snipts » ee The latest ee snipts from robertbanh.

showing 1-10 of 10 snipts for ee
  • JW Player tips
    <?php
    
    // jw player tips
    //
    // http://www.longtailvideo.com/support/jw-player-setup-wizard
    //
    // http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12536/configuration-options
    
    
    // build flashvars in case the user doesn't have js enabled
    $flash_vars = "&autostart=true&dock=false&file=".urlencode('blah.flv')."&image=".urlencode('blah.jpg')."&plugins=captions-1&captions.file=".urlencode('blah.xml');
            
    ?>
        <h3></h3>
        <p id='preview'>
        <embed src='http://www.blah.com/video/player.swf' height='360' width='640' allowscriptaccess='always' allowfullscreen='true' flashvars='<?php echo $flash_vars; ?>'/>
        </p>
    
        <script type='text/javascript' src='/video/swfobject.js'></script>
        <script type='text/javascript'>
            var s1 = new SWFObject('/video/player.swf','player','640','360','9');
            s1.addParam('allowfullscreen','true');
            s1.addParam('allowscriptaccess','always');
            s1.addVariable('file', 'blah.flv');
            s1.addVariable('autostart','true');
            s1.addVariable('dock','false');
            s1.addVariable('image','blah.jpg');
            s1.addVariable('captions.file', 'blah.xml');
            s1.addVariable('author','Me');
            s1.addVariable('description','Video of Me');
            s1.addVariable('title','Title');
            s1.addVariable('plugins','viral-2d,captions-1');
            s1.write('preview');
        </script>
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Sep 01, 2010 at 10:31 a.m. EDT
  • EE: .htaccess file
    DirectoryIndex index.php index.html
    Options -Indexes
    
    <FilesMatch "_CHANGELOG">
    deny from all
    </FilesMatch>
    
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
    
    # Increase mem for EE - large data sets
    php_value memory_limit 64M
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Jul 13, 2010 at 4:02 p.m. EDT
  • EE: ngen and imgsizer
    <?php
    
    // EE - ngen + imgsizer
    //
    // http://www.lumis.com/page/imgsizer/
    
    {exp:weblog:entries ...}
    
    // ngen - display filename only
    {customFieldNamePhoto show='filename'}
    
    // ngen - display full path
    {customFieldNamePhoto}
    
    // ngen + imgsizer
    {exp:imgsizer:size src="{customFieldNamePhoto}" 
         width="98" alt="profile pic"}
    
    {/exp:weblog:entries}
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Jul 02, 2010 at 12:04 p.m. EDT
  • EE: getting php segment vars
    <?php
    
    global $IN;
    
    $segment_2 = $IN->fetch_uri_segment('2');
    
    // get array of segments
    $seg_array = $IN->SEGS;
    
    // get the last segment
    $entry_id = $IN->QSTR;
    
    ?>
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Jun 28, 2010 at 5:24 p.m. EDT
  • EE: clean vars
    <?php
    
    global $IN, $REGX;
    
    $str = $REGX->xss_clean($_POST['abc']);
    
    ?>
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Jun 23, 2010 at 11:14 a.m. EDT
  • EE: plugin - return var pairs
    <?php
    
        // EE plugin - returning as tag paired
        //
        // usage:
        //
        // {exp:blah}
        //    {aaa}
        //       {bbb}
        //       {ccc}
        //    {/aaa}
        // {/exp:blah}
        //
    
        // now we build the return data structured for EE
        $tagdata = "";
        foreach ($returnArray as $entry_id => $obj)
        {
            // start the tagdata
            $temp = $TMPL->tagdata;
            
            if (preg_match('/{aaa}/', $temp))
            {
                // remove tag pairs
                $temp = str_replace('{aaa}', '', $temp);
                $temp = str_replace("{".SLASH."aaa}", '', $temp);
                
                $temp = str_replace('{bbb}', $obj['entry_id'], $temp);
                $temp = str_replace('{ccc}', $obj['title'], $temp);
                
                // store the tagdata
                $tagdata .= $temp;
            }
        }
    
        $this->return_data = $tagdata;
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Jun 23, 2010 at 10:11 a.m. EDT
  • EE: commenting blocks of code
    <?php
    
    // When using EE, you can comment out a section of code using
    // the following:
    
     {!--
    
     <p>Blah</p> 
    
      --}
    
    ?>
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Jun 18, 2010 at 8:45 a.m. EDT
  • EE: set and return vars in plugin
    <?php
    
    // for custom plugin in EE, setting variables 
    $tagdata = $TMPL->tagdata;    
    //var_export($TMPL->var_single);
    
    $tagdata = $TMPL->swap_var_single("rbanh_var","hello", $tagdata);
    $this->return_data .= $tagdata; 
    
    // usage:
    // {plugin_name}
    //    {rbanh_var}
    // {/plugin_name}
    ?>
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Jun 15, 2010 at 11:50 a.m. EDT
  • config.php for EE
    <?php
    
    if ( ! defined('EXT')){
    exit('Invalid file request');
    }
    
    $conf['app_version'] = "168";
    $conf['license_number'] = "";
    $conf['debug'] = "1";
    $conf['install_lock'] = "1";
    $conf['db_hostname'] = "[mysql server]";
    // Note: Must use the super admin since EE will
    // alter and add/remove columns.
    $conf['db_username'] = "xxxx";
    $conf['db_password'] = "xxxx";
    $conf['db_name'] = "xxx";
    $conf['db_type'] = "mysql";
    $conf['db_prefix'] = "exp";
    $conf['db_conntype'] = "0";
    $conf['system_folder'] = "[system folder name]";
    $conf['cp_url'] = "http://[server]/[system]/index.php";
    $conf['doc_url'] = "http://expressionengine.com/docs/";
    $conf['cookie_prefix'] = "";
    $conf['is_system_on'] = "y";
    $conf['allow_extensions'] = "y";
    $conf['multiple_sites_enabled'] = "n";
    
    // rbanh: this is for migration:
    $conf['site_url'] = "http://[server]/";
    $conf['tmpl_file_basepath'] = $conf['site_url'] . $conf['system_folder'] . "/templates/";
    $conf['theme_folder_url'] = $conf['site_url'] . "themes/";
    $conf['theme_folder_path'] = $conf['site_url'] . "themes/";
    $conf['captcha_path'] = $conf['site_url'] . "images/captchas/";
    $conf['captcha_url'] = $conf['site_url'] . "images/captchas/";
    $conf['avatar_path'] = $conf['site_url'] . "images/members/avatars/";
    $conf['avatar_url'] = $conf['site_url'] . "images/members/avatars/";
    
    ?>
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Feb 08, 2010 at 11:26 a.m. EST
  • Rewrite .htaccess to EE's engine if directory conflicts with existing directory
    RewriteEngine On
    RewriteBase /
    
    # if the file/dir does not exist, append index.php 
    # which will call EE and pull up it's structured url
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/interact/$1 [L]
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Feb 03, 2010 at 10:10 a.m. EST
Sign up to create your own snipts, or login.