inline ads

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

inline ads

Post by m2babaey »

Hi
i was using iframes with src=http://mydomain.com/adgenerator.php?referrer=username to display ads on other sites. Now I need to display inline ads like what you see on mouseover on underlined words at http://takfekr.com/inline.html
How can I do that? ( Please tell me if there is a solution other than Javascript)
Thanks
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

I'm pretty sure javascript is the only way, since those type of ads render the page and then call the javascript function(s) to render the ads on the appropriate words.

Unless you're supplying the ads yourself (in which case you could parse the page with php and hardcode ad links), I think you're going to have to stick with javascript for that.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

Post by m2babaey »

so what should i study in js? to get the problem solved quickly? :? :?: :roll:
I just know the basic js
thanks
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

m2babaey wrote:so what should i study in js? to get the problem solved quickly? :? :?: :roll:
Quickly? Inline ads aren't exactly created by amateur programmers, so there is no quick and easy fix. What kind are you after? The mini pop-up boxes on certain words?

I think you'll need to familiarize yourself with the DOM in order to traverse it, check all of the text for keywords, break the #text nodes, splice out the key word, replace the keyword with an element (anchor, or whatever) that shows that it is a keyword, and then creating a floating element to be displayed upon mouseover.
Post Reply