Fletsch
26.01.2007, 14:35
Hallo Leute.
Ich hab das jetzt lang versucht aber komm nicht weiter. Hab wohl zu wenig Webdesign skills ;) Also ich hab das Affiliate Modul für 3.03 installiert und s läuft alles prima. Was mir jetzt noch fehlt ist die rnichtige Anzeige der info_message wenn sich der Partner ein neues Passwort zusendet.
Die zuständigen Dateien sind folgende:
affiliate_password_forgotten.php
<?php
require('includes/application_top.php');
// create smarty elements
$smarty = new Smarty;
// include needed functions
require_once(DIR_FS_INC . 'xtc_image_button.inc.php');
require_once(DIR_FS_INC . 'xtc_draw_input_field.inc.php');
require_once(DIR_FS_INC . 'xtc_encrypt_password.inc.php');
require_once(DIR_FS_INC . 'xtc_php_mail.inc.php');
// include boxes
require(DIR_FS_CATALOG .'templates/'.CURRENT_TEMPLATE. '/source/boxes.php');
// include the mailer-class
require_once(DIR_WS_CLASSES . 'class.phpmailer.php');
if (isset($_GET['action']) && ($_GET['action'] == 'process')) {
****$check_affiliate_query = xtc_db_query("select affiliate_firstname, affiliate_lastname, affiliate_password, affiliate_id from " . TABLE_AFFILIATE . " where affiliate_email_address = '" . $_POST['email_address'] . "'");
****if (xtc_db_num_rows($check_affiliate_query)) {
********$check_affiliate = xtc_db_fetch_array($check_affiliate_query);
********// Crypted password mods - create a new password, update the database and mail it to them
********$newpass = xtc_create_random_value(ENTRY_PASSWORD_MIN_LENGTH) ;
********$crypted_password = xtc_encrypt_password($newpass);
********xtc_db_query("update " . TABLE_AFFILIATE . " set affiliate_password = '" . $crypted_password . "' where affiliate_id = '" . $check_affiliate['affiliate_id'] . "'");
********
********xtc_php_mail(AFFILIATE_EMAIL_ADDRESS, STORE_OWNER, $_POST['email_address'], $check_affiliate['affiliate_firstname'] . " " . $check_affiliate['affiliate_lastname'], '', AFFILIATE_EMAIL_ADDRESS, STORE_OWNER, '', '', EMAIL_PASSWORD_REMINDER_SUBJECT, nl2br(sprintf(EMAIL_PASSWORD_REMINDER_BODY, $newpass)), nl2br(sprintf(EMAIL_PASSWORD_REMINDER_BODY, $newpass)));
********if (!isset($mail_error)) {
************xtc_redirect(xtc_href_link(FILENAME_AF FILIATE, 'info_message=' . urlencode(TEXT_PASSWORD_SENT), 'SSL', true, false));
********}
********else {
************echo $mail_error;
********}
****}
****else {
********xtc_redirect(xtc_href_link(FILENAME_AFFILI ATE_PASSWORD_FORGOTTEN, 'email=nonexistent', 'SSL'));
****}
}
else {
****$breadcrumb->add(NAVBAR_TITLE, xtc_href_link(FILENAME_AFFILIATE, '', 'SSL'));
****$breadcrumb->add(NAVBAR_TITLE_PASSWORD_FORGOTTEN, xtc_href_link(FILENAME_AFFILIATE_PASSWORD_FORGOTTE N, '', 'SSL'));
****require(DIR_WS_INCLUDES . 'header.php');
****$smarty->assign('FORM_ACTION', xtc_draw_form('password_forgotten', xtc_href_link(FILENAME_AFFILIATE_PASSWORD_FORGOTTE N, 'action=process', 'SSL')));
****$smarty->assign('INPUT_EMAIL', xtc_draw_input_field('email_address', '', 'maxlength="96"'));
****$smarty->assign('LINK_AFFILIATE', '' . xtc_image_button('button_back.gif', IMAGE_BUTTON_BACK) . ' (' . xtc_href_link(FILENAME_AFFILIATE, '', 'SSL') . ')');
****$smarty->assign('BUTTON_SUBMIT', xtc_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE));
****
****if (isset($_GET['email']) && ($_GET['email'] == 'nonexistent')) {
********$smarty->assign('email_nonexistent', 'true');
****}
}
$smarty->assign('language', $_SESSION['language']);
$smarty->caching = 0;
$main_content=$smarty->fetch(CURRENT_TEMPLATE . '/module/affiliate_password_forgotten.html');
$smarty->assign('main_content',$main_content);
$smarty->assign('language', $_SESSION['language']);
$smarty->caching = 0;
$smarty->display(CURRENT_TEMPLATE . '/index.html');?>
Im Template: affiliate_password_forgotten.html
{config_load file="$language/affiliate_lang_$language.conf" section="affiliate_password_forgotten"}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
****<tr valign="top">
********<td class="contentsTopics">{#heading_title#}</td>
****</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="1" class="main">
**<tr>
****<td>{$FORM_ACTION}
******<table width="100%" border="0" cellspacing="0" cellpadding="0">
********<tr>
**********<td>{#password_intro#}</td>
********</tr>
******</table>
****
******
******<table border="0" width="100%" cellspacing="0" cellpadding="3">
******<tr>
********<td align="right" class="main">{#entry_email_address#}</td>
********<td class="main">{$INPUT_EMAIL}</td>
******</tr>
******<tr>
********<td colspan="2">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
**********<tr>
************<td valign="top">{$LINK_AFFILIATE}</td>
************<td align="right" valign="top">{$BUTTON_SUBMIT}</td>
**********</tr>
********</table></td>
******</tr>
******{if $email_nonexistent == 'true'}
********<tr>
**********<td colspan="2" class="main">{#text_no_email_address_found#}</td>
********</tr>
******{/if}
****</table></form></td>
**</tr>
</table>
So wie das jetzt ist kan man die Email-Adresse eingeben, auf weiter klicken, und dann gelangt man auf die Startseite affiliate_affiliate.php welche die Message nur in der URL enthält:
''>ZITAT</div>www.meinshop.de/affiliate_affiliate.php?info_message=Ein+neues+Pas swort+wurde+per+eMail+verschickt[/b]
Ich möchte aber, dass diese info_message im Content Bereich erscheint so wie wenn man beim Login was falsches eingibt. Dazu müsste man wohl auch die affiliate_affiliate.php bearbeiten:
<?php
require('includes/application_top.php');
// create smarty elements
$smarty = new Smarty;
// include boxes
require(DIR_FS_CATALOG .'templates/'.CURRENT_TEMPLATE. '/source/boxes.php');
// include needed functions
require_once(DIR_FS_INC . 'xtc_draw_password_field.inc.php');
require_once(DIR_FS_INC . 'xtc_image_button.inc.php');
require_once(DIR_FS_INC . 'xtc_validate_password.inc.php');
if (isset($_SESSION['affiliate_id'])) {
****xtc_redirect(xtc_href_link(FILENAME_AFFILIATE_ SUMMARY, '', 'SSL'));
}
if (isset($_GET['action']) && ($_GET['action'] == 'process')) {
****$affiliate_username = xtc_db_prepare_input($_POST['affiliate_username']);
****$affiliate_password = xtc_db_prepare_input($_POST['affiliate_password']);
****
****// Check if username exists
****$check_affiliate_query = xtc_db_query("select affiliate_id, affiliate_firstname, affiliate_password, affiliate_email_address from " . TABLE_AFFILIATE . " where affiliate_email_address = '" . xtc_db_input($affiliate_username) . "'");
****if (!xtc_db_num_rows($check_affiliate_query)) {
********$_GET['login'] = 'fail';
****}
****else {
********$check_affiliate = xtc_db_fetch_array($check_affiliate_query);
********// Check that password is good
********if (!xtc_validate_password($affiliate_password, $check_affiliate['affiliate_password'])) {
************$_GET['login'] = 'fail';
********}
********else {
************$_SESSION['affiliate_id'] = $check_affiliate['affiliate_id'];
************$date_now = date('Ymd');
************
************xtc_db_query("update " . TABLE_AFFILIATE . " set affiliate_date_of_last_logon = now(), affiliate_number_of_logons = affiliate_number_of_logons + 1 where affiliate_id = '" . $_SESSION['affiliate_id'] . "'");
************xtc_redirect(xtc_href_link(FILENAME_AF FILIATE_SUMMARY,'','SSL'));
********}
****}
}
$breadcrumb->add(NAVBAR_TITLE, xtc_href_link(FILENAME_AFFILIATE, '', 'SSL'));
require(DIR_WS_INCLUDES . 'header.php');
if (isset($_GET['login']) && ($_GET['login'] == 'fail')) {
****$info_message =TEXT_LOGIN_ERROR;
}
$smarty->assign('info_message', $info_message);
$smarty->assign('FORM_ACTION', xtc_draw_form('login', xtc_href_link(FILENAME_AFFILIATE, 'action=process', 'SSL')));
$smarty->assign('LINK_TERMS', '<a**href="' . xtc_href_link(FILENAME_CONTENT,'coID=900', 'SSL') . '">');
$smarty->assign('INPUT_AFFILIATE_USERNAME', xtc_draw_input_field('affiliate_username'));
$smarty->assign('INPUT_AFFILIATE_PASSWORD', xtc_draw_password_field('affiliate_password'));
$smarty->assign('LINK_PASSWORD_FORGOTTEN', '<a href="' . xtc_href_link(FILENAME_AFFILIATE_PASSWORD_FORGOTTE N, '', 'SSL') . '">');
$smarty->assign('LINK_SIGNUP', '' . xtc_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . ' (' . xtc_href_link(FILENAME_AFFILIATE_SIGNUP, '', 'SSL') . ')');
$smarty->assign('BUTTON_LOGIN', xtc_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN));
$smarty->assign('language', $_SESSION['language']);
$smarty->caching = 0;
$main_content=$smarty->fetch(CURRENT_TEMPLATE . '/module/affiliate_affiliate.html');
$smarty->assign('main_content',$main_content);
$smarty->assign('language', $_SESSION['language']);
$smarty->caching = 0;
$smarty->display(CURRENT_TEMPLATE . '/index.html');?>
Ich denke das ist eigentlich gar keine grosse Sache, wenn man nur weiss wie und etwas von PHP versteht. Ich hoffe es kann mir heir jemand helfen? hoff
Vielen Dank schon jetzt!
Gruss Fletsch
Ich hab das jetzt lang versucht aber komm nicht weiter. Hab wohl zu wenig Webdesign skills ;) Also ich hab das Affiliate Modul für 3.03 installiert und s läuft alles prima. Was mir jetzt noch fehlt ist die rnichtige Anzeige der info_message wenn sich der Partner ein neues Passwort zusendet.
Die zuständigen Dateien sind folgende:
affiliate_password_forgotten.php
<?php
require('includes/application_top.php');
// create smarty elements
$smarty = new Smarty;
// include needed functions
require_once(DIR_FS_INC . 'xtc_image_button.inc.php');
require_once(DIR_FS_INC . 'xtc_draw_input_field.inc.php');
require_once(DIR_FS_INC . 'xtc_encrypt_password.inc.php');
require_once(DIR_FS_INC . 'xtc_php_mail.inc.php');
// include boxes
require(DIR_FS_CATALOG .'templates/'.CURRENT_TEMPLATE. '/source/boxes.php');
// include the mailer-class
require_once(DIR_WS_CLASSES . 'class.phpmailer.php');
if (isset($_GET['action']) && ($_GET['action'] == 'process')) {
****$check_affiliate_query = xtc_db_query("select affiliate_firstname, affiliate_lastname, affiliate_password, affiliate_id from " . TABLE_AFFILIATE . " where affiliate_email_address = '" . $_POST['email_address'] . "'");
****if (xtc_db_num_rows($check_affiliate_query)) {
********$check_affiliate = xtc_db_fetch_array($check_affiliate_query);
********// Crypted password mods - create a new password, update the database and mail it to them
********$newpass = xtc_create_random_value(ENTRY_PASSWORD_MIN_LENGTH) ;
********$crypted_password = xtc_encrypt_password($newpass);
********xtc_db_query("update " . TABLE_AFFILIATE . " set affiliate_password = '" . $crypted_password . "' where affiliate_id = '" . $check_affiliate['affiliate_id'] . "'");
********
********xtc_php_mail(AFFILIATE_EMAIL_ADDRESS, STORE_OWNER, $_POST['email_address'], $check_affiliate['affiliate_firstname'] . " " . $check_affiliate['affiliate_lastname'], '', AFFILIATE_EMAIL_ADDRESS, STORE_OWNER, '', '', EMAIL_PASSWORD_REMINDER_SUBJECT, nl2br(sprintf(EMAIL_PASSWORD_REMINDER_BODY, $newpass)), nl2br(sprintf(EMAIL_PASSWORD_REMINDER_BODY, $newpass)));
********if (!isset($mail_error)) {
************xtc_redirect(xtc_href_link(FILENAME_AF FILIATE, 'info_message=' . urlencode(TEXT_PASSWORD_SENT), 'SSL', true, false));
********}
********else {
************echo $mail_error;
********}
****}
****else {
********xtc_redirect(xtc_href_link(FILENAME_AFFILI ATE_PASSWORD_FORGOTTEN, 'email=nonexistent', 'SSL'));
****}
}
else {
****$breadcrumb->add(NAVBAR_TITLE, xtc_href_link(FILENAME_AFFILIATE, '', 'SSL'));
****$breadcrumb->add(NAVBAR_TITLE_PASSWORD_FORGOTTEN, xtc_href_link(FILENAME_AFFILIATE_PASSWORD_FORGOTTE N, '', 'SSL'));
****require(DIR_WS_INCLUDES . 'header.php');
****$smarty->assign('FORM_ACTION', xtc_draw_form('password_forgotten', xtc_href_link(FILENAME_AFFILIATE_PASSWORD_FORGOTTE N, 'action=process', 'SSL')));
****$smarty->assign('INPUT_EMAIL', xtc_draw_input_field('email_address', '', 'maxlength="96"'));
****$smarty->assign('LINK_AFFILIATE', '' . xtc_image_button('button_back.gif', IMAGE_BUTTON_BACK) . ' (' . xtc_href_link(FILENAME_AFFILIATE, '', 'SSL') . ')');
****$smarty->assign('BUTTON_SUBMIT', xtc_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE));
****
****if (isset($_GET['email']) && ($_GET['email'] == 'nonexistent')) {
********$smarty->assign('email_nonexistent', 'true');
****}
}
$smarty->assign('language', $_SESSION['language']);
$smarty->caching = 0;
$main_content=$smarty->fetch(CURRENT_TEMPLATE . '/module/affiliate_password_forgotten.html');
$smarty->assign('main_content',$main_content);
$smarty->assign('language', $_SESSION['language']);
$smarty->caching = 0;
$smarty->display(CURRENT_TEMPLATE . '/index.html');?>
Im Template: affiliate_password_forgotten.html
{config_load file="$language/affiliate_lang_$language.conf" section="affiliate_password_forgotten"}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
****<tr valign="top">
********<td class="contentsTopics">{#heading_title#}</td>
****</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="1" class="main">
**<tr>
****<td>{$FORM_ACTION}
******<table width="100%" border="0" cellspacing="0" cellpadding="0">
********<tr>
**********<td>{#password_intro#}</td>
********</tr>
******</table>
****
******
******<table border="0" width="100%" cellspacing="0" cellpadding="3">
******<tr>
********<td align="right" class="main">{#entry_email_address#}</td>
********<td class="main">{$INPUT_EMAIL}</td>
******</tr>
******<tr>
********<td colspan="2">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
**********<tr>
************<td valign="top">{$LINK_AFFILIATE}</td>
************<td align="right" valign="top">{$BUTTON_SUBMIT}</td>
**********</tr>
********</table></td>
******</tr>
******{if $email_nonexistent == 'true'}
********<tr>
**********<td colspan="2" class="main">{#text_no_email_address_found#}</td>
********</tr>
******{/if}
****</table></form></td>
**</tr>
</table>
So wie das jetzt ist kan man die Email-Adresse eingeben, auf weiter klicken, und dann gelangt man auf die Startseite affiliate_affiliate.php welche die Message nur in der URL enthält:
''>ZITAT</div>www.meinshop.de/affiliate_affiliate.php?info_message=Ein+neues+Pas swort+wurde+per+eMail+verschickt[/b]
Ich möchte aber, dass diese info_message im Content Bereich erscheint so wie wenn man beim Login was falsches eingibt. Dazu müsste man wohl auch die affiliate_affiliate.php bearbeiten:
<?php
require('includes/application_top.php');
// create smarty elements
$smarty = new Smarty;
// include boxes
require(DIR_FS_CATALOG .'templates/'.CURRENT_TEMPLATE. '/source/boxes.php');
// include needed functions
require_once(DIR_FS_INC . 'xtc_draw_password_field.inc.php');
require_once(DIR_FS_INC . 'xtc_image_button.inc.php');
require_once(DIR_FS_INC . 'xtc_validate_password.inc.php');
if (isset($_SESSION['affiliate_id'])) {
****xtc_redirect(xtc_href_link(FILENAME_AFFILIATE_ SUMMARY, '', 'SSL'));
}
if (isset($_GET['action']) && ($_GET['action'] == 'process')) {
****$affiliate_username = xtc_db_prepare_input($_POST['affiliate_username']);
****$affiliate_password = xtc_db_prepare_input($_POST['affiliate_password']);
****
****// Check if username exists
****$check_affiliate_query = xtc_db_query("select affiliate_id, affiliate_firstname, affiliate_password, affiliate_email_address from " . TABLE_AFFILIATE . " where affiliate_email_address = '" . xtc_db_input($affiliate_username) . "'");
****if (!xtc_db_num_rows($check_affiliate_query)) {
********$_GET['login'] = 'fail';
****}
****else {
********$check_affiliate = xtc_db_fetch_array($check_affiliate_query);
********// Check that password is good
********if (!xtc_validate_password($affiliate_password, $check_affiliate['affiliate_password'])) {
************$_GET['login'] = 'fail';
********}
********else {
************$_SESSION['affiliate_id'] = $check_affiliate['affiliate_id'];
************$date_now = date('Ymd');
************
************xtc_db_query("update " . TABLE_AFFILIATE . " set affiliate_date_of_last_logon = now(), affiliate_number_of_logons = affiliate_number_of_logons + 1 where affiliate_id = '" . $_SESSION['affiliate_id'] . "'");
************xtc_redirect(xtc_href_link(FILENAME_AF FILIATE_SUMMARY,'','SSL'));
********}
****}
}
$breadcrumb->add(NAVBAR_TITLE, xtc_href_link(FILENAME_AFFILIATE, '', 'SSL'));
require(DIR_WS_INCLUDES . 'header.php');
if (isset($_GET['login']) && ($_GET['login'] == 'fail')) {
****$info_message =TEXT_LOGIN_ERROR;
}
$smarty->assign('info_message', $info_message);
$smarty->assign('FORM_ACTION', xtc_draw_form('login', xtc_href_link(FILENAME_AFFILIATE, 'action=process', 'SSL')));
$smarty->assign('LINK_TERMS', '<a**href="' . xtc_href_link(FILENAME_CONTENT,'coID=900', 'SSL') . '">');
$smarty->assign('INPUT_AFFILIATE_USERNAME', xtc_draw_input_field('affiliate_username'));
$smarty->assign('INPUT_AFFILIATE_PASSWORD', xtc_draw_password_field('affiliate_password'));
$smarty->assign('LINK_PASSWORD_FORGOTTEN', '<a href="' . xtc_href_link(FILENAME_AFFILIATE_PASSWORD_FORGOTTE N, '', 'SSL') . '">');
$smarty->assign('LINK_SIGNUP', '' . xtc_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . ' (' . xtc_href_link(FILENAME_AFFILIATE_SIGNUP, '', 'SSL') . ')');
$smarty->assign('BUTTON_LOGIN', xtc_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN));
$smarty->assign('language', $_SESSION['language']);
$smarty->caching = 0;
$main_content=$smarty->fetch(CURRENT_TEMPLATE . '/module/affiliate_affiliate.html');
$smarty->assign('main_content',$main_content);
$smarty->assign('language', $_SESSION['language']);
$smarty->caching = 0;
$smarty->display(CURRENT_TEMPLATE . '/index.html');?>
Ich denke das ist eigentlich gar keine grosse Sache, wenn man nur weiss wie und etwas von PHP versteht. Ich hoffe es kann mir heir jemand helfen? hoff
Vielen Dank schon jetzt!
Gruss Fletsch