Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Navigation
Latest Addons
Xbox Leaderboards 5
Cookiebar Panel 70
AD Gallery 151
SyntaxHighlighte... 63
Newsletters v4.03 168
Facebook Like Box 202
Newsletters v4.02 79
Metro 235
Facebook Connect 215
Shoutbox Panel 185
Redactor for PHP... 127
MI Floating Side... 132
Facebook Login/R... 180
Avatar Studio v2.03 215
Relationship Sta... 120
Popular Addons
iTheme2 5907
Arise 5869
User Control v1.23 4680
Event Calendar 4129
Photowidget panel 3921
Radio-Theme red2... 3394
Highslide Gallery 3359
CSS/JavaScript D... 3274
Facebook Connect... 3055
Dynamic Menu 2945
Slideshow Lightb... 2768
L-AMANT 2689
Enigma 2670
2Dark 2624
Black 2618
Articles Hierarchy
Articles Home » PHP-Fusion v7 Tutorials » Banner Manager Tutorial
Banner Manager Tutorial

PHP-Fusion has a Banners Admin page that allows you to do some sweet stuff, if you haven't discovered this feature yet, here is a bit of information to get you started.

Getting started...


Figure 1.

PHP-Fusion v7.x comes with a 'Banners' link in the Admin Panel as shown in Figure 1. Selecting this Admin Page brings up an editor page to the center panel. This is where we insert our banner code. If we split our header section in two, Banner 1 is the left part, while Banner 2 is the right part, both showing up inside the header limits of your selected theme.

Banner 1 has a trick to it and it is that the logo you set up in the main settings, (which is also the same logo you see when loging in, and when you set the maintenance mode to On) will be replaced in the header with whatever you set in Banner 1. (Replacement only takes place in the header, the logo you set in Main settings will still show up on maintenance page, and login/out pages.)

So, just what kind of code can you use as a Banner? Well, simply put, any code can be used. HTML, PHP and JavaScript code snippets are accepted and saved to your banner. You can preview it to make sure it displays, and then save it to see it show up on the header of your site.

Getting your hands dirty with some PHP code...

This might be intimidating for the new user, and for the beginner to PHP, but it is rewarding to give this a shot and play around with the customization power of PHP. Using some PHP code along with our banner, PHP-Fusion makes it easy to distinguish between regular Members (registered users), Guests (visitors who have not registered yet), and Admins (the guys who wear the top hats and are always in control - ok almost always). By using a little PHP in the Banner code, you can target different banners to your users and display only one at a time depending on what type of user is accesing your site.

Now, lets go over the PHP code that you would use to get this functionality for your banner:

<?php
if(iGUEST){
?>
[BANNER CODE FOR GUEST HERE]
<?php
}elseif(iMEMBER){
?>
[BANNER CODE FOR MEMBER HERE]
<?php
}elseif(iADMIN){
?>
[BANNER CODE FOR ADMIN HERE]
<?php
}
?>

The code above is an example of how we can target our code to different user levels. This can be ad campaign code, social network links, images, linking guests to registration page, anything you may need. The example above can also be used on Custom Pages, Custom Panels, in short, it fits anywhere if the CMS allows PHP input. You will be able to notice if PHP input is allowed if you see a button with <?php ?> in it (and TinyMCE is not activated - note that the Banners input will not use TinyMCE even if it is activated).

 

img_facebookCode
Figure 2.

A practical example, step by step

Ok, so far, you should have a very basic grasp of what you can do with your banners. Now, we will go over a simple Facebook 'Like' box, or button. We are going to place that in our banner. First, we need to get the code from Facebook.

In Figure 2, we can see the page where Facebook makes the Like button code available for us. There will be two options, the iframe code, or their proprietary XFBML code. Both depend on javascript to be on, and both achieve the same result, although the XFBL is more functional in terms that it automatically resizes the height of the button's object to match the amount of Avatar's rows.

This example uses the standard Like button, which includes a string of text recounting how many people like the page, and also displays the avatars of those who like the page. This is all customizable in the button maker from the Facebook page linked above.

So, by now you should have the code and all you need to do is copy & paste it into the Banner 2  section of your PHP-Fusion site's Banner Admin page.

And so, without too much embellishment, and plain out of the Facebook code maker, our brand spanking new Like button is up there in the header, spreading the selected URL throughout Facebook via the Like button presses your visitors make.

A practical example: Final Result

After saving that banner code onto Banner 2  your site should look like this:

img_finalBanner
Figure 3.
 
Posted by Elvenelf on January 26 2011 15:22:21
Comments
3887 #1 wolfbbs

on Feb 27 2011 at 04:24:45
I think this works better actually, The other way the only thing a superadmin sees is the member banner..
<?php
if(iSUPERADMIN){
?>
[BANNER CODE FOR SUPERADMIN HERE]
<?php
}elseif(iADMIN){
?>
[BANNER CODE FOR ADMIN HERE]
<?php
}elseif(iMEMBER){
?>
[BANNER CODE FOR MEMBER HERE]
<?php
}elseif(iGUEST){
?>
[BANNER CODE FOR GUEST HERE]
<?php
}
?>
41517 #2 phreik

on Jul 24 2011 at 19:38:55
Hi is there any way to do this with sections like news.php with a certain banner image and then the forums with another image and then the the gallery and so on...
Post Comment
Please Login to Post a Comment.
Ratings
Rating is available to Members only.

Please login or register to vote.

Awesome! Awesome! 33% [1 Vote]
Very Good Very Good 0% [No Votes]
Good Good 0% [No Votes]
Average Average 67% [2 Votes]
Poor Poor 0% [No Votes]
Official Home of PHP-Fusion uses cookies. Some may already have been set. Read more about our Cookies here.
Please click the button I Consent Cookies to hide this bar and accept our cookies. If you continue to use the site with no action taken, we'll assume that you consent our cookies anyway.
Cookiebar Panel byVenue
Shoutbox
You must login to post a message.

18-06-2013 19:37
yay. Thanks for the update

18-06-2013 19:00
Good day, the patch is out!

18-06-2013 15:50
hello friends, am new here. wana show me around? Grin

18-06-2013 15:08
G'day All, any progress reports for v.7.02.07? Wink

18-06-2013 07:39
morning

17-06-2013 13:13
Good evening. Smile

17-06-2013 08:17
Good morning!

17-06-2013 07:14
We do not have many V6 installations up and running today. There are some compatibility issues with V7 for sure.

17-06-2013 05:28
My question is to general public.

17-06-2013 04:58
Another question. How about v7 infusion used in v6 core phpfusion? Any problem?

Last Seens
Last Seen > Admins
[SA] Richard... 01:18:59
[A] NetriX 01:33:15
[SA] Domi 01:35:13
[A] Christian 02:11:05
[A] MarcusG 02:21:30


Last Seen > Members
[M] Archer < 5 mins
[M] SpaM 00:12:40
[M] svwkwk 00:15:21
[M] xxyy 00:19:05
[M] globefreak 00:29:50