Support for SMF Tricks Themes & Mods

0 Members and 1 Guest are viewing this topic.

*
urakkadan
Sniffer
Ad management mod for resseller
September 04, 2014, 09:11:56 AM
Hi

Thanks for the awesome theme.i was using ad management mod for google adsense .unfortunately ads are not showing on the board index and in the post pages. how we can fix this issue or can you suggest me a mod that is compatible with reseller..?   






*
ColicDusty
#1
Sniffer
Re: Ad management mod for resseller
September 04, 2014, 10:59:00 AM
Hi there, Daniel explain in a post of SMFTricks how you can fix that, i translate the tutorial of (How to fix the Ad Management for theme Reseller.)

/Themes/Reseller/BoardIndex.template.php
Search:
Code: [Select]
echo '
</tbody>
</table>';
}
echo '
</div>
<br />';
}
echo '
</div>';

if ($context['user']['is_logged'])

Replace for:
Code: [Select]
echo '
</tbody>
</table>';
}
echo '
</div>
        <br />
<table class="table_list">
<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>
</table>';
}
echo '
</div>';

if ($context['user']['is_logged'])

/Themes/Reseller/Display.template.php
Search:
Code: [Select]
}
echo '
</form>
</div>
<a id="lastPost"></a>';

Replace for:
Code: [Select]
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>';

With that fixes it should work, I've tried on my forum and it shows a Google Ad on the bottom side of the theme. You can't not put ads on posts, or on the top side of this theme because shouldn't work it. But just put the Adsense Add on every page at the bottom and should be okey.

Thanks for using SMFTricks theme.

Regars ColicDusty [Designer]
*
moopasa
#2
Sniffer
Re: Ad management mod for resseller
September 13, 2014, 05:53:37 PM
Hey ColicDusty, thanks for the wonderful explanation. It works like a charm.

Can I please ask for help to put the ad "in-between" posts? I especially want it for after the first post in the thread. Please help.


Thanks!
*
moopasa
#3
Sniffer
Re: Ad management mod for resseller
April 04, 2015, 10:46:15 PM
Just bumping this.

Does anyone know how to put ads in between post of reseller theme? Need your help guys!
*
Alundra
#4
Sniffer
Re: Ad management mod for resseller
September 01, 2015, 04:36:42 AM
This code is inaccurate and incorrect.

Firstly it duplicates the last post link.
Secondly there are syntax errors.
Thirdly it doesn't have all the functions.
Fourthly it's not even built for this theme, it's just an awkward cut and paste of the original themes code and shoving it into this theme.

I Really hope someone can actually provide a proper response, especially since you guys are making responsive themes now and should know your way around one ;). I would like to be able to use this mod on my Reseller theme but if I'm going to have to go into it like this then I might as well just paste the adsense code in the appropriate places and not bother.

*
kardamilas
#5
Sniffer
Re: Ad management mod for resseller
April 15, 2016, 03:55:46 PM
Is there any progress on this matter?
This mod is very useful...