1
hrac
banner problem?
  • 2004/7/18 12:11

  • hrac

  • Quite a regular

  • Posts: 305

  • Since: 2002/7/15


Hello,
I have a banner problem:

I want to have a banner, that when I click it does not open a new window, just replace current one like _top option <a href> tag. But when I don't use USE HTML on banner it opens a new window.

When I use HTML code in banner
<a href=... taeget=_top><img src=....></a>
it does not count clicks. Is there any solution for this.
Thanks
regards

2
hrac
Re: banner problem?
  • 2004/7/19 13:12

  • hrac

  • Quite a regular

  • Posts: 305

  • Since: 2002/7/15


I think there is no comment for this one.

3
Herko
Re: banner problem?
  • 2004/7/19 13:30

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


The banner URL looks like this:

https://xoops.org/banners.php?op=click&bid=22

The banners.php file, click operation invokes the clickbanner($bid) function. That function looks like this:
function clickbanner($bid)
{
    global 
$xoopsDB;
    
$bid intval($bid);
    if (
$bid 0) {
        if (
xoops_refcheck()) {
            if (
$bresult $xoopsDB->query("select clickurl from ".$xoopsDB->prefix("banner")." where bid=$bid")) {
                list(
$clickurl) = $xoopsDB->fetchRow($bresult);
                
$xoopsDB->queryF("update ".$xoopsDB->prefix("banner")." set clicks=clicks+1 where bid=$bid");
                
header ('Location: '.$clickurl);
            }
        }
    }
    exit();
}

As you can see, the browser is pointed to the new location using the header ('Location: '.$clickurl); code. So, you'll have to change that, or look for a way to set the header location to use the same browser window as it is currently using.

Now I've found this tidbit of info, but it is for apache only:
Quote:

Issuing a Location: header with the Header() function tells the browser where to go. If you give an absolute location (e.g.http://www.whatever.com/gohereinstead/), Apache issues a 302 redirect. I suppose this creates a new window? -herko
However, if you use a relative location (e.g. /gohereinstead/), Apache politely returns a 200 (normal response) and serves up the content at the redirected
location. As far as the browser knows, it's getting what was at the original location - with no additional request to the new location.


I hope this helps.

Herko

4
RachelVirago
Re: banner problem?

Sorry if I'm restateing the question here but the code was a bit dense for me I'm not that savvy with http but trying to learn.

Problem I am chasing in a nutshell is why are clicks not counted when html code is used instad of an image and url.

thats my problem as it's a drag to keep logging into my affiliate control panel to see how the banners are doing.


I also have a client who requires the click to come from my site root or an error is generated not a hit.

we have a nice php page in root that deals with this, it was written by my ex partner and again I don't fully understand the code but happy to share it here if anyone has THAT problem.

Login

Who's Online

148 user(s) are online (89 user(s) are browsing Support Forums)


Members: 0


Guests: 148


more...

Donat-O-Meter

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

Latest GitHub Commits