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 | |
// include("./head.inc"); | |
/** | |
* Script Example | |
* | |
* This script generates a prev next pagination to show posts per day of a specified date | |
* The category is set by the first url segment the date in the second |
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 | |
/* | |
* as per http://processwire.com/talk/topic/2928-pagination-by-date/ | |
* list posts by day, show prev next day if any posts found | |
* | |
* - posts have a date field "publish_from" | |
* with no time selection but only days | |
* this will save the timestamp of today 00:00 (starting) so we can simply | |
* use "publish_from=$prevday" in selectors |
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 | |
// get a page | |
$editpage = $pages->get("/editme/"); | |
$ignorefields = array("isOld","language_published"); | |
$form = $modules->get("InputfieldForm"); | |
$form->method = 'post'; | |
$form->action = './'; |
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 | |
class TextDomainHelper extends Wire implements Module { | |
public static function getModuleInfo() { | |
return array( | |
'title' => 'TextDomainHelper', | |
'version' => 1, |
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 | |
class MapPageField extends WireData implements Module{ | |
public static function getModuleInfo(){ | |
return array( | |
'title' => 'MapPageField', | |
'version' => 100, | |
'singular' => true, | |
'autoload' => true |
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
(function($){ | |
$(function(){ | |
$('textarea[data-maxlength]').each(function(){ | |
$(this).bind("keyup change", function(){ | |
var count = $(this).attr('data-maxlength') - $(this).val().replace(/\r?\n/g, '\r\n').length; | |
$(this).parent().find("span.counter span").text(count); | |
}); | |
}); |
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 | |
// start module to textarea counter | |
class TextAreaCounter extends WireData implements Module { | |
//const default_maxlength = 255; | |
/** | |
* getModuleInfo is a module required by all modules to tell ProcessWire about them |
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 | |
// front-end form example with multiple images upload | |
// add new page created on the fly and adding images | |
$message = ''; | |
if($input->post->submit){ | |
// tmp upload folder for additional security |
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 | |
$out = ''; | |
// create a new form field (also field wrapper) | |
$form = $modules->get("InputfieldForm"); | |
$form->action = "./"; | |
$form->method = "post"; | |
$form->attr("id+name",'subscribe-form'); |