News:

Version 3.5 has been released. Visit https://custom.simplemachines.org/mods/index.php?mod=255 to get the most up to date version.

Main Menu
Coinbase

Edits for ad_mod_1-1-1_v2-3

Started by bigguy, January 11, 2007, 07:42:32 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Knibal

Just wanted to give thanks for this help, I edited the hole files and now it works great on my own theme!!! ;)

myaicons

ok... so i figured it out... all the edits were made when i installed the mod... except for the ones for the index.template.php file...

so i did the edits for that file and the appropriate ads started showing up.... all except for the welcome user area... because im not sure which instance of the </td> i need to add the code to...

QuoteIn the same file find:

Code:

                     </td>


After that add:

Code:

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


so.... can i get a clarification as to where to exactly put the welcome ads code???

thanks



neotan

Works great !!! Thanks


============
SMF 1.1.4

Black Rain v2

http://jparts.info/forum

utal

heys!

how did you managed to put all the edits in the files in version 1.1.4? there are some file edits in files that aren't in BlackRain V2 (for instance Display.template.php)

can you help please?

tks!

Quote from: neotan on February 02, 2008, 09:55:53 AM
Works great !!! Thanks


============
SMF 1.1.4

Black Rain v2

http://jparts.info/forum

mcichocki

#79
Quote from: bigguy on January 11, 2007, 07:42:32 PM
These are the edits for the ad mod version 2.3

In index.php look for:

'trackip' => array('Profile.php', 'trackIP'),

Before that add:

'admod' => array('Ads.php', 'Ads'),

In the same file search for:

require_once($sourcedir . '/Security.php');

Before that add:

if (file_exists($sourcedir . '/LoadAds.php'))
require_once($sourcedir . '/LoadAds.php');


In the same file search for:

loadPermissions();

Before that add:

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

loadLanguage('Admin');

Before that add:

loadLanguage('Ads');

In the same file search for:

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

Before that add:

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

<body>';

After that add:

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

</td>

After that add:

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

template_menu();

After that add:

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

// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!

Before that add:

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

// Show some statistics next to the link tree if SP1 info is off.

Before that add:

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

echo '
</div>';


After that add:

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

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

After that add:

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

// Get all the messages...

And replace with:

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


In the same file find:

</td></tr>';
}


And replace with:

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

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

After that add:

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

echo '
</table>
</div>';


After that add:

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

'pm' => array(

And replace with:

'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

So the very first step...what index.php am I editing?
The one in the themes folder has no code as indicated.

I'm a noob so I'm sorry if this is obvious to some others. ;)

Thanks,
MC


Added---
http://custom.simplemachines.org/themes/index.php?lemma=519
This is the theme I'm using if that helps at all.

geoffstr

I'm using the Black RainTheme. It doesn't contain messageindex.template.pho, display.template.php or Boardindex.template.php

Will I be able to use ad mod with this following the instructions posted?

sturmkatze

I am using ig-oh theme. I was trying to do the edits and in the BoardIndex.template.php file, I cannot find this part:

QuoteIn the same file find:

Code:

      echo '
   </div>';

I have done searches for it and it just ain't there. What do I do? I need this mod to work and it's just not  >:( Here, attached is the file...
Marsh Wise
reenactor.Net
www.reenactor.net/
reenactor.Net Forums: http://www.reenactor.net/forums/index.php

ramsen


frosted

hey i tried to install those mods but as u have pointed out some of the text is not there

i read that dawn said changes were made but im not too comfortable with php yet because im quite new

i have the aa new damage theme from webtechnica

my planning is to do the adds from google adsense AND place a rotating banner cycle for the site


ne ideas on how i could change  this mod to work with that

Talkrooms

Im am using SEO Light Theme.

In the very first post it states "index.php" search for....

My index.php file only has the following.

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


?>

can you assist me in where to stat the install of admanagement?

thanks!
Mike.

ideasworld

Thanks for the post, but I could not fine these files

Quoteecho '
   </div>';

and when I replace
Quote// Get all the messages...
with
Quote//Ad Counter
   $adcounter =0;
   // Get all the messages...
   while ($message = $context['get_message']())
   {
      $adcounter++;
, i get errors.



Please, i want the ads centered and not aligned to the left. How do i rotate the ad?, like showing a different ad when the page refreshed. 
Please help me out.  :police:



toofaan

QuoteCode:

<body>';


After that add:

Code:

   //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);
   }
i can not find <body>'; .
i am using Anecdota theme + smf 1.1.15

toofaan


gri

Quote from: "url=http://www.smfads.com/forums/index.php?topic=475.msg6846#msg6846]toofaan in ~Edits for ad_mod_1-1-1_v2-3~[/url]"]
very bad support.

toofaan,
Would you like to have a dialogue with me ?
Instruction on getting Help on PAY-ME (AdManagement) mod installing.
Your GRItoadMIXes

toofaan

Quote from: gri on July 20, 2008, 11:07:50 AM
Quote from: "url=http://www.smfads.com/forums/index.php?topic=475.msg6846#msg6846]toofaan in ~Edits for ad_mod_1-1-1_v2-3~[/url]"]
very bad support.

toofaan,
Would you like to have a dialogue with me ?

Yas.