News:

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

Main Menu

Ad Management mod

Started by SMFHacks.com Team, January 30, 2006, 08:41:19 PM

Previous topic - Next topic

Bigguy

#440
Edits for ad_mod 1.5

In "index.template.php find:

Quotetemplate_menu();

and replace with:

Quote//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>';

in the same file find:

Quotefunction template_main_below()
{
   global $context, $settings, $options, $scripturl, $txt;

and replace with:

Quotefunction template_main_below()
{
   global $context, $settings, $options, $scripturl, $txt;

//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>';

In BoardIndex.template.php find:

Quoteglobal $context, $settings, $options, $txt, $scripturl, $modSettings;

and replace with:

Quoteglobal $context, $settings, $options, $txt, $scripturl, $modSettings;

//Ad management code to display your ads

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

In Display.template.php find:

Quoteglobal $context, $settings, $options, $txt, $scripturl, $modSettings;

and replace with:

Quoteglobal $context, $settings, $options, $txt, $scripturl, $modSettings;

//Ad management code to display your ads

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

In the same file find:

Quote</td></tr>';
   }

and replace with:

Quote</td></tr>';
if ($message['id'] == $context['first_message'])
   //Ad management code to display ads after the first post

   if ($modSettings['ad_management_firstad'] && allowedTo('ad_manageperm'))
   {
      echo '

   <tr><td style="padding: 1px 1px 0 1px;">
      <table width="100%" cellpadding="3" cellspacing="0" border="0">
         <tr><td class="windowbg3">
            <table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
               <tr>
                  <td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
                     <b>', $context['forum_name'], '</b>
                     <div class="smalltext">
                     </div>
                  </td>
                  <td valign="top" width="85%" height="100%">
                     <table width="100%" border="0"><tr>
                        <td valign="middle"><img src="', $message['icon_url'] . '" alt="" border="0" /></td>
                        <td valign="middle">
                           <div style="font-weight: bold;" id="subject_', $message['id'], '">
                              <a href="', $message['href'], '">', $message['subject'], '</a>
                           </div>
                           <div class="smalltext">« <b>', !empty($message['counter']) ? $txt[146] . ' #' . $message['counter'] : '', ' ', $txt[30], ':</b> ', $message['time'], ' »</div></td>
                        <td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" height="20" style="font-size: smaller;">';
      if ($context['can_reply'] && !empty($options['display_quick_reply']))
         echo '
               ', $reply_button, '';

      // So... quick reply is off, but they *can* reply?
      elseif ($context['can_reply'])
         echo '
               ', $reply_button, '';

      // Can the user modify the contents of this post?
      if ($message['can_modify'])
         echo '
               ', $modify_button, '';

      // How about... even... remove it entirely?!
      if ($message['can_remove'])
         echo '
               ', $remove_button, '';

      // What about splitting it off the rest of the topic?
      if ($context['can_split'])
         echo '
               ', $split_button, '';
echo '
                        </td>
                     </tr></table>
                     <hr width="100%" size="1" class="hrcolor" />
                     <div class="post">', $modSettings['ad_management_content'] , '</div>
                  </td>
               </tr>
               <tr>
                  <td valign="bottom" class="smalltext" width="85%">
                     <table width="100%" border="0" style="table-layout: fixed;"><tr>
                        <td colspan="2" class="smalltext" width="100%">
                     </tr><tr>
                        <td valign="bottom" class="smalltext" id="modified_', $message['id'], '">
                        </td>
                        <td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" class="smalltext">
                           <img src="', $settings['images_url'], '/ip.gif" alt="" border="0" />&nbsp;', $txt[511], '
                        </td>
                     </tr></table>
               </tr>
            </table>
         </td></tr>
      </table>
   </td></tr>';
   }

   }

In MessageIndex.template.php find:

Quoteglobal $context, $settings, $options, $scripturl, $modSettings, $txt;

and replace with:

Quoteglobal $context, $settings, $options, $scripturl, $modSettings, $txt;

//Ad Management Code to display your ads
if ($modSettings['ad_management_thread_index'] && allowedTo('ad_manageperm'))
   echo '<div align="',$modSettings['ad_management_align'],'">',$modSettings['ad_management_content'],'</div>';


If you have this installed on the default theme already these should be the only edits you need to do.

I was doing this last night but the power went out here where I live. This is for the current version. You must have it installed on the default theme in order for this to work.  BACKUP FILES FIRST.



RebelRose

BigGuy, I opened the index_template.php and I did not see an area that read just   template_menu();

I was going to try the edits you have listed here for ads mod 1.5, maybe I am missing something, I did see template_menu_main, I think is what it said, so I did not try the changes for fear I would mess something up.

Bigguy

Always make a backup of the file you are about to edit, then you can play a bit. If you mess up then replace the file with the original. I usually rename the index.template.php to index.template1.php after I download a copy of it. then with the copy on my desktop I can check things out and upload it knowing I have a backup of it.

As I said before the code does vary from theme to theme. For help with that edit try asking the theme author the proper place to put that edit. You can try the rest of the edits if you want to see if they will go.

RebelRose

Quote from: Bigguy on June 02, 2006, 10:39:01 AM
Always make a backup of the file you are about to edit, then you can play a bit. If you mess up then replace the file with the original. I usually rename the index.template.php to index.template1.php after I download a copy of it. then with the copy on my desktop I can check things out and upload it knowing I have a backup of it.

As I said before the code does vary from theme to theme. For help with that edit try asking the theme author the proper place to put that edit. You can try the rest of the edits if you want to see if they will go.

I will give it a go and see what happens, I have tried getting help from the them author on his board, as well as tried to get help for the author of this mod, to which I was told to just post it on the forum and someone was sure to help me.  I thank you for you time. And I will take your advise and do backups and copies before I do anything else.

Thank You

Bigguy

Your welcome, I hope it helps a bit. Once you get used to reading the .xml files you`ll be fine. You need a good editor to.

RebelRose

Yes I took your advise on getting an editor for php as well, again thank you so very much.

RebelRose

Quote from: Bigguy on June 02, 2006, 10:49:53 AM
Your welcome, I hope it helps a bit. Once you get used to reading the .xml files you`ll be fine. You need a good editor to.

Thank You So Very Much

The Edits worked GREAT

Thanks again

Bigguy

I`m glad it worked for you, cheers. :)

willi1

thank you for your work,

now it works  :)

but i can´t see the ad settings in my admin control panel
where i must change these settings

have you any suggestions again


great  :)

best regards

André

Bigguy

Do you have a "Modifications.english.php" file in the languge directory of the theme you are trying to modify???

willi1

#450
no i have two files first settings.german.php and second settings.english.php
in the default theme is a modification.english.php but not in the classic theme

best regards

Bigguy

Copy the file "modification.english.php" to the language folder of the theme you are trying to modify.

Bigguy

after you copy that file to the language folder of the theme you want to modify go to features and options and you should see the "ads" link. Also in the permissions for each user group there is an option to enable ads.

willi1

#453
thank you very much,

now it works all  :)  :)  :)

i have copy the content of the modifications.english.php in the modifications.german.php and now i can all see the ads settings.

best regards

André

Bigguy


SoftDux

Does anyone have a working copy for SMF 1.0.7 ?
  • cPanel :: Fantastico :: RVSkin :: WHM :: ModernBill
  • Reseller Hosting :: SSL Certificates :: Domain Registrations :: Affiliate Program
  • Blog Hosting :: CMS Hosting :: Forum Hosting :: E-Commerce Hosting
SoftDux- The Leaders in Software
Use the coupon: smf-06 to get 20% off our packages

eladio

i need help

i have tested that mod on my forum , but i have a problem becose i have a croatian language pack , and i can not see "ADS" button in Features and Options .

i have tested on english version and than is all OK .


sorry on bad english and thanks  :)








Bigguy


eladio

Quote from: eladio on June 03, 2006, 08:09:25 AM
i need help

i have tested that mod on my forum , but i have a problem becose i have a croatian language pack , and i can not see "ADS" button in Features and Options .

i have tested on english version and than is all OK .


sorry on bad english and thanks  :)










i have a half problem solution  :D


if i type url : http://www.mypage.com/mySMFforum/index.php?action=featuresettings;sa=ad_management

then i manage to open  MANAGEMENT , hehe  :D

but there is a problem , then compleatly all text will be on center of page ::)

is there a chance to fix that center alligment in code ?

thanks and soory egen on my fuuny english  :D

Gamersea

I don't know what you language is.
But it makes some modifications in your:
Modifactions.English.php file that is in your theme directory.
To see it on your features at your language you have to copy the text in the modification.english.php file and past it in your modifications.your language.php file.

Advertisement: