SMF and AD help

Status
Not open for further replies.

trsa1

New Member
Messages
112
Reaction score
0
Points
0
I searched on smf site but I didnt get any answers. I searched here but it says my terms are too short. I need some help

My current site is trsa.x10hosting.com

I am trying to use that code right now.
PHP:
 <?php include('http://staff.x10hosting.com/adCode.php?ad=advanced'); ?>

I want to place it on top of everything. Where is the best place to put the code in index.template page

If you want the page code, i will post it if needed.
 

trsa1

New Member
Messages
112
Reaction score
0
Points
0
I know that mod but I am going to put it into a different theme. If i want to use the ad mod, I have to put the coding manually and I am not good at that. I dont plan on adding any mods at all.

I always get parsing errors when I use the code. Can I have help on where to put that code
 

bigguy

Retired
Messages
10,984
Reaction score
10
Points
38
It`s very easy to add it to another theme. Install it on default and then do a couple edits in some of the files. I have it all written down over at simplemachines.org. Would you like to see the thread ??

Guess not...
 
Last edited:

trsa1

New Member
Messages
112
Reaction score
0
Points
0
Thank you for the link

Before I continue, can you tell me what code should i use to make it work on my default them. I mean the ad code.

I just want to see if it works on the default theme, then I can continue
 

bigguy

Retired
Messages
10,984
Reaction score
10
Points
38
Either of these should work:

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

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

If not I`ll give you another code it should work.
 
Last edited:

bigguy

Retired
Messages
10,984
Reaction score
10
Points
38
Try this one, it should put a banner up:

<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:1&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=a7fb3e9d' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:1&n=a7fb3e9d' border='0' alt=''></a></noscript>
</p>
 

trsa1

New Member
Messages
112
Reaction score
0
Points
0
I dont know what the problem is but I am not seeing the ads. Let me try something. One sec


There we go, it is working
 
Last edited:

trsa1

New Member
Messages
112
Reaction score
0
Points
0
Okay, that worked. Can u give me the advanced ad in the code that you gave it to me the second time.
 

Chris S

Retired
Messages
2,055
Reaction score
1
Points
38
here you go

Code:
 <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>
 

trsa1

New Member
Messages
112
Reaction score
0
Points
0
Sweet.

Thanks for all of your help Chris and Geoff. I will follow how to add the mod in different themes.

Thanks everyone.
 

trsa1

New Member
Messages
112
Reaction score
0
Points
0
Now to follow the link you gave me. I will post again if I have any more problems with the different theme.
 

trsa1

New Member
Messages
112
Reaction score
0
Points
0
I made a mistake

I get

Template Parse Error!

There was a problem loading the /Themes/amber11rc2/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

Code is

(from index.template.php)

PHP:
//Ad management code to display ads on top of the menubar

if ($modSettings['ad_management_index_above'] && allowedTo('ad_manageperm'))
   echo '<div align="',$modSettings['ad_management_align'],'">',$modSettings['ad_management_content'],'</div>';

   template_menu();

//Ad management code to display ads on the bottom of the memubar

if ($modSettings['ad_management_index_below'] && allowedTo('ad_manageperm'))
   echo '<div align="',$modSettings['ad_management_align'],'">',$modSettings['ad_management_content'],'</div>';
PHP:
function template_main_below()
{
    global $context, $settings, $options, $scripturl, $txt , $user_info , $modSettings;

//Ad management code to display your ads

   global $modSettings;

if ($modSettings['ad_management_bot_index'] && allowedTo('ad_manageperm'))
   echo '<div align="',$modSettings['ad_management_align'],'">',$modSettings['ad_management_content'],'</div>';</b>
 

bigguy

Retired
Messages
10,984
Reaction score
10
Points
38
This is from the amber theme ?? Give me a minute I`ll see what I can do. Is the ad mod the only modification you have installed. ???
 
Status
Not open for further replies.
Top