Skip to content

Instantly share code, notes, and snippets.

@zvineyard
zvineyard / PyroCMS: Multiple Relationship Streams Example
Last active August 29, 2015 13:56
A multiple relationship streams tag example for PyroCMS, using two streams to output data.
{{ streams:cycle stream="articles" namespace="cope" paginate="yes" pag_segment="2" limit="10" order_by="created" sort="desc" }}
<!--{{ total }} entries returned-->
<div>
{{ entries }}
<p>{{ title }}</p>
<p>
{{ streams:departments }}
@zvineyard
zvineyard / pyrocms_core_hacks
Last active August 29, 2015 13:56
PyroCMS Core Hacks
system/cms/core/Public_Controller.php, around line 103:
if($this->uri->segment(1) !== 'story')
{
$this->template->set_metadata('canonical', site_url($this->uri->uri_string()), 'link');
}
@zvineyard
zvineyard / cope_articles_pyrocms_tag
Last active August 29, 2015 13:57
PyroCMS Tag: Cope Articles
<div class="posts">
{{ articles:preview limit="2" }}
<div class="post" style="border:none;margin:0;">
<h2><a href="story/{{ article_slug }}">{{ article_title }}</a></h2>
<div class="meta">
<p class="pub_date">{{ helper:date timestamp=created }}</p>
</div>
{{ if thumb_id }}
@zvineyard
zvineyard / gist:6e2f4b1c8fe896fc0915
Last active August 29, 2015 14:06
Messenger Homepage HTML with Tag
<div class="grid_8 alpha">
<div class="posts">
{{ articles:preview limit="4" where="`messenger_issue`='summer_2014'" }}
<div class="post">
<h2><a href="story/{{ article_slug }}">{{ article_title }}</a></h2>
<div class="meta">
<p class="pub_date">{{ helper:date timestamp=article_created }}</p>
</div>
{{ if thumb_id }}
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
@zvineyard
zvineyard / ssl_apache_config.txt
Created June 17, 2015 04:33
SSL Apache Config
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/yourdomain_com.crt
SSLCertificateKeyFile /etc/apache2/ssl/yourdomain_com.key
SSLCACertificateFile /etc/apache2/ssl/yourdomain_com.cer
ServerAdmin admin@yourdomain.com
ServerName www.yourdomain.com
DocumentRoot /var/www/yourdomain.com/public_html/
ErrorLog /var/www/yourdomain.com/logs/error.log
@zvineyard
zvineyard / streams_entry_looping_example.html
Last active August 29, 2015 14:27
Stream Entry Looping PyroCMS
{{ streams:cycle stream="employement_positions" limit="1" where="`position_slug`='[segment_2]'" }}
{{ entries }}
{{ if description != "" }}
<h3>Description of Position</h3>
<p>{{ description }}</p>
{{ endif }}
{{ /entries }}
{{ /streams:cycle }}
@zvineyard
zvineyard / phonegap_filetransfer_object.html
Created February 26, 2012 05:35
PhoneGap: FileTransfer Object
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>File Transfer Example</title>
<script type="text/javascript" charset="utf-8" src="phonegap-1.2.0.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for PhoneGap to load
document.addEventListener("deviceready", onDeviceReady, false);
@zvineyard
zvineyard / example_php_upload.php
Created February 27, 2012 05:22
PHP: Basic File Upload
<?php
print_r($_FILES);
$new_image_name = "namethisimage.jpg";
move_uploaded_file($_FILES["file"]["tmp_name"], "/srv/www/upload/".$new_image_name);
?>
@zvineyard
zvineyard / example_html_form.html
Created March 11, 2012 20:48
HTML: Basic Info Request Form
<form method="post" id="infoForm">
<input type="text" name="first_name" id="first_name" value="" placeholder="First Name" />
<input type="text" name="last_name" id="last_name" value="" placeholder="Last Name" />
<input type="text" name="email" id="email" value="" placeholder="Email" />
<button type="submit">Submit</button>
</form>