Coinbase

Author Topic: Edits for ad_mod_rc2_v2 for themes other than default  (Read 156613 times)

0 Members and 1 Guest are viewing this topic.

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Edits for ad_mod_rc2_v2 for themes other than default
« on: June 20, 2006, 07: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: [Select]
<body>';
After that line add:

Code: [Select]
//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: [Select]
</td>
BEFORE that add:

Code: [Select]
';
//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: [Select]
template_menu();
Then add BEFORE:

Code: [Select]
//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: [Select]
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
After that add:

Code: [Select]
//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: [Select]
// Show some statistics next to the link tree if SP1 info is off.
Add after that:

Code: [Select]
//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: [Select]
global $context, $settings, $options, $txt, $scripturl, $modSettings;
BEFORE that add:

Code: [Select]
//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: [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 ($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: [Select]
global $context, $settings, $options, $scripturl, $modSettings, $txt;
BEFORE that add:

Code: [Select]
//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, 04:13:36 pm by bigguy »

Offline Jump1979man

  • Jr. Member
  • **
  • Posts: 25
Re: Edits for the default theme
« Reply #1 on: June 20, 2006, 08:03:15 pm »
thank you for this.  I will try it soon to see if I can get it to work.

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Edits for the default theme
« Reply #2 on: June 21, 2006, 09:14:35 am »
Make sure the mod is installed first and then edit the template you want to use with these edits.

Offline ingaffa

  • Newbie
  • *
  • Posts: 1
Re: Edits for the default theme
« Reply #3 on: June 23, 2006, 06:04:32 pm »
Quote
Then find in the same file:

Quote
                     </td>

Which one?  There are hundreds!

Thanks.

Offline jerm

  • Support
  • Elite Member
  • *
  • Posts: 726
Re: Edits for the default theme
« Reply #4 on: June 23, 2006, 06:08:50 pm »
search for this instead:
Code: [Select]
</td>only one line will show up

Offline erik

  • Newbie
  • *
  • Posts: 9
  • The world as you know it, will soon be changing
    • Erik? Community
    • Email
Re: Edits for the default theme
« Reply #5 on: June 24, 2006, 01:46:02 am »
search for this instead:
Code: [Select]
</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"

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Edits for the default theme
« Reply #6 on: June 24, 2006, 10: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 ??

Offline willi1

  • Jr. Member
  • **
  • Posts: 13
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #7 on: July 07, 2006, 05: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  ???

can you explain me waht i must do?

sorry for my bad english

best regards

willi1


Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #8 on: July 07, 2006, 07: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.

Offline willi1

  • Jr. Member
  • **
  • Posts: 13
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #9 on: July 10, 2006, 12: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

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #10 on: July 10, 2006, 08:51:44 am »
All the edits for that that have to be made are above. You have to modify all the template files listed.

Offline willi1

  • Jr. Member
  • **
  • Posts: 13
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #11 on: July 12, 2006, 09: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

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #12 on: July 12, 2006, 10:30:21 am »
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.

Offline willi1

  • Jr. Member
  • **
  • Posts: 13
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #13 on: July 12, 2006, 12: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, 12:34:34 pm by willi1 »

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #14 on: July 12, 2006, 01:10:13 pm »
Try this one out...

SMF Ads Support Forum

Re: Edits for ad_mod_rc2_v2 for themes other than default
« Reply #14 on: July 12, 2006, 01:10:13 pm »
.

 

.