update install and email activation + add friends inviting system

This commit is contained in:
unknown
2012-05-22 20:52:56 +03:00
parent 7d43ffbaa3
commit 2d87749f95
34 changed files with 765 additions and 488 deletions
+27 -6
View File
@@ -14,16 +14,17 @@ include("Templates/Plus/pmenu.tpl");
<h3>1) Invite your friends via Email</h3>
<?php if($session->access != BANNED){ ?>
<p><a href="plus.php?id=5&amp;a=1&amp;mail">&raquo; Invite by e-mail</a></p>
<?php }else{ ?>
<p><a href="banned.php">&raquo; Invite by e-mail</a></p>
<?php } ?>
<h3>2) Copy your personal REF-Link and share it!</h3><span class="notice">Your personal REF Link:</span>
<br>
<span class="link"><?php echo HOMEPAGE; ?>?id=ref_<?php echo $session->uid; ?></span>
<span class="link"><?php echo HOMEPAGE; ?>anmelden?id=ref_<?php echo $session->uid; ?></span>
<h3>Progress of your invited friends</h3>
<p>As soon as a player you invited has found his <b>2</b>. village, you will be credited with <b>50</b> gold.</p>
<p>As soon as a player you invited has found his <b>2</b> village, you will be credited with <b>50</b> gold.</p>
<table id="brought_in" cellpadding="1" cellspacing="1">
<thead>
@@ -32,10 +33,6 @@ include("Templates/Plus/pmenu.tpl");
</tr>
<tr>
<td></td>
<td>World</td>
<td>UID</td>
<td>Member since</td>
@@ -45,9 +42,33 @@ include("Templates/Plus/pmenu.tpl");
<td>Villages</td>
</tr>
</thead>
<tbody>
<?php
$invite = $database->getInvitedUser($session->uid);
if(count($invite) > 0){
foreach($invite as $invited) {
$varray = $database->getProfileVillages($invited['id']);
$totalpop = 0;
foreach($varray as $vil) {
$totalpop += $vil['pop'];
}
?>
<tr>
<td><?php echo $invited['id']; ?></td>
<td><?php echo date("j.m.y",$invited['regtime']); ?></td>
<td><?php echo $totalpop; ?></td>
<td><?php echo count($varray); ?></td>
</tr>
<?php
}}else{
?>
<tr>
<td class="none" colspan="6">You have not brought in any new players yet.</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
+80
View File
@@ -0,0 +1,80 @@
<?php
include("Templates/Plus/pmenu.tpl");
?>
<h2>Invite friends and receive free Gold</h2>
<p>If you get new players to open an account and settle a second village with Travian you will receive gold. You can use this gold to purchase a plus account or plus advantages.
<br>
<br>
To bring in new players, you can invite them by e-mail or have them click on your REF link.</p>
<h2>How is it done?</h2>
<h3>1) Invite your friends via Email</h3>
<?php if($session->access != BANNED){ ?>
<form action="plus.php" method="POST">
<p><input class="mail" name="mail" value=""></p>
<p>Own text:</p>
<p><textarea id="text" name="text"></textarea></p>
</form>
<?php }else{ ?>
<p><a href="banned.php">&raquo; Invite by e-mail</a></p>
<?php } ?>
<h3>2) Copy your personal REF-Link and share it!</h3><span class="notice">Your personal REF Link:</span>
<br>
<span class="link"><?php echo HOMEPAGE; ?>anmelden?id=ref_<?php echo $session->uid; ?></span>
<h3>Progress of your invited friends</h3>
<p>As soon as a player you invited has found his <b>2</b>. village, you will be credited with <b>50</b> gold.</p>
<table id="brought_in" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th colspan="6">Players brought in</th>
</tr>
<tr>
<td></td>
<td>World</td>
<td>UID</td>
<td>Member since</td>
<td>Inhabitants</td>
<td>Villages</td>
</tr>
</thead>
<tbody>
<?php
$invite = $database->getInvitedUser($session->uid);
if(count($invite) > 0){
foreach($invite as $invited) {
$varray = $database->getProfileVillages($invited['id']);
$totalpop = 0;
foreach($varray as $vil) {
$totalpop += $vil['pop'];
}
?>
<tr>
<td><?php echo $invited['id']; ?></td>
<td><?php echo date("j.m.y",$invited['regtime']); ?></td>
<td><?php echo $totalpop; ?></td>
<td><?php echo count($varray); ?></td>
</tr>
<?php
}}else{
?>
<tr>
<td class="none" colspan="6">You have not brought in any new players yet.</td>
</tr>
<?php } ?>
</table>
</div>
+203 -62
View File
@@ -1,67 +1,208 @@
<div id="content" class="signup">
<div id="content" class="signup">
<?php
if(isset($_GET['id']) && isset($_GET['q'])) {
$act2=$database->getActivateField($_GET['id'],"act2",0);
if($act2==$_GET['q']){
$show='1';
$naam=$database->getActivateField($_GET['id'],"username",0);
$email=$database->getActivateField($_GET['id'],"email",0);
<?php
if(isset($_GET['id']) && isset($_GET['q'])) {
$act2=$database->getActivateField($_GET['id'],"act2",0);
if($act2==$_GET['q']){
$show='1';
$naam=$database->getActivateField($_GET['id'],"username",0);
$email=$database->getActivateField($_GET['id'],"email",0);
}
}
}
if(isset($show)){
?>
<h1><img src="img/x.gif" class="anmelden" alt="register for the game"></h1>
<h5><img src="img/x.gif" class="img_u05" alt="registration"/></h5>
<p>
Hello <?php echo $naam; ?>,
<br/>
<br/>
The registration was successful. In the next few minutes you will receive an email with the access information.
<br /><br />
The email will be sent to following address: <span class="important"><?php echo $email; ?></span>
</p>
<p>In order to activate your account enter the code or click on the link in your email.</p>
<div id="activation">
<form action="activate.php" method="post">
<p class="important">
Activation code:
</p>
<input class="text" type="text" name="id" maxlength="10" />
<p>
<input type="image" value="ok" name="s1" src="img/x.gif" id="btn_send" class="dynamic_img" alt="send"/>
<input type="hidden" name="ft" value="a2" />
</p>
</form>
</div>
<div id="no_mail">
<p>
<a href="activate.php?id=<?php echo $_GET['id']; ?>&amp;c=<?php echo $generator->encodeStr($email,5); ?>"><span class="important">No email received?</span></a>
</p>
<p>
Sometimes the email is moved to the spam folder. For further help click <a href="activate.php?id=<?php echo $_GET['id']; ?>&amp;c=<?php echo $generator->encodeStr($email,5); ?>">here</a>
</p>
</div>
</div>
<?php if(START_DATE > date('m/d/Y') or START_DATE == date('m/d/Y') && START_TIME <= date('H:i')){ ?>
<br/><center><big>Activation Availble in: </big></center>
<script language="JavaScript">
TargetDate = "<?php echo START_DATE; ?> <?php echo START_TIME; ?>";
CountActive = true;
CountStepper = -1;
LeadingZero = true;
DisplayFormat = "%%H%%:%%M%%:%%S%%";
FinishMessage = "START NOW";
function calcage(secs, num1, num2) {
s = ((Math.floor(secs/num1))%num2).toString();
if (LeadingZero && s.length < 2)
s = "0" + s;
return "" + s + "";
}
if(isset($show)){
?>
<h1><img src="img/x.gif" class="anmelden" alt="register for the game"></h1>
<h5><img src="img/x.gif" class="img_u05" alt="registration"/></h5>
<p>
Hello <?php echo $naam; ?>,
<br/>
<br/>
The registration was successful. In the next few minutes you will receive an email with the access information.
<br /><br />
The email will be sent to following address: <span class="important"><?php echo $email; ?></span>
</p>
<p>In order to activate your account enter the code or click on the link in your email.</p>
<div id="activation">
<form action="activate.php" method="post">
<p class="important">
Activation code:
</p>
<input class="text" type="text" name="id" maxlength="10" />
<p>
<input type="image" value="ok" name="s1" src="img/x.gif" id="btn_send" class="dynamic_img" alt="send"/>
<input type="hidden" name="ft" value="a2" />
</p>
</form>
</div>
<div id="no_mail">
<p>
<a href="activate.php?id=<?php echo $_GET['id']; ?>&amp;c=<?php echo $generator->encodeStr($email,5); ?>"><span class="important">No email received?</span></a>
</p>
<p>
Sometimes the email is moved to the spam folder. For further help click <a href="activate.php?id=<?php echo $_GET['id']; ?>&amp;c=<?php echo $generator->encodeStr($email,5); ?>">here</a>
</p>
</div>
</div>
<?php } else {
?>
<p>
<div id="activation">
<form action="activate.php" method="post">
<p class="important">
Activation code:
</p>
<input class="text" type="text" name="id" maxlength="10" />
<p>
<input type="image" value="ok" name="s1" src="img/x.gif" id="btn_send" class="dynamic_img" alt="send"/>
<input type="hidden" name="ft" value="a2" />
</p>
</form>
</div>
</div>
<?php }
function CountBack(secs) {
if (secs < 0) {
document.getElementById("cntdwn").innerHTML = FinishMessage;
return;
}
DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage(secs,86400,100000));
DisplayStr = DisplayStr.replace(/%%H%%/g, calcage(secs,3600,24));
DisplayStr = DisplayStr.replace(/%%M%%/g, calcage(secs,60,60));
DisplayStr = DisplayStr.replace(/%%S%%/g, calcage(secs,1,60));
document.getElementById("cntdwn").innerHTML = DisplayStr;
if (CountActive)
setTimeout("CountBack(" + (secs+CountStepper) + ")", SetTimeOutPeriod);
}
function putspan(backcolor, forecolor) {
document.write("<div class='activation_time' id='cntdwn'></div>");
}
if (typeof(BackColor)=="undefined")
BackColor = "white";
if (typeof(ForeColor)=="undefined")
ForeColor= "black";
if (typeof(TargetDate)=="undefined")
TargetDate = "12/31/2020 5:00 AM";
if (typeof(DisplayFormat)=="undefined")
DisplayFormat = "%%H%%:%%M%%:%%S%%";
if (typeof(CountActive)=="undefined")
CountActive = true;
if (typeof(FinishMessage)=="undefined")
FinishMessage = "";
if (typeof(CountStepper)!="number")
CountStepper = -1;
if (typeof(LeadingZero)=="undefined")
LeadingZero = true;
CountStepper = Math.ceil(CountStepper);
if (CountStepper == 0)
CountActive = false;
var SetTimeOutPeriod = (Math.abs(CountStepper)-1)*1000 + 990;
putspan(BackColor, ForeColor);
var dthen = new Date(TargetDate);
var dnow = new Date();
if(CountStepper>0)
ddiff = new Date(dnow-dthen);
else
ddiff = new Date(dthen-dnow);
gsecs = Math.floor(ddiff.valueOf()/1000);
CountBack(gsecs);
</script>
<?php }}else{ ?>
<p>
<?php
if(START_DATE > date('m/d/Y') or START_DATE == date('m/d/Y') && START_TIME <= date('H:i')){
?>
<br/><center><big>Activation Availble in: </big></center>
<script language="JavaScript">
TargetDate = "<?php echo START_DATE; ?> <?php echo START_TIME; ?>";
CountActive = true;
CountStepper = -1;
LeadingZero = true;
DisplayFormat = "%%H%%:%%M%%:%%S%%";
FinishMessage = "START NOW";
function calcage(secs, num1, num2) {
s = ((Math.floor(secs/num1))%num2).toString();
if (LeadingZero && s.length < 2)
s = "0" + s;
return "" + s + "";
}
function CountBack(secs) {
if (secs < 0) {
document.getElementById("cntdwn").innerHTML = FinishMessage;
return;
}
DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage(secs,86400,100000));
DisplayStr = DisplayStr.replace(/%%H%%/g, calcage(secs,3600,24));
DisplayStr = DisplayStr.replace(/%%M%%/g, calcage(secs,60,60));
DisplayStr = DisplayStr.replace(/%%S%%/g, calcage(secs,1,60));
document.getElementById("cntdwn").innerHTML = DisplayStr;
if (CountActive)
setTimeout("CountBack(" + (secs+CountStepper) + ")", SetTimeOutPeriod);
}
function putspan(backcolor, forecolor) {
document.write("<div class='activation_time' id='cntdwn'></div>");
}
if (typeof(BackColor)=="undefined")
BackColor = "white";
if (typeof(ForeColor)=="undefined")
ForeColor= "black";
if (typeof(TargetDate)=="undefined")
TargetDate = "12/31/2020 5:00 AM";
if (typeof(DisplayFormat)=="undefined")
DisplayFormat = "%%H%%:%%M%%:%%S%%";
if (typeof(CountActive)=="undefined")
CountActive = true;
if (typeof(FinishMessage)=="undefined")
FinishMessage = "";
if (typeof(CountStepper)!="number")
CountStepper = -1;
if (typeof(LeadingZero)=="undefined")
LeadingZero = true;
CountStepper = Math.ceil(CountStepper);
if (CountStepper == 0)
CountActive = false;
var SetTimeOutPeriod = (Math.abs(CountStepper)-1)*1000 + 990;
putspan(BackColor, ForeColor);
var dthen = new Date(TargetDate);
var dnow = new Date();
if(CountStepper>0)
ddiff = new Date(dnow-dthen);
else
ddiff = new Date(dthen-dnow);
gsecs = Math.floor(ddiff.valueOf()/1000);
CountBack(gsecs);
</script>
<?php
}else{ ?>
<div id="activation">
<form action="activate.php" method="post">
<p class="important">
Activation code:
</p>
<input class="text" type="text" name="id" maxlength="10" />
<p>
<input type="image" value="ok" name="s1" src="img/x.gif" id="btn_send" class="dynamic_img" alt="send"/>
<input type="hidden" name="ft" value="a2" />
</p>
</form> <?php } ?>
</div>
</div>
<?php }
?>