Skip to content

Instantly share code, notes, and snippets.

<?php
// Bootstrap ProcessWire
require 'index.php';
// Make sure that FieldtypeRepeater is installed and ready for use
if (!wire('modules')->isInstalled('FieldtypeRepeater')) {
if (wire('modules')->isInstallable('FieldtypeRepeater')) {
wire('modules')->install('FieldtypeRepeater');
echo "Module FieldtypeRepeater installed\n";
@kongondo
kongondo / pw_configurable_module_example.php
Last active August 29, 2015 13:56
Example Configurable ProcessWire Process Module
<?php
//Example by Ryan Cramer @ProcessWire - http://processwire.com/talk/topic/5480-configurable-process-module-need-walk-through/?p=53729
class YourModule extends WireData implements Module, ConfigurableModule {
public static function getModuleInfo() {
return array('title' => 'Your Module', 'version' => 1);
}
const defaultValue = 'smith';
@kongondo
kongondo / data.php
Created March 12, 2014 00:41 — forked from jjb3rd/data.php
<?php
/*
* Script: DataTables server-side script for PHP and MySQL
* Copyright: 2012 - John Becker, Beckersoft, Inc.
* Copyright: 2010 - Allan Jardine
* License: GPL v2 or BSD (3-point)
*/
class TableData {
<?php
/**
* Adding other types of save buttons for page edit form.
*
* ProcessWire 2.x
* Copyright (C) 2010 by Ryan Cramer
* Licensed under GNU/GPL v2, see LICENSE.TXT
*
* http://www.processwire.com
@kongondo
kongondo / member.login.php
Last active August 29, 2015 14:00
ProcessWire: Code example - front-end system to handle logins, password resets and changing passwords
<?php
/*
Code by Ryan Cramer
Integrating a member visitor login form
https://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/?p=15919
*/
/*
I recently had to setup front-end system to handle logins, password resets and changing passwords, so here's about how it was done. This should be functional code, but consider it pseudocode as you may need to make minor adjustments here and there. Please let me know if anything that doesn't compile and I'll correct it here.
@kongondo
kongondo / blogCleaner
Last active August 29, 2015 14:14
Blog 2 Cleanup Utility in case you mistakenly uninstalled Blog without first running the inbuilt Cleanup Utility
<?php
/**
*
* CONTEXT: This is a utility class for 'cleaning-up' Blog in case you uninstalled Blog without first running its inbuilt Cleanup utility.
*
* WARNING: The utility will irreversibly delete the following Blog Components
* Fields (blog_xxx)
* Templates (blog-xxx)
* Optionally Template Files (in case you installed the blank/demo Template Files) (blog-xxx.php/inc)
@kongondo
kongondo / Multisite.module.php
Last active August 29, 2015 14:27 — forked from LostKobrakai/Multisite.module.php
Multisite routing for ProcessWire
<?php
// source: https://processwire.com/talk/topic/680-multiple-sites-from-one-install/?p=8778
class Multisite extends WireData implements Module, ConfigurableModule {
public static function getModuleInfo() {
return array(
'title' => 'Multisite',
'version' => 1,
@kongondo
kongondo / paginator.php
Last active December 18, 2015 04:48 — forked from somatonic/paginator.php
manual pagination example for in memory page arrays
<?php
/**
* include paginator class from ProcessWire core, $config->paths->Modulename can
* be used to get the path of any module in PW.
*/
require_once($config->paths->MarkupPagerNav . "PagerNav.php");
/**
@kongondo
kongondo / repeater_example.php
Created June 7, 2013 09:17 — forked from somatonic/repeater_example.php
example repeater creation and save front-end form
<?php
$mypage = $pages->get("/about/");
if($input->post->submit){
$n = 1;
$title = "element_title_$n";
$url = "external_url_$n";
$mypage->setOutputFormatting(false);
<?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");