Skip to content

Instantly share code, notes, and snippets.

# For STAGING SERVER ONLY...
# --------------------------
# --------------------------
# Developers add your IP Below
# DO NOT ADD Fuller IP's, however
# --------------------------
# --------------------------
# To set a u/p for everyone else,
# in command line on the server, type:
@shoeshine
shoeshine / gist:54834de007fe8ae81fb7
Created July 29, 2014 13:35
Add hidden text field with full Structure value
# Replace line 140 in tab.structure.php with:
$help_text = "<p class='instruction_override'><strong>URL prefix</strong><style>#sub_hold_field_structure__uri .instruction_text p {display:none;} #sub_hold_field_structure__uri .instruction_text p.instruction_override {display:block;}</style>: ".$site_pages['uris'][$parent_id]."</p><input type='hidden' id='full_url' value='".$site_pages['uris'][$parent_id]."".$slug."'>";
@shoeshine
shoeshine / EE-default.gitignore
Last active December 27, 2015 04:09
Default ExpressionEngine .gitignore file
# Globals
.DS_Store
cgi-bin/
error_log
# Master Config
config/config.local.php
# Caches
sized/
@shoeshine
shoeshine / target-blank
Created August 27, 2013 11:57
Add target="_blank" to all external links
$(document).ready(function() {
$("a[@href^=http]").each(
function(){
if(this.href.indexOf(location.hostname) == -1) {
$(this).attr('target', '_blank');
}
}
)
});
@shoeshine
shoeshine / segment-count
Created August 12, 2013 15:56
Segment count for link URL
$url="http://www.mysite.org/one/two/three";
$data=explode("//",$url);
$segments=explode("/",$data[1]);
$count = count($segments)-1;
echo $url . '<br>';
echo $segments[0] . '<br>';
echo $segments[1] . '<br>';
echo $segments[2] . '<br>';
echo $segments[3] . '<br>';