Ad Management mod

Started by SMFHacks.com Team, January 30, 2006, 08:41:19 PM

Previous topic - Next topic

Kat9119

Quote from: Kat9119 on June 30, 2012, 12:06:14 PM
This installs fine other then the template files. I'm using "Core" with some mods installed and minor edits. The three template files fail mainly due to the "replace" codes. I don't have those in my files.

I've searched through this thread, and it looks like a lot of people have had issues with this with not much help other then told to compare files from the Core theme and Default theme. So I downloaded and installed WinMerge, I tried to add the code where I thought they'd be, which probably was "ok" but then the "replace" codes stumped me. When I tried to place them where I thought they went, it gave me an error.

I've attached the three template files in hopes that someone can help me. Doesn't seem like a huge edit and someone who knows what they are doing I would think could edit this very quickly. This is much much much appreciated. If I wasn't thousands of dollars in debut with medical bills I'd  pay you for your help  8)

I have a live event going on on my forum on the 13th and this forum needs to be updated and live about a week before that to install and tweak things I can't on my computer. So please help if you can, I'm ready to tear my hair out!  :-\

Trying to see if anyone still wants to help me on this sometime within the next couple weeks. My forum still is not live...keep missing the date due to being sick. But I'd appreciate help with it once it is live...as then I can give correct finalized files for the help.

mladja037

Please help install error in two files:

Display.template
Board.Index.template

Please integrate the code... :(

BOARD.INDEX

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>';





DISPLAY.INDEX Replace

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>';

arcadecontrols

I'm having an issue with this mod on my 2.02 forum. I'm attempting to use a Google ad. However, when I paste the contents of the Google ad into the ad text box (set to HTML mode), it goes awry. It pastes the entire ad block fine, and I set the various other parameters and hit save. However, when I go back to modify the ad, the ad text box is truncated towards the end. This of course messes up the forum as well as the ad not displaying.

I've attempted it with two different Google ads copy/pasted from the Google Adsense site. This happens whether I am using the default SMS 2.02 theme, or the Yabb_SE_Classic theme.

Here is the text I'm pasting into the box:


<script type="text/javascript"><!--
google_ad_client = "ca-pub-xxxxxxxxxxxxxxxx";
/* Forum-Graphical */
google_ad_slot = "7740891865";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


(I have replaced my specific ad client # with x's here obviously, but I am pasting it unaltered in the ad box)

When I go back to look at it after it's saved, it truncates in the second to last line, so that it ends at: "src="http://pagead2.goog [nofollow]"

The exact spot of truncation varies somewhat depending on what ad I put in there, but it's always in the second to last line, and the last ending </script> line is always missing as well.

Without knowing what's happening behind the scenes, it's acting very much as if there is a limit to the # of characters that can be put in the ad box.

Any help? As I'm sure you often hear, if I can get this working I'm very likely to want to buy the pro version. I'm reluctant to jump up to the pro version however until I can test out the free one first.

Appreciate any help - thanks!

AMWebby

I think this is a cool mod and am on the verge of upgrading to the pro version. However I've come across a bug. I've searched this topic but can find no mention of it.

I have certain groups on my forum (and admins) set not to see ads. However, for those groups the New Post and Go Up/Go Down buttons no longer work. I'm guessing because they are anchor links and the anchor is inside a display: none element if that group can't see ads.

The New Post and Go Up/Go Down buttons work fine for those who can see ads so I'm fairly sure my hypothesis is correct but wanted to see if anyone else had encountered this (and a fix) before I start digging.

Edit: Mark this as solved. I just found out it is unrelated to this mod. I run my forum inside a Joomla wrapper and I had altered it from fixed height to 100%. It seems that was enough to short-circuit the anchor links.

KRISHNA0007

thanks for this awesome mod

Matthew K.

Quote from: AMWebby on August 07, 2012, 11:08:37 AM
I think this is a cool mod and am on the verge of upgrading to the pro version. However I've come across a bug. I've searched this topic but can find no mention of it.

I have certain groups on my forum (and admins) set not to see ads. However, for those groups the New Post and Go Up/Go Down buttons no longer work. I'm guessing because they are anchor links and the anchor is inside a display: none element if that group can't see ads.

The New Post and Go Up/Go Down buttons work fine for those who can see ads so I'm fairly sure my hypothesis is correct but wanted to see if anyone else had encountered this (and a fix) before I start digging.

Edit: Mark this as solved. I just found out it is unrelated to this mod. I run my forum inside a Joomla wrapper and I had altered it from fixed height to 100%. It seems that was enough to short-circuit the anchor links.
Sorry for a late reply here. Glad you figured it out :) I was ready to help you fix it, though.

Quote from: KRISHNA0007 on August 07, 2012, 03:24:56 PM
thanks for this awesome mod
Glad you like it!

LOLwut

Hey, I had the mod on my site a LONG time ago and it worked great. But now when I add, an add, it will not show up. its strange because when I type in a random line of text, that will show, but not when I select a vertical ad from google.

Any Ideas as to what could be causing this?
www.TizeMe.com

The #1 place to show off your website/forum/blog/youtube channel, you name it!

- ALL FOR FREE.

vbgamer45

Google takes a while to appear so will be blank for a while if it is a new ad block/new site for google.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

AMWebby

Quote from: Labradoodle-360 on August 08, 2012, 11:27:07 AM
Sorry for a late reply here. Glad you figured it out :) I was ready to help you fix it, though.
Hope you can help me with this then.

I'm trying to display the ads on my Joomla website with a module using the following code:


<?php
require_once("./forum/SSI.php");

include_once(
"./forum/Sources/LoadAds.php");

$ads show_bottomAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);

?>



I cribbed this from an earlier post but it doesn't seem to display anything and doesn't throw up any errors. Any idea what I'm doing wrong?

Matthew K.

There's nothing I can do without testing it to debug it, sorry.

airtetdotin

Quote from: Realinfo on May 05, 2012, 10:08:00 PM
Quote from: Austin G on April 30, 2012, 08:45:23 PM
I can not get ads to disable for usergroups. I only have "Enable Ads" selected on regular members and guests. But it will show up for everyone (except admins if using the "hide for admins" setting). I would really like to get this working so that we can remove ads for paid members. I would be happy just to add more usergroups to the "hide for admins" setting.

I have very same issue........... is there any solution................
you have installed
but i have facing these problem

   Type    Action    Description
   1.    Execute Code    install.php    
*    2.    Execute Modification    ./index.php    Test successful
*    3.    Execute Modification    ./Sources/Admin.php    Test successful
*    4.    Execute Modification    ./Sources/QueryString.php    Test successful
*    5.    Execute Modification    ./Themes/default/BoardIndex.template.php    Test successful
*    6.    Execute Modification    ./Themes/default/Display.template.php    Test successful
*    7.    Execute Modification    ./Themes/default/MessageIndex.template.php    Test successful
*    8.    Execute Modification    ./Sources/ManagePermissions.php    Test successful
   9.    Extract File    ./Sources/Ads.php    
   10.    Extract File    ./Sources/LoadAds.php    
   11.    Extract File    ./Themes/default/Ads.template.php    
   12.    Extract File    ./Themes/default/languages/Ads.english.php    
   13.    Extract File    ./Themes/default/languages/Ads.english-utf8.php    

Install in Other Themes
To use this modification in themes other than the default, the package manager needs to make additional changes to the other themes. If you'd like to install this modification in the other themes, please select these themes below.
      Core Theme
      Execute Modification    ./Themes/core/BoardIndex.template.php    Test failed
      1.    Add Before    ./Themes/core/BoardIndex.template.php    Test successful
      2.    Add After    ./Themes/core/BoardIndex.template.php    Test failed
      Execute Modification    ./Themes/core/Display.template.php    Test failed
      1.    Add After    ./Themes/core/Display.template.php    Test successful
      2.    Replace    ./Themes/core/Display.template.php    Test successful
      3.    Replace    ./Themes/core/Display.template.php    Test failed
      Execute Modification    ./Themes/core/MessageIndex.template.php    Test failed
      1.    Add After    ./Themes/core/MessageIndex.template.php    Test successful
      2.    Replace    ./Themes/core/MessageIndex.template.php    Test failed

When i installed error message
SQL logic error or missing database
near "NOT": syntax error
File: /home/a5716416/public_html/Packages/temp/install.php
Line: 51

vbgamer45

Are you using MySQL currently the mod only supports that database type.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

jayman2

I've been trying to install ad management into my smf v2.0.2 forum.  I'm using the Urban theme and I'm not having any luck.  I ran the install.php file from my root directory, then when I go to phpmyadmin, the only entries that I see for the mod is smf_ads and smf_ads_settings.  Shouldn't there be more entries? 

I know this mod will work on the Urban theme because I visited a forum running smf 2.0.2 with the Urban theme and he had ads all over the place.  Are there many people having any luck with this?

Blackburn

Gerçek mutluluk mal ve mülke sahip olmak ile değil,akıl ve erdeme sahip olmak ile mümkündür.
Slax Tr - Slax Türkiye Topluluğu adresinden usb ile bile çalışan işletim sisteminin Türkiye sitesine ulaşabilirsin.
Özgür yaşam,özgür insan.

jayman2

#6814
Can anyone help me?

Quote from: jayman2 on August 19, 2012, 07:43:53 PM
I've been trying to install ad management into my smf v2.0.2 forum.  I'm using the Urban theme and I'm not having any luck.  I ran the install.php file from my root directory, then when I go to phpmyadmin, the only entries that I see for the mod is smf_ads and smf_ads_settings.  Shouldn't there be more entries? 

I know this mod will work on the Urban theme because I visited a forum running smf 2.0.2 with the Urban theme and he had ads all over the place.  Are there many people having any luck with this?
OK... I've got it to the point now, where I can display ads in my forums areas, but only as LIVE LINKS, they don't pull the ad image.   I get box outlines the shape of the ad with a small red x in the upper left-hand corner, and a link to the ad.   I can get the ads to appear in the correct positions that I select in the ads setup, but only as LINKS.  I can even just type in html code and that displays also.  How do I get the ad images to show up?  I feel like I'm so close.

mrintech

Thanks a ton for this MOD :)

I just started using it and it works like a charm :)

Thanks a lot again :)

Texan78

Hello,

I have this mod installed and I have had it installed for months and no problems out of it at all. I just have a minor tweak I want to make so I can manage the location of Ads better.

If you look at the screenshot, you will noticed circled in red is where the Mod places the ad if you have it selected for "Display ads on every page on the top of the page". I would like to move that bit of code that displays those Ads to where the Banner Ad is currently placed. I have that ad hard coded in my index.template.php for the Banner. I would like to control my ads from the Mod, but I would like it to place them where the current banner is at.

Traced back through the manual edits and nothing referring to code for the index.template.php file that adds that code to the very top. So where would I find that code so I can move it to where I want it or is that done with a hook? If so, where could I find it?



-Thanks!

Kindred

Use HTML center tags...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Texan78

Quote from: Kindred on August 20, 2012, 11:12:28 PM
Use HTML center tags...

Those are Deprecated tags, instead do.

<div style="text-align:center">INSERT GOOGLE CODE HERE</div>

mrintech

Quote from: khyamay on August 21, 2012, 08:21:47 AM
Quote from: Texan78 on August 20, 2012, 11:41:53 PM
Quote from: Kindred on August 20, 2012, 11:12:28 PM
Use HTML center tags...

Those are Deprecated tags, instead do.

<div style="text-align:center">INSERT GOOGLE CODE HERE</div>

i am using ad management mod and the code u mention can only be used when manually inserting the ad right??

It will work everywhere. Just put the tags above and below the Ad code in Ad Management Page :)

I used following and it works like a charm:

<center>
.
.
GOOGLE ADSENSE CODE
.
.
</center>
<br></br>

:)

Advertisement: