FusionBB
Back to FusionBB Forum | Purchase FusionBB | Features | FusionBB FAQ | Documentation Wiki | License

(edit)




Installation Documentation




Installation: Narrated Tutorials




Administrator-Developer Documentation



General Administration

General Customizations

Troubleshooting


Feature-Specific Topics


FusionBB Calendar

MyPaymentPal

MySQL

Particle Boxes



Users: FusionBB Profile Options




Users: FusionBB-Related FAQ



Users:General Site FAQ



Users: Information & How To's


Narrated Tutorials (.mov format)

Images

Making Posts

Posting & Viewing Messages FAQ

Managing Files & Polls

Searching

Troubleshooting



Recent Changes Printable View Page History Edit Page

(Applies to: all versions of FusionBB)


You can customize your site by creating your own particle boxes.
These can be used for quotes, statistics, or even content such as Google's Add Sense.


Note: Just by changing a few things, you could create just about any particle box you want...


BEFORE PROCEEDING WITH THE FOLLOWING INSTRUCTIONS, BACK UP THE FOLLOWING FILES:

includes/common.php
language/*/common.php
templates/fusionbb/header_left.php
templates/fusionbb/ footer_both.php
templates/fusionbb/ footer_right.php

  • Create a title for your referral particle box:

Open your language/*/common.php file and, toward the end before the ?> , add the following line:$lang_str['REFERRAL']= 'Referrals';

  • Create a template var called PARTICLE_REFERRAL.

Open your includes/common.php file.

Look for:

$template->setTemplateVar("PARTICLE_RECENT_PICTURES",$particle->createThumbPicBox());

Then below that add:

$template->setTemplateVar("PARTICLE_REFERRAL",$particle->createReferralBox());

Note:You'll have to do that step twice (once for the send header function, and once for the send footer function).

  • Now create a function called createReferralBox.

Find:

} $cache_data=null; return $this->particlebox['THUMBPICS']; }

And below that add:

function createReferralBox() { global $session,$conf,$FBB_SESS,$template,$lang_str,$skin;

$referral = @implode('',@file(FBB_ROOT . "/custompb/referral_box.php"));

$this->particlebox['REFERRAL'] = str_replace("<!--BLANK_TITLE-->",$lang_str['REFERRAL'],$this->particlebox['BLANK']); $this->particlebox['REFERRAL'] = str_replace("<!--BLANK_CONTENT-->",$referral,$this->particlebox['REFERRAL']);

return $this->particlebox['REFERRAL'];

}

Note: Take a close look at the lines starting with $this. The first line uses the particlebox['BLANK'] array. This is what the contents of that array look like:

{$skin['tableopen']} <table border='0' cellpadding='3' cellspacing='{$skin['cellspacing']}' width='100%'> <tr> <th class='theader' align='left'> <!--BLANK_TITLE--> </th> </tr> <tr> <td align='left' valign='top' class='color1'>

<!--BLANK_CONTENT--> <!--BLANK_EXTRA-->

</td> </tr> </table> {$skin['tableclose']}

The first command that starts with $this replaces the <!--BLANK_TITLE--> in the array with our language string , but at the same time it creates a new table in the particlebox array called particlebox['REFERRAL']. Now particlebox['REFERRAL'] looks like this:

{$skin['tableopen']} <table border='0' cellpadding='3' cellspacing='{$skin['cellspacing']}' width='100%'> <tr> <th class='theader' align='left'> Referral </th> </tr> <tr> <td align='left' valign='top' class='color1'>

<!--BLANK_CONTENT--> <!--BLANK_EXTRA-->

</td> </tr> </table> {$skin['tableclose']}

Then the second $this does another string replace, but this time it's on the particlebox['REFERRAL'] array that was created with the first $this command line.

There is a <!--BLANK_EXTRA--> string in that template, but there wasn't any need for it in this mod. You can reuse that particlebox['BLANK'] array as many times as you like, just be sure an give your new array a unique name...

  • To customize the particlebox for Google Add Sense: open the referral_box.php script and replace the example referral code with the one that you get from Google's Add Sense site.'

Create a directory under your FusionBB directory called custompb and upload your referral_box.php file there.

To make the referral particle box show up on your pages: Go to your templates directory and open your header_left.php file. Look for:

<!--PARTICLE_ONLINE-->

And above that add:

<!--PARTICLE_REFERRAL-->

Open your footer_both.php file. Look for:

<!--PARTICLE_ONLINE-->

And above that add:

<!--PARTICLE_REFERRAL-->

Open your footer_right.php file. Look for:

<!--PARTICLE_ONLINE-->

And above that add:

<!--PARTICLE_REFERRAL-->

  • Save and upload all files to your server.

Note This is what the referral_box.php file looks like (it's just the referral code that you get form Google's Add Sense web site):

//
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-4282358225994806";
google_ad_width = 125;
google_ad_height = 125;
google_ad_format = "125x125_as_rimg";
google_cpa_choice = "CAAQweaZzgEaCA2ZyYC_NXeAKK2293M";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


(Thanks to Dalantech (www.dalantech.com) for this 'How To' guide!)


©2003-2007 InteractivePHP, Inc.
Page last modified on February 24, 2007, at 03:07 AM