News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Adding ad code to RC2

Started by Bigguy, January 05, 2006, 12:22:07 PM

Previous topic - Next topic

Bigguy

How would I ad this code so the ad shows on every page, like were would I put it in RC2 ???

Quote<?php include('http://staff.x10hosting.com/adCode.php?ad=advanced'); ?>

Oldiesmann

You would put that code (without the <?php and ?> tags) in index.template.php. However, the exact place where you would put that code depends on where you want it to appear.
Michael Eshom
Christian Metal Fans

Bigguy

well either at the very top or the very bottom would be nice.

Oldiesmann

Ok.

To put it at the very top (before anything else gets output):

Find
<body>';

And add it after that.

If it's not already centered and you want it to be centered:

Replace the above code with this:
<body><div align="center">';

Then put your ad code after that, and add a </div> right after the first echo '.

To add it at the very bottom:

Find
echo '
</div>
</body></html>';


Replace
echo '
</div>';
include('http://staff.x10hosting.com/adCode.php?ad=advanced');
echo '</body></html>';


Or (if you want to center it and it isn't already centered)
echo '
</div><div align="center">';
include('http://staff.x10hosting.com/adCode.php?ad=advanced');
echo '</div></body></html>';

Michael Eshom
Christian Metal Fans

jerm

i will be releasing a mod in the next day or so that will do exactly what you want, so if you wish to wait, you can.

Bigguy

Both ideas are great. If its ok I would like to post the changes that Oldiesmann has made to the support forum I work on for our members to use if they need it.

@ electrohome88: I might just wait for it myself but I do know of a couple ppl that might find this useful now.

jerm

im sick as a dog, so im fixing it all up right now. so in like an hour it should be done, or less. just have to give me time to test it out, and assume theres no glitches

Bigguy

Ok I will wait for you and test it out. I have a new smf 1.1 rc2 forum unmodded waiting for it.

@ Oldiesmann: is it ok to take your changes and put them on the hosting company I work for. Incase anyone needs the changes ?

jerm

i have uploaded it and tested it on RC2 with the default theme.
http://mods.simplemachines.org/index.php?mod=255

Bigguy

I cant download it. All I get is a white screen.

jerm

donno why then
try this and upload it with the package manager

Bigguy

ok got it that time. I`ll report about this in a minute.

jerm

cool thanks, till im able to post images up in the mod section about this mod
go into features and settings, you will see an "ads" menu, click then, and the rest should explain itself

Bigguy

It installed great but I cant seem to get the ad code I posted to work with or without the php tags. Code is in the first post, any ideas.

jerm

thats the one thing i didn't test.. the includes
but what you can do is grab the code in the includes file and put that there instead

<script language='JavaScript' type='text/javascript'>
<!--
   if (!document.phpAds_used) document.phpAds_used = ',';
   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
   
   document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
   document.write ("http://x10hosting.com/advert/adjs.php?n=" + phpAds_random);
   document.write ("&what=zone:3&target=_blank");
   document.write ("&exclude=" + document.phpAds_used);
   if (document.referrer)
      document.write ("&referer=" + escape(document.referrer));
   document.write ("'><" + "/script>");
//-->

</script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a915c788' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:3&n=a915c788' border='0' alt='' /></a></noscript>


stick that in there

Bigguy

ok thats got it. It shows up good. Only theres 2 of them now.

http://ang.x10hosting.com/forum/index.php

jerm

lol ya, thats one thing i should add to the read me or the help or something

you have everything checked
to have it displayed on all the pages, just check index

to have it display just on the specific pages like board index, thread index, thread, have those checked. theeres no need to have all 4 of them checked

i put that there cause in googles TOS, you can't have it display ads on all the pages. so ya

Bigguy

Ok its an awesome mod and it works good. Now I know this is not your problem and I will try to get this solved. Let me try to explain. On the hosting company I work for they have made a script that automatically checks accounts for ad codes. I wonder if the script we use would pick up on this. Would you have any ideas ??

jerm

glad it worked, your my first official tester lol

and im guessing your hosting company doesn't want you to put ads up?.. i wouldn't know how to make it so that its not noticed. you can try first by not using "key words" such as ads or ad or adverts. thats probably how the script works. that is, if im understanding your question

Bigguy

Oh yes it is in the T.O.S. that all accounts on the server other than the ones on the static plan have to have ads showing on all pages (ads from x10) You are also allowed to have your own ads but they can be no bigger than the one we place. The script I am talking about checks all accounts on the free server for the ad code if it does not show that account gets put in a list for suspension.

Advertisement: