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 download{ | |
public function startDownload( $vFilePath, $vDownloadName=""){ | |
$vFilename = basename( $vFilePath); | |
$vNewFilename = $vDownloadName == "" ? $vFilename : $vDownloadName; | |
$vFileType = $this->getFileType( $vFilename); | |
$vContentType = $this->GetContentType( $vFileType); | |
// Fix IE bug [0] |
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 | |
/** | |
* ProcessWire PageReferenceLink | |
* | |
* @author Soma philipp(at)urlich.ch | |
* | |
* | |
* ProcessWire 2.x | |
* Copyright (C) 2010 by Ryan Cramer |
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 | |
/** | |
* ProcessWire Module FieldHelper | |
* | |
* | |
* ProcessWire 2.x | |
* Copyright (C) 2010 by Ryan Cramer | |
* Licensed under GNU/GPL v2, see LICENSE.TXT | |
* |
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
(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 | |
// 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 |