PDA

View Full Version : I am stuck, the code isn't working



mediavideosite
04-17-2010, 07:10 AM
The following piece of code feed the home page (only index.php page) google adsense to my side mediavideosite.com

I bought it a while ago, seller didn't reply to my Qs any more.

In admin area there is a form where I can enter the adsense code

It works the first time but then when I made the modification it doesn't do the job of updating.



function cleanCode($code) {

$cleanCode = "";

for($i = 0 ; $i < strlen($code) ; $i++) {

if($code[$i] == '\\') {
$cleanCode .= '';
}else{
$cleanCode .= $code[$i];
}

}

$cleanCode2 = "";

for($i = 0 ; $i < strlen($cleanCode) ; $i++) {

if($cleanCode[$i] == '"') {
$cleanCode2 .= '\"';
}else{
$cleanCode2 .= $cleanCode[$i];
}

}

return $cleanCode2;
}

$config["ads_468"] = "'. cleanCode($_POST["ads_468"]). '";
$config["ads_728"] = "'. cleanCode($_POST["ads_728"]). '";
$config["ads_300"] = "'. cleanCode($_POST["ads_300"]). '";

I know something wrong with the cleanCode function but I don't know the grammar, anyone could please help please, this cleanCode also suppose to feed google analytics but I have entered the analytics code for months and google can't detect the code being installed:

### Tracking Code ###
$config["tracking_code"] = "'. cleanCode($_POST["tracking_code"]). '";
?>';


There is another longtail ad also fed by this piece of code which also isn't function properly

### Longtail video ads ###
$config["longtail_enabled"] = '. $_POST["longtail_enabled"]. ';
$config["longtail_channel"] = "'. $_POST["longtail_channel"]. '";
$config["longtail_js"] = "'. cleanCode($_POST["longtail_js"]). '";

When I first bought the site the videos load very quickly, now it takes ages to load a single video, I could never get it to play, anybody got idea where went wrong???

Thanks a mil.................................:o