View Full Version : Show Last Date A Referral Was Active
OUT2WIN
01-05-2009, 07:43 AM
I'd like to be able to show the last date a referral was active on my members area of my website. I own a paid to site and am planning to add a referral replacement option, but before I can begin that I would like to be able to show the last active date in the referral.php area of the members.php area.
This should be a simple process, but I haven't been able to figure it out.
Thanks, I'm stuck.
Rob
If you already have the referral system worked out - you can do something like this:
$query = "WHOS ONLINE QUERY GOES HERE";
//WHOS ONLINE CODE GOES HERE
if($user['referral']){
$referrals[] = $user['name'];
}
If you have a field in your database called referral - and it sets to true if the person is a referral then that should work.
Please give us all the fields to your database - a link to your page - and the code.
OUT2WIN
01-05-2009, 06:47 PM
Thanks for the reply. My db fields are :
c_online
tb_ads
tb_advertisers
tb_adverts
tb_buyref
tb_config
tb_contact
tb_history
tb_payme
tb_upgrade
tb_users
Under tb_users (I'm guessing thats where I start) the fields are as follows:
Id
username
password
ip
email
pemail
referrer
country
visits
referals
referal visits
money
paid
joindate
lastlogdate
lastiplog
account
The lastlogdate and joindate confuse the crap out of me because they read:
joindate:
(User id 1) 1184512264
(User id 2) 1223439616
lastlogindate:
(User id 1) 1229406190
(User id 2) 1230777398
Which isn't a understandable set of numbers to myself. This fujumble of numbers seems to work though, I added $1 to my balance and cashed out to check everything routed correctly and it did along with imputing the correct date of cash out in the history section of the members area.
Sorry this turned out so long. I'm not sure how to make that cool graybox with the code placed all neat inside of it, so I'll post the code (I think this is what you are asking for - members.php):
<?
session_start();
?>
<?PHP
define("LOCKER909", 1);
?>
<html>
<head>
<?
require('config.php');
?>
<title><?
$sql = "SELECT * FROM tb_config WHERE id='2' and howmany='1'";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
?><?= $row['item'] ?> <?= $tsname ?></title>
<link rel="stylesheet" type="text/css" href="estilo.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" media="screen">
<!--
@import url("unknown.css");
-->
</style></head>
<body link="#0000ff" alink="#0000ff" vlink="#0000ff">
<center>
<div id="outline">
<div id="logo"></div>
<div id="nav">
<a href="surf.php"><img src="images/header_03r.gif" border="0"></a>
<a href="offer.php"><img src="images/header_04r.gif" border="0"></a>
<a href="faq.php"><img src="images/header_05r.gif" border="0"></a>
<a href="advertise.php"><img src="images/header_06r.gif" border="0"></a>
<a href="contact.php"><img src="images/header_07r.gif" border="0"></a>
<br>
</div>
<div class="rightsider">
<?
include('menu.php');
?>
<br>
<br>
<marquee width="275px" height="550px" direction="up" onMouseOver="this.stop();" onMouseOut="this.start()";>
<?
include('news.php');
?>
</marquee>
</div>
<div style="border:0px #666 solid;padding-top:7px;padding-bottom:7px;" bgcolor="#000000" width="500" id="tables">
<font size="2" face="verdana">
<?
if(!isset($_COOKIE["usNick"]) && !isset($_COOKIE["usPass"]))
{
exit();
}
?>
<?
$sql = "SELECT * FROM tb_users WHERE username='$user'";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
?><div style="border:1px solid blue;padding:10px;">
To refer others, use <b><? showmeurgoods.com; echo $url; ?>http://www.showmeurgoods.com/?r=<? echo $row["username"]; ?></b>
<br>
OR
<br>
Email a Friend
<form action="" method="post">
Your Name:
<font size="2" face="verdana">
<input type="input" name="yourname" />
</font>
Friend email:
<input type="input" name="friendemail" />
<input type="submit" name="submit" value="Send" />
</form>
<?
if (isset($_POST['submit'])){
$to="".$_POST['friendemail']."";
$subject="".$_POST['yourname']." wants you to check this out!";
$mail_from="from: Invitation@ShowMeUrGoods.com \n";
$mail_from .="Content-Type: text/html; charset=utf-8 \n";
$message="<font size=\"2\" face=\"Verdana\"> <b>".$_POST['friendemail']."</b>,<br />
".$_POST['yourname']." Is Inviting You To Try A Great Program With Payout At $0.50!<br />
<a href=\"http://www.showmeurgoods.com/?r=".$row["username"]."\">ShowMeUrGoods</a> </font>";
$sentmail = mail($to,$subject,$message,$mail_from);
echo "<li><font color=\"#8CC600\">Message Sent</font></li>";
}
?><br></div>
<br>
<table width="85%" cellpadding="0" cellspacing="0" style="padding-bottom:10px;">
<tr>
<td style="border-bottom:1px #000 solid;padding:2px;">
<font style="font-size:11px;" face="verdana">
<b>Your Statistics</b>
</font>
</td>
<td style="border-bottom:1px #000 solid;padding:2px;">
</td>
</tr>
<tr>
<td style="padding:2px;">
<font style="font-size:11px;" face="verdana">
# of Website Visits
</font>
</td>
<td align="right" style="padding:2px;">
<font style="font-size:11px;" face="verdana"><b>
<? echo $row["visits"]; ?>
</b></font>
</td>
</tr>
</table>
<table width="85%" cellpadding="0" cellspacing="0" style="padding-bottom:10px;">
<tr>
<td style="border-bottom:1px #000 solid;padding:2px;">
<font style="font-size:11px;" face="verdana">
<b>Your Referral Statistics</b>
</font>
</td>
<td style="border-bottom:1px #000 solid;padding:2px;">
</td>
</tr>
<tr>
<td style="padding:2px;">
<font style="font-size:11px;" face="verdana">
# of Referrals (<a href="referals.php"><b>View</b></a>)
</font>
</td>
<td align="right" style="padding:2px;">
<font style="font-size:11px;" face="verdana"><b>
<? echo $row["referals"]; ?>
</b></font>
</td>
</tr>
<tr>
<td style="padding:2px;">
<font style="font-size:11px;" face="verdana">
# of Referral Website Visits
</font>
</td>
<td align="right" style="padding:2px;">
<font style="font-size:11px;" face="verdana"><b>
<? echo $row["referalvisits"]; ?>
</b></font>
</td>
</tr>
</table>
<table width="85%" cellpadding="0" cellspacing="0" style="padding-bottom:10px;">
<tr>
<td style="border-bottom:1px #000 solid;padding:2px;">
<font style="font-size:11px;" face="verdana">
<b>Balance Information</b>
</font>
</td>
<td style="border-bottom:1px #000 solid;padding:2px;">
</td>
</tr>
<tr>
<td style="padding:2px;">
<font style="font-size:11px;" face="verdana">
Account Balance (<a href="convert.php"><b>cashout</b></a>)
</font>
</td>
<td align="right" style="padding:2px;">
<font style="font-size:11px;" face="verdana"><b>
$<? echo $row["money"]; ?>
</b></font>
</td>
</tr>
<tr>
<td style="padding:2px;">
<font style="font-size:11px;" face="verdana">
Total Amount Paid
</font>
</td>
<td align="right" style="padding:2px;">
<font style="font-size:11px;" face="verdana"><b>
$<? echo $row["paid"]; ?>
</b></font>
</td>
</tr>
</table>
</font></div>
<div class="clear"></div>
</div>
<div id="footer" align="center"><a href="privacy.php"><font size="2" face="verdana" color="#FFFFFF">© 2008 ShowMeUrGoods-</font> Privacy</a> - <a href="tos.php">TOS</a></div>
</center>
</div>
</body>
</html>
When pasting a code, please remember to use [code] tags. That includes [ html ], [ code ], and [ php ].
Can you also tell me what each field in the DB is used for?
Did you make this script - if you didn't, where did you get it from?
OUT2WIN
01-05-2009, 07:35 PM
Ah Ha...so thats how the code gets its own box. Cool, ty, I didn't know that.
I bought this script from the same guy Garret Baily who build, owned, and ran into the ground tbcfclicks.net or something like that. He also sold/sells scripts on ebay. It got rated very secure by uronlinbiz (I'm still building, adding to, subtracting, and haven't launched yet.) Which is why I bought it. But because it was being used as a "scam business model" ptc originally, it failed and he decided to continue to sell scripts but has got out of the ptc business.
c_online - see current users online
tb_ads - ad's purchased, who, when, how many, email address, user ect..
tb_advertisers - shows information which transfers to me when someone buys an ad
tb_adverts - has the current offers I offer (cash back offers)
tb_buyref - keeps track of purchased referral packs
tb_config - contains the ammount/dollar/increments/ per advertisment available. routes correct dollar amounts
tb_contact - contains all the information they fill in in the contact form + ip and id information
tb_history - automatically tracks when I authorize payments and routes the information to the menu.php file which shows total payouts, members, and online
tb_payme - routes to the admin section of the site when someone requests a payment to let me know.
tb_upgrade - upgrade status, date, username, payment email, email, username, id, and ip
tb_users - Complete sum up of all members. usernames, passwords, ip, lastlogin, lastloginip, email, payment email, premium or standard membership.
Quck question, with those code tags, do I highlight the text then press the code/html button to make it appear in the box?
To highlight the code in the boz:
To highlight PHP Syntax use the [ PHP ] tag.
To highlight HTML Syntax use the [ HTML ] tag.
To highlight like this:
Blah Blah Balah
Use the [ ICODE ] in the [ CODE ] tag.
I don't know how you figure out if someone is a referral, but replace the highlighted with the referral field..
$queryA = mysql_query("SELECT * FROM `Id` WHERE `referral` = TRUE");
while($resultA = mysql_fetch_assoc($queryA){
$queryB = mysql_query("SELECT * FROM `c_online`");
while($resultB = mysql_fetch_assoc($queryB){
if(preg_match(/$resultA['username']/,$resultB['c_online'])){
echo $resultA['username'];
}
}
}
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.