Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Anyone successfully Have Header Tags Seo & Extra Fields running on OSC 2.3.4


toyzonline

Recommended Posts

Running OSC 2.3.4 with Extra Fields contribution running and having a small issue when installing Header Tags SEO

 

I have received fine support from Jack on his Header Tags support thread but he does not know (as in the insides and out) of the Extra Fields Add-On.

 

Just taking a pop shot that maybe someone already has these 2 running side by side, before I go down other avenues of solutions (i.e. deleting one of them, paying for coding help etc)

 

As it stands both are installed and the live out put works fine for both Add-Ons. However on the admin side there is a section of coding that is a problem. I say problem as they wont work together on the admin side as it stands but I can change it to suit 1 add-on, complete the required product fields, then change the code to suit the other add-on, complete those fields on the products and then in the sense of live website both areas work fine. This leads me to believe that POSSIBLY it could be a case of just this small section of coding.

 

the original osc code is :

if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
      $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

The extra fields add-on changes it this (note just asks to insert code after 1st line not change anything)

if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
// BOF Extra Fields Contribution	  
      $products_extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " WHERE products_id=" . (int)$HTTP_GET_VARS['pID']);
      while ($products_extra_fields = tep_db_fetch_array($products_extra_fields_query)) {
        $extra_field[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];
      }
	  $extra_field_array=array('extra_field'=>$extra_field);
	  $pInfo->objectInfo($extra_field_array);
// EOF Extra Fields Contribution
      $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

Now the header tags requires me to change the original code, however the only change is in the second line of code which still remains the same but has some code inserted between 1 and second line.

 

HEADER TAGS INSTRUCTIONS

 

 

FIND (around line 448):

    if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
      $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

REPLACE WITH:

 

    if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
    /*** Begin Header Tags SEO ***/
      $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_head_title_tag,pd.products_head_title_tag_alt, pd.products_head_title_tag_url, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_head_breadcrumb_text, pd.products_head_listing_text, pd.products_head_sub_text, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
    /*** End Header Tags SEO ***/

 

So I changed the second line ony and my code now looks like:

if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
// BOF Extra Fields Contribution	  
      $products_extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " WHERE products_id=" . (int)$HTTP_GET_VARS['pID']);
      while ($products_extra_fields = tep_db_fetch_array($products_extra_fields_query)) {
        $extra_field[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];
      }
	  $extra_field_array=array('extra_field'=>$extra_field);
	  $pInfo->objectInfo($extra_field_array);
// EOF Extra Fields Contribution
      /*** Begin Header Tags SEO ***/
      $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_head_title_tag,pd.products_head_title_tag_alt, pd.products_head_title_tag_url, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_head_breadcrumb_text, pd.products_head_listing_text, pd.products_head_sub_text, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
    /*** End Header Tags SEO ***/

Complete Newbie On The Learn - Not A Programmer

But Learning As I Go

Link to comment
Share on other sites

Looks fine to me :thumbsup:

 

not familar with extra fields but if that is what it says the complete  code block would be

    if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
	// BOF Extra Fields Contribution	  
      $products_extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " WHERE products_id=" . (int)$HTTP_GET_VARS['pID']);
      while ($products_extra_fields = tep_db_fetch_array($products_extra_fields_query)) {
        $extra_field[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];
      }
	  $extra_field_array=array('extra_field'=>$extra_field);
	  $pInfo->objectInfo($extra_field_array);
// EOF Extra Fields Contribution
    /*** Begin Header Tags SEO ***/
       $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_head_title_tag,pd.products_head_title_tag_alt, pd.products_head_title_tag_url, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_head_breadcrumb_text, pd.products_head_listing_text, pd.products_head_sub_text, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
    /*** End Header Tags SEO ***/
	  
	  $product = tep_db_fetch_array($product_query);

      $pInfo->objectInfo($product);

      $product_images_query = tep_db_query("select id, image, htmlcontent, sort_order from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$product['products_id'] . "' order by sort_order");
      while ($product_images = tep_db_fetch_array($product_images_query)) {
        $pInfo->products_larger_images[] = array('id' => $product_images['id'],
                                                 'image' => $product_images['image'],
                                                 'htmlcontent' => $product_images['htmlcontent'],
                                                 'sort_order' => $product_images['sort_order']);
      }
    }

Regards

Joli

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

You see that's what I thought but from that if I click on Admin>Catagories All I get is a blank page

 

Yet put that 1 section back to suit either Add-On and it works for that Add-on (do the work and save) change it for the other Add-on (do the work and save) and all inputed changes work on the live site

Complete Newbie On The Learn - Not A Programmer

But Learning As I Go

Link to comment
Share on other sites

You are most likely missing something else be careful of the curly brackets

 

Turn error reporting on in to your includes/application-top.php and see what it says

If you can't access the error log then find this line in ./admin/includes/application_top.php

error_reporting(E_ALL & ~E_NOTICE);

And change it, temporarily, to:

error_reporting(E_ALL);
ini_set('display_errors', '1');

Regards

Joli

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

The only error given is:

 

 

Notice: Undefined variable: SID in /home/****/public_html/shop/admin/includes/functions/html_output.php on line 48

 

As far as I am aware this function is used in neither of the Add-Ons (as told previously by ***, sorry don't recall)

 

Line 48 being the 3rd line down

// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
    if ( ($add_session_id == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) {
      if (tep_not_null($SID)) {
        $_sid = $SID;
      } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {
        if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
          $_sid = tep_session_name() . '=' . tep_session_id();
        }
      }
    }

    if (isset($_sid)) {
      $link .= $separator . tep_output_string($_sid);
    }

    while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);

    return $link;
  }

  function tep_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL') {
    if ($connection == 'NONSSL') {
      $link = HTTP_CATALOG_SERVER . DIR_WS_CATALOG;
    } elseif ($connection == 'SSL') {
      if (ENABLE_SSL_CATALOG == 'true') {
        $link = HTTPS_CATALOG_SERVER . (defined('DIR_WS_HTTPS_CATALOG') ? DIR_WS_HTTPS_CATALOG : DIR_WS_CATALOG);
      } else {
        $link = HTTP_CATALOG_SERVER . DIR_WS_CATALOG;
      }
    } else {
      die('</td></tr></table></td></tr></table><br /><br /><font color="#ff0000"><strong>Error!</strong></font><br /><br /><strong>Unable to determine connection method on a link!<br /><br />Known methods: NONSSL SSL<br /><br />Function used:<br /><br />tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</strong>');
    }
    if ($parameters == '') {
      $link .= $page;
    } else {
      $link .= $page . '?' . $parameters;
    }

    while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);

    return $link;
  }

Complete Newbie On The Learn - Not A Programmer

But Learning As I Go

Link to comment
Share on other sites

You see that's what I thought but from that if I click on Admin>Catagories All I get is a blank page

 

Yet put that 1 section back to suit either Add-On and it works for that Add-on (do the work and save) change it for the other Add-on (do the work and save) and all inputed changes work on the live site

 

Looks fine to me :thumbsup:

 

not familar with extra fields but if that is what it says the complete  code block would be

    if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
	// BOF Extra Fields Contribution	  
      $products_extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " WHERE products_id=" . (int)$HTTP_GET_VARS['pID']);
      while ($products_extra_fields = tep_db_fetch_array($products_extra_fields_query)) {
        $extra_field[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];
      }
	  $extra_field_array=array('extra_field'=>$extra_field);
	  $pInfo->objectInfo($extra_field_array);
// EOF Extra Fields Contribution
    /*** Begin Header Tags SEO ***/
       $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_head_title_tag,pd.products_head_title_tag_alt, pd.products_head_title_tag_url, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_head_breadcrumb_text, pd.products_head_listing_text, pd.products_head_sub_text, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
    /*** End Header Tags SEO ***/
	  
	  $product = tep_db_fetch_array($product_query);

      $pInfo->objectInfo($product);

      $product_images_query = tep_db_query("select id, image, htmlcontent, sort_order from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$product['products_id'] . "' order by sort_order");
      while ($product_images = tep_db_fetch_array($product_images_query)) {
        $pInfo->products_larger_images[] = array('id' => $product_images['id'],
                                                 'image' => $product_images['image'],
                                                 'htmlcontent' => $product_images['htmlcontent'],
                                                 'sort_order' => $product_images['sort_order']);
      }
    }

Regards

Joli

 

Try this small change made just the one line change

 /*** Begin Header Tags SEO ***/
       $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_title_tag_alt, pd.products_head_title_tag_url, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_head_breadcrumb_text, pd.products_head_listing_text, pd.products_head_sub_text, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
    /*** End Header Tags SEO ***/

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

Good spot, unfortunately no change.

 

Also since changing the error reporting apart from a screen full of:

 

Notice: Undefined variable: SID in /home/****/public_html/shop/admin/includes/functions/html_output.php on line 48

 

I also get a couple of:

 

Warning: usort() expects parameter 2 to be a valid callback, function 'tep_sort_admin_boxes_links' not found or invalid function name in /home/****/public_html/shop/admin/includes/column_left.php on line 51

Complete Newbie On The Learn - Not A Programmer

But Learning As I Go

Link to comment
Share on other sites

hmmmm that sort of puts me back to the beginning with the blank page on admin>catagories  all the others (manufacturers etc) work fine

Complete Newbie On The Learn - Not A Programmer

But Learning As I Go

Link to comment
Share on other sites

do not see why it does not work have you tested all the header tags functions it has a inbuilt error reporting system

 

So to recap singley they work (either add on ) but together they do not??

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

Yeah if I take out either of the Add-ons code just in that section they both work. I can switch between the 2 and save anything I change and both the outputs are created on the live site as well.

 

Just has me baffled (but then I aint a programmer) lol

Complete Newbie On The Learn - Not A Programmer

But Learning As I Go

Link to comment
Share on other sites

well mistake somewhere in there really see no reason why they both should not work together.

 

Hope you did not add anything to admin/column-left.php  only mentioning because of that second error yur are getting above

In admin/includes/column_left.php before the first ?> (by the other
include statements), *** SKIP FOR VERSION 2.3.3.4 ***

ADD:

/*** Begin Header Tags SEO ***/
include(DIR_WS_BOXES . 'header_tags_seo.php');
/*** End Header Tags SEO ***/

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

No I did skip that...I am right in thinking that the error must be in the catagories file (just thinking as that's the only function that is not working)?

 

Just thinking I could post it on this thread to see if anyone spots anything that my daft none programming self cant?

Complete Newbie On The Learn - Not A Programmer

But Learning As I Go

Link to comment
Share on other sites

attach the whole admin/categories.php  file if you click more reply options you can upload the complete file

 

I will have a look later this evening and see if I can spot anything

 

or maybe someone else

 

Regards

Joli

 

BEWARE THE CURY BRACKETS (w00t)

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

attach the whole admin/categories.php  file if you click more reply options you can upload the complete file

 

I will have a look later this evening and see if I can spot anything

 

or maybe someone else

 

Regards

Joli

 

BEWARE THE CURY BRACKETS (w00t)

 

Just wanted to thank Joli for the continued help with this mystery

Complete Newbie On The Learn - Not A Programmer

But Learning As I Go

Link to comment
Share on other sites

yes missing <?php tag about line 828 just after the closing </form>

 

win merge is a nice tool to use when checking / comparing files !

 

Regards

Joli

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...