11
chipbyte
Re: xoops banner system into a block?
  • 2008/11/26 12:03

  • chipbyte

  • Just popping in

  • Posts: 12

  • Since: 2007/11/1


So how can we apply this on theme?

I don't mean block.

I want to display static banner on top of page [(in theme)(not random banner)]

12
sailjapan
Re: xoops banner system into a block?

Do you mean like the banner here on xoops.org
Resized Image

?

What theme are you using?
Never let a man who does not believe something can be done, talk to a man that is doing it.

13
chipbyte
Re: xoops banner system into a block?
  • 2008/11/26 15:21

  • chipbyte

  • Just popping in

  • Posts: 12

  • Since: 2007/11/1


Yes i do, like the banner here...
BUT
I just wanna show one banner (No random banner ok) just one.

For example: By Banner ID: 1

14
sailjapan
Re: xoops banner system into a block?

If you don't need it to change, why use the banner code atall? Just hard code it into your theme.

The file you will need to change depends on the theme you are using, but usually can be found in:

/themes/(yourthemename)/xotpl/xoheader.html

But as I say, some themes are different... if you can give us a link to the theme or your site, we might be able to help better.
Never let a man who does not believe something can be done, talk to a man that is doing it.

15
chipbyte
Re: xoops banner system into a block?
  • 2008/11/26 15:47

  • chipbyte

  • Just popping in

  • Posts: 12

  • Since: 2007/11/1


Because i want to use XOOPS banner system and i wanna see clicks on the banner.

I just want to one banner top of the page, that's all. I'am working localhost now.

I think we Must be change in theme.html

this line:

<{$xoops_banner}>

For example like this:

<{php}>echo xoops_getbanner(1);<{/php}>


But i can't do that and i can't understand anytihng, must be very simple!


16
ghia
Re: xoops banner system into a block?
  • 2008/11/26 16:11

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


If you have only one banner configured then you can use it as it is.
Or do you need other banners elsewhere?

17
stefan88
Re: xoops banner system into a block?
  • 2008/11/26 16:11

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


..

18
sailjapan
Re: xoops banner system into a block?

Ok, if you only enter one banner in the admin>banners section, it won't rotate, will it. It will always show the same banner if there's only one...

Sorry, I'm having trouble understanding why this wouldn't work for you.

I'll leave it to someone else to offer other ideas.
Never let a man who does not believe something can be done, talk to a man that is doing it.

19
rennevat
Re: xoops banner system into a block?
  • 2008/11/26 17:06

  • rennevat

  • Just popping in

  • Posts: 6

  • Since: 2006/4/30


I believe the ability to specify specific banner ads (by ID) is located in the xoops_getbanner function. It currently pulls a random banner ID ($bannum). Modifying it to pull a random ID if a specific banner ID is not is not defined may be the way to go. Then you could create custom blocks to display an ad by ID in specific modules using ie. xoops_getbanner(22), etc. I am also trying to implement this and an testing out the following code within includes/functions.

/*
* Function to get banner html tags for use in templates
*/
function xoops_getbanner($bannernum)
{
global $xoopsConfig;
$db =& Database::getInstance();
$bresult = $db->query("SELECT COUNT(*) FROM ".$db->prefix("banner"));
list ($numrows) = $db->fetchRow($bresult);
$bannernum = intval($bannernum);

if ( $bannernum = '') {
if ( $numrows > 1 ) {
$numrows = $numrows-1;
mt_srand((double)microtime()*1000000);
$bannum = mt_rand(0, $numrows);

} else {
$bannum = 0;
}
} else {
$bannum = $bannernum;
}

20
Anonymous
Re: xoops banner system into a block?
  • 2008/11/26 18:50

  • Anonymous

  • Posts: 0

  • Since:


Add stefanosilvestrini.com hack to /include/functions.php file then edit theme.html and add:

<{php}> echo getbanner_from_id_banner(1); <{/php}>


Login

Who's Online

522 user(s) are online (378 user(s) are browsing Support Forums)


Members: 0


Guests: 522


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