Latest 100 public snipts »
robertbanh's
snipts » ee
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>
-
∞ 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
-
∞ 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}
-
∞ 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; ?>
-
∞ EE: clean vars
<?php global $IN, $REGX; $str = $REGX->xss_clean($_POST['abc']); ?>
-
∞ 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;
-
∞ EE: commenting blocks of code
<?php // When using EE, you can comment out a section of code using // the following: {!-- <p>Blah</p> --} ?>
-
∞ 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} ?>
-
∞ 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/"; ?>
-
∞ 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]


