News:

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

Main Menu

How to display ads under MENU toolbar/ Header ??

Started by shiraz_homie, September 17, 2010, 11:46:08 AM

Previous topic - Next topic

shiraz_homie


Kindred

edit index.template.php and move the code under the template_menu call....

(warning, an advert in such a location MAY have conflicts with your dropdown menus)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

shiraz_homie

Well i don't have drop down menus

I added this:
<center><script type="text/javascript">
Ad code</noscript></center></br>


Under
template_menu();

   // The main content should go here.
   echo '
   <div id="bodyarea" style="padding: 5ex 50px 2ex 50px;">';
}


When i click on "Save" it says
QuoteThe file you tried to save generated the following error:
Parse error: syntax error, unexpected '<' in index.template.php on line 267

Kindred

Well, you can't just add plain HTML randomly into a php file.... it has to be enclosed in an echo statement (like the div statement is)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

shiraz_homie

Can you tell me a lil bit bout that cause i don't know php ? :(

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Hj Ahmad Rasyid Hj Ismail

I know several ad mod and other mod can do such a thing. Why don't you use them instead?

IceXaos

You would simply do the following.

echo '<center><script type="text/javascript">
Ad code</noscript></center></br>';


Alternatively, you can use a MOD found here : http://custom.simplemachines.org/mods/index.php?mod=255

shiraz_homie

#8
echo '<script type="text/javascript">
//interstitial ad
clicksor_enable_inter = true; clicksor_maxad = -1;   
clicksor_hourcap = -1; clicksor_showcap = 2;
//default banner house ad url
clicksor_default_url = 'http://grabfreemovies.tk';
clicksor_banner_border = '#aa0003'; clicksor_banner_ad_bg = '#e0e0e0';
clicksor_banner_link_color = '#000000'; clicksor_banner_text_color = '#666666';
clicksor_banner_image_banner = true; clicksor_banner_text_banner = true;
clicksor_layer_border_color = '';
clicksor_layer_ad_bg = ''; clicksor_layer_ad_link_color = '';
clicksor_layer_ad_text_color = ''; clicksor_text_link_bg = '';
clicksor_text_link_color = ''; clicksor_enable_text_link = false;
</script>
<script type="text/javascript" src="http://ads.clicksor.com/showAd.php?nid=1&pid=144059&adtype=1&sid=227726&zone=11489"></script>
<noscript><a href="http://www.yesadvertising.com">affiliate marketing</a></noscript>';


I tried to save after adding the code above but still it says Parse error: Syntax error . . .

Later i installed that ad management mod, and added my ad code, saved but no ad appears :(

IceXaos

You use multiple ' within the echo, which means you're closing & opening it multiple times.  You need to either use \' or " inside it.

shiraz_homie

I replaced all ' with "  :-\
still
QuoteThe file you tried to save generated the following error:
Parse error: syntax error, unexpected '=' in index.template.php on line 262

shiraz_homie

Cleared my browser cache and reloaded the site, ads have started appearing :)

Thanks everybody who helped me

Hj Ahmad Rasyid Hj Ismail


Kindred

BTW: Interstital ads are some of the most obnoxious things in existence. I tend to avoid any site which triggers them
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: