// init page defaults:
// -------------------
include("includes/config.inc.php");
include("includes/functions.inc.php");
include("includes/partners.inc.php");
$PageTitle = SITE_TITLE;
$PageSubTitle = "Links naar andere sites.";
$PageHeader = "Links naar andere sites. Gesorteerd op populariteit.";
$Refresh_URL = "";
$Refresh_Name = "";
$Refresh_Name_Long = "";
$table = "partners";
///////////////////////////
//DATABASE CONNECTIE:
///////////////////////////
open_DB_Meezingen();
if ( (!isset($in) || empty($in)) && (!isset($out) || empty($out)) ) {
//No incomming or outgoing traffic, so go to the main page.
$content = "";
$Refresh_URL = $SiteUrl;
$Refresh_Name = $SiteTitle;
}
elseif (isset($in)) {
//Incoming visitor
//increment the click-amount for musiclink id:
$query = "UPDATE $table SET p_click_in=p_click_in+1, p_click_in_total=p_click_in_total+1 WHERE p_id='$in'";
if(!mysql_query($query)) {
$content .= mysql_errno().": ";
$content .= mysql_error()."
";
$content .= "SQL Statement:\n" . $query;
}
switch($in) {
//example 1:
case 9971:
//Hits from rene-froger.startkabel.nl redirect to rene froger page:
$Refresh_URL = $SiteUrl . "artist.php?id=0133";
break;
//example 2:
case 9980: //DutchTop40.net MP3
//if isset($q), go to search.php with the given query.
if (isset($q) && !empty($q))
{
$Refresh_URL = $SiteUrl . "zoek.php?searchFor=$q&mode=$mode";
} else { $Refresh_URL = $SiteUrl; }
break;
default:
$Refresh_URL = $SiteUrl;
//$content .= showMusicLinksTable();
break;
}
$showContent = true;
$Refresh_Name = $SiteTitle;
$refreshTime = 3;
$content .= "Bedankt voor het stemmen op een van onze link partners!
\n";
$content .= "Klik hier om naar onze homepage te gaan.\n";
}
elseif (isset($out)) {
//OUTgoing visitors
//increment the click-amount for $PARTNER_ID
$query = "UPDATE $table SET p_click_out=p_click_out+1, p_click_out_total=p_click_out_total+1 WHERE p_id='$out'";
if(!mysql_query($query))
{
echo mysql_errno().": ";
echo mysql_error()."
";
}
// Fetch the link for redirect:
$query = "SELECT p_url, p_name, p_description FROM $table WHERE p_id='$out'";
$query_result = mysql_query($query) or die ("Unable to process query");
$click_site = mysql_fetch_array($query_result);
$Refresh_URL = $click_site['p_url'];
$Refresh_Name = $click_site['p_name'];
$Refresh_Name_Long = $click_site['p_description'];
$content .= "
De website: $Refresh_Name, is nu geopend in een nieuw venster. Zo niet, klik op de volgende link om dit alsnog te doen. ";
$content .= "$Refresh_Name - $Refresh_Name_Long";
$content .= "
Bedankt voor je bezoek aan $SiteTitle!
Met vriendelijke groet,
Het $SiteTitle team.
|