Skip to content

Instantly share code, notes, and snippets.

#added by Nevin Lyne - DoS protection against /entry/vote-ajax URL
Redirect 403 /entry/vote-ajax
RewriteEngine On
RewriteBase /
# For SLP Site
RewriteCond %{HTTP_HOST} ^slp.pbinsight.com$
RewriteCond %{REQUEST_FILENAME} !slp/
RewriteRule ^(.*)$ slp/$1
@iso100
iso100 / mod.structure.php
Created April 24, 2013 01:19
Ian's mods to breadcrumbs allowing a custom last class to support Foundation 4
/** -------------------------------------
/** Create a Breadcrumb Trail
/** -------------------------------------*/
function breadcrumb()
{
$site_pages = $this->sql->get_site_pages();
if ( ! $site_pages)
return FALSE;
@iso100
iso100 / statamic_feed_template.html
Created May 1, 2013 12:50
A quick rss feed template for Statamic.
<channel>
<title><![CDATA[{{ folder }}]]></title>
<link>{{ _site_url }}/{{ folder }}</link>
<description>{{ _site_name }} {{ folder }}</description>
<dc:language>en-us</dc:language>
<dc:creator>{{ contact_email }}</dc:creator>
<dc:rights>Copyright {{ current_date format='Y' }}</dc:rights>
<dc:date>{{ current_date format="Y-m-d\TH:i:s\Z" }}</dc:date>
<admin:generatorAgent rdf:resource="http://statamic.com/" />
@iso100
iso100 / .htaccess
Created May 4, 2013 18:04
Remove trailing slash from URLs
# Remove Trailing Slash
# ------------------------------
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} (.*)$
RewriteRule ^(.+)/$ http://www.yourdomain.com/$1 [R=301,NC,L]
@iso100
iso100 / Conditional Secondary Nav with Structure
Created May 24, 2013 18:29
Failed attempt at only rendering secondary navigation when there's nav items to display.
{if '{structure:child_ids_for:{structure:top:entry_id}}' != ''}
<div id="secondary-nav" class="widget">
<h3>Other Pages in <a href="{structure:top:uri}">{structure:top:title}</a>:</h3>
{exp:structure:nav
current_class="active"
start_from="/{segment_1}"
include_ul="yes"
}
</div>
{/if}
@iso100
iso100 / .htaccess
Last active December 18, 2015 12:39
Mapinfo.com redirects
php_value memory_limit 256M
php_value error_reporting 8191
php_value upload_max_filesize 20M
php_value post_max_size 20M
php_value max_execution_time 200
php_value max_input_time 200
php_value suhosin.memory_limit 256M
php_value suhosin.post.max_vars 6000
php_value suhosin.request.max_vars 6000
php_value max_input_vars 2000
@iso100
iso100 / detail.html
Created June 17, 2013 12:12
Model template for detail layout.
{if {exp:stash:not_empty name="{segment_1}-color-styles" scope="site"}==0}
{exp:channel:entries
channel="overview"
disable="categories|member_data|pagination|trackbacks"
status="not Closed"
dynamic="no"
url_title="{segment_1}"
limit="1"
}
{exp:stash:set
@iso100
iso100 / _detail.html
Created June 17, 2013 12:16
Wrapper for detail template
<!DOCTYPE HTML>
<html lang="en-US">
<head>
{exp:seo_lite use_last_segment="yes"}
<link rel="canonical" href="http://www.pb.com/smb{structure:page:uri}" />
{sn_head}
{gv_easybox_overrides}
<style type="text/css">
{exp:stash:get name="{segment_1}-color-styles" scope="site"}
</style>
@iso100
iso100 / debugging.txt
Created June 17, 2013 13:53
Debugging for stash/ce cache issue. This is with user logged in and thus CE Cache not running.
(0.000010 / 14.13MB) - Begin Template Processing -
(0.000145 / 14.14MB) URI: qr-codes/gallery/custom-qr-prints
(0.000160 / 14.14MB) Path.php Template: data/detail
(0.000174 / 14.14MB) Retrieving Template
(0.000190 / 14.14MB) Retrieving Template from Database: data/detail
(0.001371 / 14.14MB) Template Found
(0.001457 / 14.15MB) Retrieving Template from File
(0.004854 / 14.46MB) Calling Extension Class/Method: Low_variables_ext/template_fetch_template
(0.008221 / 14.53MB) Calling Extension Class/Method: Ce_cache_ext/template_pre_parse
(0.009650 / 14.62MB) Calling Extension Class/Method: Stash_ext/template_fetch_template
@iso100
iso100 / debugging-ce-enabled.txt
Created June 17, 2013 13:55
Template debugging with CE Cache enabled.
(0.000014 / 14.13MB) - Begin Template Processing -
(0.000165 / 14.14MB) URI: qr-codes/gallery/custom-qr-prints
(0.000183 / 14.14MB) Path.php Template: data/detail
(0.000199 / 14.14MB) Retrieving Template
(0.000219 / 14.14MB) Retrieving Template from Database: data/detail
(0.001334 / 14.14MB) Template Found
(0.001446 / 14.15MB) Retrieving Template from File
(0.005255 / 14.46MB) Calling Extension Class/Method: Low_variables_ext/template_fetch_template
(0.008529 / 14.53MB) Calling Extension Class/Method: Ce_cache_ext/template_pre_parse
(0.010052 / 14.62MB) Calling Extension Class/Method: Stash_ext/template_fetch_template