Synapseal Arclights

Random neuronal meanderings

Entries tagged "phpbb".

Adsense inside first post of a phpBB forum
11th April 2011

 

I do not like ads. I realize they're a good way for a web presence to support itself somewhat, but I still don't like them. I especially don't like the big honkin' 300x300 squares smack in the middle of the page.

On my phpBB forum, I've had good luck running a mod called Advertising Management to place ads in the various places.

I've been running a 728x90 banner under the first post for years, but have come to the realization that folks just roll right past it as they browse the forum.

I recently set up a SimpleMachines board, and found an adsense mod that had the ad inside the first post. "Hmmm", says I. "Can't avoid that one."

So, off I go to the great Google, and found this: How to put Adsense in first post of phpBB3. I did not do it exactly as it says, but it did provide me a good starting place.

Instead of adding anything to the style sheet(s), I included the styling in the ad code block itself.

Here is the code I ended up with. For prosilver, it's pretty much as it goes on the linked page:
<!-- IF postrow.S_FIRST_ROW -->
<div style="float: right; margin: 3px 3px 3px 3px;">
<script type="text/javascript"><!--
google_ad_client = "YOUR-ADSENSE-CODE-GOES-HERE";
google_ad_width = 120;
google_ad_height = 240;
google_ad_format = "120x240_as";
google_ad_type = "text_image";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<br><br>
<!-- ENDIF -->
Now, for subsilver2, you'll need to find
<div class="postbody">{postrow.MESSAGE}</div>
in your $forumhome/styles/subsilver2/template/viewtopic_body.html and place the code in the appropriate place.

The guy has code that puts an ad both next to and below the post content, but I see no real reason for two ads in the first post.

I chose to use a 120x240 ad size, as this isn't huge and eyeburning, and doesn't make a single line post into some cumbersome thing that is full of empty space. You can see the ad in action in Subsilver2 and Prosilver


Bookmark and Share  Want to discuss this? Have a comment for the author? Mosey on over to the Novarata Forums and let us know what you think.


Tags: phpbb, technology.
PHPBB3 BBCodes
10th May 2011
 

Something seems to have clicked lately, and I've gotten on to a bbcode-making kick. These bbcodes are for phpBB3.

Google Voice
This bbcode will allow the user to emplace a Google Voice call widget in their posts or signatures. Example

BBCode usage:
[gvoice]{SIMPLETEXT}[/gvoice]


HTML Replacement:
<object type="application/x-shockwave-flash" data="https://clients4.google.com/voice/embed/webCallButton" width="230" height="85"><param name="movie" value="https://clients4.google.com/voice/embed/webCallButton" /><param name="wmode" value="transparent" /><param name="FlashVars" value="id={SIMPLETEXT}&style=0" /></object>


Help line:
[gvoice]Your Google Voice ID number[/gvoice]


The "Google Voice ID number" can be found in the widget's code.


The following Amazon bbcodes require you have an Amazon Affiliates account.

Amazon BBCode
This one isn't new, and I found it at this site, where apparently it's been in use since phpbb2. It works fine in phpbb3, though. Amazon BBCode Example

BBCode usage:
[amazon]{SIMPLETEXT}[/amazon]


HTML Replacement:
<iframe src="http://rcm.amazon.com/e/cm?t=novarata-20&o=1&p=8&l=as1&asins={SIMPLETEXT}&fc1=000000&IS2=1&lt1=_blank&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>


Help line:
[amazon]The item's 10-digit ISBN or ASIN number[/amazon]



Amazon ad with caption
I took the bbcode above and ran with it a little bit, and mixed-and-mashed it and came up with an Amazon bbcode you could caption. Amazon w/caption Example

BBCode Usage:
[amzcap]{SIMPLETEXT},{SIMPLETEXT1}[/amzcap]


HTML Replacement:
<div style="width:120px; float:left; margin: 0 .5em .5em 0;"><iframe src="http://rcm.amazon.com/e/cm?t=novarata-20&o=1&p=8&l=as1&asins={SIMPLETEXT}&fc1=000000&IS2=1&lt1=_blank&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe> <p style="font-size:.8em;line-height:.95em;text-align: justify;">{SIMPLETEXT1}</p></div>


Help line:
[amzcap]Amazon ASIN/ISBN,Text description[/amzcap]


Amazon ad with word wrap
This one's the same ad as the two above, but it allows you to wrap your content around it, and you can place it on the left or right side. Amazon w/wrap Example

BBCode Usage:
[amzwrap]{SIMPLETEXT},{SIMPLETEXT1}[/amzwrap]


HTML Replacement:
<div style="float:{SIMPLETEXT}; padding:6px;"><iframe src="http://rcm.amazon.com/e/cm?t=novarata-20&o=1&p=8&l=as1&asins={SIMPLETEXT1}&fc1=000000&IS2=1&lt1=_blank&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe> </div>


Help line:
AmzWrap: [amzwrap]Choose left or right for float,Amazon ASIN or ISBN[/amzwrap]



That's all for now! Have a good day!


Bookmark and Share  Want to discuss this? Have a comment for the author? Mosey on over to the Novarata Forums and let us know what you think.


Tags: phpbb, technology.

RSS Feed

Created by Chronicle v4.5

fortnight-latitude