Jump to content

Paid to Click script


ginger76

Recommended Posts

Hi,

 

I have a set of ptc scripts that I can't get working properly. There are two types of membership, free and upgraded. When a buyer purchases advertising they can choose to display their ad to all members or just the upgraded. There is then a page with a list of ads that can be clicked. If the member is upgraded they will see the extra ads, or rather that is how it is supposed to be. For some reason the extra ads are not showing up for the upgraded members. The script for the list of ads is below. Can anyone see anything wrong?

<? include "header.php";?>
<h1>Surf Ads - Visit Websites</h1>
<div align=center>Current Ad Count: <strong><?php
$currentads = ($loggedin == 1 and $rowe["status"]=="upgraded") ? "" : " AND premium=0";
$currentads = mysql_query("SELECT COUNT(*) AS cnt FROM ads WHERE active='1'".$currentads);
$currentads = mysql_fetch_array($currentads);
$currentads = $currentads["cnt"];
print $currentads;
?></strong>    New Ads Today: <strong>
<?=$set["newadstoday"];?></strong>    Total Ads Served: <strong>
<?=$set["totalads"];?></strong><br><br></div>
<?php
$cats = array(  "1"  => "Arts & Entertainment",
"2" => "Business & Money",
"3" => "Computers & Internet",
"4" => "Health & Recreation",
"5" => "Reference & Education",
"6" => "Shopping & Spending",
"8" => "Travel & Accommodation",
"9" => "Charity & Nonprofit" );
foreach($cats as $k=>$v)
{
print '	<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr> <td width="70%" class="surfcat"><span style="margin-left: 3px;"><strong>'.$v.'</strong></span></td><td width="10%" class="surfheader"><span style="margin-left: 3px;"><strong>Member</strong></span></td><td width="10%" class="surfheader"><span style="margin-left: 3px;"><strong>Outside</strong></span></td><td width="10%" class="surfheader"><span style="margin-left: 3px;"><strong>Total</strong></span></td></tr>';
$premium = ($loggedin == 1 and $rowe["status"]=="upgraded") ? "" : " AND premium=0";
$ads = mysql_query("SELECT COUNT(*) AS cnt FROM ads WHERE active='1' AND cat='$k'". $premium);
$ads = mysql_fetch_array($ads);
$ads = $ads['cnt'];
if($ads == 0)
{
print '<tr> <td colspan="4" class="surfnoads"><span style="margin-left: 3px;">No Current Ads</span></td></tr>';
} else {
$premium = ($loggedin == 1 and $rowe["status"]=="upgraded") ? "" : " AND premium=0";
$quer = mysql_query("SELECT * FROM ads WHERE active='1' AND cat='$k'". $premium);
while($ad = mysql_fetch_array($quer))
{
if($loggedin==1)
{
$checkvisit = mysql_query("SELECT COUNT(*) AS cnt FROM ad_clicks WHERE user='{$r['id']}' AND ad='{$ad['ad_id']}'") or die(mysql_error());
$checkvisit = mysql_fetch_array($checkvisit);
$checkvisit = $checkvisit["cnt"];
}
if($checkvisit > 0 and $loggedin ==1)
{

print '	<tr>  <td width="70%" class="surfads"><span style="margin-left: 3px; text-decoration:none; color: #787878;"><font color=#660000><strike>'.$ad['ad_description'].'</strike></font> </span></td> <td width="10%" class="surfadsdetails"><span style="margin-left: 3px;">'.$ad['clicks'].'</span></td><td width="10%" class="surfadsdetails"><span style="margin-left: 3px;">'.$ad['outside'].'</span></td> <td width="10%" class="surfadsdetails"><span style="margin-left: 3px;">'.($ad['outside']+$ad['clicks']).'</span></td></tr>';
} else {
print '	<tr> <td width="70%" class="surfads"><span style="margin-left: 3px; text-decoration:none; color: #787878;"><a href=view.php?ad='.$ad['ad_id'].' target=_blank style="text-decoration:none; color: #787878;">'.$ad['ad_description'].'</a> </span></td><td width="10%" class="surfadsdetails"><span style="margin-left: 3px;">'.$ad['clicks'].'</span></td><td width="10%" class="surfadsdetails"><span style="margin-left: 3px;">'.$ad['outside'].'</span></td><td width="10%" class="surfadsdetails"><span style="margin-left: 3px;">'.($ad['outside']+$ad['clicks']).'</span></td>
</tr>';
}
}
}
print "</table><br />";
}
?>
<? include "footer.php";?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.