smf 2 still not fully support javascript ad codes

Started by meko me, September 13, 2009, 02:02:19 PM

Previous topic - Next topic

meko me

hi smf 2 does'nt support javascript ad codes i.e clicksor ad code  :'( :'( :'(

karlbenson

you need to either use ad management mod

or insert the code directly in the template eg index.template.php

but remember, smf's templates are php+html mix, so your code will need echoing out, and any single quotes within it will need escpaing with a backslash.

echo '<script> var script = \'hello\';</script>';

H

It certainly does support ad codes, and you can see that as we're using adsense on this site which uses JS

If you tell us what you've tried so far, we can help you fix the ad codes so that they work correctly in SMF
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Something like that

Also make sure your Javascript doesn't use document.write. That's incompatible with xhtml.

meko me

hi thanx for replying guys  :)

will u please edit the code for me  :)

Quote<script type=''text/javascript''>
//interstitial ad
clicksor_enable_inter = true; clicksor_maxad = -1;   
clicksor_hourcap = -1; clicksor_showcap = 2;
//Alert MsgAd
clicksor_enable_MsgAlert = true;
//default pop-under house ad url
clicksor_enable_pop = true; clicksor_frequencyCap = -1;
durl = '';
//default banner house ad url
clicksor_default_url = '';
clicksor_banner_border = '#2570ab'; clicksor_banner_ad_bg = '#FFFFFF';
clicksor_banner_link_color = '#000000'; clicksor_banner_text_color = '#666666';
clicksor_banner_image_banner = true; clicksor_banner_text_banner = true;
clicksor_layer_border_color = '';
clicksor_layer_ad_bg = ''; clicksor_layer_ad_link_color = '';
clicksor_layer_ad_text_color = ''; clicksor_text_link_bg = '';
clicksor_text_link_color = '#3d7cad'; clicksor_enable_text_link = true;
clicksor_enable_VideoAd = true;
</script>
<script type="text/javascript" src="http://ads.clicksor.com/showAd.php?pid=101253&adtype=1&sid=150055&zone="></script>
<noscript><a href='http://www.yesads.com'>online marketing</a></noscript>

Thank u very much  :)

Something like that


meko me

Quote from: Mark Rose on September 14, 2009, 02:27:25 AM
You'll need to modify the script at http://ads.clicksor.com/showAd.php?pid=101253&adtype=1&sid=150055&zone= . It calls document.write, which is where your problem is.

hi but i don't know how to modify it  :-[ will ya please do it for me  :-*

Something like that

Quote from: meko me on September 14, 2009, 02:35:12 AM
Quote from: Mark Rose on September 14, 2009, 02:27:25 AM
You'll need to modify the script at http://ads.clicksor.com/showAd.php?pid=101253&adtype=1&sid=150055&zone= . It calls document.write, which is where your problem is.

hi but i don't know how to modify it  :-[ will ya please do it for me  :-*

Nope. Contact whoever it is that runs clicksor.com and get them to do it.

meko me

Quote from: Mark Rose on September 14, 2009, 09:20:57 AM
Quote from: meko me on September 14, 2009, 02:35:12 AM
Quote from: Mark Rose on September 14, 2009, 02:27:25 AM
You'll need to modify the script at http://ads.clicksor.com/showAd.php?pid=101253&adtype=1&sid=150055&zone= . It calls document.write, which is where your problem is.


hi but i don't know how to modify it  :-[ will ya please do it for me  :-*

Nope. Contact whoever it is that runs clicksor.com and get them to do it.

this is rude bt thanx for replying anyways :)

meko me

BTW  their code is working in 1.1.10 version  :o how in the world is this possible ?

青山 素子

Quote from: meko me on September 14, 2009, 02:28:33 PM
BTW  their code is working in 1.1.10 version  :o how in the world is this possible ?

If it works in the 1.1 series, it should work fine in 2.0, although you might have issues with quickreply and quickedit due to the way their code works.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Something like that

Quote from: meko me on September 14, 2009, 02:23:02 PM
Quote from: Mark Rose on September 14, 2009, 09:20:57 AM
Quote from: meko me on September 14, 2009, 02:35:12 AM
Quote from: Mark Rose on September 14, 2009, 02:27:25 AM
You'll need to modify the script at http://ads.clicksor.com/showAd.php?pid=101253&adtype=1&sid=150055&zone= . It calls document.write, which is where your problem is.


hi but i don't know how to modify it  :-[ will ya please do it for me  :-*

Nope. Contact whoever it is that runs clicksor.com and get them to do it.

this is rude bt thanx for replying anyways :)

It's mainly because I can't. It's up to clicksor to fix their script.

meko me

Quote from: Mark Rose on September 14, 2009, 03:33:30 PM
Quote from: meko me on September 14, 2009, 02:23:02 PM
Quote from: Mark Rose on September 14, 2009, 09:20:57 AM
Quote from: meko me on September 14, 2009, 02:35:12 AM
Quote from: Mark Rose on September 14, 2009, 02:27:25 AM
You'll need to modify the script at http://ads.clicksor.com/showAd.php?pid=101253&adtype=1&sid=150055&zone= . It calls document.write, which is where your problem is.


hi but i don't know how to modify it  :-[ will ya please do it for me  :-*

Nope. Contact whoever it is that runs clicksor.com and get them to do it.

this is rude bt thanx for replying anyways :)

It's mainly because I can't. It's up to clicksor to fix their script.

oops my bad i'm sorry i was thinking something else lol  ;)

BTW will u please tell me why this code is working in 1.1.10 ? u can atleast answer this quesion as ur the beta girl why did'nt u test this before releasing 2.0  :( :'( :(

Arantor

SMF is designed to be as compatible as it can, more specifically is designed to XHTML standard - clicksor.com's code is not. As Mark Rose has said, the fault lies with clicksor.com because the way their script is written.

If SMF were to make changes that never broke anything else... they'd have stopped a LONG time ago, before 2.0 even started.
Holder of controversial views, all of which my own.


Jerome YES

Hi,
With regards to the error you are receiving, if you could post exactly where you are inputting your ad code from Clicksor, I can try to recreate the error. Then, I may be able to find out what is causing it.

Thank you,
Jerome
Clicksor.com

Something like that

Jerome, the issue is almost certainly the use of document.write, which is incompatible with the xhtml doctype. The solution is to use something like the following, which works everywhere.

<div id="unique_id_from_clicksor"><script type="text/javascript"><!--
document.getElementById('unique_id_from_clicksor').innerHTML = "magical clicksor ad content";
--></script></div>


And have your users insert that into their documents/html. Of course, "magical clicksort ad content" can be the result of a function call in a javascript file pulled in earlier or any other chunk of HTML.

meko me

Quote from: Jerome YES on September 21, 2009, 10:30:06 AM
Hi,
With regards to the error you are receiving, if you could post exactly where you are inputting your ad code from Clicksor, I can try to recreate the error. Then, I may be able to find out what is causing it.

Thank you,
Jerome
Clicksor.com

thank u for replying sir i'm placing the code in forum index page but i'm getting the  following parse error

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home2/******/public_html/Sources/Load.php(2015) : eval()'d code(17) : eval()'d code on line 1

Darkly Cute

Quote from: meko me on September 23, 2009, 12:58:36 PM
thank u for replying sir i'm placing the code in forum index page but i'm getting the  following parse error


This is an important part you might have missed:

Quote from: karlbenson on September 13, 2009, 02:19:45 PM
but remember, smf's templates are php+html mix, so your code will need echoing out, and any single quotes within it will need escpaing with a backslash.

echo '<script> var script = \'hello\';</script>';

Jerome YES

Quote from: Darkly Cute on September 23, 2009, 02:27:00 PM
Quote from: meko me on September 23, 2009, 12:58:36 PM
thank u for replying sir i'm placing the code in forum index page but i'm getting the  following parse error


This is an important part you might have missed:

Quote from: karlbenson on September 13, 2009, 02:19:45 PM
but remember, smf's templates are php+html mix, so your code will need echoing out, and any single quotes within it will need escpaing with a backslash.

echo '<script> var script = \'hello\';</script>';

This was actually the part that was missed when I got to take a look at it.
Seems like the JavaScript ad code does actually work on SMF sites.

Advertisement: