Skip to content

Instantly share code, notes, and snippets.

View outflux3's full-sized avatar

Marc outflux3

  • nibiri
  • Sunny Goldens Bridge, NY
View GitHub Profile
<?php
class AssignSession extends WireData implements Module {
/**
* Basic information about module
*/
public static function getModuleInfo() {
return array(
'title' => 'Assign Session',
'summary' => 'Assigns a session to the session_table field in class, upon save',
@outflux3
outflux3 / gist:797a18f5d2eaf0a87efb
Last active August 29, 2015 14:03
scheduled mail with processwire
<?php // messages
// Set Defaults
$base_path = '/server/path/to/pwsite';
$base_url = 'base-http-url-here';
$now = date("U"); // current date
//Setup Time Range, Send all messages in range; +-4 minutes seems to work well...cron runs every 5 min
$minus4 = date('U', strtotime('-4 minutes'));
@outflux3
outflux3 / gist:530b8adb1a6b7019d262
Last active August 29, 2015 14:04
Email with multi-sending schedule
<?php // messages
// Set Defaults
$base_path = '/server/path/to/pwsite';
$base_url = 'base-http-url-here';
$now = date("U"); // current date
//Setup Time Range, Send all messages in range:
$minus4 = date('U', strtotime('-4 minutes'));
@outflux3
outflux3 / gist:cf5807ddedfaa5c0d425
Last active August 29, 2015 14:07
Processwire Append Other Page Body
<?php
class AppendBoilerplates extends WireData implements Module {
/**
* Basic information about module
*/
public static function getModuleInfo() {
return array(
'title' => 'Append Boilerplates',
'summary' => 'Append selected boilerplate texts to a text body',
@outflux3
outflux3 / gist:fb7e7dc3ed6c711842f9
Last active August 29, 2015 14:11
code snippets for modern web design class
<?php
// featured
$slides = $pages->find("template=slide, featured=1");
// Word Limiter
function wordLimiter(HookEvent $event){
$field = $event->arguments[0]; // first argument
$limit = $event->arguments[1];
@outflux3
outflux3 / PageDocsTab.module
Last active August 29, 2015 14:14
Page Docs Tab for Processwire
<?php
/**
* ProcessWire Page Docs Tab
*
* A little addon to display help docs relevant to the page being edited.
*
* @copyright Copyright (c) 2015, Macrura
*
*/
@outflux3
outflux3 / buildUrl.module
Created November 20, 2013 18:17
Processwire - example of how to use fields to automatically create page name and title, including date fields and page ID..
<?php
class BuildUrl extends WireData implements Module {
/**
* Basic information about module
*/
public static function getModuleInfo() {
return array(
'title' => 'Build URL',
'summary' => 'Builds a URL on page save based on specific fields.',
@outflux3
outflux3 / foxycart_xml_processor.php
Last active December 29, 2015 03:39
adapted modx foxycart script for processwire..
<?
/*
Title:
FoxyCart_Inventory
Description:
Uses FoxyCart.com's XML Data Feeds to modify Processwire data.
Version:
@outflux3
outflux3 / search-form.php
Created June 1, 2013 13:40
Processwire sample search form based on skyscrapers search
<form name='search' id='product-search' method='get' action='<?php echo $config->urls->root?>speaker-finder/'>
<ul id="row1">
<li>
<label for='search_app'>Application</label>
<select id='search_app' name='application' onchange="$(this.form).trigger('submit')">
<option value=''>Any</option><?php
// generate the application options, checking the whitelist to see if any are already selected
foreach($pages->get(1016)->children('include=all') as $app) {
$selected = $app->name == $input->whitelist->application ? " selected='selected' " : '';
@outflux3
outflux3 / search-processor.php
Created June 1, 2013 13:42
search-processor. processwire
<?php
// check if there are GET variables present in the URL
if(count($input->get)) {
$selector = '';
if($input->get->application) {
$application = $sanitizer->pageName($input->get->application);
$appid = $pages->get("template=product-options, name=$application");