Topic RSS
12:42 pm
Hello,
I have added some code to your plugin as it is licensed under GNU GPL i though i would shear it in the hope you add it to the package as i could see loads of users finding this helpfull,
js/include/lib_database_overview.php
line 58
Remove
$where = ''
Replace with
if(isset($_GET['form_id'])){
$where = "WHERE form_id = '".$_GET['form_id']."'";
if($_GET['form_id'] == '*'){
$where = "";
}
}
cforms-database.php
line 31
Add
### get the form names
$fnames = array();for ($i=1; $i <= $cformsSettings['global']['cforms_formcount']; $i++){
$n = ( $i==1 )?'':$i;
$fnames[$i]=stripslashes($cformsSettings['form'.$n]['cforms'.$n.'_fname']);
}
line 46
Add
<p><form action="/wp-admin/admin.php?page=cforms/cforms-database.php" method="post">
<?php _e('If you\'re wanting results from one form please select the form name:', 'cforms'); ?> <select onchange="this.form.submit();" name="form_id">
<option value="*">Show All</option>
<?php foreach($fnames as $key => $val): ?>
<option <?php if($_POST['form_id'] == $key) echo 'selected="selected"'; ?> value="<?php echo $key ?>"><?php echo $val ?></option>
<?php endforeach; ?>
</select>
</form>
</p>
Line 70
Remove
url: '<?php echo $cforms_root.'/js/include/lib_database_overview.php'; ?>',
Replace with
url: '<?php echo $cforms_root.'/js/include/lib_database_overview.php'; ?>?form_id=<?php echo ($_POST['form_id'] == '1')? ' ': $_POST['form_id']; ?>',
And that's it all done it will then give an option for you select any of the forms you have created
2:19 pm
Hello again,
Added a little update to my code changes so a when you click the download it will only download the results for the form you have selected.
Admin if you could confirm if your going to add my changes to the currently live version or if i'm ok to create a fork and add my code in there?
Updated the cformsadmin.js to allow the form_id to be passed to the download scripts please download updated file here: http://www.mediafire.com/?ad1v4960k7dded1
lib_database_getentries.php
Replace
else
$where = "";
With
if(isset($_REQUEST['form_id'])){
$where = ($_REQUEST['form_id'] == "1")? "AND form_id = ' '":"AND form_id = '".$_REQUEST['form_id']."'";
if($_REQUEST['form_id'] == '*'){
$where = "";
}
}
cfoms-database.php
Add at line: 153
<input id="formID" type="hidden" name="form_id" value="" />
4:25 pm
February 10, 2009
OfflineThanks for the code contribution!
What strikes me is that form based download of records has been working forever, so on first sight, I'm not sure what your code adds.
I'll take a look at it and will pass it on to Oliver to include it in the next version if it indeed adds functionality that's not already built in.
P.
12:25 pm
I have added it to the tracking as i could not find out how to get the per form download and i needed it easily found for my clients so i built it into the tracking page so that the results can be found from one page
On another note where can i get the result's for an single form so it can be downloaded as CSV?
1:41 pm
February 10, 2009
OfflineMartin, not sure what cforms version you've been working on, but the tracking page really hasn't changed in prob a year or so.
The tracking page that displays all form submission offers filters for date, email address and form name. Once you set a filter and then simply click download, you'll get all submissions based on the filter set.
P.
9:16 am
Where is this filters system then i'm using the current cforms according to WordPress
This is my tracking page, the red block is what my code adds to cforms, there is no filter on the page before my code,
There are the options what what columns to show in the Table View and Ordering the results,
As for getting only the Data from 1 form i can not see a way of doing it
9:47 am
February 10, 2009
OfflineIt's simple :-)
To the left of the "30" you see a zoom/magnifier icon, click that and it opens your filter options.
P.
Most Users Ever Online: 959
Currently Online:
58 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
tracedef: 43
mores: 21
Gyrus: 20
frozenwaste: 18
asuffredini: 15
photoworks: 14
Member Stats:
Guest Posters: 3566
Members: 1464
Moderators: 3
Admins: 1
Forum Stats:
Groups: 1
Forums: 4
Topics: 5171
Posts: 18411
Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass
Moderators: Paul (421), cnymike (8), sonika (95)
Administrators: Oliver (6398)
FAQs
Home
Add Reply
Add Topic
Quote










