1
LostGirl
Since 'out of the box' use is to easy for me
  • 2004/2/18 12:05

  • LostGirl

  • Just popping in

  • Posts: 8

  • Since: 2004/1/26


I would like to use a differnt banner management then what comes with xoops. I found the code in header.php that 'does' the banner. At first I just used an include but that put the banner on top of everything throwing off the alignment of the first of the page.

From some looking at the original code:
if ($xoopsConfig['banners'] == 1) {
    
$xoopsTpl->assign('xoops_banner'xoops_getbanner());
    } else {
        
$xoopsTpl->assign('xoops_banner'' ');
    }

and the theme.html
I figured out I need to use the if/else language and assign the selector name for the css to work. What I have figured out so far is:
if (whatdoiputhere) {
    
$xoopsTpl->assign('pbanner');
    else {
    
$xoopsTpl->assign('pbanner'' ');


It seems like in the first set of () I should have it check for the banner.php file I am using. But I don't know how to write that I am looking at the php.net manual but don't really know what I am looking for.

Another question I have is on the $xoopsTpl variable what does the Tpl stand for? Only thing I could figure out is table placement.

Thanks for your time.

2
chapi
Re: Since 'out of the box' use is to easy for me
  • 2004/2/18 12:48

  • chapi

  • Theme Designer

  • Posts: 611

  • Since: 2002/1/22


if ($xoopsConfig['banners'] == 1)


This line checks, whether you activated the banners management in your XOOPS preferences or not. If so, it does the following:

$xoopsTpl->assign('xoops_banner'xoops_getbanner());


The var 'xoops_banner' in your XoopsTemplate (xoopsTpl) gets the banner value. Otherwise (the else statement) a space will be displayed instead of the banner.

$xoopsTpl->assign('xoops_banner'' ');


Don't know exactly if this is, what you wanted to know ...

3
Mithrandir
Re: Since 'out of the box' use is to easy for me

you should probably do something like:
if ($xoopsConfig['banners'] == 1) { //assuming that you want to set the banner on/off in XOOPS preferences
    
$xoopsTpl->assign('xoops_banner'function_for_showing_your_custom_banner());
} else {
    
$xoopsTpl->assign('xoops_banner'' ');
}

This will replace the current banner with your custom banner/code to find and display your banner.

If you want to add your own banner management scheme in _addition_ to the XOOPS one, you should do a
$xoopsTpl->assign('pbanner'function_for_showing_your_custom_banner());

AFTER the closing bracket of the XOOPS code. After that, you'll need to edit the theme.html of your chosen theme to show the new banner where you want it. This is done by inserting
<{$pbanner}>
where you want this banner to be placed.

4
LostGirl
Re: Since 'out of the box' use is to easy for me
  • 2004/2/18 14:45

  • LostGirl

  • Just popping in

  • Posts: 8

  • Since: 2004/1/26


Thanks that helps alot.

My brain is like a cheap sponge stuff has to sit on it a while before it gets it.

Login

Who's Online

402 user(s) are online (58 user(s) are browsing Support Forums)


Members: 0


Guests: 402


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