<script LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
var s_track = document.URL; var s_ref = document.referrer;
document.write('<script src="http://www.4n-community.de/tracker/tracker.php?track='+s_track+'"><\/script>');
if (document.layers){
window.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
window.onmousedown=rightclick;
window.onmouseup=rightclick;
function rightclick(e) {
if (e.which == 3) {
// Put right mouse code here
alert('Sorry, this Picture is copyright !');
return false;
}
else {
return true;
}
}
}
if (document.all){
function click() {
if (event.button==2) {
alert('Sorry, this Picture is copyright !')
}
if (event.button==3) {
alert('Sorry, this Picture is copyright !')}
}
document.onmousedown=click
}
// -->
</script>
<?php

##############################################################################
// eCards Virtual Greeting Card System
// Copyright (C) 2004 by 4n-community.de
// http://www.4n-community.de
// ---------------------------------------------------------------------------
// LICENSE:
// This Script is copyright of www.4n-community.de and may free of charge be used exclusively for private homepage.
// For free use  must all copyright notices unchanged in the Script! Also not be removed, converted, hidden or made invisible.
// If you liked not to indicate the copyright reference or the Script on commercial sides begin, you can acquire a license (= > LIZENZ.txt)!
// ---------------------------------------------------------------------------
// Filename: Card_V7.1
// Original Author: Lothar Dambowsky
// Purpose: Create via web a Virtual Greeting Card
// ---------------------------------------------------------------------------
// Forum to the Script of: http://www.4n-community.de/modules.php?name=4nForum
##############################################################################

if (!isset($mainfile)) { include("mainfile.php");}
include('header.php');
require("modules/Card/include.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$index=0;

if (!$send and !$preview){ OpenTable();

?>

<div align="center"><br><a href="javascript:history.back();"><h4><? echo _CARDNEW ; ?></h4> </a>
      <table align="center"  border="0" cellpadding='2' bgcolor="<? echo $bgcolor2; ?>" cellspacing="5" cellpadding="2" >
      <tr><td colspan="4" align="center"></td></tr>
      <tr><td  width="91%" align="center" colspan="3">

<p> <?php if(isset($picture)){ ?> <img src="<?php echo "modules/Card/$picture";?>"> <?php }else{echo "<br><b>"._CARDERROR."</b><br><br>";}?> </p>
<form name="form1" method="post" action="modules.php?name=Card&file=start">

      <input type="hidden"  name="bild" value="<?php echo "$picture";?>">
      <input type="hidden"  name="color" value="<?php echo "$bgcolor2";?>">

          <hr></td></tr>

                <tr>
                  <td><h5><? echo _CARDMUSIC ; ?></h5></td>
                  <td colspan="2" align="right"><h5><? echo _CARDMESSAGE ; ?></h5></td>
                </tr>
                <tr>
                  <td width="170">
                    <p>
                      <select name="audio">
                        <option value="" selected><? echo _CARDNOMUSIC ; ?></option>
                        <option value="yesterd.mid">Yesterday</option>
                        <option value="mandy.mid">Mandy</option>
                        <option value="obladida.mid">Obladi Oblada</option>
                        <option value="standbyy.mid">Stand By Me</option>
                        <option value="sheloveu.mid">She Love You</option>
                        <option value="shalalai.mid">Shalalai</option>
                        <option value="sweetdr.mid">Sweet Dreams</option>
                        <option value="gloria.mid">Gloria</option>
                      </select>
                    </p>
                  <p><b><? echo _CARDLISTENMUSIC ; ?></b><br>
                    <a href="modules/Card/sweetdr.mid">Sweet Dreams</a><br>
                    <a href="modules/Card/standbyy.mid">Stand by me</a><br>
                    <a href="modules/Card/shalalai.mid">Shalalai</a>
                  </p></td>
                  <td colspan="2" align="right">
                    <textarea name="nachricht" cols="35" rows="6"></textarea>
                  </td>
                </tr>
                <tr><td colspan="4" hight="100"><hr></td></tr><tr></table>

                    <table align="center" border="0" cellspacing="2" cellpadding="2" >
                    <tr>
                        <td colspan="5" align="center"><br><h5><? echo _CARDDATA ; ?></h5></td>
                    </tr>
                    <tr>
                        <td width="150" align="right">&nbsp;</td>
                        <td colspan="2"><? echo _CARDSENDER ; ?></font></td>
                        <td width="150"><? echo _CARDRECEIVER ; ?></td>
                        <td width="130" align="right">&nbsp;</td>
                    </tr>
                    <tr>
                        <td width="" align="right"><? echo _CARDNAME ; ?></td>
                        <td colspan="2" > <font face="Arial, Helvetica, sans-serif" size="2">
                        <input type="text" name="absendername"></font></td>
                        <td width="150" > <font face="Arial, Helvetica, sans-serif" size="2">
                        <input type="text" name="empfaengername"></font></td>
                        <td width="130" align="right">&nbsp;</td>
                      </tr>
                      <tr>
                        <td width="" align="right"><? echo _CARDEMAIL ; ?></td>
                        <td colspan="2" > <font face="Arial, Helvetica, sans-serif" size="2">
                        <input type="text" name="absenderemail"></font></td>
                        <td width="150" > <font face="Arial, Helvetica, sans-serif" size="2">
                        <input type="text" name="empfaengeremail"></font></td>
                        <td width="130" align="right">&nbsp;</td>
                      </tr>
                      <tr>
                        <td colspan="5" align="center"><br>
                        <input type='submit' value='<? echo _CARDPRESEND ; ?>'>
                        <input type=hidden name="preview" id="preview" value="1">
                  </td>
                </tr>
              </form>
           </table> </div>
<?
if(file_exists("modules/Card/file.php")){include "modules/Card/file.php"; CloseTable(); include("footer.php");}

// Dieser Link muss erhalten bleiben und darf nicht entfernt werden - not edit or delete this link, thanks!
echo "<br><br><hr><center> <a title='Module &copy Information' href=\"#\" onClick=\"window.open('modules/Card/modul.php','neuesfenster','width=400,height=300,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes,');return false\">eCard-Modul</a> phpNuke &copy by <a href='http://www.4n-community.de' target='_blank'> 4n-community </a></center>";
CloseTable();
}
else
{

if (empty ($nachricht)) {
    die ("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"3\" color=red><div align=\"center\"><br><h4>"._CARDCHECKMESSAGE."</h4><br><a href=\"javascript:history.back();\"><h5>&laquo;&laquo; "._CARDBACK."</h5></A></font></div>");}
if (empty ($absenderemail)) {
    die ("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"3\" color=red><div align=\"center\"><br><h4>"._CARDCHECKMAIL."</h4><br><a href=\"javascript:history.back();\"><h5>&laquo;&laquo; "._CARDBACK."</h5></A></font></div>");}
if(!eregi("^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,4}$", $absenderemail)) {
     die("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"3\" color=red><div align=\"center\"><br><h4>"._CARDCHECKSMAIL."</h4><br><a href=\"javascript:history.back();\"><h5>&laquo;&laquo; "._CARDBACK."</h5></A></font></div>");}
if (empty ($empfaengeremail)) {
    die ("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"3\" color=red><div align=\"center\"><br><h4>"._CARDCHECKRMAIL."</h4><br><a href=\"javascript:history.back();\"><h5>&laquo;&laquo; "._CARDBACK."</h5></A></font></div>");}
if(!eregi("^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,4}$", $empfaengeremail)) {
     die("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"3\" color=red><div align=\"center\"><br><h4>"._CARDCHECKRRMAIL."</h4><br><a href=\"javascript:history.back();\"><h5>&laquo;&laquo; "._CARDBACK."</h5></A></font></div>");}
if (empty ($absendername)) {
    die ("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"3\" color=red><div align=\"center\"><br><h4>"._CARDCHECKNAME."</h4><br><a href=\"javascript:history.back();\"><h5>&laquo;&laquo; "._CARDBACK."</h5></A></font></div>");}
if (empty ($empfaengername)) {
    die ("<b><font face=\"Arial, Helvetica, sans-serif\" size=\"3\" color=red><div align=\"center\"><br><h4>"._CARDCHECKRNAME."</h4><br><a href=\"javascript:history.back();\"><h5>&laquo;&laquo; "._CARDBACK."</h5></A></font></div>");}

if($send=="1")
{

$unixtime = time();
$ablaufdatum = "$unixtime"+"$zeitspanne";

$templatefile = fopen ($template, "r");
$html = fread ($templatefile, filesize ($template));
fclose ($templatefile);
$nachricht = stripslashes($nachricht);
$nachricht = strip_tags($nachricht,"<br><b></b>");

$html = ereg_replace("%absendername%","$absendername",$html);
$html = ereg_replace("%absenderemail%","$absenderemail",$html);
$html = ereg_replace("%empfaengername%","$empfaengername",$html);
$html = ereg_replace("%empfaengeremail%","$empfaengeremail",$html);
$html = ereg_replace("%bild%","$bild",$html);
$html = ereg_replace("%audio%","$audio",$html);
$html = ereg_replace("%nachricht%","$nachricht",$html);
$html = ereg_replace("%homepageurl%","$homepageurl",$html);
$html = ereg_replace("%versendet%", _CARDGREETINGC,$html);
$html = ereg_replace("%for%",_CARDFOR,$html);

$datei = fopen("modules/Card/"."$ablaufdatum".".html", "w+");
if ($datei)
{
fputs ($datei,"$html");
fclose ($datei);
}

$db = "modules/Card/daten.txt";
$daten= fopen ("$db","a+");
if (flock($daten,2)){
fputs ($daten, "$ablaufdatum".";\n");
fclose ($daten);}

$link = "$kartenverzeichnis"."card.php?id=$ablaufdatum";

$emailtext = " "._CARHELLO." $empfaengername ,

$absendername ($absenderemail) "._CARDMAILTEXT."

$link
"._CARDMAILTEXTT."\n";

$betreff = ""._CARDBETRFF." $absendername" ;
mail("$empfaengeremail", "$betreff", "$emailtext","From: $absenderemail");
?>
<script LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
var s_referer = '<? echo "$empfaengeremail"; ?>';
document.write('<script src="<? echo "$view"; ?>/tracker/referer.php?referer='+s_referer+'"><\/script>');
// -->
</script>
<?php
OpenTable();
$feedback ="<table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\" align='center>'>
<tr><td align=\"center\"><br><br>"._CARDFEEDBACK." $empfaengername ($empfaengeremail) "._CARDFEEDBACKK."
<!-- Dieser Link muss erhalten bleiben und darf nicht entfernt werden - not edit or remove this link, thanks!//-->
<hr><div align='center'> <a title='Module &copy Information' href=\"#\" onClick=\"window.open('modules/Card/modul.php','neuesfenster','width=400,height=300,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes,');return false\">eCard-Modul</a> phpNuke &copy by <a href='http://www.4n-community.de' target='_blank' title='www.4n-community.de'>
4n-community</a>&nbsp;</div></td></tr></table>";

echo $feedback;
CloseTable();

$ziffernzeilen = file($db);
while (list ($line_num, $line) = each ($ziffernzeilen))
{ $ziffern = explode(";",$line);

if ("$ziffern[0]" < "$unixtime")
{$nummer = $line_num;
$delete = "modules/Card/"."$ziffern[0]".".html";
@unlink($delete);

$fp = fopen( "$db", "r" );
$size = filesize($db);
$contents = fread($fp, $size);
fclose($fp);

$string2 = "";
if ($line_num == $nummer){
$replace = ereg_replace($line, $string2, $contents);

$fp = fopen($db, "w");
fputs($fp, $replace, $size);
fclose($fp);}
}
}}
if($preview==1)
{

OpenTable();
$templatefile = fopen ($templatevorschau, "r");
$html = fread ($templatefile, filesize ($templatevorschau));
fclose ($templatefile);
$nachricht = stripslashes($nachricht);
$nachricht = strip_tags($nachricht,"<br><b></b>");
//$nachricht = htmlentities($nachricht, ENT_QUOTES);

$html = ereg_replace("%absendername%","$absendername",$html);
$html = ereg_replace("%absenderemail%","$absenderemail",$html);
$html = ereg_replace("%empfaengername%","$empfaengername",$html);
$html = ereg_replace("%empfaengeremail%","$empfaengeremail",$html);
$html = ereg_replace("%bild%","$bild",$html);
$html = ereg_replace("%audio%","$audio",$html);
$html = ereg_replace("%nachricht%","$nachricht",$html);
$html = ereg_replace("%vorschau%",_CARDPREVIEW,$html);
$html = ereg_replace("%versenden%",_CARDGREETING,$html);
$html = ereg_replace("%for%",_CARDFOR,$html);
$html = ereg_replace("%senden%",_CARDSEND,$html);
$html = ereg_replace("%back%",_CARDBACK,$html);

echo "$html";
CloseTable();
}

}

include("footer.php");

?>
