Skip to content

Commit

Permalink
correct version 11.8
Browse files Browse the repository at this point in the history
git-svn-id: https://plugins.svn.wordpress.org/cforms2/tags/11.8@1008331 b8457f37-d9ea-0310-8a92-e5e31aec5664
  • Loading branch information
bgermann committed Oct 16, 2014
1 parent 143278a commit 6484266
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 37 deletions.
14 changes: 12 additions & 2 deletions ____HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
=====================================================================================
License:
=====================================================================================
Copyright 2007, 2008, 2009 OLIVER SEIDEL (email : oliver.seidel @ deliciousdays.com)
Copyright 2007-2011 OLIVER SEIDEL (email : oliver.seidel @ deliciousdays.com)

This program is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software Foundation,
Expand All @@ -15,7 +15,6 @@
You should have received a copy of the GNU General Public License along with this
program. If not, see <http://www.gnu.org/licenses/>.


=====================================================================================
Donation Page:
=====================================================================================
Expand All @@ -26,6 +25,17 @@
Version History:
=====================================================================================


PLEASE NOTE: BEFORE INSTALLING V11.8 MAKE A BACKUP OF YOUR CFORMS.JS FILE, AS THE PATH
INFORMATION & DECLARATION HAS CHANGED!


WHAT's NEW in cformsII - v11.8
*) bugfix: fixing PHP's issue with uksort()
*) bugfix: upload fields in forms could cause hang ups when submitted from iphone/ipad
*) other: enhanced path determination in cforms.js, should help to avoid issues going forward
*) other: session check in cforms.php to better support existing sessions (shopping carts etc)

WHAT's NEW in cformsII - v11.7.3
*) bugfix: stalling of upload forms fixed (or ones with alternative form action)

Expand Down
2 changes: 1 addition & 1 deletion ____LICENSE_CREDITS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
======================================================================================
License:
======================================================================================
Copyright 2007, 2008, 2009 OLIVER SEIDEL (email : oliver.seidel @ deliciousdays.com)
Copyright 2007-2011 OLIVER SEIDEL (email : oliver.seidel @ deliciousdays.com)

This program is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software Foundation,
Expand Down
13 changes: 11 additions & 2 deletions cforms.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
Plugin URI: http://www.deliciousdays.com/cforms-plugin
Description: cformsII offers unparalleled flexibility in deploying contact forms across your blog. Features include: comprehensive SPAM protection, Ajax support, Backup & Restore, Multi-Recipients, Role Manager support, Database tracking and many more. Please see ____HISTORY.txt for <strong>what's new</strong> and current <strong>bugfixes</strong>.
Author: Oliver Seidel
Version: 11.7.3
Version: 11.8
Author URI: http://www.deliciousdays.com
*/

global $localversion;
$localversion = '11.7.3';
$localversion = '11.8';

### debug messages
$cfdebug = false;
Expand Down Expand Up @@ -102,11 +102,20 @@ function cforms_scripts_corrupted(){

### session control for multi-page form
add_action('template_redirect', 'start_cforms_session');
/*
function start_cforms_session() {
@session_cache_limiter('private, must-revalidate');
@session_cache_expire(0);
@session_start();
}
*/
function start_cforms_session() {
@session_cache_limiter('private, must-revalidate');
@session_cache_expire(0);
if (!isset($_SESSION)){
@session_start();
}
}



Expand Down
10 changes: 8 additions & 2 deletions js/cforms.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 47 additions & 27 deletions lib_aux.php
Original file line number Diff line number Diff line change
Expand Up @@ -600,18 +600,32 @@ function outputRSS() {
global $cfdata, $cfsort, $cfsortdir;

function get_cforms_entries($fname=false,$from=false,$to=false,$s=false,$limit=false,$sd='asc') {
global $wpdb, $cformsSettings, $cfdata, $cfsort, $cfsortdir;
global $wpdb, $cformsSettings, $cfdataTMP, $cfsort, $cfsortdir;

//unify
if( $s=='date' || $s=='timestamp' )
$s = 'sub_date';

if( $s=='date' )
$s = 'timestamp';
//set limit
$limit = ($limit && $limit<>'')?'LIMIT 0,'.$limit:'';

$cfdata = array();
$cfsort=$s;
$cfsortdir=$sd;

$ORDER_1 = $cfsort = '';
if( in_array($s,array('id','form','timestamp','email','ip')) )
$ORDER_1 = "ORDER BY " . $s . ' ' . $sd;
else{
$ORDER_1 = "ORDER BY id DESC";
$cfsort = $s;
}

$fname_in = '';
//SORT
$cfdata = array();
$cfsortdir = $sd;

//GENERAL WHERE
$where = false;

$fname_in = '';
for ($i=1; $i <= $cformsSettings['global']['cforms_formcount']; $i++){
$n = ( $i==1 )?'':$i;
$fnames[$i]=stripslashes($cformsSettings['form'.$n]['cforms'.$n.'_fname']);
Expand All @@ -624,13 +638,19 @@ function get_cforms_entries($fname=false,$from=false,$to=false,$s=false,$limit=f
$where .= $from?($where?' AND':'')." sub_date > '$from'":'';
$where .= $to?($where?' AND':'')." sub_date < '$to'":'';
$where = $where?'WHERE'.$where:'';

$limit = ($limit && $limit<>'')?'LIMIT 0,'.$limit:'';

//

$in = '';
$sql = "SELECT *, UNIX_TIMESTAMP(sub_date) as rawdate FROM {$wpdb->cformssubmissions} $where $limit";

$sql = "SELECT *, UNIX_TIMESTAMP(sub_date) as rawdate FROM {$wpdb->cformssubmissions} $where $ORDER_1 $limit";
$all = $wpdb->get_results($sql);

/*
echo '<br> >>'.$sql;
echo '<br><pre>'.print_r($all,1).'</pre>';
die();
*/

foreach ( $all as $d ){
$in = $in . $d->id . ',';
$n = ( $d->form_id=='' )?1:$d->form_id;
Expand All @@ -649,7 +669,6 @@ function get_cforms_entries($fname=false,$from=false,$to=false,$s=false,$limit=f
$sql = "SELECT * FROM {$wpdb->cformsdata} WHERE $where";
$all = $wpdb->get_results($sql);


$offsets = array();
foreach ( $all as $d ){

Expand All @@ -666,31 +685,32 @@ function get_cforms_entries($fname=false,$from=false,$to=false,$s=false,$limit=f

}

if ( $cfsort <> '' )
if ( $cfsort <> '' ){
$cfdataTMP = $cfdata;
uksort ($cfdata, "cf_sort");

}
return $cfdata;
}



function cf_sort( $a,$b ){
global $cfdata, $cfsort, $cfsortdir;

global $cfdataTMP, $cfsort, $cfsortdir;

if (!is_array($a) && !is_array($b)){

if( $cfdata[$a][$cfsort]<>'' && $cfdata[$b][$cfsort]<>'' ){
$na = $cfdata[$a][$cfsort];
$nb = $cfdata[$b][$cfsort];
}else if ( $cfdata[$a]['data'][$cfsort]<>'' && $cfdata[$b]['data'][$cfsort]<>'' ){
$na = $cfdata[$a]['data'][$cfsort];
$nb = $cfdata[$b]['data'][$cfsort];
}
else
return 0;


$na = ($cfdataTMP[$a]['data'][$cfsort]<>'') ? $cfdataTMP[$a]['data'][$cfsort]:false;
$nb = ($cfdataTMP[$b]['data'][$cfsort]<>'') ? $cfdataTMP[$b]['data'][$cfsort]:false;

if ( !($na && $nb) ){
//echo "err: ($a=$naD) :: ($b=$nbD)<br>";
if ( !$na ) return 1;
if ( !$nb ) return -1;
return 0;
}
}

//echo "($a=$na) :: ($b=$nb)<br>";

$tmpA=(int)trim($na);
$tmpB=(int)trim($nb);
Expand Down
3 changes: 2 additions & 1 deletion lib_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ function cforms_init() {
}

### try to adjust cforms.js automatically
/*
$jsContent = $jsContentNew = '';
if ( $fhandle = fopen(dirname(__FILE__).'/js/cforms.js', "r") ) {
$jsContent = fread($fhandle, filesize(dirname(__FILE__).'/js/cforms.js'));
Expand All @@ -185,7 +186,7 @@ function cforms_init() {
fwrite($fhandle, $jsContentNew);
fclose($fhandle);
}

*/
### save ABSPATH for ajax routines
if ( defined('ABSPATH') && ($fhandle = fopen(dirname(__FILE__).$sep.'abspath.php', "w")) ) {
fwrite($fhandle, "<?php \$abspath = '". addslashes(ABSPATH) . "'; ?>\n");
Expand Down
8 changes: 6 additions & 2 deletions lib_nonajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,12 @@
}
else if ( $field_type == "upload" ){

### $fsize = $file['size'][$filefield]/1000;
$value = str_replace(' ','_',$file['name'][$filefield++]);
if ( is_array($file) && is_array($file['name']) ) {
### $fsize = $file['size'][$filefield]/1000;
$value = str_replace(' ','_',$file['name'][$filefield++]);
}else{
$value = '';
}

}
else if ( $field_type == "multiselectbox" || $field_type == "checkboxgroup"){
Expand Down

0 comments on commit 6484266

Please sign in to comment.