The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Advertising Widget Code

3 posters

Go down

Solved Advertising Widget Code

Post by Cman August 2nd 2009, 12:37 am

Okay...I have noticed how on sites like Yahoo!, whatever..they all show a random advertisment. What is the code to show a random advertisment on every page visit.


Last edited by Cman on August 2nd 2009, 8:15 pm; edited 3 times in total
Cman
Cman
Forumember

Male Posts : 681
Reputation : 5
Language : English
Location : Florida

http://firealarmsrme.org/

Back to top Go down

Solved Re: Advertising Widget Code

Post by Conundrum August 2nd 2009, 5:46 am

If you have registered with the Google Adsense program, you can get a code that places ads on your page. As for the widget, that doesn't seem to work with those ad codes. The Google Adsense program allows Google to place ads on your forum using the code they give when you design the ad and Google will pay you per page impression or per click. Hope that helps.
avatar
Conundrum
Forumember

Male Posts : 176
Reputation : 0
Language : English
Location : Australia

http://theskyfortress.darkbb.com

Back to top Go down

Solved Re: Advertising Widget Code

Post by Cman August 2nd 2009, 5:48 am

Well, I am doing my own advertisments. I just need the code. I think Google ads are things like <img src=*******>
Cman
Cman
Forumember

Male Posts : 681
Reputation : 5
Language : English
Location : Florida

http://firealarmsrme.org/

Back to top Go down

Solved Re: Advertising Widget Code

Post by ankillien August 2nd 2009, 8:53 am

Hi Cman!

You can use this code to put random advertisement on your page.
You can put it in widgets or anywhere by editing your template.

Code:
<script language="JavaScript">
<!--
/*
Random Image Link Script
By Website Abstraction (http://www.wsabstract.com)
and Java-scripts.net (http://www.java-scripts.net)
*/

function random_imglink(){
  var myimages=new Array()
  //specify random images below. You can have as many as you wish
  myimages[1]="img1.gif"
  myimages[2]="img2.gif"
  myimages[3]="img3.gif"

  //specify corresponding links below
  var imagelinks=new Array()
  imagelinks[1]="http://www.wsabstract.com"
  imagelinks[2]="http://www.dynamicdrive.com"
  imagelinks[3]="http://www.java-scripts.net"

  var ry=Math.floor(Math.random()*myimages.length)

  if (ry==0)
    ry=1
    document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>')
}

  random_imglink()
//-->
</script>

Read the script carefully, it is self explanatory Wink
You just have to edit image url and link url.
ankillien
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

Back to top Go down

Solved Re: Advertising Widget Code

Post by Cman August 2nd 2009, 5:18 pm

Thanks...that is EXACTLY what I needed...you solved it on the first try. Once AGAIN, ankillien, you solved it.

Edit: wait...it doesn't work on my forum, but it works everywhere else.
Cman
Cman
Forumember

Male Posts : 681
Reputation : 5
Language : English
Location : Florida

http://firealarmsrme.org/

Back to top Go down

Solved Re: Advertising Widget Code

Post by ankillien August 2nd 2009, 7:23 pm

Where do you put the code?
In a widget? or HTML page?

The code should go between <body> tags.
ankillien
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

Back to top Go down

Solved Re: Advertising Widget Code

Post by Cman August 2nd 2009, 7:33 pm

code in widget
Cman
Cman
Forumember

Male Posts : 681
Reputation : 5
Language : English
Location : Florida

http://firealarmsrme.org/

Back to top Go down

Solved Re: Advertising Widget Code

Post by ankillien August 2nd 2009, 8:00 pm

hmmm.. there is a problem with the script.
It has to go between <html> <body> tags and widgets won't execute these tags.
So, now you need to create an HTML page, put the script between <html> and <body> tags and save.
Check if it works. If yes, go ahead....

Put this code in the widget where you want to show the ads...

Code:
<iframe src="HTML PAGE URL HERE" width="98%" height="98%"></iframe>

Just add the url of the HTML page that you just created and save.
It should work now.

Hope you understand this Very Happy
ankillien
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

Back to top Go down

Solved Re: Advertising Widget Code

Post by Cman August 2nd 2009, 8:14 pm

Oh my gosh! You are sidekick! I already did that. Except I used this code:

Code:
<center><iframe name="FRAME1" src="http://justcorbin.forumotion.net/Advertisments-h39.htm" width="100%" height="110" frameborder="1" ></iframe>

<br><A href="about:blank"  target="FRAME1" onfocus="this.blur()"><FONT size=4 face=Arial>Disable Advertisments</FONT></A></br></center>

Thanks for the help, it is solved.
Cman
Cman
Forumember

Male Posts : 681
Reputation : 5
Language : English
Location : Florida

http://firealarmsrme.org/

Back to top Go down

Solved Re: Advertising Widget Code

Post by ankillien August 2nd 2009, 8:28 pm

Since the topic is solved, I'll lock it.
ankillien
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum