Changeset 20059 for extensions/Piwecard/include/piwecard.class.php
- Timestamp:
- Jan 11, 2013, 12:44:10 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Piwecard/include/piwecard.class.php
r20047 r20059 27 27 // Initialize default values of params 28 28 private function get_default_config() { 29 require( ECARD_INSTALL_PATH.'default_values.inc.php');29 require(PIWECARD_INSTALL_PATH.'default_values.inc.php'); 30 30 foreach ($ecard_default_values as $key => $value) { 31 31 if (!isset($this->my_config[$key])) … … 66 66 67 67 function parse($data, $_POST = NULL, $image_element = NULL) { 68 include ( ECARD_PATH.'include/config_param.inc.php');68 include (PIWECARD_PATH.'include/config_param.inc.php'); 69 69 70 70 $patterns = array(); … … 80 80 // Get the number of ecard in the database 81 81 function get_nb_ecard() { 82 $query = 'SELECT COUNT(DISTINCT id) AS nb FROM '. ECARD_TABLE.' ORDER BY date_creation;';82 $query = 'SELECT COUNT(DISTINCT id) AS nb FROM '.PIWECARD_TABLE.' ORDER BY date_creation;'; 83 83 $result = pwg_query($query); 84 84 … … 92 92 // Get the number of valid ecard in the database 93 93 function get_nb_valid_ecard() { 94 $query = 'SELECT COUNT(DISTINCT id) AS nb FROM '. ECARD_TABLE.' WHERE date_validity IS NULL OR date_validity > NOW();';94 $query = 'SELECT COUNT(DISTINCT id) AS nb FROM '.PIWECARD_TABLE.' WHERE date_validity IS NULL OR date_validity > NOW();'; 95 95 $result = pwg_query($query); 96 96 … … 106 106 function get_ecard($ecard_id = null) { 107 107 if ($ecard_id!== null) { 108 $query = 'SELECT * FROM ' . ECARD_TABLE .' WHERE id ="' . $ecard_id . '" LIMIT 1;';108 $query = 'SELECT * FROM ' . PIWECARD_TABLE .' WHERE id ="' . $ecard_id . '" LIMIT 1;'; 109 109 110 110 $result = pwg_query($query); … … 144 144 function delete_ecard($ecard_id = null) { 145 145 if (isset($ecard_id)) { 146 $query = 'DELETE FROM ' . ECARD_TABLE .' WHERE id="' . $ecard_id . '";';146 $query = 'DELETE FROM ' . PIWECARD_TABLE .' WHERE id="' . $ecard_id . '";'; 147 147 pwg_query($query); 148 148 } else … … 152 152 // Delete all invalid ecard 153 153 function delete_allinvalid_ecard() { 154 $query = 'DELETE FROM ' . ECARD_TABLE .' WHERE date_validity < NOW();';154 $query = 'DELETE FROM ' . PIWECARD_TABLE .' WHERE date_validity < NOW();'; 155 155 pwg_query($query); 156 156 } … … 223 223 // Template informations 224 224 $template->assign('ecard', array( 225 ' subject' => l10n('piwecard_subject'),225 'title' => l10n('Title'), 226 226 'message' => l10n('piwecard_message'), 227 227 'sender_name' => $user['username'], … … 249 249 $template->append('ecard_email_format', array( 250 250 'id' => $email_format, 251 'name' => l10n('piwecard_ mail_format_'.$email_format),251 'name' => l10n('piwecard_email_format_'.$email_format), 252 252 'selected' => (($this->my_config['email_format_default'] == $email_format) ? '' : 'checked'), 253 253 ) … … 290 290 'sender_email' => $_POST['ecard_sender_email'], 291 291 'recipient_email' => $_POST['ecard_recipient_email'], 292 ' subject' => $_POST['ecard_subject'],292 'title' => $_POST['ecard_title'], 293 293 'message' => $_POST['ecard_message'], 294 294 'image' => $image_element['id'], … … 300 300 $insert['date_validity'] = $date->format('Y-m-d H:i:s'); 301 301 } 302 single_insert( ECARD_TABLE, $insert);302 single_insert(PIWECARD_TABLE, $insert); 303 303 304 304 // Complete the image_element array with Link for the ecard url to be added in the mail … … 352 352 } 353 353 354 $template->set_filenames(array('ecard_template' => ECARD_ROOT.'/template/ecard.tpl'));354 $template->set_filenames(array('ecard_template' => PIWECARD_ROOT.'/template/ecard.tpl')); 355 355 $template->concat('COMMENT_IMG', $template->parse('ecard_template', true)); 356 356 }
Note: See TracChangeset
for help on using the changeset viewer.