Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* NSM Example Addon Display
*
* Usage:
*
* $this->EE->load->library("nsm_live_look_display");
*
* # Add the custom field stylesheet to the header
* $this->EE->nsm_live_look_display->addCSS('custom_field.css');
{!--
Add this to your index page.
Returns the content before <!-- #more --> including the replacement
The idea is you can use a comment in a single custom field and only return a sub-section.
find="" accepts a regular expression which allows you to add <!-- #more --> inside a paragraph block.
--}
{exp:nsm_content_split:split find="#<!-- #more -->(<\p>)?#"}
{replace_with}<a href="{comment_url_title}">More &hellip;</a>$1{/replace_with}
{news_content}
{exp:nsm_content_split:split}
<!DOCTYPE html>
<html>
<head>
<title>iPhone Toggle</title>
<style>
label.checkbox{
background:url('../img/toggle.png') no-repeat top left;
cursor:pointer;
display:block;
height:0;
{exp:channel:entries${1:
cache="yes" refresh="${2:10}"}${3:
disable="categories|category_fields|${4:custom_fields|}member_data|pagination|trackbacks"}${5:
entry_id="${6:{segment_$7\}}"}${8:
limit="1"}${9:
rdf="off"}${10:
url_title="${11:{segment_$12\}}"}${13:
weblog="$14"
}}
$15
<?php
make_embed_params_tag_params()
{
// the valid params for the tag
$valid_params = array(
'entry_id',
'weblog_id',
'url_title'
);
<?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
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 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))
{
<?php
class Nsm_module_CP {
var $module_name = "Nsm_module";
var $version = '1.0.0';
public function __construct($switch = TRUE)
{
global $IN;