Coinbase

Author Topic: Edits for ad_mod_1-1-1_v2-3  (Read 114254 times)

0 Members and 1 Guest are viewing this topic.

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Edits for ad_mod_1-1-1_v2-3
« on: January 11, 2007, 07:42:32 pm »
These are the edits for the ad mod version 2.3

In index.php look for:

Code: [Select]
'trackip' => array('Profile.php', 'trackIP'),
Before that add:

Code: [Select]
'admod' => array('Ads.php', 'Ads'),
In the same file search for:

Code: [Select]
require_once($sourcedir . '/Security.php');
Before that add:

Code: [Select]
if (file_exists($sourcedir . '/LoadAds.php'))
require_once($sourcedir . '/LoadAds.php');

In the same file search for:

Code: [Select]
loadPermissions();
Before that add:

Code: [Select]
// Load all the ads up
if (function_exists("loadAds"))
loadAds();

Save and upload after backing up the original.
NOTE: Only do this edit if installing manually


In your Sources Directory find and open Subs.php, Search for:

Code: [Select]
loadLanguage('Admin');
Before that add:

Code: [Select]
loadLanguage('Ads');
In the same file search for:

Code: [Select]
'manage_themes' => '<a href="' . $scripturl . '?action=theme;sa=admin;sesc=' . $sc . '">' . $txt['theme_admin'] . '</a>',
Before that add:

Code: [Select]
'edit_addmod' => '<a href="' . $scripturl . '?action=admod">' . $txt['ad_management'] . '</a>',
Save and upload after backing up the original.
NOTE: Only do this edit if installing manually


In your theme directory find and open index.template.php and search for:

Code: [Select]
<body>';
After that add:

Code: [Select]
//Display ads on the top of the page
if (function_exists("show_topofpageAds"))
{
$ads = show_topofpageAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}

In the same file find:

Code: [Select]
</td>
After that add:

Code: [Select]
';
//Welcome Ads
if (function_exists("show_welcomeAds"))
{
$ads = show_welcomeAds();
if(!empty($ads))
{
echo '<td class="windowbg2">';
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
echo '</td>';
}
unset($ads);
}
echo '

In the same file find:

Code: [Select]
template_menu();
After that add:

Code: [Select]
//Below the menu ads
if (function_exists("show_indexAds") && function_exists("show_towerleftAds") && function_exists("show_towerrightAds"))
{
$ads = show_indexAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);

//Tower left Ads
$ads = show_towerleftAds();
if(!empty($ads))
echo '<table><tr><td valign="top">', $ads['type']==0 ? $ads['content'] : eval($ads['content']) ,'</td><td width="100%" valign="top">';

unset($ads);
//Tower Right Ads
$ads = show_towerrightAds();
if(!empty($ads))
echo '<table><tr><td width="100%" valign="top">';
unset($ads);
}

In the same file find:

Code: [Select]
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
Before that add:

Code: [Select]
//Close table for towerright ads
if (function_exists("show_towerrightAds") && function_exists("show_towerleftAds") && function_exists("show_bottomAds"))
{
$ads = show_towerrightAds();
if(!empty($ads))
echo '</td><td valign="top">', $ads['type']==0 ? $ads['content'] : eval($ads['content']) ,'</td></tr></table>';

unset($ads);
//Close table for towerleft ads
$ads = show_towerleftAds();
if(!empty($ads))
echo '</td></tr></table>';
unset($ads);

//Show ads on the bottom of the page
$ads = show_bottomAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}


In BoardIndex.template.php find:

Code: [Select]
// Show some statistics next to the link tree if SP1 info is off.
Before that add:

Code: [Select]
//Display ads on the board index
if (function_exists("show_boardAds"))
{
$ads = show_boardAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}

In the same file find:

Code: [Select]
echo '
</div>';

After that add:

Code: [Select]
//Display ads Between cats
if (function_exists("show_category"))
{
$ads = show_category($category['id']);
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}


In Display.template.php find:

Code: [Select]
global $context, $settings, $options, $txt, $scripturl, $modSettings;
After that add:

Code: [Select]
//Display ads on the thread page
if (function_exists("show_threadAds"))
{
$ads = show_threadAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}

In the same file find:

Code: [Select]
// Get all the messages...
And replace with:

Code: [Select]
//Ad Counter
$adcounter =0;
// Get all the messages...
while ($message = $context['get_message']())
{
$adcounter++;

In the same file find:

Code: [Select]
</td></tr>';
}

And replace with:

Code: [Select]
</td></tr>';
if (function_exists("show_posts"))
{
if ($adpost = show_posts($adcounter))
{
if($modSettings['ads_lookLikePosts'])
{
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">&#171; <b>', !empty($message['counter']) ? $txt[146] . ' #' . $message['counter'] : '', ' ', $txt[30], ':</b> ', $message['time'], ' &#187;</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">', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['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>';
}
else
echo '
<tr><td style="padding: 1px 1px 0 1px;">
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr>
<td class="windowbg3">', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) , '</td>
</tr>
</table>
</td></tr>';
}

}

}

if(function_exists("show_lastpostAds") && function_exists("show_posts"))
{
if(($ads = show_lastpostAds()) && !show_posts($adcounter))
{
if($modSettings['ads_lookLikePosts'])
{
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">
&nbsp;</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, '';


echo '
</td>
</tr></table>
<hr width="100%" size="1" class="hrcolor" />
<div class="post">', $ads['type'] == 0 ? $ads['content'] : eval($ads['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>';
}
else
echo '
<tr><td style="padding: 1px 1px 0 1px;">
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr>
<td class="windowbg3">', $ads['type'] == 0 ? $ads['content'] : eval($ads['content']) , '</td>
</tr>
</table>
</td></tr>';

}

}


In MessageIndex.template.php find:

Code: [Select]
global $context, $settings, $options, $scripturl, $modSettings, $txt;
After that add:

Code: [Select]
//Display Ads on the Message index
if (function_exists("show_threadindexAds"))
{
$ads = show_threadindexAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}

In the same file find:

Code: [Select]
echo '
</table>
</div>';

After that add:

Code: [Select]
//Display Ads on the Message index
if (function_exists("show_underchildren"))
{
$ads = show_underchildren();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}


In ManagePermissions.php in the sources directory find:

Code: [Select]
'pm' => array(
And replace with:

Code: [Select]
'ad_manage' => array(
'ad_manageperm' => false,
),
'pm' => array(

Save and upload after backing up the original.
NOTE: Only do this edit if installing manually


ONLY If installing manually you will require these 2 files to be in your Sources Directory:

Ads.php
LoadAds.php

And this file to be in your theme directory:

Ads.template.php

And this file to be in your Langauge directory:

Ads.english.php
« Last Edit: January 12, 2007, 02:03:51 pm by jerm »

Offline sasawawa

  • Newbie
  • *
  • Posts: 8
Re: Edits for ad_mod_1-1-1_v2-3
« Reply #1 on: January 21, 2007, 12:58:30 am »
Thanks, Biggue, just installed successful ,really cool ! ;)

Offline blessing2006

  • Newbie
  • *
  • Posts: 2
Re: Edits for ad_mod_1-1-1_v2-3
« Reply #2 on: January 25, 2007, 06:23:22 am »
hi, bigguy.

I uploaded ad management v2.3 to my smf forum using the admin panel. However, my adsense ads do not show anywhere.

Your post suggest i need to edit some files. But then i'm confused because you say "NOTE: Only do this edit if installing manually".

Should i do these edits even though i uploaded the ad management mod using the admin panel?

What else should i do to make the adsense ads show?

my site is . . .

http://www.nigerianewsjournal.com/forum/


Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Edits for ad_mod_1-1-1_v2-3
« Reply #3 on: January 25, 2007, 03:51:24 pm »
All you need to do is edit 4 template files in the theme you are using from the edits above.

Offline DawnsWebDesigns

  • Newbie
  • *
  • Posts: 7
    • Dawn's Web Designs
Re: Edits for ad_mod_1-1-1_v2-3
« Reply #4 on: January 29, 2007, 06:09:27 pm »
I'm using SMF 1.1.1., TinyPortal v0.9.7,  & Aero79 design by Bloc.  Your latest ad mod wouldn't install automatically...it had problems with Index.template.php & Display.template.php.  So I manually did those 2 & all is well.

The problem is trying to transfer it to the Aero79 theme.  I'm having a problem with Index.template.php & BoardIndex.template.php.  The coding you're telling me to look for either doesn't exist or it's written differently.  I wasn't able to add a couple of things at all.  Yet the ads appear & I get no error messages?  Still...I'd like it "right".

For instance...under BoardIndex.template.php you have: <search position="after"><![CDATA[// Show some statistics next to the link tree if SP1 info is off.]]></search>

I don't even have that.  So I did this:

Code: [Select]
function template_main()
{
   global $context, $settings, $options, $txt, $scripturl, $modSettings, $ID_MEMBER;

//Display ads on the board index
   if (function_exists("show_boardAds"))
   {
      $ads = show_boardAds();
      if(!empty($ads))
         if($ads['type']==0)
            echo $ads['content'];
         else
            eval($ads['content']);
      unset($ads);
   }

   // Show the news fader?  (assuming there are things to show...)

And it works.  So is it ok?

Next you have: <search position="before"><![CDATA[      echo '
   </div>';]]></search>.  I don't have that either.  So I've got:

Code: [Select]
echo '
</table>
<br />';
//Display ads Between cats
   if (function_exists("show_category"))
   {
      $ads = show_category($category['id']);
      if(!empty($ads))
         if($ads['type']==0)
            echo $ads['content'];
         else
            eval($ads['content']);
      unset($ads);
   }
   }

   if ($context['user']['is_logged'])

But again it works...so is it ok?

I wasn't able to add

Code: [Select]
';
//Welcome Ads
if (function_exists("show_welcomeAds"))
{
$ads = show_welcomeAds();
if(!empty($ads))
{
echo '<td class="windowbg2">';
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
echo '</td>';
}
unset($ads);
}
echo '

or

Code: [Select]
//Below the menu ads
if (function_exists("show_indexAds") && function_exists("show_towerleftAds") && function_exists("show_towerrightAds"))
{
$ads = show_indexAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);

//Tower left Ads
$ads = show_towerleftAds();
if(!empty($ads))
echo '<table><tr><td valign="top">', $ads['type']==0 ? $ads['content'] : eval($ads['content']) ,'</td><td width="100%" valign="top">';

unset($ads);
//Tower Right Ads
$ads = show_towerrightAds();
if(!empty($ads))
echo '<table><tr><td width="100%" valign="top">';
unset($ads);
}
   

to index.template.php yet it still works/there's no error messages?  How can I get help with this?  Should I post a copy of the default index.template & the theme index.template?  Thanks, in advance, for any help.  :)

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Edits for ad_mod_1-1-1_v2-3
« Reply #5 on: January 30, 2007, 11:11:28 am »
If it is working and you get no errors then leave it. I probably would have done exactly the same thing. In some of the ad mods I install I can't put all the edits in because the code is not there. As you have found out it still works so I would leave it.

Offline DawnsWebDesigns

  • Newbie
  • *
  • Posts: 7
    • Dawn's Web Designs
Re: Edits for ad_mod_1-1-1_v2-3
« Reply #6 on: January 30, 2007, 12:29:41 pm »
If it is working and you get no errors then leave it. I probably would have done exactly the same thing. In some of the ad mods I install I can't put all the edits in because the code is not there. As you have found out it still works so I would leave it.

Yeah they're working.  I've got ads at the bottom of the pages...on the board index...after posts...& under child boards.  And no error messages. :)  It's a miracle.  :o  Thanks for your post & a great mod.  ;)

Offline webmistress

  • Newbie
  • *
  • Posts: 4
    • Colored Diamond Forum
Re: Edits for ad_mod_1-1-1_v2-3
« Reply #7 on: February 01, 2007, 07:18:32 pm »
I'm having the same issue of the ads or even the word testing to show up in the position where I have checked the ads. I thought "classic" was the default theme. So I see how to do everything that comes after this:

In index.php look for:

I have an index.php that came with the ad mod and it doesn't have much in it at all

Code: [Select]
<?php

// Try to handle it with the upper level index.php.  (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
else
exit;

?>

In other words I'm not finding this code in either index.php file I have or any file for that matter.
Code: [Select]
'trackip' => array('Profile.php', 'trackIP'),
How can I get mine to work if I can't do this first step but I can do the rest?

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Edits for ad_mod_1-1-1_v2-3
« Reply #8 on: February 01, 2007, 07:30:52 pm »
Only edit the template files. The index.php and all others should not have to be done if you have it installed. So only 4 template files to edit.

Offline webmistress

  • Newbie
  • *
  • Posts: 4
    • Colored Diamond Forum
Re: Edits for ad_mod_1-1-1_v2-3
« Reply #9 on: February 01, 2007, 07:36:40 pm »
Okay, thank you so much. Do I need to do this part or not?

Code: [Select]
Ads.php
LoadAds.php

And this file to be in your theme directory:

Ads.template.php

And this file to be in your Langauge directory:

Ads.english.php

And which one of these in the template file? </td>
The one after smflogo.gif?
« Last Edit: February 01, 2007, 07:50:31 pm by webmistress »

Offline webmistress

  • Newbie
  • *
  • Posts: 4
    • Colored Diamond Forum
Re: Edits for ad_mod_1-1-1_v2-3
« Reply #10 on: February 02, 2007, 07:28:57 am »
I'm also not finding this in the board index file. I have classic installed. Does it go before the news fader code?

Code: [Select]
echo '
</div>';

Should I refer to this thread instead since I have classic?

http://www.smfads.com/forums/index.php?topic=22.0

Offline blessing2006

  • Newbie
  • *
  • Posts: 2
Re: Edits for ad_mod_1-1-1_v2-3
« Reply #11 on: February 08, 2007, 08:07:37 am »
hi.

There are 7 files mentioned above. You say in my case i need to edit only 4 of them.

What are the 4 files?

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Edits for ad_mod_1-1-1_v2-3
« Reply #12 on: February 12, 2007, 02:49:25 am »
messageindex.template.php
display.template.php
Boardindex.templeta.php
index.template.php

Offline Farmacija

  • Jr. Member
  • **
  • Posts: 14
    • Forum of students of pharmacy
Re: Edits for ad_mod_1-1-1_v2-3
« Reply #13 on: February 19, 2007, 08:58:40 am »
in the first message in isnt precised which </td> tag we should find [ there is a lot </td> tags in different places] and add ad code in index,template.php file. you should correct that!

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Edits for ad_mod_1-1-1_v2-3
« Reply #14 on: February 19, 2007, 10:52:32 am »
The edit for the ad mod that goes after the </td> is for the welcome user area of the template so you know it is going to be higher in the template file. What theme are you using. ???