Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem with redirect.php


mark27uk3

Recommended Posts

Posted

I get the error below whenever I click on a banner

 

Parse error: parse error, unexpected T_CASE in /home2/mobiacc/public_html/redirect.php on line 61

 

This is the redirect.php code

 

  require('includes/application_top.php');

 switch ($HTTP_GET_VARS['action']) {
   case 'banner':
     $banner_query = tep_db_query("select banners_url from " . TABLE_BANNERS . " where banners_id = '" . (int)$HTTP_GET_VARS['goto'] . "'");
     if (tep_db_num_rows($banner_query)) {
       $banner = tep_db_fetch_array($banner_query);
       tep_update_banner_click_count($HTTP_GET_VARS['goto']);

       tep_redirect($banner['banners_url']);
     }
     break;

   case 'url':
     if (isset($HTTP_GET_VARS['goto']) && tep_not_null($HTTP_GET_VARS['goto'])) {
       tep_redirect('http://' . $HTTP_GET_VARS['goto']);
     }
     break;

   case 'manufacturer':
     if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
       $manufacturer_query = tep_db_query("select manufacturers_url from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and languages_id = '" . (int)$languages_id . "'");
       if (tep_db_num_rows($manufacturer_query)) {
// url exists in selected language
         $manufacturer = tep_db_fetch_array($manufacturer_query);

         if (tep_not_null($manufacturer['manufacturers_url'])) {
           tep_db_query("update " . TABLE_MANUFACTURERS_INFO . " set url_clicked = url_clicked+1, date_last_click = now() where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and languages_id = '" . (int)$languages_id . "'");

           tep_redirect($manufacturer['manufacturers_url']);
         }
       } else {
// no url exists for the selected language, lets use the default language then
         $manufacturer_query = tep_db_query("select mi.languages_id, mi.manufacturers_url from " . TABLE_MANUFACTURERS_INFO . " mi, " . TABLE_LANGUAGES . " l where mi.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and mi.languages_id = l.languages_id and l.code = '" . DEFAULT_LANGUAGE . "'");
         if (tep_db_num_rows($manufacturer_query)) {
           $manufacturer = tep_db_fetch_array($manufacturer_query);

           if (tep_not_null($manufacturer['manufacturers_url'])) {
             tep_db_query("update " . TABLE_MANUFACTURERS_INFO . " set url_clicked = url_clicked+1, date_last_click = now() where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and languages_id = '" . (int)$manufacturer['languages_id'] . "'");

             tep_redirect($manufacturer['manufacturers_url']);
           }
         }
       }
     }
     break;
 }
// VJ Links Manager v1.00 begin
   case 'links':
     require(DIR_WS_FUNCTIONS . 'links.php');

     $links_query = tep_db_query("select links_url from " . TABLE_LINKS . " where links_id = '" . (int)$HTTP_GET_VARS['goto'] . "'");
     if (tep_db_num_rows($links_query)) {
       $link = tep_db_fetch_array($links_query);
       tep_update_links_click_count($HTTP_GET_VARS['goto']);

       tep_redirect($link['links_url']);
     }
     break;
// VJ Links Manager v1.00 end

 tep_redirect(tep_href_link(FILENAME_DEFAULT));
?>

 

Help as I really need banners to display in my store.

 

Mark :'(

Lifes a bitch, then you marry one, then you die!

Posted

Revert the code back to original as that is the part on line 61 that is throwing the error. Alternately, you can ask the author for support.

 

Bobby

Posted

I reverted back to the original and my links page did not work, so I reinserted the code for the links manager and now all my links have disappeared from the catalog side of the store.

 

They are still visible in the database and in the admin.

 

Any ideas on how I can get them back in the catalog??

 

 

Thanks

 

Mark :'(

Lifes a bitch, then you marry one, then you die!

Posted

Why not just re-upload the code you posted above?

 

Bobby

Posted

Hi Bobby,

 

I have sorted it out I think except for whenever I change currencies/languages (I am using the language box to change the currency) The links do not show in any other language except for english.

 

Take a look here and try changing the currency and then viewing the links.

 

Mark

Lifes a bitch, then you marry one, then you die!

Archived

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

×
×
  • Create New...