I've just finished a complete redesign of my site at http://www.mari-len.com. When working the changes on my local test server I put the coop stuff in and found that the way I was doing links in the CSS it didn't look right. So I used the class="us82jsdd" to change the color of the links so they came out better. The problem was the links were a very light color and the background they were on was a very light color. You can see the problem at the above link. Unfortunatly when I uploaded everything I found that the links generated with the same ad network files don't put the class="us82jsdd" attribute in the links so the CSS for them isn't picked up. Is there something I need to do to make this work the same way it does on the local server?
You just want to change the colors of the links? Why don't you put a <span> tag around everything and then add in an ID. Don't use class as it can get overtaken easier. Does that make sense?
Yeah, it makes sense, and that's probably what I'll have to do. Just wondered why it worked on my local server and not on my hosts server. It's not big deal, as long as I can get it fixed fairly soon. I don't want anyone to think I'm trying to go stealth on the coop ads. Wait a second! As I was trying that I realized something. In order for the span to work it has to be inside the <a> tag. I tried it anyway, it didn't work. I'm going to have to find another way.
Ok, here's what I'm talking about: On my local server the links produced look like this: <a href="http://www.domain.com" class="us82jsdd"> Code (markup): With the exact same code in the exact same footer file on my host site they look like this: <a href="http://www.domain.com"> Code (markup): I've subsequently updated to the latest "175" setup for the coop and still get the same results. The txt files are identical, or at least they were when I started this. I'm aware that the server could be the problem, so here's that info: Local: XP Pro SP2 2 proc PHP 4.3.10 Apache 2.0.52 Host: Linux 2.4.21 smp PHP 4.3.10 Apache 1.3.33
The co-op ad network links show up however they want, you can't actually put class' in the <a> tags. Or as far as I know.
I know, those class attributes are there. Take a look inside the ads txt file and you'll see right near the begining "us82jsdd" which, on my Win server comes out as a class statement in the links. On the linux server it doesn't.
Well, actually it's a work around, but it gets the job done. Here's the code: for($a = 0;$a < 5;$a++){ if(!stristr($ad_network[$a],"us82jsdd")){ $ad_network[$a] = str_replace("a href","a class=\"us82jsdd\" href",$ad_network[$a]); } } Code (markup): This is for putting 5 text ads on the page. You can change the class statement to an ID or a style statement if you want. If you're putting less than 5 just change the number in the loop to the number of ads you're displaying. If you're just displaying one ad you can just use the "if" statment part of it and remove the "$a" from the "$ad_network[]" vars in the statement. This works on my site really well. I hope someone else finds it useful.