News:

Help keep this project going by donating or buying adseller pro

Main Menu
Coinbase

Edits for ad_mod_rc2_v2 for themes other than default

Started by bigguy, June 20, 2006, 08:26:59 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

bigguy

These are the default edits for the ad mod taken right from the install.xml file. These are the edits you should do on other themes, as all the other edits will install fine.

In your theme directory you want to modify, in "index.template.php" find:

<body>';

After that line add:

//Display ads on the top of the page
$ads = show_topofpageAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);


Then find in the same file:

</td>

BEFORE that add:

';
//Welcome Ads
$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 search for:

template_menu();

Then add BEFORE:

//Below the menu ads
$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!

After that add:

//Close table for towerright ads
$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);


ABOVE ARE THE EDITS FOR THE INDEX.TEMPLATE.PHP FILE

In "BoardIndex.template.php" find:

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

Add after that:

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


ABOVE IS THE EDIT FOR THE BoardIndex.template.php


In "Display.template.php" FIND:

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

BEFORE that add:

//Display ads on the thread page
$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 ($adpost = show_posts($adcounter))
{
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">', $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>';
}

}


ABOVE ARE THE EDITS FOR THE DISPLAY.TEMPLATE.PHP

In "MessageIndex.template.php" Find:

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

BEFORE that add:

//Display Ads on the Message index
$ads = show_threadindexAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);


NOTE: If you cannot find the "Ad management" link in the admin panel, move your "Modifications.english.php file from your default language directory to the language directory of the theme you are modifying.

Jump1979man

thank you for this.  I will try it soon to see if I can get it to work.

bigguy

Make sure the mod is installed first and then edit the template you want to use with these edits.

ingaffa

QuoteThen find in the same file:

Quote
                     </td>

Which one?  There are hundreds!

Thanks.

jerm

search for this instead:
</td>
only one line will show up

erik

Quote from: electrohome on June 23, 2006, 07:08:50 PM
search for this instead:
</td>
only one line will show up

It's inside the userbox at the top. Some themes doesn't have it
Erik?
   SMF Ads "translator"

bigguy

Leaving this edit out won`t effect the ad mod at all, it will still run. You just won`t be able to show the ad`s there. What theme are you installing this on ??

willi1

Hello,

i have instialled the mod vers 2.0 can you help me i want to use the mod with the theme classic in german
i don?t know what i must do, i read this post but the settings in  the index.template.php are different
and i?m a newbie  ???

can you explain me waht i must do?

sorry for my bad english

best regards

willi1


bigguy

Install the ad mod to the default theme and then to the theme you want to use do the edits above. The edits above are for version 2 of the mod and will only work on smf 1.1rc2. I don`t think we have a german translation yet though.

willi1

Hello bigguy,

i have install the mod to the theme that i want to use and to the default theme.
but i can?t see the ads in the Forum can you help me what i must change in my classic theme?

The settings in the first entry?

best regards

willi1

bigguy

All the edits for that that have to be made are above. You have to modify all the template files listed.

willi1

Hej Hej,

i have a question, i don?t have this line in my index.template.php

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

and the

Quote</td>

i have many </td> in my index.template.php which one schould i use?

can you help me again?

thank you for your great mod

willi1

bigguy

The //show the powered by stuff will have to be there somewhere, what theme are you using ??? also try searching for this:

Quote</td>

search for it with the space, thats very important.

willi1

QuoteThe //show the powered by stuff will have to be there somewhere, what theme are you using Huh? also try searching for this:

Quote
                     </td>

search for it with the space, thats very important.

Hello bigguy,

i use the classic template

and my Adress is http://www.preishals.de

ok i will search for this.

i have attached the index.template.php perhaps you can look of this sorry for my english

best regards

Andr?