SMF Ads Support Forum
May 25, 2013, 12:03:25 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Version 2.3 has been released. Visit http://mods.simplemachines.org to get the most up to date version.
 
   Home   Help Downloads Login Register  
Pages: [1] 2 3 ... 22   Go Down
  Print  
Author Topic: Edits for ad_mod_rc2_v2 for themes other than default  (Read 76192 times)
0 Members and 1 Guest are viewing this topic.
bigguy
Support
Elite Member
*
Offline Offline

Posts: 1518



WWW
« on: June 20, 2006, 08:26:59 am »

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:

Code:
<body>';

After that line add:

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

Code:
</td>

BEFORE that add:

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

Code:
template_menu();

Then add BEFORE:

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

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

After that add:

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

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

Add after that:

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

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

BEFORE that add:

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

Code:
// Get all the messages...

And REPLACE with:

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

In the same file find:

Code:
</td></tr>';
}

And REPLACE with:

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

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

BEFORE that add:

Code:
//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.
« Last Edit: August 07, 2006, 05:13:36 pm by bigguy » Logged

Jump1979man
Jr. Member
**
Offline Offline

Posts: 25


« Reply #1 on: June 20, 2006, 09:03:15 pm »

thank you for this.  I will try it soon to see if I can get it to work.
Logged
bigguy
Support
Elite Member
*
Offline Offline

Posts: 1518



WWW
« Reply #2 on: June 21, 2006, 10:14:35 am »

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

ingaffa
Newbie
*
Offline Offline

Posts: 1


« Reply #3 on: June 23, 2006, 07:04:32 pm »

Quote
Then find in the same file:

Quote
                     </td>

Which one?  There are hundreds!

Thanks.
Logged
jerm
Support
Elite Member
*
Offline Offline

Posts: 726


« Reply #4 on: June 23, 2006, 07:08:50 pm »

search for this instead:
Code:
</td>
only one line will show up
Logged
erik
Newbie
*
Offline Offline

Posts: 9


The world as you know it, will soon be changing


WWW Email
« Reply #5 on: June 24, 2006, 02:46:02 am »

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

It's inside the userbox at the top. Some themes doesn't have it
Logged

Erik?
   SMF Ads "translator"
bigguy
Support
Elite Member
*
Offline Offline

Posts: 1518



WWW
« Reply #6 on: June 24, 2006, 11:29:59 am »

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 ??
Logged

willi1
Jr. Member
**
Offline Offline

Posts: 13


« Reply #7 on: July 07, 2006, 06:55:41 am »

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  Huh?

can you explain me waht i must do?

sorry for my bad english

best regards

willi1

Logged
bigguy
Support
Elite Member
*
Offline Offline

Posts: 1518



WWW
« Reply #8 on: July 07, 2006, 08:44:12 am »

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.
Logged

willi1
Jr. Member
**
Offline Offline

Posts: 13


« Reply #9 on: July 10, 2006, 01:13:14 am »

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
Logged
bigguy
Support
Elite Member
*
Offline Offline

Posts: 1518



WWW
« Reply #10 on: July 10, 2006, 09:51:44 am »

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

willi1
Jr. Member
**
Offline Offline

Posts: 13


« Reply #11 on: July 12, 2006, 10:14:54 am »

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
Logged
bigguy
Support
Elite Member
*
Offline Offline

Posts: 1518



WWW
« Reply #12 on: July 12, 2006, 11:30:21 am »

The //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.
Logged

willi1
Jr. Member
**
Offline Offline

Posts: 13


« Reply #13 on: July 12, 2006, 01:32:50 pm »

Quote
The //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?



« Last Edit: July 12, 2006, 01:34:34 pm by willi1 » Logged
bigguy
Support
Elite Member
*
Offline Offline

Posts: 1518



WWW
« Reply #14 on: July 12, 2006, 02:10:13 pm »

Try this one out...
Logged

SMF Ads Support Forum
   

.
 Logged
Pages: [1] 2 3 ... 22   Go Up
  Print  
 
Jump to:  

.
Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
SMF and SimpleMachines are registered trademarks of Simple Machines. SMFAds.com is not affiliated with nor endorsed by Simple Machines.