Author Topic: Tell a friend  (Read 65539 times)

0 Members and 1 Guest are viewing this topic.

Offline michi-w.

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Tell a friend
« on: June 01, 2005, 01:02:30 PM »
Hallo,

ich weiß zwar nicht, ob ich den Mod noch zusammen bekomme, aber ich versuch es mal.
Getestet habe ich es allerdings nicht noch einmal.
Hier ist meine Seite als Demo:
http://www.web-upload.de/index.php?template=tell

Mit diesem Mod (ist zwar kein richtig echter Mod) können User eure Seite, über Emails, an Freunde empfehlen.

Im Prinzip handelt es sich um dieses Script:
http://www.tamingthebeast.net/articles3/tell-a-friend-script.htm

1. eine tellafriend.php im Root Verzeichnis von 4images erstellen, das kommt da rein:
(wo "ändern" steht, muss der Code angepasst werden)
Code: [Select]
<?PHP

// Taming The Beast Tell-A-Friend script V 1.1
// Taming the Beast.net - http://www.tamingthebeast.net
// Free Web Marketing and Ecommerce Resources
// By using this code you agree to indemnify
// Taming the Beast from from any liability that might arise // from it's use.

# This section removes any nasty tags that the
# user may have entered in the form fields

strip_tags($friendmail1);
strip_tags($friendmail2);
strip_tags($friendmail3);
strip_tags($email);
strip_tags($name);

# This section sends you a notification email when
# the form is used

// Your email address (for copies to be sent to you)
$emailto = "Absender-Email-Adresse eintragen - ändern";

// Your email subject text
$esubject = "Betreffzeile in der Email - ändern";

// The email text for copies sent to you
$emailtext = "
".$name." hat eine Webseiten Empfehlung versendet, seine Email Adresse ist ".$email."

An diese Email Adressen wurde die Empfehlung gesendet:

".$friendmail1."
".$friendmail2."
".$friendmail3."

";
# Send the email to you
@mail("$emailto", $esubject, $emailtext, "From: $email");

## This section sends to the recipients

// Target page after successful submission
$thankyoupage = "index.php";

 //  Change the subject text below to suit
$tsubject = "Webseiten-Empfehlung";

 // Change the text below for the email
$ttext = "
Hallo,

".$name." mit der Email Adresse ".$email." möchte Sie auf die unten angegebene Webseite aufmerksam machen.

".$name." hat für diese Email den Tell-A-Friend Service von deineDomain.de - ändern verwendet.
Hier kann noch mehr Email Text stehen!!!! - ändern

Besuchen sie
http://www.deineDomain.de/ - ändern

Vielen Dank für die Aufmerksamkeit!
";
# This sends the email to the addresses entered
@mail("$friendmail1 $friendmail2 $friendmail3", $tsubject, $ttext, "FROM: $email");

# After submission, the target URL
header("Location: $thankyoupage");
exit;
?>

2. templates/default/header.html zwischen <head> und </head>
Code: [Select]
<script language="javascript">
<!--

function reset() {
document.tellafriend.name.value="";
document.tellafriend.email.value="";
document.tellafriend.friendmail1.value="";
document.tellafriend.friendmail2.value="";
document.tellafriend.friendmail3.value="";
}

function validate() {


if (document.tellafriend.friendmail1.value.length==0) {
alert("please enter your friend's email address");
return false;
}

if (document.tellafriend.email.value.length==0) {
alert("please enter your email address");
return false;
}
if (document.tellafriend.name.value.length==0) {
alert("please enter your name");
return false;
}

document.tellafriend.submit()
return true;
}

//-->
</script>

3. Eigentlich müsste lt. Urheberscript noch im body der header.html
Code: [Select]
onload="reset()" topmargin="0" leftmargin="0" eingetragen werden, bei mir funktioniert der Script aber auch ohne.

4. Neue Datei in templates/default/ erstellen, am besten eine Kopie der home.html machen und diese Kopie in tell.html umbennen. Die Seite entsprechend umbauen, der tell a friend Abschnitt ist:
Code: [Select]
<table  border="0" bordercolor="#004C75" cellspacing="0" cellpadding="4" align="center">
<tr valign="top">
<td valign="middle" align="center">
<form name="tellafriend" action="tellafriend.php" method="post" onsubmit="return checkfields()">
<div align="center">
<center>
<table border="0" cellpadding="10" cellspacing="0">
<tr>
<td> *Ihr Name:</td>
<td>
<input size="30" name="name" maxlength="45">
</td>
</tr>
<tr>
<td>*Ihre Email:</td>
<td>
<input size="30" name="email" maxlength="45">
</td>
</tr>
<tr>
<td colspan="2">
Bitte die Email Adresse eintragen, an der die Empfehlung gesendet werden soll:</td>
</tr>
<tr>
<td>*email 1:</td>
<td>
<input size="30" name="friendmail1" maxlength="45">
</td>
</tr>
<tr>
<td>email 2:</td>
<td>
<input size="30" name="friendmail2" maxlength="45">
</td>
</tr>
<tr>
<td>email 3:</td>
<td>
<input size="30" name="friendmail3" maxlength="45">
</td>
</tr>
<tr>
<td colspan="2" align="center">

Bitte beachten, die Email enthält ihren Namen und ihre Email Adresse.<br>
<input onclick="validate();" class="button" type="button" value="Abschicken">

</td>
</tr><tr>
<td colspan="2">*Pflichtfelder</td></tr>
</table>
</center>
</div>
</form>
</td>
</tr>
<tr valign="top">
<td valign="middle" align="center">
&nbsp;
</td>
</tr>
</table>

5. Nun wird die Seite über
http://www.deinedomain.de/index.php?template=tell
aufgerufen.



Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: Tell a friend
« Reply #1 on: June 01, 2005, 05:47:14 PM »
nun ich schicke einfach eine postkarte um bekannt zu werden  :wink:

gruss
vincent
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline michi-w.

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Re: Tell a friend
« Reply #2 on: June 01, 2005, 06:19:26 PM »
Brauchst es ja nicht einbauen! :roll:

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: Tell a friend
« Reply #3 on: June 01, 2005, 08:22:42 PM »
ENGLISH ??   :roll: :roll: :roll:

Offline artpics

  • Full Member
  • ***
  • Posts: 173
    • View Profile
    • my site
Re: Tell a friend
« Reply #4 on: June 01, 2005, 10:50:17 PM »
http://www.tamingthebeast.net/articles3/tell-a-friend-script.htm

follow this link as in first post all working see my site  :D

Offline michi-w.

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Re: Tell a friend
« Reply #5 on: June 01, 2005, 11:03:44 PM »
Attention, my english is not good, control this.
Change the script by -->xxx<--. (delete --><--)

1. new tellafriend.php in root of 4images.
contents
Code: [Select]
<?PHP

// Taming The Beast Tell-A-Friend script V 1.1
// Taming the Beast.net - http://www.tamingthebeast.net
// Free Web Marketing and Ecommerce Resources
// By using this code you agree to indemnify
// Taming the Beast from from any liability that might arise // from it's use.

# This section removes any nasty tags that the
# user may have entered in the form fields

strip_tags($friendmail1);
strip_tags($friendmail2);
strip_tags($friendmail3);
strip_tags($email);
strip_tags($name);

# This section sends you a notification email when
# the form is used

// Your email address (for copies to be sent to you)
$emailto = "Sender-Email-Adresse eintragen - ändern";

// Your email subject text
$esubject = "Titel der Email - ändern";

// The email text for copies sent to you
$emailtext = "
".$name." has one website recommendation mailed, your Email Adress is".$email."

To this email addresses the recommendation was sent:

".$friendmail1."
".$friendmail2."
".$friendmail3."

";
# Send the email to you
@mail("$emailto", $esubject, $emailtext, "From: $email");

## This section sends to the recipients

// Target page after successful submission
$thankyoupage = "index.php";

//  Change the subject text below to suit
$tsubject = "Webseiten-Empfehlung";

// Change the text below for the email
$ttext = "
Hallo,

".$name." with the email address ".$email." would like you on the down mentioned website attentive.

".$name." has for this email that Tell-A-Friend service of -->yourDomain.de<-- used.
-->Here still more email text can stand!!!!<--

Visit they
-->http://www.deineDomain.de/ <--

Thank you for the attention!
";
# This sends the email to the addresses entered
@mail("$friendmail1 $friendmail2 $friendmail3", $tsubject, $ttext, "FROM: $email");

# After submission, the target URL
header("Location: $thankyoupage");
exit;
?>

2. templates/default/header.html between <head> and </head>
Code: [Select]
<script language="javascript">
<!--

function reset() {
document.tellafriend.name.value="";
document.tellafriend.email.value="";
document.tellafriend.friendmail1.value="";
document.tellafriend.friendmail2.value="";
document.tellafriend.friendmail3.value="";
}

function validate() {


if (document.tellafriend.friendmail1.value.length==0) {
alert("please enter your friend's email address");
return false;
}

if (document.tellafriend.email.value.length==0) {
alert("please enter your email address");
return false;
}
if (document.tellafriend.name.value.length==0) {
alert("please enter your name");
return false;
}

document.tellafriend.submit()
return true;
}

//-->
</script>

3.  Actually would have after the author of the scripts still in body the header html
Code: [Select]
onload="reset()" topmargin="0" leftmargin="0" so
Code: [Select]
<body onload="reset()" topmargin="0" leftmargin="0">functioned with me also without.

4. new file in templates/default/
Copy the home.html and amend the name in tell.html, this file changes, the tell-a-friend range is
Code: [Select]
<table  border="0" bordercolor="#004C75" cellspacing="0" cellpadding="4" align="center">
<tr valign="top">
<td valign="middle" align="center">
<form name="tellafriend" action="tellafriend.php" method="post" onsubmit="return checkfields()">
<div align="center">
<center>
<table border="0" cellpadding="10" cellspacing="0">
<tr>
<td> *Ihr Name:</td>
<td>
<input size="30" name="name" maxlength="45">
</td>
</tr>
<tr>
<td>*Your Email:</td>
<td>
<input size="30" name="email" maxlength="45">
</td>
</tr>
<tr>
<td colspan="2">
Please insert the email adress, at that the recommendation to be sent is:</td>
</tr>
<tr>
<td>*email 1:</td>
<td>
<input size="30" name="friendmail1" maxlength="45">
</td>
</tr>
<tr>
<td>email 2:</td>
<td>
<input size="30" name="friendmail2" maxlength="45">
</td>
</tr>
<tr>
<td>email 3:</td>
<td>
<input size="30" name="friendmail3" maxlength="45">
</td>
</tr>
<tr>
<td colspan="2" align="center">

Please, the email contain their name and its email address consider.<br>
<input onclick="validate();" class="button" type="button" value="send">

</td>
</tr><tr>
<td colspan="2">*must be filled out</td></tr>
</table>
</center>
</div>
</form>
</td>
</tr>
<tr valign="top">
<td valign="middle" align="center">
&nbsp;
</td>
</tr>
</table>

5. these left use over tell-a-friend to use:
-->http://www.yourdomain.de/index.php?template=tell<--

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Tell a friend
« Reply #6 on: June 02, 2005, 12:16:06 AM »
May I suggest to edit the original post instead of post new code as a separate reply. So people would not need hunt all over the topic for the correct code ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline michi-w.

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Re: Tell a friend
« Reply #7 on: June 02, 2005, 12:42:20 AM »
My english so bad? :oops:
Sorry! :cry:

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Tell a friend
« Reply #8 on: June 02, 2005, 12:56:10 AM »
My english so bad? :oops:
Sorry! :cry:
no, nothing about your english, its just please dont post "new" version as a reply, instead of edit the original post and update it to your new version ;)
because it confuses people, who see the code on top (old code), install it without reading the reply with new code...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Re: Tell a friend
« Reply #9 on: June 02, 2005, 04:32:49 AM »
Editing the original post is DEFINITELY the thing to do :!:

Offline bibabobu

  • Sr. Member
  • ****
  • Posts: 311
  • Technische und künstlerische Gravuren
    • View Profile
    • Technische und künstlerische Gravuren für die gesamte Metall-, Kunststoff- und Papierindustrie
Re: Tell a friend
« Reply #10 on: June 05, 2005, 03:26:27 AM »
i have just installed the code.
but it does only works a part of it for me.

the cgi message mail is sent to my own email adress. but there are missing the variable info fields.
also the receipients have not become the email.

what i am doing wrong.

at the bottom of the php file. the 3 email variables have not to be a "," (comma) between???

i dont know.

who helps me?

Offline michi-w.

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Re: Tell a friend
« Reply #11 on: June 05, 2005, 11:57:15 AM »
You becomes a email messages, if one used the tell-a-friend.

Posting your tellafriend.php


Offline bibabobu

  • Sr. Member
  • ****
  • Posts: 311
  • Technische und künstlerische Gravuren
    • View Profile
    • Technische und künstlerische Gravuren für die gesamte Metall-, Kunststoff- und Papierindustrie
Re: Tell a friend
« Reply #12 on: June 05, 2005, 02:32:08 PM »
Hi,

here is my tellafriend.php :

Code: [Select]
<?PHP

# This section removes any nasty tags that the
# user may have entered in the form fields

strip_tags($friendmail1);
strip_tags($friendmail2);
strip_tags($friendmail3);
strip_tags($email);
strip_tags($name);

# This section sends you a notification email when
# the form is used

// Your email address (for copies to be sent to you)
$emailto = "info@industrie-gravuren.de";

// Your email subject text
$esubject = "Industrie-Gravuren: Weiterempfehlung";

// The email text for copies sent to you
$emailtext = "
".$name." hat eine Webseiten Empfehlung versendet, seine Email Adresse ist ".$email."

An diese Email Adressen wurde die Empfehlung gesendet:

".$friendmail1."
".$friendmail2."
".$friendmail3."

";
# Send the email to you
@mail("$emailto", $esubject, $emailtext, "From: $email");

## This section sends to the recipients

// Target page after successful submission
$thankyoupage = "index.php";

//  Change the subject text below to suit
$tsubject = "Webseiten-Empfehlung INDUSTRIE-GRAVUREN GMBH";

// Change the text below for the email
$ttext = "
Hallo,

".$name." mit der Email Adresse ".$email." möchte Sie auf die unten angegebene Webseite aufmerksam machen.

".$name." hat für diese Email den Weiterempfehlungs-Service von industrie-gravuren.de verwendet.
TECHNISCHE UND KÜNSTLERISCHE GRAVUREN FÜR DIE GESAMTE METALL-, PAPIER- UND KUNSTSTOFFINDUSTRIE.

Besuchen sie doch mal
http://www.industrie-gravuren.de/
es ist bestimmt auch etwas Interessantes für Sie dabei!

Vielen Dank für die Aufmerksamkeit!
";
# This sends the email to the addresses entered
@mail("$friendmail1 $friendmail2 $friendmail3", $tsubject, $ttext, "FROM: $email");

# After submission, the target URL
header("Location: $thankyoupage");
exit;
?>

perhaps you could test it once for me.

my url: www.industrie-gravuren.de/galerie    test the link Weiterempfehlung

Thanks

Offline michi-w.

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Re: Tell a friend
« Reply #13 on: June 05, 2005, 05:02:44 PM »
Wir können ja Deutsch :D

Also ich konnte nichts falsches finden, vielleicht nimmst du mal
Code: [Select]
onload="reset()" topmargin="0" leftmargin="0" aus dem body raus, das ist das einzige, was bei mir anders ist.

Ich könnte mir vorstellen, das es mit der Umleitung auf die thankyou.html zusammen hängt.
Wie hast du die Umleitung erzeugt?

In der tellafriend.php wird normalerweise auf die index.php verwiesen,
Code: [Select]
// Target page after successful submission
$thankyoupage = "index.php";


Mein Browser zeigt überrings Script Fehler an!
(Index.php Zeile 67)

Gruß
michi-w.

Offline bibabobu

  • Sr. Member
  • ****
  • Posts: 311
  • Technische und künstlerische Gravuren
    • View Profile
    • Technische und künstlerische Gravuren für die gesamte Metall-, Kunststoff- und Papierindustrie
Re: Tell a friend
« Reply #14 on: June 05, 2005, 09:27:59 PM »
Ja prima! Deutsch! Hatte ich mir auch schon gedacht.  8)

Also hatte zuerst auch nur auf die index.php verwiesen, da tat es auch nicht.
Habe die tahnkyou.html so eingebunden "index.php?template=thankyou"

Habe nicht so die Ahnung von dem Ganzen. Aber irgendwie setzt er mir nicht den Emailtext aus den Variablen zusammen und versendet diesen.

Weiß auch nicht, ob ich den Code im Body richtig eingefügt habe. Aber es tat auch nicht ohne.

Na ja vielleicht hast Du noch nen Tipp für mich. Werde weiter probieren es hinzubekommen.

Merci