// Set the view file
$view = 'photosValidate.html';
$fileData = '<pre>$_FILES: ' . print_r( $_FILES, true ) . '</pre>';
+ $clearData = ( filter_var( $_REQUEST['clear_data'], FILTER_VALIDATE_BOOLEAN ) );
break;
// Set the view file
$view = 'filesValidate.html';
$fileData = '<pre>$_FILES: ' . print_r( $_FILES, true ) . '</pre>';
+ $clearData = ( filter_var( $_REQUEST['clear_data'], FILTER_VALIDATE_BOOLEAN ) );
break;
case 'photosProcess':
+ if ( $clearData ) {
+ // Empty the tables for the member data.
+ // Not including the management options.
+ $this->wpdb->query('DELETE FROM ' . GLM_MEMBERS_PLUGIN_DB_PREFIX . 'images');
+ }
// Setup the image processing
require_once GLM_MEMBERS_PLUGIN_PATH . '/models/admin/ajax/imageUpload.php';
$ImageUpload = new GlmMembersAdmin_ajax_imageUpload($this->wpdb, $this->config);
break;
case 'filesProcess':
+ if ( $clearData ) {
+ // Empty the tables for the member data.
+ // Not including the management options.
+ $this->wpdb->query('DELETE FROM ' . GLM_MEMBERS_PLUGIN_DB_PREFIX . 'files');
+ }
// Setup the file processing
require_once GLM_MEMBERS_PLUGIN_PATH . '/models/admin/ajax/fileUpload.php';
$FileUpload = new GlmMembersAdmin_ajax_fileUpload($this->wpdb, $this->config);
{/if}
</td>
</tr>
+
+ {if $clearData}
+ <tr>
+ <td colspan="2">
+ All Member Files Data will be cleared before importing any files.
+ </td>
+ </tr>
+ {else}
+ <tr>
+ <td colspan="2">
+ No Member Files Data will not be cleared before importing any files. No attempts will be made to prevent duplication of members.
+ </td>
+ </tr>
+ {/if}
{if $readyToProcess}
<tr>
<td colspan="2">
- <a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=filesProcess" class="button">Process Files</a>
+ <a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=filesProcess{if $clearData}&clear_data=1{/if}" class="button">Process Files</a>
</td>
</tr>
{/if}
{/if}
</td>
</tr>
+
+ {if $clearData}
+ <tr>
+ <td colspan="2">
+ All Member Photo Data will be cleared before importing any files.
+ </td>
+ </tr>
+ {else}
+ <tr>
+ <td colspan="2">
+ No Member Photo Data will not be cleared before importing any files. No attempts will be made to prevent duplication of members.
+ </td>
+ </tr>
+ {/if}
+
{if $readyToProcess}
<tr>
<td colspan="2">
- <a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=photosProcess" class="button">Process Photos</a>
+ <a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=photosProcess{if $clearData}&clear_data=1{/if}" class="button">Process Photos</a>
</td>
</tr>
{/if}