1
banjaluka
banner in home only
  • 2006/1/20 10:49

  • banjaluka

  • Just popping in

  • Posts: 2

  • Since: 2004/8/5 1


I have one question: How i can make code for display banner only on home (first page).

2
banjaluka
Re: banner in home only
  • 2006/1/20 11:23

  • banjaluka

  • Just popping in

  • Posts: 2

  • Since: 2004/8/5 1


To Add: instead standard banner systems module <{$xoops_banner}>, I use my script for display. How to assign function only for display on the heading page.

3
JMorris
Re: banner in home only
  • 2006/1/20 11:45

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


If you want to place your banner in a Custom PHP block, and only display it on your homepage, use the following...

if ($_SERVER['PHP_SELF'] == "/index.php") {
echo (
'
');
global 
$xoopsConfig;
if (
$xoopsConfig['banners'] == 1) {
    
//Display Banner
    
echo (xoops_getbanner());
} else {
    return 
false;
}
echo (
'
'
);
}


If you want to hard code the banner code into your theme and only display the banner on your homepage, use the following...

<{php}>if ($_SERVER['PHP_SELF'] == "/index.php") {echo ('<{$xoops_banner}>');}<{/php}>


The above assumes you are using the XOOPS built-in banner manager. If you want to use your own banner code, the important part of the above code is the following...

if ($_SERVER['PHP_SELF'] == "/index.php") {echo ('[b]YOUR CODE HERE[/b]');}


Hope this helps.

James
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

Login

Who's Online

409 user(s) are online (95 user(s) are browsing Support Forums)


Members: 0


Guests: 409


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits