Skip to content

Instantly share code, notes, and snippets.

if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
#http://gist.github.com/31934
<?php
$routes = array(
array(
"route" => "^(.*)/addon/(.*)/tickets",
"template_group" => "site",
"template" => "archives",
"query_string" => "%1/%2/%3/%4"
)
);
?>
function insert($at, $html)
{
global $SESS;
$SESS->cache['lg'][LG_POL_addon_id]['snippets'][$at][] = $html;
}
function insert_css($css, $file = TRUE, $at = "head")
{
if($file)
{
<?php
function load_settings($force_refresh = FALSE, $return_all = FALSE)
{
global $SESS, $DB, $REGX, $PREFS;
$settings = array();
$site_id = $PREFS->ini('site_id');
if(
<?php
class Nsm_module_CP {
var $module_name = "Nsm_module";
var $version = '1.0.0';
public function __construct($switch = TRUE)
{
global $IN;
<?php function render_collection($collection, $tagdata, $prefix = "", $depth = "0")
{
global $TMPL;
$count = 0;
foreach ((array)$collection as $key => $data)
{
++$count;
// print(str_repeat("&nbsp;&nbsp;", $depth). $prefix . $key."<br />");
if(is_array($data) || is_object($data))
{
function update_last_revision($entry_id)
{
global $DB, $IN;
$weblog_id = $IN->GBL('weblog_id');
$query = $DB->query("SELECT
enable_versioning,
enable_qucksave_versioning
FROM exp_weblogs
WHERE weblog_id = '".$weblog_id
);
<?php
// Written by Leevi Graham - Technical Director - http://newism.com.au
// All the best EE extensions can be found at: http://leevigraham.com !!
/**
The function below demonstrates how to use the weblog obect
to parse your own custom module / plugin tags
Usage {exp:my_plugin:use_weblog_object} ... {exp:my_plugin:use_weblog_object}
The tag will now behave like an exp:weblog:entries tag accepting the same params
<?php
make_embed_params_tag_params()
{
// the valid params for the tag
$valid_params = array(
'entry_id',
'weblog_id',
'url_title'
);