Skip to content

Instantly share code, notes, and snippets.

@billcreswell
billcreswell / simple.site.php
Created August 29, 2015 00:06
Simple Pluck Module Part 2
```{php}
<?php
defined('IN_PLUCK') or exit('Access denied!');
//{pluginname}_theme_main()
function simple_theme_main() {
echo getMessage();
}
function getMessage() {
return 'Hello Friends, this is my simple module';
}
@billcreswell
billcreswell / simple.php
Last active August 29, 2015 00:05
Simple Pluck Module Part 1
```{php}
<?php
//{plugin}_info
function simple_info() {
$module_info = array(
'name' => 'My Simple Demo Module',
'intro' => 'The Simplest Module',
'version' => '0.1',
'author' => 'grwebguy',
// set location of docx text content file
$xmlFile = $targetDir."/word/document.xml";
$reader = new XMLReader;
$reader->open($xmlFile);
// set up variables for formatting
$text = ''; $formatting['bold'] = 'closed'; $formatting['italic'] = 'closed'; $formatting['underline'] = 'closed'; $formatting['header'] = 0;
// loop through docx xml dom
while ($reader->read()){
@billcreswell
billcreswell / styleguide.html
Created January 3, 2015 16:46
HTML Style Guide Basel
<!-- Beginning of Styleguide -->
<h1>Poor Man's Styleguide</h1>
<p>A quick-and-dirty frontend styleguide, designed to be copied and pasted into your CMS.</p>
<strong><a href="http://poormansstyleguide.com">See the full demo at poormansstyleguide.com</a></strong>
<hr />
// set location of docx text content file
$xmlFile = $targetDir."/word/document.xml";
$reader = new XMLReader;
$reader->open($xmlFile);
// set up variables for formatting
$text = ''; $formatting['bold'] = 'closed'; $formatting['italic'] = 'closed'; $formatting['underline'] = 'closed'; $formatting['header'] = 0;
// loop through docx xml dom
while ($reader->read()){
@billcreswell
billcreswell / PluckInstalls.md
Last active August 29, 2015 14:05
"Powered By Pluck" - Websites using Pluck CMS
<html>
<head>
<script type="text/javascript">
//<[CDATA[
window.addEvent('domready', function(){
// onload functions here
});
function overlay() {
el = document.getElementById("overlay");
<?php
/**
* Adding Cache Headers and ETag to example: http://sperling.com/examples/pcss/
*/
class PHPStyle
{
public static function setHeaders($filename="style.css",$type="text/css")
<?php
$url="http://thehilolowdown.blogspot.com/feeds/posts/default?max-results=1";
$_c = curl_init();
curl_setopt($_c, CURLOPT_URL, $url);
curl_setopt($_c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($_c, CURLOPT_TIMEOUT, 3);
//curl_setopt($_c, CURLOPT_USERPWD, "$_user:$_pass");
//curl_setopt($_c, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
$_data = curl_exec($_c);
$response= curl_getinfo($_c);
<?php
/**
* Use whatever method you like to grab your HTML string. We'll use a site I mentioned in this post
* as an example.
*/
$remote_site_data = file_get_contents('http://www.10stripe.com/articles/automatically-generate-table-of-contents-php.php');
$dom_document = new DomDocument();
@$dom_document->loadHTML($remote_site_data);
$headers = $dom_document->getElementsByTagName('h2');
foreach ($headers as $header) {