News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SMF Ad Revenue Sharing Mod (Official Beta Testing Thread)

Started by karlbenson, March 04, 2007, 01:53:33 PM

Previous topic - Next topic

Niteblade

karlbenson,

Will you update the beta in order to successfully install with Tinyportal?
affiliate blog

911

Any updates on this? Still working on the Mod Karl?

Niteblade

I got it to work with TP, but had to fudge it. It's a sloppy fix.
affiliate blog

dadaas

What if we have integrated forum into portal and adsense ads are on portal and other suers ads are on forum, will this still be against rules of google?

Noddegamra

I use this mod on my forum with a few others installed. Works fine! Thanks! :)

CanadianDots

Quote from: nite0859 on July 01, 2007, 08:51:09 AM
I got it to work with TP, but had to fudge it. It's a sloppy fix.
Care to share? I've been wanting to implement this mod with my smf / tp site and simply can't find the time to figure it out.
hxxp:www.canadiandots.ca [nonactive]

Niteblade

Quote from: CanadianDots on July 13, 2007, 11:52:00 PM
Quote from: nite0859 on July 01, 2007, 08:51:09 AM
I got it to work with TP, but had to fudge it. It's a sloppy fix.
Care to share? I've been wanting to implement this mod with my smf / tp site and simply can't find the time to figure it out.

BACKUP ORIGINAL FILES FIRST

Sure.

When you attempt to install this mod, you'll notice that it fails with index.template.php. For the most part, all the other files it attempts to modify will not throw up an error message. So the issue is with index.template.php.

What I did was remove all references to index.template.php in the installer XML file. Now, when I re-installed, everything worked. Index.template.php is a template file, so all it's really doing is controlling the looks of the modification -- not the function. So, technically, you can have a working modification without running anything in index.template.php.

Index.template.php is useful for rendering ads on ALL pages.

So, what I did was this.

I looked at what functions were being called through index.template.php.

// AD REVENUE SHARING - PLACEMENT OF ARS ADS AT TOP OF THE PAGE (CENTERED)
if ($modSettings['ars_enabled']) {
// START COUNTING THE NUMBER OF ADS
$context['arsadscount'] = 0;
showArsAds("top");
showArsMessage("top");
}
// END OF ARS PLACEMENT OF ARS ADS


I placed that piece of code where I wanted TOP ads to display. In the bigger picture, the code block looks like this (for me)..


// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo ' </span>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sha1.js"></script>

<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">', $txt['smf53'], '</option>
<option value="1440">', $txt['smf47'], '</option>
<option value="10080">', $txt['smf48'], '</option>
<option value="43200">', $txt['smf49'], '</option>
<option value="-1" selected="selected">', $txt['smf50'], '</option>
</select>
<input type="submit" value="', $txt[34], '" /><br />
<span class="middletext">', $txt['smf52'], '</span>
<input type="hidden" name="hash_passwrd" value="" />
</form>';
}

echo '
</td>

<td width="50%" class="windowbg2" valign="middle" align="right"><div id="sponsored-links-468x60">';

// AD REVENUE SHARING - PLACEMENT OF ARS ADS AT TOP OF THE PAGE (CENTERED)
if ($modSettings['ars_enabled']) {
// START COUNTING THE NUMBER OF ADS
$context['arsadscount'] = 0;
showArsAds("top");
showArsMessage("top");
}
// END OF ARS PLACEMENT OF ARS ADS

echo '</div><br /></td>

</tr>
</table>
</td>
</tr>
</table>';

echo '
<table id="upshrinkHeader2"', empty($options['collapse_header']) ? '' : ' style="display: none;"', ' width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>';

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<td width="90%" class="titlebg2">
<span class="smalltext"><b>', $txt[102], '</b>: ', $context['random_news_line'], '</span>
</td>';
echo '
<td class="titlebg2" align="right" nowrap="nowrap" valign="top">
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
<a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
<input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="', $txt[182], '" style="width: 11ex;" />
<input type="hidden" name="advanced" value="0" />';

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

echo '
</form>
</td>
</tr>
</table>
';
// TinyPortal
       }
//  end
echo '
</div>';


What I also did here is make a 468x60 image and use a div element to call it out -- it is the background image for the adsense units that is rendered even if someone uses firefox to block all ads.

Anyhow, the most important thing is to pay attention to the code that calls out the function.


// AD REVENUE SHARING - PLACEMENT OF ARS ADS AT TOP OF THE PAGE (CENTERED)
if ($modSettings['ars_enabled']) {
// START COUNTING THE NUMBER OF ADS
$context['arsadscount'] = 0;
showArsAds("top");
showArsMessage("top");
}
// END OF ARS PLACEMENT OF ARS ADS

affiliate blog

anakmacan


tsanko

The mod works great with 1.1.3 :) I use it from 3-4 days and have no problems.

igauresh

I tried to install te mod on 1.1.3 and even though the mod is installed without any errors it doesnt show me any options in the admin panel to edit the settings for it.
Please help me with this installation.

karlbenson


igauresh

hi,
I tried uninstalling and reinstalling but it was all in vain and I couldnt get those options. So i installed the 1.1.2 version of smf manually and now its working on that version.
Also I suspect that since i installed the previous version thru fantastico tools of my hosting there was some problem in the installation which was causing the malfunction ...
Still I am really happy that it works...
A small suggestion would be that .. is it possible to have a point system and the points can then be used to buy impressions of ad units by the members of the forum.
This will make sure that only the currently posting members are the ones who earn points and use them to show their google ads to others.

karlbenson

I'm deliberately staying away from dealing with impressions.

For the new 2.0 I'm working on.  Inactive users get disabled and/or removed from participating after a period of time.
So only currently active posters will benefit.

vipmoney

VipMoney

n971

Just installed. Grat mod. I have a suggestion/question:

Instead of 'register' to register with adsense link, can we have our AdSense referral ad?

AdRevenue Sharing doesn't work with other languages. What can I do in order to make it work? Actually, you can switch to english, enter your PID, and switch back to your language.

Tnx

karlbenson

in the new version I'm working on, it uses the referral ad for the register

I don't have any other translations than the english version. (once the new version is ready I'll be asked for help with translations)

vipmoney

#136
Are the Impressions on the Admin / Report, posted in real time ?

For some reason, my impressions are stucked, and everything is working, I'm showing banners, i got the «Log Impressions» checked, etc, but impressions don't grow...

Why ?

VipMoney

karlbenson


vipmoney

Quote from: karlbenson on August 23, 2007, 09:51:37 AM
Impressions should be real time.

Hum.... I copy the ad placement codes from index.template.php to the inde.template.php of my theme, is there any part of the code that says to impressions to be logged ?
VipMoney

karlbenson

no the counter isnt in the themes, its in ArsAds.php

Advertisement: