Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help with banners


rayfox62

Recommended Posts

Hi. I am having two problems with advertising banners at the bottom of my pages, First when I click on one the page opens in the same window as my side so my site page is replaced by my advertisers page. can this be changed so that the advertisers page opens in a new page/window?

 

Second problem, my banners are causing warning messages on ssl pages eg log in and cart etc. can I delete the banners from these pages but stil have them on the other unsecured pages?

 

All help is very much appreciated. Ray.

Link to comment
Share on other sites

Post the contents of /includes/footer.php

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Post the contents of /includes/footer.php

 

 

Ok here is contents of includes/footer.php

 

<?php

/*

$Id: footer.php 1739 2007-12-20 00:52:16Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require(DIR_WS_INCLUDES . 'counter.php');

?>

<table border="0" width="100%" cellspacing="0" cellpadding="1">

<tr class="footer">

<td class="footer">  <?php echo strftime(DATE_FORMAT_LONG); ?>  </td>

<td align="right" class="footer">  <?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>  </td>

</tr>

</table>

<br>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td align="center" class="smallText"><?php echo FOOTER_TEXT_BODY; ?></td>

</tr>

</table>

<?php

if ($banner = tep_banner_exists('dynamic', '468x60')) {

?>

<br>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td align="center"><?php echo tep_display_banner('static', $banner); ?></td>

</tr>

</table>

<?php

}

?>

Link to comment
Share on other sites

You're going to have to give me the URL to the site (either by post or PM).

 

The site I thought was yours, that's not the code that comes out on the web page.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Maybe that is the code.

 

BACKUP THE FILE.

 

Then change this line:

 

  if ($banner = tep_banner_exists('dynamic', '468x60')) {

to:

 

  if ( ($banner = tep_banner_exists('dynamic', '468x60')) && ( $request_type != 'SSL' ) ) {

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Maybe that is the code.

 

BACKUP THE FILE.

 

Then change this line:

 

  if ($banner = tep_banner_exists('dynamic', '468x60')) {

to:

 

  if ( ($banner = tep_banner_exists('dynamic', '468x60')) && ( $request_type != 'SSL' ) ) {

 

Thanks Jim, that has worked and removed the the banners from the ssl pages and no more warnings.

Don't know if you can help me with the other banner issue? If the banners are clicked on they open up in place of my site rather than in a new tab?

My url is www.smileychops.co.uk if you wish to take a look? Ray.

Link to comment
Share on other sites

Thanks Jim, that has worked and removed the the banners from the ssl pages and no more warnings.

Don't know if you can help me with the other banner issue? If the banners are clicked on they open up in place of my site rather than in a new tab?

My url is www.smileychops.co.uk if you wish to take a look? Ray.

I thought that was the site.

 

Post the contents of /includes/functions/banner.php

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

I thought that was the site.

 

Post the contents of /includes/functions/banner.php

 

 

OK this is the contents:

 

<?php

/*

$Id: banner.php 1739 2007-12-20 00:52:16Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

////

// Sets the status of a banner

function tep_set_banner_status($banners_id, $status) {

if ($status == '1') {

return tep_db_query("update " . TABLE_BANNERS . " set status = '1', date_status_change = now(), date_scheduled = NULL where banners_id = '" . (int)$banners_id . "'");

} elseif ($status == '0') {

return tep_db_query("update " . TABLE_BANNERS . " set status = '0', date_status_change = now() where banners_id = '" . (int)$banners_id . "'");

} else {

return -1;

}

}

 

////

// Auto activate banners

function tep_activate_banners() {

$banners_query = tep_db_query("select banners_id, date_scheduled from " . TABLE_BANNERS . " where date_scheduled != ''");

if (tep_db_num_rows($banners_query)) {

while ($banners = tep_db_fetch_array($banners_query)) {

if (date('Y-m-d H:i:s') >= $banners['date_scheduled']) {

tep_set_banner_status($banners['banners_id'], '1');

}

}

}

}

 

////

// Auto expire banners

function tep_expire_banners() {

$banners_query = tep_db_query("select b.banners_id, b.expires_date, b.expires_impressions, sum(bh.banners_shown) as banners_shown from " . TABLE_BANNERS . " b, " . TABLE_BANNERS_HISTORY . " bh where b.status = '1' and b.banners_id = bh.banners_id group by b.banners_id");

if (tep_db_num_rows($banners_query)) {

while ($banners = tep_db_fetch_array($banners_query)) {

if (tep_not_null($banners['expires_date'])) {

if (date('Y-m-d H:i:s') >= $banners['expires_date']) {

tep_set_banner_status($banners['banners_id'], '0');

}

} elseif (tep_not_null($banners['expires_impressions'])) {

if ( ($banners['expires_impressions'] > 0) && ($banners['banners_shown'] >= $banners['expires_impressions']) ) {

tep_set_banner_status($banners['banners_id'], '0');

}

}

}

}

}

 

////

// Display a banner from the specified group or banner id ($identifier)

function tep_display_banner($action, $identifier) {

if ($action == 'dynamic') {

$banners_query = tep_db_query("select count(*) as count from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . "'");

$banners = tep_db_fetch_array($banners_query);

if ($banners['count'] > 0) {

$banner = tep_random_select("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . "'");

} else {

return '<b>TEP ERROR! (tep_display_banner(' . $action . ', ' . $identifier . ') -> No banners with group \'' . $identifier . '\' found!</b>';

}

} elseif ($action == 'static') {

if (is_array($identifier)) {

$banner = $identifier;

} else {

$banner_query = tep_db_query("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_id = '" . (int)$identifier . "'");

if (tep_db_num_rows($banner_query)) {

$banner = tep_db_fetch_array($banner_query);

} else {

return '<b>TEP ERROR! (tep_display_banner(' . $action . ', ' . $identifier . ') -> Banner with ID \'' . $identifier . '\' not found, or status inactive</b>';

}

}

} else {

return '<b>TEP ERROR! (tep_display_banner(' . $action . ', ' . $identifier . ') -> Unknown $action parameter value - it must be either \'dynamic\' or \'static\'</b>';

}

 

if (tep_not_null($banner['banners_html_text'])) {

$banner_string = $banner['banners_html_text'];

} else {

$banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>';

}

 

tep_update_banner_display_count($banner['banners_id']);

 

return $banner_string;

}

 

////

// Check to see if a banner exists

function tep_banner_exists($action, $identifier) {

if ($action == 'dynamic') {

return tep_random_select("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . "'");

} elseif ($action == 'static') {

$banner_query = tep_db_query("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_id = '" . (int)$identifier . "'");

return tep_db_fetch_array($banner_query);

} else {

return false;

}

}

 

////

// Update the banner display statistics

function tep_update_banner_display_count($banner_id) {

$banner_check_query = tep_db_query("select count(*) as count from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int)$banner_id . "' and date_format(banners_history_date, '%Y%m%d') = date_format(now(), '%Y%m%d')");

$banner_check = tep_db_fetch_array($banner_check_query);

 

if ($banner_check['count'] > 0) {

tep_db_query("update " . TABLE_BANNERS_HISTORY . " set banners_shown = banners_shown + 1 where banners_id = '" . (int)$banner_id . "' and date_format(banners_history_date, '%Y%m%d') = date_format(now(), '%Y%m%d')");

} else {

tep_db_query("insert into " . TABLE_BANNERS_HISTORY . " (banners_id, banners_shown, banners_history_date) values ('" . (int)$banner_id . "', 1, now())");

}

}

 

////

// Update the banner click statistics

function tep_update_banner_click_count($banner_id) {

tep_db_query("update " . TABLE_BANNERS_HISTORY . " set banners_clicked = banners_clicked + 1 where banners_id = '" . (int)$banner_id . "' and date_format(banners_history_date, '%Y%m%d') = date_format(now(), '%Y%m%d')");

}

?>

Link to comment
Share on other sites

You're going to have to edit the HTML text for the banners in your admin.

 

Change all the:

 

<a href

to

 

<a target="_blank" href

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

You're going to have to edit the HTML text for the banners in your admin.

 

Change all the:

 

<a href

to

 

<a target="_blank" href

 

 

Thanks Jim, That fixed that problem and was very easy once I knew how.

I Don't suppose you know how to alter the tax rate in shipping? I have UK tax/vat set at 17.5 percent but on shipping it seems to be set around 16 percent. Lots about this on the forum but nothing that helped me fix it? Ray :huh:

Link to comment
Share on other sites

I honestly have no clue...

:blink:

 

Sorry...

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...