This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{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'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{php} | |
<?php | |
//{plugin}_info | |
function simple_info() { | |
$module_info = array( | |
'name' => 'My Simple Demo Module', | |
'intro' => 'The Simplest Module', | |
'version' => '0.1', | |
'author' => 'grwebguy', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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()){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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 /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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()){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript"> | |
//<[CDATA[ | |
window.addEvent('domready', function(){ | |
// onload functions here | |
}); | |
function overlay() { | |
el = document.getElementById("overlay"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) { |
NewerOlder