Skip to content

Instantly share code, notes, and snippets.

Avatar

Marc outflux3

  • nibiri
  • Sunny Goldens Bridge, NY
View GitHub Profile
@outflux3
outflux3 / PageDocsTab.module
Last active Aug 29, 2015
Page Docs Tab for Processwire
View PageDocsTab.module
<?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 / gist:fb7e7dc3ed6c711842f9
Last active Aug 29, 2015
code snippets for modern web design class
View gist:fb7e7dc3ed6c711842f9
<?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 / gist:cf5807ddedfaa5c0d425
Last active Aug 29, 2015
Processwire Append Other Page Body
View gist:cf5807ddedfaa5c0d425
<?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:530b8adb1a6b7019d262
Last active Aug 29, 2015
Email with multi-sending schedule
View gist:530b8adb1a6b7019d262
<?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:797a18f5d2eaf0a87efb
Last active Aug 29, 2015
scheduled mail with processwire
View gist:797a18f5d2eaf0a87efb
<?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'));
View gist:0a013ea20b46e706a6f9
<?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 / foxycart_xml_processor.php
Last active Dec 29, 2015
adapted modx foxycart script for processwire..
View foxycart_xml_processor.php
<?
/*
Title:
FoxyCart_Inventory
Description:
Uses FoxyCart.com's XML Data Feeds to modify Processwire data.
Version:
@outflux3
outflux3 / buildUrl.module
Created Nov 20, 2013
Processwire - example of how to use fields to automatically create page name and title, including date fields and page ID..
View buildUrl.module
<?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 / search-processor.php
Created Jun 1, 2013
search-processor. processwire
View search-processor.php
<?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");
@outflux3
outflux3 / search-form.php
Created Jun 1, 2013
Processwire sample search form based on skyscrapers search
View search-form.php
<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' " : '';
You can’t perform that action at this time.