Customizing SMF > Modifications and Packages

Ad Management mod 3.1 Released SMF 2.0.x and SMF 1.1.x Support!

<< < (1355/1410) > >>

Kat9119:

--- Quote from: iain sherriff on June 30, 2012, 10:12:53 PM ---I have to do this too. Im surprised no one has posted the relevant bits yet....

--- End quote ---

It makes sense that they couldn't do it for every theme, but doesn't Core come with SMF? therefore I think it would be an all around edit that everyone using Core could use. I really really need this mod installed :(

Labradoodle-360:
Eventually I'll get around to updating this modification and allow global theme support without having to touch any template files. However, until then, you'll need to complete the manual edits on the theme.

Not sure that I have time within the next week to manually tweak it in for you.

Kat9119:

--- Quote from: Labradoodle-360 on June 30, 2012, 11:57:50 PM ---Eventually I'll get around to updating this modification and allow global theme support without having to touch any template files. However, until then, you'll need to complete the manual edits on the theme.

Not sure that I have time within the next week to manually tweak it in for you.

--- End quote ---

Ok, well, its not a rush rush for me, I'd "like" it up by the 13th, but obviously if it can't be done it can't be, and I have no idea what I'm doing with it lmao. So, if you can help me out in the near future that would be awesome :) My site can still go up without it for now. But those files attached above might change in that time if I install other things.

iain sherriff:
I cant guarantee this will work but it's what I am going to try  8)
I found the Parser and got this


--- Code: ---Logo
Package Parser
[I'm ready for IPv6, are you?]
email twitter GooglePlus GitHub

    Forum
    GIT
    Password Generator
    PackageParser
    Pastebin
    SMF PacMan

General Package Information
This is general information about the package, such as the package ID and name.
Package ID: jeremy:ads
Package name: Ad Managment
Package version: 3.0.1
Package type: modification

Installation instructions for SMF versions: 2.0-2.99.99, 2.0 RC4,2.0 RC5
Note: If a file does not exist in your theme, it doesn't matter (as the file from the Default theme will be used).
In file Themes/[your theme]/BoardIndex.template.php
Find:

// Show some statistics if stat info is off.



Add before:

 
//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);
}
 




Find:

<tbody class="divider">
<tr>
<td colspan="4"></td>
</tr>
</tbody>';



Add after:

 
echo '<tbody><tr><td colspan="4">';
//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);
}
echo ' </td></tr></tbody>';
 




In file Themes/[your theme]/Display.template.php
Find:

// Show the anchor for the top and for the first message. If the first message is new, say so.



Add after:

 
//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);
 
$messageStorage = '';
}
 




Find:

// Get all the messages...
while ($message = $context['get_message']())
{



Replace with:

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




Find:

}
 
echo '
</form>
</div>
<a id="lastPost"></a>';
 



Replace with:

 
if (function_exists("show_posts"))
{
$messageStorage = $message;
if ($adpost = show_posts($adcounter))
{
if($modSettings['ads_lookLikePosts'])
{
echo '
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="poster">
<h4>', $context['forum_name'], '</h4>
</div>
<div class="postarea">
<div class="flow_hidden">
<div class="keyinfo">
<div class="messageicon">
<img src="', $message['icon_url'] . '" alt="" border="0" />
</div>
<h5 id="subject_', $message['id'], '">
<a href="', $message['href'], '" rel="nofollow">', $message['subject'], '</a>
</h5>
<div class="smalltext">&#171; <strong>', !empty($message['counter']) ? $txt['reply_noun'] . ' #' . $message['counter'] : '', ' ', $txt['on'], ':</strong> ', $message['time'], ' &#187;</div>
<div id="msg_', $message['id'], '_quick_mod"></div>
</div>';
 
// If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
echo '
<ul class="reset smalltext quickbuttons">';
 
// Can they reply? Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<li class="quote_button"><a>', $txt['quote'], '</a></li>';
 
// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<li class="quote_button"><a>', $txt['quote'], '</a></li>';
 
// Can the user modify the contents of this post?
if ($message['can_modify'])
echo '
<li class="modify_button"><a>', $txt['modify'], '</a></li>';
 
// How about... even... remove it entirely?!
if ($message['can_remove'])
echo '
<li class="remove_button"><a>', $txt['remove'], '</a></li>';
 
// What about splitting it off the rest of the topic?
if ($context['can_split'] && !empty($context['num_replies']))
echo '
<li class="split_button"><a>', $txt['split'], '</a></li>';
 
// Can we restore topics?
if ($context['can_restore_msg'])
echo '
<li class="restore_button"><a>', $txt['restore_message'], '</a></li>';
 
if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
echo '
</ul>';
 
echo '
</div>';
 
 
// Show the post itself, finally!
echo '
<div class="post">';
 
echo '
<div class="inner" id="msg_', $message['id'], '"', '>', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) ,'</div>
</div>';
 
 
echo '
</div>
 
 
<span class="botslice"><span></span></span>
</div>
<hr class="post_separator" />
';
}
else
echo '
<div class="windowbg">
<span class="topslice"><span></span></span>
 
<div align="center">', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) ,'</div>
 
<span class="botslice"><span></span></span>
</div>
<hr class="post_separator" />
';
}
}
}
 
if(function_exists("show_lastpostAds") && function_exists("show_posts"))
{
$message = $messageStorage;
if(($adpost = show_lastpostAds()) && !show_posts($adcounter))
{
if($modSettings['ads_lookLikePosts'])
{
echo '
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="poster">
<h4>', $context['forum_name'], '</h4>
</div>
<div class="postarea">
<div class="flow_hidden">
<div class="keyinfo">
<div class="messageicon">
<img src="', $message['icon_url'] . '" alt="" border="0" />
</div>
<h5 id="subject_', $message['id'], '">
<a href="', $message['href'], '" rel="nofollow">', $message['subject'], '</a>
</h5>
<div class="smalltext">&#171; <strong>', !empty($message['counter']) ? $txt['reply_noun'] . ' #' . $message['counter'] : '', ' ', $txt['on'], ':</strong> ', $message['time'], ' &#187;</div>
<div id="msg_', $message['id'], '_quick_mod"></div>
</div>';
 
// If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
echo '
<ul class="reset smalltext quickbuttons">';
 
// Can they reply? Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<li class="quote_button"><a>', $txt['quote'], '</a></li>';
 
// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<li class="quote_button"><a>', $txt['quote'], '</a></li>';
 
// Can the user modify the contents of this post?
if ($message['can_modify'])
echo '
<li class="modify_button"><a>', $txt['modify'], '</a></li>';
 
// How about... even... remove it entirely?!
if ($message['can_remove'])
echo '
<li class="remove_button"><a>', $txt['remove'], '</a></li>';
 
// What about splitting it off the rest of the topic?
if ($context['can_split'] && !empty($context['num_replies']))
echo '
<li class="split_button"><a>', $txt['split'], '</a></li>';
 
// Can we restore topics?
if ($context['can_restore_msg'])
echo '
<li class="restore_button"><a>', $txt['restore_message'], '</a></li>';
 
if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
echo '
</ul>';
 
echo '
</div>';
 
 
// Show the post itself, finally!
echo '
<div class="post">';
 
echo '
<div class="inner" id="msg_', $message['id'], '"', '>', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) ,'</div>
</div>';
 
 
echo '
</div>
 
 
<span class="botslice"><span></span></span>
</div>
<hr class="post_separator" />
';
}
else
echo '
<div class="windowbg">
<span class="topslice"><span></span></span>
 
<div align="center">', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) ,'</div>
 
<span class="botslice"><span></span></span>
</div>
<hr class="post_separator" />
';
}
}
 
echo '
</form>
</div>
<a id="lastPost"></a>';
 
 




In file Themes/[your theme]/MessageIndex.template.php
Find:

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



Add after:

 
//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);
}
 




Find:

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



Replace with:

echo '
</tbody>
</table>
</div>
</div>';
//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);
}
 




SMF Package Parser, by Daniel15.
Wordpress Theme by ThemeZee

SleePyCode uses WordPress and Simple Machines | Page created in 1.774 seconds with 12 queries.
SleePyCode.com is hosted on Linode
Loading...



--- End code ---

Kindred:
iain sherriff,

those instructions are on the mod download page as well, under "Manual Install Instructions for SMF " [CHOOSE YOUR VERSION]


the problem that others are complaining about is that the mod installs only into the curve (default) theme (which is typical of most mods)
but because "core" has significantly different coding from curve, the install instructions are not just "cut and paste" between themes.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version