News:

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

Main Menu

ads help

Started by mittal, March 04, 2015, 02:38:29 AM

Previous topic - Next topic

mittal

hello

i want to display ads in my site.i dont know where to put codes in the site.i want to display ads in main page and inside forum category.

where to put codes? i want to put like this include("filename.php");

using include function.

Pipke

install this mod http://custom.simplemachines.org/mods/index.php?mod=255, after that you can paste your ads html script/code in the mod for showing it.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

mittal

i installed it but it says testing failed in some themes.

br360

You would have to edit the specific theme's files and manually add in the code that failed to those themes.

You can also try this mod which I think seems to work a little better with other themes- http://custom.simplemachines.org/mods/index.php?mod=2557

Although make sure the other mod is fully uninstalled first- as having both of those mods installed at the same time could cause issues with your forum.

mittal

i m using 2.0.9 smf

is it compatible?

compalibility is not described  for 2.0.9 there

br360

Yes, it works fine on 2.0.9. You may have to emulate your version to get it to install though-

http://wiki.simplemachines.org/smf/How_can_I_install_a_mod_that_doesn%27t_work_in_my_SMF_version


Edit- just tried installing it on a 2.0.9 test site, and it installed cleanly without having to emulate.

mittal

i  tried to install but i got this error


br360

That means that in that theme's display.template.php there are two places in that file that you are going to have to manually edit the code yourself. Where you see that icon to the left (that pencil and paper icon) of the two places in display template that shows errors, click on each one, and it will show you what you have to do to manually install the code.


mittal

ok after editing those file.where to put codes of ads.i use  include function

include("filename.php");

br360

Here try this, but back up first.

In your sunset 2.0 theme. Display.template.php

Find:
// Get all the messages...

replace with:

// Get all the messages...
   $removableMessageIDs = array();
   while ($message = $context['get_message']())
   {
      if (!isset($msg_counter))
         $msg_counter = 0;
      if (++$msg_counter == 2)
         template_ad_position('after_first_post');



Find:
// Show the page index... "Pages: [1]".

Replace with:

template_ad_position('after_last_post');
   // Show the page index... "Pages: [1]".

mittal

what about skipping file error?

the code u provided is for testing failed. but i am also getting error skipping file.see above screenshot please.

br360

Make sure that you edit the display.template of the Sunset theme. Then you can install the mod, and ignore those errors in that theme. I installed that theme, got the exact same errors you did, manually added the code in the two places in the display template I posted above, and it did install and work properly.

Make sure that there are no errors in the default theme of course.

Oh, and don't worry about the skipping file part. That just means that that file isn't being used on your forum and not important in your install.

mittal

i just edited and replaced codes as u said.but still facing same error

br360

Quote from: mittal on March 04, 2015, 04:34:10 AM
i just edited and replaced codes as u said.but still facing same error

Yes, you will still see the error for that theme, but with the code added correctly in both places, you can go ahead and install it anyway. Just make sure that there are no errors in the default theme when you install.

mittal

i installed now. wat i do now?

br360

Now you can add ads into your forum. ;)

Take a look at the support thread for that mod as it will probably answer all of your questions about how to add different ads in different sections and places on your site.

http://www.simplemachines.org/community/index.php?topic=381408.0

mittal


br360

Yes. Open that link and then hit the tab that says "SUPPORT AND COMMENTS FOR THIS MOD"

Or you can open the link I posted right above your post above. ;)

mittal

i seen now.its members problem discussed there but not discussed where to put codes and in which template?

br360

For that, you're going to have to go into the simple ads section in your admin panel and play around with the various settings a bit. Also, knowing some basic html and having the banner code already to add is going to help as well.

Look for the part that says Body Template: Click on the drop down to the right, and choose what you want. Click a choice, and that code will appear in the box. Where you see {Content}, add your banner code there. Then scroll down and decide where you want the banner to show on your forum.

Advertisement: