Changeset 20010
- Timestamp:
- Jan 8, 2013, 10:48:14 PM (11 years ago)
- Location:
- extensions/Piwecard
- Files:
-
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Piwecard/admin/admin_consult.php
r19968 r20010 4 4 global $template, $page; 5 5 6 $ ecard = get_plugin_data($plugin_id);6 $piwecard = get_plugin_data($plugin_id); 7 7 8 8 $start = (isset($_GET['start']) ? $_GET['start'] : 0); 9 9 // Verify if the previous action is delete the last ecard on a page, go to first page 10 if ($start != 0 and $ ecard->get_nb_ecard() == $ecard->my_config['nb_ecard_page'])10 if ($start != 0 and $piwecard->get_nb_ecard() == $piwecard->my_config['nb_ecard_page']) 11 11 $start = 0; 12 12 … … 15 15 case "delete" : 16 16 $ecard_id = $_GET['id']; 17 $ ecard->delete_ecard($ecard_id);17 $piwecard->delete_ecard($ecard_id); 18 18 redirect(ECARD_ADMIN . '-consult&start='.$start); 19 19 break; 20 20 case "delall" : 21 $ ecard->delete_allinvalid_ecard();21 $piwecard->delete_allinvalid_ecard(); 22 22 redirect(ECARD_ADMIN . '-consult'); 23 23 break; … … 31 31 $consult_url = ECARD_ADMIN.'-consult'; 32 32 $ecard_navbar = array(); 33 $ecard_navbar = create_navigation_bar($consult_url, $ ecard->get_nb_ecard(), $start, $ecard->my_config['nb_ecard_page']);33 $ecard_navbar = create_navigation_bar($consult_url, $piwecard->get_nb_ecard(), $start, $piwecard->my_config['nb_ecard_page']); 34 34 35 $query = 'SELECT * FROM '.ECARD_TABLE.' ORDER BY date_creation DESC LIMIT '.$start.','.$ ecard->my_config['nb_ecard_page'].';';35 $query = 'SELECT * FROM '.ECARD_TABLE.' ORDER BY date_creation DESC LIMIT '.$start.','.$piwecard->my_config['nb_ecard_page'].';'; 36 36 $result = pwg_query($query); 37 37 … … 40 40 41 41 // Check if the ecard is valid 42 $valid = $ ecard->is_valid($file['id']);42 $valid = $piwecard->is_valid($file['id']); 43 43 44 44 $template->append('ecard_file',array( … … 58 58 59 59 // Get the number of ecard (total & valid & invalid) 60 $template->assign('nb_ecard_valid', $ ecard->get_nb_valid_ecard());61 $template->assign('nb_ecard', $ ecard->get_nb_ecard());60 $template->assign('nb_ecard_valid', $piwecard->get_nb_valid_ecard()); 61 $template->assign('nb_ecard', $piwecard->get_nb_ecard()); 62 62 63 63 $template->assign('ecard_del_all', $consult_url.'&action=delall' ); -
extensions/Piwecard/admin/admin_manage.php
r19968 r20010 14 14 if (isset($_POST['falsify']) and isset($_POST['cat_true']) and count($_POST['cat_true']) > 0) { 15 15 foreach ($_POST['cat_true'] as $cat) 16 unset($piwecard->my_config[' cats'][array_search($cat, $piwecard->my_config['cats'])]);16 unset($piwecard->my_config['selected_cats'][array_search($cat, $piwecard->my_config['selected_cats'])]); 17 17 $piwecard->save_config(); 18 18 } … … 22 22 $query = 'SELECT id, name, uppercats, global_rank FROM '.CATEGORIES_TABLE.' WHERE id IN ("'.implode('","', $_POST['cat_false']).'");'; 23 23 $result = pwg_query($query); 24 $categories = array();25 24 26 25 if (!empty($result)) { 27 while ($ row= pwg_db_fetch_assoc($result))28 array_push($ categories, $row);26 while ($cat = pwg_db_fetch_assoc($result)) 27 array_push($piwecard->my_config['selected_cats'], $cat['id']); 29 28 } 30 usort($ categories, 'global_rank_compare');29 usort($piwecard->my_config['selected_cats'], 'global_rank_compare'); 31 30 32 if (!empty($result)) {33 foreach ($categories as $cat) {34 array_push($piwecard->my_config['cats'], $cat['id']);35 }36 }37 31 $piwecard->save_config(); 38 32 } 39 33 40 34 if (isset($_POST['submit'])) { 41 $piwecard->my_config['allcats'] = isset($_POST['allcats']); 42 $piwecard->my_config['user_cat'] = isset($_POST['user_cat']); 43 $piwecard->my_config['recursive'] = isset($_POST['recursiv']); 44 if ($piwecard->my_config['groups'] = isset($_POST['groups'])) 45 array_map("mysql_escape_string", $_POST['groups']); 35 $piwecard->my_config['authorizations'] = $_POST['ecard_authorizations']; 36 if (isset($_POST['ecard_selected_cats_recursive']) AND $_POST['ecard_selected_cats_recursive'] == '1') 37 $piwecard->my_config['recursive'] = true; 46 38 else 47 array();39 $piwecard->my_config['recursive'] = false; 48 40 $piwecard->save_config(); 49 41 array_push($page['infos'], l10n('ecard_admin_saveOK')); 50 42 } 51 43 52 // Groups selection 53 $groups = get_all_groups(); 54 if (!empty($groups)) { 55 $template->assign('group_perm', array('GROUPSELECTION' => get_html_groups_selection($groups, 'groups', (isset($piwecard->my_config['groups']) ? $piwecard->my_config['groups'] : array())))); 56 } 57 58 // Test double select wall categories 59 // Categories non prises en compte 60 $query = 'SELECT id, name, uppercats, global_rank FROM '.CATEGORIES_TABLE.' WHERE id not IN ("'.implode('","', $piwecard->my_config['cats']).'");'; 44 //Populate double_select 45 $query = 'SELECT id, name, uppercats, global_rank FROM '.CATEGORIES_TABLE.' WHERE id not IN ("'.implode('","', $piwecard->my_config['selected_cats']).'");'; 61 46 $result = pwg_query($query); 62 47 $categories = array(); … … 73 58 } 74 59 } 75 $template->assign( 76 $template->assign( 60 $template->assign('category_option_false', $tpl); 61 $template->assign('category_option_false_selected', array()); 77 62 78 // Categories prises en compte 79 $query = 'SELECT id, name, uppercats, global_rank FROM '.CATEGORIES_TABLE.' WHERE id IN ("'.implode('","', $piwecard->my_config['cats']).'");'; 63 $query = 'SELECT id, name, uppercats, global_rank FROM '.CATEGORIES_TABLE.' WHERE id IN ("'.implode('","', $piwecard->my_config['selected_cats']).'");'; 80 64 $result = pwg_query($query); 81 65 $categories = array(); 82 if (!empty($result)) 83 { 66 if (!empty($result)) { 84 67 while ($row = pwg_db_fetch_assoc($result)) 85 68 array_push($categories, $row); 86 69 } 87 70 usort($categories, 'global_rank_compare'); 71 88 72 $tpl2 = array(); 89 73 if (!empty($result)) { … … 92 76 } 93 77 } 94 $template->assign( 95 $template->assign( 78 $template->assign('category_option_true', $tpl2); 79 $template->assign('category_option_true_selected', array()); 96 80 97 $template->assign('ECARD_ALLCATS', ($piwecard->my_config['allcats'] ? 'checked="checked"' : '')); 98 $template->assign('ECARD_USERCAT', ($piwecard->my_config['user_cat'] ? 'checked="checked"' : '')); 99 $template->assign('ECARD_RECURSIV', ($piwecard->my_config['recursive'] ? 'checked="checked"' : '')); 81 $template->assign('ecard', array( 82 'all_cats_checked' => (($piwecard->my_config['authorizations'] == 'all_cats') ? 'checked="checked"' : ''), 83 'selected_cats_checked' => (($piwecard->my_config['authorizations'] == 'selected_cats') ? 'checked="checked"' : ''), 84 'selected_cats_recursive_checked' => (($piwecard->my_config['recursive']) ? 'checked="checked"' : ''), 85 'user_cats_checked' => (($piwecard->my_config['authorizations'] == 'user_cats') ? 'checked="checked"' : ''), 86 ) 87 ); 100 88 101 $template->assign(Array( 102 'F_ACTION' => '', 103 'L_CAT_OPTIONS_TRUE' => l10n('To Translate!'), 104 'L_CAT_OPTIONS_FALSE' => l10n('To Translate!'), 105 )); 89 $template->assign(array( 90 'F_ACTION' => '', 91 'L_CAT_OPTIONS_TRUE' => l10n('selected_cats'), 92 'L_CAT_OPTIONS_FALSE' => l10n('non_selected_cats'), 93 ) 94 ); 106 95 107 96 $template->assign_var_from_handle('DOUBLE_SELECT', 'double_select'); 108 $template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content'); 109 110 function get_html_groups_selection($groups, $fieldname, $selecteds = array()) { 111 global $conf; 112 113 if (count ($groups) == 0) { 114 return ''; 115 } 116 117 $output = '<div id="'.$fieldname.'">'; 118 $id = 1; 119 120 foreach ($groups as $group) { 121 $output.= '<input type="checkbox" name="'.$fieldname.'[]" id="group_'.$id++.'" value="'.$group['id'].'"'; 122 123 if (in_array($group['id'], $selecteds)) { 124 $output.= ' checked="checked"'; 125 } 126 127 $output.= '><label> '. $group['name'].'</label>\n'; 128 } 129 $output.= '</div>'; 130 131 return $output; 132 } 133 134 function get_all_groups() { 135 $query = 'SELECT id, name FROM '.GROUPS_TABLE.' ORDER BY name ASC;'; 136 $result = pwg_query($query); 137 138 $groups = array(); 139 while ($row = pwg_db_fetch_assoc($result)) { 140 array_push($groups, $row); 141 } 142 uasort($groups, 'name_compare'); 143 144 return $groups; 145 } 97 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 146 98 ?> -
extensions/Piwecard/admin/admin_params.php
r19926 r20010 4 4 global $template, $page; 5 5 6 $ me= get_plugin_data($plugin_id);6 $piwecard = get_plugin_data($plugin_id); 7 7 8 8 9 9 if (isset($_POST['submit'])) { 10 10 11 $ me->my_config['activ'] = $_POST['ecard_activ'];12 $ me->my_config['send_copy'] = isset($_POST['ecard_sendcopy']);13 $ me->my_config['expmail_change'] = isset($_POST['ecard_modifexpmail']);14 $ me->my_config['send_HTML'] = isset($_POST['ecard_sendhtml']);15 $ me->my_config['ecard_showinfos'] = isset($_POST['ecard_showinfos']);16 $ me->my_config['nb_ecard_page'] = $_POST['ecard_nb_page'];11 $piwecard->my_config['validity_default'] = $_POST['ecard_activ']; 12 $piwecard->my_config['sender_copy'] = isset($_POST['ecard_sender_copy']); 13 $piwecard->my_config['sender_email_change'] = isset($_POST['ecard_modifexpmail']); 14 $piwecard->my_config['email_format'] = isset($_POST['ecard_sendhtml']); 15 $piwecard->my_config['show_image_infos'] = isset($_POST['ecard_showinfos']); 16 $piwecard->my_config['nb_ecard_page'] = $_POST['ecard_nb_page']; 17 17 18 $ me->my_config['defaultmail'] = $_POST['defaultmail'];18 $piwecard->my_config['default_guest_email'] = $_POST['defaultmail']; 19 19 20 20 21 $ me->my_config['subject_link'] = htmlspecialchars($_POST['ecard_subject_link']);22 $ me->my_config['message_link'] = htmlspecialchars($_POST['ecard_message_link']);23 $ me->my_config['message_HTML'] = stripslashes($_POST['ecard_message_html']);24 $ me->save_config();21 $piwecard->my_config['email_subject'] = htmlspecialchars($_POST['ecard_subject_link']); 22 $piwecard->my_config['email_text'] = htmlspecialchars($_POST['ecard_message_link']); 23 $piwecard->my_config['email_html'] = stripslashes($_POST['ecard_message_html']); 24 $piwecard->save_config(); 25 25 array_push($page['infos'], l10n('ecard_admin_saveOK')); 26 26 27 27 } 28 28 29 $template->append('ECARD_ACTIV',array('ID' => 0,'NAME' => l10n('ecard_nolimit'),'SELECTED' => ($me->my_config['activ'] == 0 ? 'selected' : ''))); 30 31 for($jj=5; $jj < 30; $jj+=5) 32 { 33 $template->append('ECARD_ACTIV',array('ID' => $jj,'NAME' => $jj.' '.l10n('ecard_days'),'SELECTED' => ($me->my_config['activ'] == $jj ? 'selected' : ''))); 29 foreach($piwecard->my_config['validity'] as $validity) { 30 $template->append('ECARD_ACTIV', array( 31 'ID' => $validity, 32 'NAME' => ($validity == 0) ? l10n('ecard_nolimit') : $validity.' '.l10n('ecard_days'), 33 'SELECTED' => ($piwecard->my_config['validity_default'] == $validity ? 'selected' : '') 34 ) 35 ); 34 36 } 35 37 36 38 for($jj=1; $jj < 20; $jj++) 37 $template->append('ECARD_NB_PAGE',array('ID' => $jj,'NAME' => $jj,'SELECTED' => ($ me->my_config['nb_ecard_page'] == $jj ? 'selected' : '')));39 $template->append('ECARD_NB_PAGE',array('ID' => $jj,'NAME' => $jj,'SELECTED' => ($piwecard->my_config['nb_ecard_page'] == $jj ? 'selected' : ''))); 38 40 39 41 40 $template->assign('ECARD_SENDCOPY', $ me->my_config['send_copy'] ? 'checked="checked"' : '');41 $template->assign('ECARD_MODIFEXPMAIL', $ me->my_config['expmail_change'] ? 'checked="checked"' : '');42 $template->assign('ECARD_SENDHTML', $me->my_config['send_HTML']? 'checked="checked"' : '');43 $template->assign('ECARD_SHOWINFOS', $ me->my_config['ecard_showinfos'] ? 'checked="checked"' : '');42 $template->assign('ECARD_SENDCOPY', $piwecard->my_config['sender_copy'] ? 'checked="checked"' : ''); 43 $template->assign('ECARD_MODIFEXPMAIL', $piwecard->my_config['sender_email_change'] ? 'checked="checked"' : ''); 44 $template->assign('ECARD_SENDHTML', ($piwecard->my_config['email_format'] == 'html') ? 'checked="checked"' : ''); 45 $template->assign('ECARD_SHOWINFOS', $piwecard->my_config['show_image_infos'] ? 'checked="checked"' : ''); 44 46 45 $template->assign('ECARD_DEFAULT_MAIL', $ me->my_config['defaultmail']);47 $template->assign('ECARD_DEFAULT_MAIL', $piwecard->my_config['default_guest_email']); 46 48 47 $template->assign('ECARD_SUBJECT_LINK', htmlspecialchars_decode($ me->my_config['subject_link']));48 $template->assign('ECARD_MESSAGE_LINK', htmlspecialchars_decode($ me->my_config['message_link']));49 $template->assign('ECARD_MESSAGE_HTML', htmlspecialchars_decode($ me->my_config['message_HTML']));49 $template->assign('ECARD_SUBJECT_LINK', htmlspecialchars_decode($piwecard->my_config['email_subject'])); 50 $template->assign('ECARD_MESSAGE_LINK', htmlspecialchars_decode($piwecard->my_config['email_text'])); 51 $template->assign('ECARD_MESSAGE_HTML', htmlspecialchars_decode($piwecard->my_config['email_html'])); 50 52 51 53 // Use FCK Editor -
extensions/Piwecard/admin/template/admin_consult.tpl
r19956 r20010 5 5 <legend>{'ecard_list'|@translate}</legend> 6 6 <div id="ECardAdminConsult"> 7 <div class="ecard_first_line">8 {'ecard_list'|@translate} [{$nb_ecard_valid} {'valid'|@translate} / {$nb_ecard} {'total'|@translate}]9 <a href="{$ecard_del_all}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');" title="{'ecard_delete_all'|@translate}">10 {'ecard_delete_all'|@translate}11 <img src="{$themeconf.admin_icon_dir}/delete.png" alt="{'ecard_delete_all'|@translate}"/>12 </a>13 </div>14 7 {if count($ecard_file)} 8 <div class="ecard_first_line"> 9 {'ecard_list'|@translate} [{$nb_ecard_valid} {'valid'|@translate} / {$nb_ecard} {'total'|@translate}] 10 <a href="{$ecard_del_all}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');" title="{'ecard_delete_all'|@translate}"> 11 {'ecard_delete_all'|@translate} 12 <img src="{$themeconf.admin_icon_dir}/delete.png" alt="{'ecard_delete_all'|@translate}"/> 13 </a> 14 </div> 15 15 <table class="table2" width="97%"> 16 16 <thead> -
extensions/Piwecard/admin/template/admin_manage.tpl
r19968 r20010 22 22 <h2>{'ecard'|@translate}</h2> 23 23 </div> 24 <form method="post" action="" class="properties" ENCTYPE="multipart/form-data">25 < fieldset>26 < legend>{'ecard_manage'|@translate}</legend>27 <div id="ECardAdminManage">28 <div >29 <input type="radio" name="ecard_ manage" id="ecard_user_cats" value="ecard_user_cats" {$ecard.user_cats} /><label for="ecard_user_cats">{'ecard_active_user_cat'|@translate}</label><br />24 <form method="post" action="" class="properties"> 25 <div id="ECardAdminManage"> 26 <fieldset> 27 <legend>{'ecard_manage'|@translate}</legend> 28 <div class="ecard_radio"> 29 <input type="radio" name="ecard_authorizations" id="ecard_all_cats" value="all_cats" {$ecard.all_cats_checked} /><label for="ecard_all_cats"> {'ecard_active_all_cats'|@translate}</label> 30 30 </div> 31 <div> 32 <input type="radio" name="ecard_manage" id="ecard_all_cats" value="ecard_all_cats" {$ecard.all_cats} /><label for="ecard_all_cats">{'ecard_active_all_cats'|@translate}</label><br /> 33 </div> 34 <div> 35 <input type="radio" name="ecard_manage" id="ecard_selected_cats" value="ecard_selected_cats" {$ecard.selected_cats}><label for="ecard_selected_cats">{'ecard_active_spec_cats'|@translate}</label><br /> 31 <div class="ecard_radio"> 32 <input type="radio" name="ecard_authorizations" id="ecard_selected_cats" value="selected_cats" {$ecard.selected_cats_checked}><label for="ecard_selected_cats"> {'ecard_active_spec_cats'|@translate}</label> 36 33 <div id="ecard_selected_cats_options"> 37 <input type="checkbox" name="ecard_selected_cats_recursive" id="ecard_selected_cats_recursive" {$ecard.selected_cats_recursive} /><label for="ecard_selected_cats_recursive">{'ecard_recursive'|@translate}</label><br />34 <input type="checkbox" name="ecard_selected_cats_recursive" id="ecard_selected_cats_recursive" value="1" {$ecard.selected_cats_recursive_checked} /><label for="ecard_selected_cats_recursive"> {'ecard_recursive'|@translate}</label><br /> 38 35 <div id="ecard_cat_select"> 39 36 {$DOUBLE_SELECT} … … 41 38 </div> 42 39 </div> 43 <div >44 <input type=" submit" name="submit" value="{'Submit'|@translate}" />40 <div class="ecard_radio"> 41 <input type="radio" name="ecard_authorizations" id="ecard_user_cats" value="user_cats" {$ecard.user_cats_checked} /><label for="ecard_user_cats"> {'ecard_active_user_cat'|@translate}</label> 45 42 </div> 43 </fieldset> 44 <div id="ecard_submit"> 45 <input type="submit" name="submit" value="{'Submit'|@translate}" /> 46 46 </div> 47 </ fieldset>47 </div> 48 48 </form> -
extensions/Piwecard/admin/template/admin_params.tpl
r19968 r20010 15 15 </div> 16 16 <div> 17 <input type="checkbox" name="ecard_sendcopy" {$ECARD_SENDCOPY}/> {'ecard_send_copy'|@translate}17 <input type="checkbox" name="ecard_sendcopy" id="ecard_sendcopy" {$ECARD_SENDCOPY}/> <label for="ecard_sendcopy">{'ecard_send_copy'|@translate}</label> 18 18 </div> 19 19 <div> 20 <input type="checkbox" name="ecard_modifexpmail" {$ECARD_MODIFEXPMAIL}/> {'ecard_nomodif_expmail'|@translate}20 <input type="checkbox" name="ecard_modifexpmail" id="ecard_modifexpmail" {$ECARD_MODIFEXPMAIL}/> <label for="ecard_modifexpmail">{'ecard_nomodif_expmail'|@translate}</label> 21 21 </div> 22 22 <div> 23 <input type="checkbox" name="ecard_sendhtml" {$ECARD_SENDHTML}/> {'ecard_send_HTML'|@translate}23 <input type="checkbox" name="ecard_sendhtml" id="ecard_sendhtml" {$ECARD_SENDHTML}/> <label for="ecard_sendhtml">{'ecard_send_HTML'|@translate}</label> 24 24 </div> 25 25 <div> 26 <input type="checkbox" name="ecard_showinfos" {$ECARD_SHOWINFOS}/> {'ecard_show_infos'|@translate}26 <input type="checkbox" name="ecard_showinfos" id="ecard_showinfos" {$ECARD_SHOWINFOS}/> <label for="ecard_showinfos">{'ecard_show_infos'|@translate}</label> 27 27 </div> 28 28 <div> 29 {'ecard_admin_nb_page'|@translate} 29 {'ecard_admin_nb_page'|@translate}</label> 30 30 <select id="ecard_nb_page" name="ecard_nb_page"> 31 31 {foreach from=$ECARD_NB_PAGE item=ECARD_NB_PAGE} … … 35 35 </div> 36 36 <div> 37 {'ecard_default_mail'|@translate}37 <label for="defaultmail">{'ecard_default_mail'|@translate} 38 38 <input type="text" maxlength="50" size="50" name="defaultmail" id="defaultmail" value="{$ECARD_DEFAULT_MAIL}" /> 39 39 </div> … … 42 42 <fieldset> 43 43 <legend>{'ecard_mail_config'|@translate}</legend> 44 </br> 45 <ul> 46 <li> 47 <span class="property"> 44 <div> 48 45 <label for="ecard_subject_link">{'ecard_subject_link'|@translate}</label> 49 </span> 50 <input type="text" maxlength="255" size="50" name="ecard_subject_link" id="ecard_subject_link" value="{$ECARD_SUBJECT_LINK}" /> 51 </li> 52 <li> 53 54 <span class="property"> 55 <label for="page_banner">{'ecard_message_link'|@translate}</label> 56 </span> 57 <textarea name="ecard_message_link" id="ecard_message_link" rows="10" cols="50" style="width:100%; height: 150px;">{$ECARD_MESSAGE_LINK}</textarea> 58 </li> 59 <li> 60 61 <span class="property"> 62 <label for="page_banner">{'ecard_message_html'|@translate}</label> 63 </span> 64 <textarea name="ecard_message_html" id="ecard_message_html" rows="10" cols="50" style="width:100%; height: 200px;">{$ECARD_MESSAGE_HTML}</textarea> 65 </li> 66 <p><div align="left"> 67 <small>{'ecard_parameters'|@translate}<small> 68 </div></p> 69 </ul> 70 46 <input type="text" maxlength="255" size="50" name="ecard_subject_link" id="ecard_subject_link" value="{$ECARD_SUBJECT_LINK}" /> 47 </div> 48 <div> 49 <label for="ecard_message_link">{'ecard_message_link'|@translate}</label> 50 <textarea name="ecard_message_link" id="ecard_message_link" rows="10" cols="50" style="width:100%; height: 150px;">{$ECARD_MESSAGE_LINK}</textarea> 51 </div> 52 <div> 53 <label for="ecard_message_html">{'ecard_message_html'|@translate}</label> 54 <textarea name="ecard_message_html" id="ecard_message_html" rows="10" cols="50" style="width:100%; height: 200px;">{$ECARD_MESSAGE_HTML}</textarea> 55 </div> 56 <div id="ecard_parameters_description"> 57 <div id="ecard_parameters_description_label"> 58 {'ecard_parameters'|@translate}<br /> 59 </div> 60 <div id="ecard_parameters_description_text"> 61 <span class="ecard_parameters_description_parameter">%yourname% : </span><span class="ecard_parameters_description_parameter">{'piwecard_sender_name'|@translate}</span><br /> 62 <span class="ecard_parameters_description_parameter">%youremail% : </span><span class="ecard_parameters_description_parameter">{'piwecard_sender_email'|@translate}</span><br /> 63 <span class="ecard_parameters_description_parameter">%recipientname% : </span><span class="ecard_parameters_description_parameter">{'piwecard_recipient_name'|@translate}</span><br /> 64 <span class="ecard_parameters_description_parameter">%recipientemail% : </span><span class="ecard_parameters_description_parameter">{'piwecard_recipient_email'|@translate}</span><br /> 65 <span class="ecard_parameters_description_parameter">%website% : </span><span class="ecard_parameters_description_parameter">{'piwecard_website'|@translate}</span><br /> 66 <span class="ecard_parameters_description_parameter">%websiteurl% : </span><span class="ecard_parameters_description_parameter">{'piwecard_website_url'|@translate}</span><br /> 67 <span class="ecard_parameters_description_parameter">%ecardurl% : </span><span class="ecard_parameters_description_parameter">{'piwecard_ecard_url'|@translate}</span><br /> 68 <span class="ecard_parameters_description_parameter">%ecardsubject% : </span><span class="ecard_parameters_description_parameter">{'piwecard_ecard_email_subject'|@translate}</span><br /> 69 <span class="ecard_parameters_description_parameter">%ecardmessage% : </span><span class="ecard_parameters_description_parameter">{'piwecard_ecard_email_message'|@translate}</span><br /> 70 <span class="ecard_parameters_description_parameter">%pictureurl% : </span><span class="ecard_parameters_description_parameter">{'piwecard_ecard_image_url'|@translate}</span><br /> 71 <span class="ecard_parameters_description_parameter">%pictureinfos% : </span><span class="ecard_parameters_description_parameter">{'piwecard_ecard_image_infos'|@translate}</span> 72 </div> 73 </div> 71 74 </fieldset> 72 75 <div> -
extensions/Piwecard/css/admin.css
r19926 r20010 1 #ECardAdminManage .ecard_radio { 2 margin-top: 0.5em; 3 } 4 5 #ECardAdminManage .ecard_radio #ecard_selected_cats_options { 6 margin-left: 5%; 7 margin-right: 5%; 8 margin-top: 1em; 9 } 10 11 #ECardAdminManage h3 { 12 font-size: 1.17em !important; 13 } 14 15 #ECardAdminManage #ecard_submit { 16 text-align: center; 17 margin-bottom: 2em; 18 } 19 20 1 21 #ECardAdminConsult .ecard_first_line { 2 22 text-align: left; -
extensions/Piwecard/include/piwecard.class.php
r19968 r20010 27 27 // Initialize default values of params 28 28 private function load_default_config() { 29 require _once(ECARD_INSTALL_PATH.'default_values.inc.php');29 require(ECARD_INSTALL_PATH.'default_values.inc.php'); 30 30 foreach ($ecard_default_values as $key => $value) { 31 31 if (!isset($this->my_config[$key])) … … 36 36 // Save general configuration to config_database 37 37 function save_config() { 38 $query = 'UPDATE '.CONFIG_TABLE.' SET value="'.pwg_db_real_escape_string(serialize($this->my_config)).'" WHERE param="piwecard";'; 39 $result = pwg_query($query); 40 41 if($result) 42 return true; 43 else 44 return false; 45 } 46 47 48 // Retrieve user groups 49 function get_user_groups() { 50 global $user; 51 52 $query = 'SELECT group_id FROM ' . USER_GROUP_TABLE . ' WHERE user_id=' . $user['id'] . ';'; 53 54 $result = pwg_query($query); 55 while ($row = pwg_db_fetch_assoc($result)) { 56 array_push($this->user_groups, $row['group_id']); 57 } 58 } 59 60 38 conf_update_param('piwecard', pwg_db_real_escape_string(serialize($this->my_config))); 39 } 40 61 41 function section_init_ecard() { 62 42 global $tokens, $page; … … 179 159 function display_ecard_to_picture() { 180 160 global $page, $user, $template; 181 182 // Init user groups183 $this->get_user_groups();184 161 185 162 // Only on category page! … … 191 168 // - if the parameter for "recursive" is OK 192 169 // - if the upper category is activated for this function 193 $query = 'SELECT * 194 FROM '.CATEGORIES_TABLE.' 195 WHERE id = '.pwg_db_real_escape_string($page['category']['id']).' 196 ;'; 170 $query = 'SELECT * FROM '.CATEGORIES_TABLE.' WHERE id = '.pwg_db_real_escape_string($page['category']['id']).';'; 197 171 $cat = pwg_db_fetch_assoc(pwg_query($query)); 198 172 … … 211 185 } 212 186 213 if ($this->my_config[' user_cat']) { // !Function only allowed on user image187 if ($this->my_config['authorizations'] == 'user_cats') { // !Function only allowed on user image 214 188 // Check the category name, user name et img author 215 189 // Get all name for upper categories and current category 216 190 if (isset($cat) and !empty($cat)) { 217 191 $catname[0] = $cat['name']; 218 if (isset($upper_ids) and $upper_ids != null) {192 if (isset($upper_ids)) { 219 193 $nb=1; 220 194 foreach ($upper_ids as $upper_cat) { … … 235 209 $authorname = $img_infos['author']; 236 210 } 237 } 238 211 } 212 239 213 // Only on available cats 240 if ($this->my_config['allcats'] // Available on all cats 241 OR (!empty($page['category']) AND in_array($page['category']['id'], $this->my_config['cats'])) // Available on specific cats 242 OR ($this->my_config['recursive'] AND isset($upper_ids) AND // Available on upper cats this recursiv mode 243 (array_intersect($upper_ids, $this->my_config['cats']) != array())) 244 OR // Available based on usename 245 ($this->my_config['user_cat'] 246 AND (in_array($username, $catname) // Available user categories 247 OR $username == $authorname) 248 249 ) 250 ) 251 { 252 // And only available groups 253 if (empty($this->my_config['groups']) 254 OR (!empty($this->my_config['groups']) 255 AND (array_intersect($this->user_groups, $this->my_config['groups']) != array())) 256 ) 257 { 258 259 // Check if user is guest. 260 // In this case, force mail to default mail (in params) 261 if (is_a_guest()) { 262 if (!empty($this->my_config['defaultmail'])) 263 $user['email'] = $this->my_config['defaultmail']; 264 } 265 266 // Template informations 267 $template->assign('ecard', array( 268 'subject' => l10n('ecard_send_title'), 269 'message' => l10n('ecard_send_message'), 270 'sender_name' => $user['username'], 271 'sender_email' => $user['email'], 272 'recipient_name' => l10n('ecard_send_dest_name'), 273 'recipient_email' => l10n('ecard_send_dest_mail'), 274 'copy' => $this->my_config['send_copy'] ? 'checked="checked"' : '', 275 'changemail' => ($this->my_config['expmail_change'] ? '' : 'disabled="disabled"') 276 )); 277 278 // Template add for the active parameter choice by the user 279 if ($this->my_config['active_parameter']) { // Allowed for the user 280 $template->append('ecard_validity',array('id' => 0, 'name' => l10n('ecard_nolimit'), 'selected' => ($this->my_config['activ'] == 0 ? 'checked' : ''))); 281 for($jj=5; $jj < 30; $jj+=5) 282 $template->append('ecard_validity',array('id' => $jj, 'name' => $jj , 'selected' => ($this->my_config['activ'] == $jj ? 'checked' : ''))); 283 } 284 285 // Template add for the send method to be chose, by the user 286 // default : text 287 $template->append('ecard_send_method',array('id' => 0, 'name' => l10n('ecard_maillink'), 'selected' => ($this->my_config['send_HTML'] ? '' : 'checked'))); 288 if ($this->my_config['send_HTML']) { // Allowed for the user 289 $template->append('ecard_send_method',array('id' => 1, 'name' => l10n('ecard_mailhtml'), 'selected' => ($this->my_config['send_HTML'] ? 'checked' : ''))); 290 } 291 292 // Send the card 293 if (isset($_POST['ecard_submit'])) { 294 $send_method = $_POST['ecard_send_method']; 295 296 // If conf doesn't allow to modify the %votremail param, force it to user mail 297 if (!isset($_POST['ecard_sender_email'])) 298 $_POST['ecard_sender_email'] = $user['email']; 299 300 // Initialize the array for image element 301 $image_element = array(); 302 303 // Get all image informations 304 $query = 'SELECT * FROM '.IMAGES_TABLE.' WHERE id='.$page['image_id'].' LIMIT 1;'; 305 $result = pwg_query($query); 306 if (isset($result)) 307 $image_element = mysql_fetch_array($result); 308 309 // Generate random number 310 $image_element['next_element_id'] = $this->random(64); 311 312 // Image infos 313 if ($this->my_config['ecard_showinfos']) { 314 if (isset($image_element['name'])) { 315 $image_element['picture_infos'] = $image_element['name']; 316 if (isset($image_element['author'])) 317 $image_element['picture_infos'] .= ' ('.$image_element['author'].')'; 318 } 214 if (($this->my_config['authorizations'] == 'all_cats') //Parameter : all_cats 215 OR ($this->my_config['authorizations'] == 'selected_cats' AND !empty($page['category']) AND in_array($page['category']['id'], $this->my_config['selected_cats'])) //Parameter : selected_cats but not recursive 216 OR ($this->my_config['authorizations'] == 'selected_cats' AND $this->my_config['recursive'] AND isset($upper_ids) AND (array_intersect($upper_ids, $this->my_config['selected_cats']) != array())) //Parameter : selected_cats and recursive 217 OR ($this->my_config['authorizations'] == 'user_cats' AND (in_array($username, $catname) OR $username == $authorname)) //Parameter : selected_cats and recursive 218 ) { 219 // Check if user is guest. 220 // In this case, force mail to default mail (in params) 221 if (is_a_guest()) { 222 if (!empty($this->my_config['default_guest_email'])) 223 $user['email'] = $this->my_config['default_guest_email']; 224 } 225 226 // Template informations 227 $template->assign('ecard', array( 228 'subject' => l10n('ecard_send_title'), 229 'message' => l10n('ecard_send_message'), 230 'sender_name' => $user['username'], 231 'sender_email' => $user['email'], 232 'recipient_name' => l10n('ecard_send_dest_name'), 233 'recipient_email' => l10n('ecard_send_dest_mail'), 234 'copy' => $this->my_config['sender_copy'] ? 'checked="checked"' : '', 235 'changemail' => (!isset($user['email']) OR $this->my_config['sender_email_change']) ? '' : 'disabled="disabled"') 236 )); 237 238 // Template add for the active parameter choice by the user 239 if ($this->my_config['validity_choice']) { 240 foreach($this->my_config['validity'] as $validity) { 241 $template->append('ecard_validity', array( 242 'id' => $validity, 243 'name' => ($validity == 0) ? l10n('ecard_nolimit') : $validity.' '.l10n('ecard_days'), 244 'selected' => ($this->my_config['validity_default'] == $validity ? 'checked' : '') 245 ) 246 ); 247 } 248 } 249 250 foreach ($this->my_config['email_format'] as $email_format) { 251 $template->append('ecard_send_method', array( 252 'id' => $email_format, 253 'name' => l10n('ecard_mail_format_'.$email_format), 254 'selected' => (($this->my_config['email_format_default'] == $email_format) ? '' : 'checked') 255 ) 256 ); 257 } 258 259 // Send the card 260 if (isset($_POST['ecard_submit'])) { 261 $send_method = $_POST['ecard_send_method']; 262 263 // If conf doesn't allow to modify the %votremail param, force it to user mail 264 if (!$this->my_config['sender_email_change']) 265 $_POST['ecard_sender_email'] = $user['email']; 266 267 // Initialize the array for image element 268 $image_element = array(); 269 270 // Get all image informations 271 $query = 'SELECT * FROM '.IMAGES_TABLE.' WHERE id='.$page['image_id'].' LIMIT 1;'; 272 $result = pwg_query($query); 273 if (isset($result)) 274 $image_element = mysql_fetch_array($result); 275 276 // Generate random number 277 $image_element['next_element_id'] = $this->random(64); 278 279 // Image infos 280 if ($this->my_config['show_image_infos']) { 281 if (isset($image_element['name'])) { 282 $image_element['picture_infos'] = $image_element['name']; 283 if (isset($image_element['author'])) 284 $image_element['picture_infos'] .= ' ('.$image_element['author'].')'; 319 285 } 320 321 $insert = array( 322 'id' => $image_element['next_element_id'], 323 'sender_name' => $_POST['ecard_sender_name'], 324 'recipient_name' => $_POST['ecard_recipient_name'], 325 'sender_email' => $_POST['ecard_sender_email'], 326 'recipient_email' => $_POST['ecard_recipient_email'], 327 'subject' => $_POST['ecard_subject'], 328 'message' => $_POST['ecard_message'], 329 'image' => $image_element['id'], 330 'date_creation' => date("Y-m-d H:i:s"), 331 ); 332 if ($_POST['ecard_validity'] != '0') { 333 $date = new DateTime(); 334 $date->modify("+".$_POST['ecard_validity']." day"); 335 $insert['date_validity'] = $date->format('Y-m-d H:i:s'); 336 } 337 single_insert(ECARD_TABLE, $insert); 338 339 // Complete the image_element array with Link for the ecard url to be added in the mail 340 set_make_full_url(); 341 $ecard_url = embellish_url(get_absolute_root_url() . './index.php?/ecard/'.$image_element['next_element_id']); 342 $image_element['ecard_url'] = $ecard_url; 343 unset_make_full_url(); 344 345 // Complete the image_element with the url to point to the image url 346 set_make_full_url(); 347 $image_element['picture_url'] = duplicate_picture_url( 348 array( 349 'image_id' => $image_element['id'], 350 'image_file' => $image_element['file'] 351 ), 352 array('start') 353 ); 354 unset_make_full_url(); 355 356 $mail_subject = htmlspecialchars_decode($this->parse( $this->my_config['subject_link'], $_POST)); 357 358 switch($send_method) { 359 case 0 : // text 360 // Get the standard message (in admin param) and parse it with the informations 361 $mail_message = stripslashes(htmlspecialchars_decode($this->parse($this->my_config['message_link'], $_POST, $image_element))); 362 $mail_arg=array('from' => $_POST['ecard_sender_email'], 363 'subject' => $mail_subject, 364 'content' => $mail_message, 365 'content_format' => "text/plain", 366 'email_format' => "text/html" 367 ); 368 break; 369 case 1 : // html 370 $mail_message_HTML = stripslashes(htmlspecialchars_decode($this->parse($this->my_config['message_HTML'], $_POST, $image_element))); 371 $mail_arg=array('from' => $_POST['ecard_sender_email'], 372 'subject' => $mail_subject, 373 'content' => $mail_message_HTML, 374 'content_format' => "text/html", 286 } 287 288 $insert = array( 289 'id' => $image_element['next_element_id'], 290 'sender_name' => $_POST['ecard_sender_name'], 291 'recipient_name' => $_POST['ecard_recipient_name'], 292 'sender_email' => $_POST['ecard_sender_email'], 293 'recipient_email' => $_POST['ecard_recipient_email'], 294 'subject' => $_POST['ecard_subject'], 295 'message' => $_POST['ecard_message'], 296 'image' => $image_element['id'], 297 'date_creation' => date("Y-m-d H:i:s"), 298 ); 299 if ($_POST['ecard_validity'] != '0') { 300 $date = new DateTime(); 301 $date->modify("+".$_POST['ecard_validity']." day"); 302 $insert['date_validity'] = $date->format('Y-m-d H:i:s'); 303 } 304 single_insert(ECARD_TABLE, $insert); 305 306 // Complete the image_element array with Link for the ecard url to be added in the mail 307 set_make_full_url(); 308 $ecard_url = embellish_url(get_absolute_root_url() . './index.php?/ecard/'.$image_element['next_element_id']); 309 $image_element['ecard_url'] = $ecard_url; 310 unset_make_full_url(); 311 312 // Complete the image_element with the url to point to the image url 313 set_make_full_url(); 314 $image_element['picture_url'] = duplicate_picture_url( 315 array( 316 'image_id' => $image_element['id'], 317 'image_file' => $image_element['file'] 318 ), 319 array('start') 320 ); 321 unset_make_full_url(); 322 323 $email_subject = htmlspecialchars_decode($this->parse( $this->my_config['email_subject'], $_POST)); 324 $email_message = htmlspecialchars_decode($this->parse($this->my_config['email_'.$this->my_config['email_format']], $_POST, $image_element)); 325 $email_arg=array( 'from' => $_POST['ecard_sender_email'], 326 'subject' => $email_subject, 327 'content' => $email_message, 328 ); 329 330 switch($send_method) { 331 case 'text': // text 332 $email_arg=array( 'content_format' => "text/plain", 333 'email_format' => "text/plain" 334 ); 335 break; 336 case 'html': // html 337 $email_arg=array( 'content_format' => "text/html", 375 338 'email_format' => "text/html" 376 ); 377 break; 378 default: 379 break; 380 } 381 382 // Add the copy to expe if param. 383 if (isset($_POST['ecard_copy'])) // send copy to sender 384 $mail_arg['Bcc'] = array((isset($_POST['ecard_sender_email']) ? $_POST['ecard_sender_email'] : $user['email'])); 385 386 // Send the mail 387 pwg_mail($_POST['ecard_recipient_email'], $mail_arg); 388 } 389 390 $template->set_filenames(array('ecard_template' => ECARD_ROOT.'/template/ecard.tpl')); 391 $template->concat('COMMENT_IMG', $template->parse('ecard_template', true)); 392 } 339 ); 340 break; 341 default: 342 break; 343 } 344 345 // Add the copy to expe if param. 346 if (isset($_POST['ecard_copy'])) // send copy to sender 347 $email_arg['Bcc'] = array((isset($_POST['ecard_sender_email']) ? $_POST['ecard_sender_email'] : $user['email'])); 348 349 // Send the mail 350 pwg_mail($_POST['ecard_recipient_email'], $email_arg); 351 } 352 353 $template->set_filenames(array('ecard_template' => ECARD_ROOT.'/template/ecard.tpl')); 354 $template->concat('COMMENT_IMG', $template->parse('ecard_template', true)); 393 355 } 394 356 } -
extensions/Piwecard/install/default_values.inc.php
r19956 r20010 1 1 <?php 2 $ecard_default_values['site_name'] = ""; // Site Name 3 $ecard_default_values['allcats'] = false;; // active plugin on all categories 4 $ecard_default_values['cats'] = array();; // List of all categories where the plugin is active 5 $ecard_default_values['send_copy'] = false; // Send a copy to sender 6 $ecard_default_values['only_link'] = true; // Send only a link to the ecard in the mail 2 //Manage parameters 3 $ecard_default_values['authorizations'] = 'selected_cats'; //Determine the page from which the user can send ecard : 'all_cats' (all categories the user can access), 'selected_cats' (only the categories defined in the parameter 'selected_cats') or 'user_cats' (only the categories which are named like the user) 4 $ecard_default_values['selected_cats'] = array(); //List of categories where the plugin is active 5 $ecard_default_values['recursive'] = true; //Active recursivity to activate plugin on top categories ==> all the subcats are active 7 6 8 // message for the mail when only a link is sent 9 $ecard_default_values['message_link'] = 7 //Params parameters 8 $ecard_default_values['validity'] = array(0, 5, 10, 15); //Number of days a card is available 9 $ecard_default_values['validity_default'] = 10; //Default number of days a card is available 10 $ecard_default_values['validity_choice'] = true; //Add function for a user to choose the valid duration of an ecard 11 $ecard_default_values['sender_copy'] = false; //Send a copy to sender 12 $ecard_default_values['sender_email_change'] = false; //Possibility for the user to change the sender email 13 $ecard_default_values['email_format'] = array('text', 'html'); //Type of mail sent : 'text' or 'html' or both 14 $ecard_default_values['email_format_default'] = array('text', 'html'); //Type of mail sent : 'text' or 'html' or both 15 $ecard_default_values['show_image_infos'] = true; //Default : show infos under the image in ecard 16 $ecard_default_values['default_guest_email'] = ''; //Default email used for guest user 17 $ecard_default_values['email_subject'] = "Une eCard vous a ete envoyee par %yourname%"; //Subject of the email for plain text emails 18 $ecard_default_values['email_text'] = 10 19 "Bonjour %recipientname% ! 11 20 %yourname% vous a envoyé une eCard depuis le site %website%. … … 13 22 A bientot sur %website% (%websiteurl% ) ! 14 23 Le Webmaster"; 15 16 $ecard_default_values['subject_link'] = "Une eCard vous a ete envoyee par %yourname%"; // subject of the mail when only a link is sent 17 18 $ecard_default_values['groups'] = array(); // Groups 19 $ecard_default_values['activ'] = 10; // nb of days a card is available 20 21 $ecard_default_values['user_cat'] = false; // active plugin only on user categories (categorie name = user name; for ex. cat = toto.abc and username = toto.abc) 22 $ecard_default_values['expmail_change'] = false; // possibility for the user to change the exp mail 23 $ecard_default_values['recursive'] = false; // Active recursivity to only activate plugin on top categories ==> all the subcats are active 24 $ecard_default_values['send_HTML'] = false; // Send a complete HTML mail with image attachement 25 $ecard_default_values['nb_ecard_page'] = 10; // nb of ecard per page listed in the admin page 26 27 $ecard_default_values['active_parameter'] = true; // Add function for a user to choice the valid duration for an ecard 28 $ecard_default_values['message_HTML'] = 24 $ecard_default_values['email_html'] = 29 25 'Bonjour %recipientname% ! 30 26 <b>%yourname%</b> vous a envoyé une eCard depuis le site <a href="%websiteurl%">%website%</a> : … … 37 33 Le Webmaster'; 38 34 39 $ecard_default_values['ecard_showinfos'] = true; // Default : show infos under image in ecard 40 $ecard_default_values[' defaultmail'] = ''; // Default mail used for guest user35 //Consult parameters 36 $ecard_default_values['nb_ecard_page'] = '10'; //Number of ecard per page listed in the admin page 41 37 ?> -
extensions/Piwecard/language/en_UK/plugin.lang.php
r19924 r20010 1 1 <?php 2 /*3 * Plugin Name: Piwecard4 * File : plugin.lang.php5 * Lang : EN6 */7 2 8 3 … … 51 46 $lang['ecard_publish_bottom'] = 'This eCard was sent by '; 52 47 53 // Admin 54 $lang['ecard_admin_saveOK'] = 'Config saved'; 48 //Admin 49 $lang['ecard_admin_saveOK'] = 'Configuration saved'; 50 51 //admin_manage.php 52 $lang['selected_cats'] = 'Selected categories'; 53 $lang['non_selected_cats'] = 'Non selected categories'; 55 54 56 55 $lang['ecard_management'] = 'Piwecard Management'; … … 80 79 $lang['ecard_message_link'] = 'Message sent (mail for link mode only)'; 81 80 $lang['ecard_message_html'] = 'Message sent (mail HTML with photo)'; 82 $lang['ecard_parameters'] = '<b><u>Parameters</u></b>:<br> 83 <b>%yourname%</b> ==> Sender name<br> 84 <b>%youremail%</b> ==> Sender mail<br> 85 <b>%recipientname%</b> ==> Receiver name<br> 86 <b>%recipientemail%</b> ==> Receiver mail<br> 87 <b>%website%</b> ==> Site name (Piwigo standard config)<br> 88 <b>%websiteurl%</b> ==> Site link (Piwigo standard config)<br> 89 <b>%ecardurl%</b> ==> Link to eCard page<br> 90 <b>%ecardsubject%</b> ==> eCard subject (write by user)<br> 91 <b>%ecardmessage%</b> ==> eCard message (write by user)<br> 92 <b>%pictureurl%</b> ==> Link to photo<br> 93 <b>%pictureinfos%</b> ==> Photo information (name and author)'; 81 $lang['ecard_parameters'] = 'Parameters'; 94 82 95 83 $lang['ecard_admin_consult'] = 'List'; -
extensions/Piwecard/main.inc.php
r19968 r20010 32 32 load_language('plugin.lang', ECARD_PATH); 33 33 34 $ ecard = new Piwecard();34 $piwecard = new Piwecard(); 35 35 36 36 // Add ecard to picture page 37 add_event_handler('loc_end_picture', array(&$ ecard, 'display_ecard_to_picture'));37 add_event_handler('loc_end_picture', array(&$piwecard, 'display_ecard_to_picture')); 38 38 39 add_event_handler('loc_end_section_init', array(&$ ecard, 'section_init_ecard'));40 add_event_handler('loc_end_index', array(&$ ecard, 'index_ecard'));39 add_event_handler('loc_end_section_init', array(&$piwecard, 'section_init_ecard')); 40 add_event_handler('loc_end_index', array(&$piwecard, 'index_ecard')); 41 41 42 42 add_event_handler('loc_end_page_header', 'css_js_ecard'); 43 43 44 set_plugin_data($plugin['id'], $ ecard);44 set_plugin_data($plugin['id'], $piwecard); 45 45 46 46 /* +-----------------------------------------------------------------------+ -
extensions/Piwecard/publish.php
r19968 r20010 10 10 11 11 if (isset($ecard_id) and $ecard_id != '' and $ecard->is_valid($ecard_id)) { 12 $query = 'SELECT * FROM '.ECARD_TABLE.' WHERE numero= "'.$ecard_id.'";';12 $query = 'SELECT * FROM '.ECARD_TABLE.' WHERE id = "'.$ecard_id.'";'; 13 13 $result = pwg_query($query); 14 14 $result_array = pwg_db_fetch_assoc($result); 15 15 16 if (isset($result_array[' numero'])) {16 if (isset($result_array['id'])) { 17 17 //Recover img infos. 18 18 $query = 'SELECT DISTINCT * FROM '.IMAGES_TABLE.' AS img WHERE img.id = '.$result_array['image'].';'; … … 32 32 //Assign variables to template 33 33 $template->assign('ecard', array( 34 'subject' => $result_array['su jet'],34 'subject' => $result_array['subject'], 35 35 'image' => $result_array['image'], 36 36 'message' => $result_array['message'], … … 38 38 'name' => $row['name'], 39 39 'image' => DerivativeImage::url(IMG_LARGE, $row), 40 'sender_email' => $result_array[' adrexp'],41 'sender_name' => $result_array[' nomexp'],42 'image_title' => $ecard->my_config[' ecard_showinfos'] ? $row['name'] : null,43 'image_author' => $ecard->my_config[' ecard_showinfos'] ? $row['author'] : null40 'sender_email' => $result_array['sender_email'], 41 'sender_name' => $result_array['sender_name'], 42 'image_title' => $ecard->my_config['show_image_infos'] ? $row['name'] : null, 43 'image_author' => $ecard->my_config['show_image_infos'] ? $row['author'] : null 44 44 )); 45 45 -
extensions/Piwecard/template/ecard.tpl
r19924 r20010 97 97 <span class="ecard_label">{'ecard_send_exp'|@translate}<span class="ecard_mandatory_fields">*</span> :</span> 98 98 <span class="ecard_name"><input name="ecard_sender_name" type="text" id="ecard_sender_name" maxlength="100" value="{$ecard.sender_name}"></span> 99 <span class="ecard_email"><input name="ecard_sender_email" type="text" id="ecard_sender_email" maxlength="100" {$ecard.changemail} 99 <span class="ecard_email"><input name="ecard_sender_email" type="text" id="ecard_sender_email" maxlength="100" {$ecard.changemail} value="{$ecard.sender_email}" onfocus="ecard_clearDefaultText(this, '{$ecard.sender_email}');" onblur="ecard_checkField(this, 1);"></span> 100 100 </div> 101 101 <div class="ecard_field">
Note: See TracChangeset
for help on using the changeset viewer.