Need a simple script

Status
Not open for further replies.
Welll i can't even add this into my forums, becouse example my add is a script. and it gives this error:

"
The following error occurred when attempting to evaluate this template:
%1$s
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish."

Warning: Invalid argument supplied for foreach() in [path]/includes/functions.php on line 3416

Try changing all " in your ad script to \"
Then enclose the script in $ad_html with " rather than '
 
You will need to properly escape the quote marks in your script eg.

Code:
$ad_html = '<script>
var adfly_id = 236329;
var adfly_advert = \'banner\';
var exclude_domains =
</script>
<script src="LINKlink..asf.asdas></script>
';

Note the backslashes before the ' in your ad script.

Alternately put your ad code into ad.txt and change the $ad_html = 'this is the fucking ad'; line to:

Code:
$ad_html = file_get_contents('ad.txt');

That will load your ad script from an external file, with no need to escape the code in your ad script.

Also note that if you are hacking up the code I posted for your forum, the part that sets the cookie (above the <html> tag) has to be before the opening <html> tag in your script too. You can't set a cookie if you've already sent html to the browser.
 
Last edited:
You will need to properly escape the quote marks in your script eg.

Code:
$ad_html = '<script>
var adfly_id = 236329;
var adfly_advert = \'banner\';
var exclude_domains =
</script>
<script src="LINKlink..asf.asdas></script>
';
Note the backslashes before the ' in your ad script.

Alternately put your ad code into ad.txt and change the $ad_html = 'this is the fucking ad'; line to:

Code:
$ad_html = file_get_contents('ad.txt');
That will load your ad script from an external file, with no need to escape the code in your ad script.

Also note that if you are hacking up the code I posted for your forum, the part that sets the cookie (above the <html> tag) has to be before the opening <html> tag in your script too. You can't set a cookie if you've already sent html to the browser.

Still getting the same error.

Im trying to add that code to the footer of my Vbulletin forums, by editing styles. (ad locations) ..

Hmm...
 
Sorry I can't help you without seeing the page, I'm not a vbulletin user. However the code I posted works - you can test it by just uploading the page to your server, looking at it in your browser, and refreshing the page a few times.
 
Sorry I can't help you without seeing the page, I'm not a vbulletin user. However the code I posted works - you can test it by just uploading the page to your server, looking at it in your browser, and refreshing the page a few times.

www
spammerzone
com

There you can see it =)
 
Any of these scripts are not working with my adfly script.

Here is my adfly script.
www
spammerzone
. com
/adfly.html

I have took those </ >>>> Things oway from <script> that you guys can see the whole code, please someone solve this problem, i need this to work fast.
 
Status
Not open for further replies.
This thread has been auto closed due to the forum's thread age policy. Read more.
Back
Top