1
crackerboy
xoops banner system into a block?
  • 2004/10/6 16:12

  • crackerboy

  • Just popping in

  • Posts: 16

  • Since: 2004/9/29


is it possible to more the xoosp banner system code into a custom block? i tried this and it didn't seem to work. has anyone else done this?

2
Rickb
Re: xoops banner system into a block?
  • 2004/10/28 15:23

  • Rickb

  • Not too shy to talk

  • Posts: 118

  • Since: 2004/10/24


Quote:

Is it possible to more the xoosp banner system code into a custom block? i tried this and it didn't seem to work. has anyone else done this?


Good question left unanswered. Can this be done?

Rick

3
Mithrandir
Re: xoops banner system into a block?

What did you try?

Try making a new custom block of the PHP type and as the contents, write this:
echo xoops_getbanner();

4
ackbarr
Re:xoops banner system into a block?

most definitely. Create a custom block with the following info:

Content:
global $xoopsConfig;
if (
$xoopsConfig['banners'] == 1) {
    
//Display Banner
    
echo (xoops_getbanner());
} else {
    return 
false;
}

Content Type: PHP Script
Cache lifetime: No Cache

This block honors the 'Use Banner Ads?' setting in System -> Preferences -> General Settings.

5
Mithrandir
Re:xoops banner system into a block?

I don't see the need for the if statement, though. Crackerboy clearly wants to show banners - and if he didn't, he could just set the block to not be visible in blocks admin

6
jondixon
Re:xoops banner system into a block?
  • 2005/1/21 18:04

  • jondixon

  • Not too shy to talk

  • Posts: 107

  • Since: 2004/5/12


Excellent! This is what I'm trying to do on my site. How do I center the banner rather than have it left justify in the banner block, also how do I change it so that cliccking the banner does not open a new browser window but works in the same window?

7
pnppcs
Re:xoops banner system into a block?
  • 2005/9/24 2:26

  • pnppcs

  • Just popping in

  • Posts: 55

  • Since: 2005/1/25


How do we go about centering the banner in a custom block??

I am using this code:
global $xoopsConfig;
if (
$xoopsConfig['banners'] == 1) {
    
//Display Banner
    
echo (xoops_getbanner());
} else {
    return 
false;
}


The banners show as normal which is great but the are left aligned. To have them centered would be a needed improvement. I tried to
but this did not work.

Does anyone kow how to center the banners in a custom block??

Thanks in advance,
Marty.

8
pnppcs
Re:xoops banner system into a block?
  • 2005/9/25 0:48

  • pnppcs

  • Just popping in

  • Posts: 55

  • Since: 2005/1/25


^bump^

9
JMorris
Re:xoops banner system into a block?
  • 2005/9/25 2:05

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Try this:

echo ('
');
global 
$xoopsConfig;
if (
$xoopsConfig['banners'] == 1) {
    
//Display Banner
    
echo (xoops_getbanner());
} else {
    return 
false;
}
echo (
'
'
);


As far as making the link open in the same window, I'm not sure there is a way to do that without editing core files.

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.

10
pnppcs
Re:xoops banner system into a block?
  • 2005/9/25 23:21

  • pnppcs

  • Just popping in

  • Posts: 55

  • Since: 2005/1/25


That worked a treat JMorris I don't want the ads to open in same window so your snippet is perfect for me.

Thankyou
Marty.

Login

Who's Online

197 user(s) are online (86 user(s) are browsing Support Forums)


Members: 0


Guests: 197


more...

Donat-O-Meter

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

Latest GitHub Commits