Skip to content

Instantly share code, notes, and snippets.

View marcoscoelho's full-sized avatar
🐰
welcome

Marcos Coelho marcoscoelho

🐰
welcome
View GitHub Profile
@marcoscoelho
marcoscoelho / pyrocms_noparse_sample
Created May 31, 2011 16:29
PyroCMS no parser sample
{pyro:noparse}
<cite>{pyro:some:tag parsed="false"}</cite>
{/pyro:noparse}
@marcoscoelho
marcoscoelho / pyrocms_theme_img_optional.php
Created May 31, 2011 18:04
Using plugin theme to generate an image optional
Image traditional
{pyro:theme:image file="icons/{pyro:module_details:slug}.png" base="path"}
<?php
echo 'html_img_open' . 'path' . 'file' . 'html_img_close'; // image tag
?>
@marcoscoelho
marcoscoelho / gist:1101567
Created July 23, 2011 15:48
Generating image thumbnail with PyroCMS - Files Module
image original dimensions (???x???)
files/large/1
files/thumb/1/auto/auto
files/thumb/1/auto/auto/fill
files/thumb/1/auto/auto/fit
max default dimensions (100x100) with aspect ratio
files/thumb/1
@marcoscoelho
marcoscoelho / files_helper.php
Created August 8, 2011 20:16
Helper file of the "Files module" to PyroCMS
<?php defined('BASEPATH') OR exit('No direct script access allowed.');
/**
* CodeIgniter Files Helpers
*
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
* @author PyroCMS development team
*/
<ul>
{pyro:files:listing folder="root/subfolder" type="i"}
<li>
* {id}
* {folder_id}
* {user_id}
* {type}
* {name}
* {filename}
* {description}
@marcoscoelho
marcoscoelho / developerquiz.php
Created August 9, 2011 14:33 — forked from alganet/developerquiz.php
Full script for the Google Developer Day Quiz (http://developerquiz.appspot.com) in 39 lines (max: 80 char/line)
<?php isset($argv[1]) OR die('Input file should be the first arg on cmd line.');
const G_FOO = 'bjdrf'; //Googlon special letters
const G_INV = 'c'; //Preposition invalidator
const G_PREP = 3; //Preposition size
const G_VERB = 6; //Verb size
const G_ORDER = 'gkvrbjwtnlphzfmdxcqs'; //Letter ordering
const G_NUM_MOD = 5; //Pretty number divisor
const G_NUM_MAX = 860533; //Pretty number minimum
@marcoscoelho
marcoscoelho / output.html
Created August 12, 2011 00:46
Testing plugin files
<h1>test files plugin</h1>
<h2>double</h2>
<ul>
{pyro:files:listing folder="1"}
<li>{filename}</li>
{/pyro:files:listing}
</ul>
@marcoscoelho
marcoscoelho / text_helper.php
Created August 25, 2011 07:22
This function is similar to two native functions from CI (ellipsize and character_limiter) but more ruthless (non-preserves words), flexible (dont alters or strip anything in your string, because you can do it easily if necessary) and accurate (passed in
<?php defined('BASEPATH') OR exit('No direct script access allowed.');
/**
* Character Limiter Mid
*
* Limits the string representing the characters removed from somewhere from
* their mid. This limiter considers the output string as two parts (start and
* end) and not preserves complete words, so you also can chose exactly how many
* characters at start and end you need have.
*
@marcoscoelho
marcoscoelho / template_metadata.html
Created September 2, 2011 19:32
PyroCMS metadata places
<html>
<head>
{pyro:template:metadata} <!-- // default is "header", as {pyro:template:metadata in="header"} -->
</head>
<body>
{pyro:template:metadata in="body"}
[...]
{pyro:template:metadata in="footer"}
</body>
</html>
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the 'Database Connection'
| page of the User Guide.
|