Jump to content
Jack_mcs

Header Tags SEO

Recommended Posts

If I am understanding you correctly, the problem is that the category titles are not showing in the bRowser. If so, and the titles are present when you view the category in admin, then it is probably because you don't have teh category box checked in Page Control, assuming everything is installed correctly, of course.

 

 

Yes you understood me correctly. Well i'm running version 3.1.0, in admin there is no box about category... Am i missing something?

 

I read again sql file and there is no configuration change to control categories.

Edited by fozzo

Share this post


Link to post
Share on other sites

Hello, I need help please, the problem is, the title of the index is repeated in categories and manufacturers.

Uncheck the root box in Page Control for index.php.

Share this post


Link to post
Share on other sites

Yes you understood me correctly. Well i'm running version 3.1.0, in admin there is no box about category... Am i missing something?

 

I read again sql file and there is no configuration change to control categories.

Oh, sorry, but I couldn't begin to offer a suggestion on 3.1.0 due to the large number of changes made to the contribution since it was released.

Share this post


Link to post
Share on other sites

Yes you understood me correctly. Well i'm running version 3.1.0, in admin there is no box about category... Am i missing something?

 

I read again sql file and there is no configuration change to control categories.

 

 

Ok now title is showing but just after title there is still "index" description. Is there a way to take it off?

Edited by fozzo

Share this post


Link to post
Share on other sites

I'm getting crazy, now the situation is:

 

index shows title correctly

 

categories show title correctly

 

product info show category title and product title.

 

 

How to remove category title from product info page?

Edited by fozzo

Share this post


Link to post
Share on other sites

How to remove category title from product info page?

Uncheck the category box in Page Control for product_info.php. Starting to see a pattern yet? Maybe reading the including docs that have examples will help?

Share this post


Link to post
Share on other sites

Uncheck the category box in Page Control for product_info.php. Starting to see a pattern yet? Maybe reading the including docs that have examples will help?

 

 

If i uncheck the category box i get the error

 

Warning: implode() [function.implode]: Invalid arguments passed in...

 

those are the setting:

 

Senza titolo-5.gif

 

If i check the category box then categories title will works correctly but product info will show category title and product title..

Edited by fozzo

Share this post


Link to post
Share on other sites

Finally it works correclty! it was a matter of box checked or not, as you said.

 

Thanks a lot for your support Jack_mcs!!

Edited by fozzo

Share this post


Link to post
Share on other sites

hello!

I have installed this contribution, which is great BTW, but the problem is that I have several contributions installed and I have one problem!

I cannot access the categories/products menu in admin. I just get a blank page! I run the test but there is nothing wrong, I don't get any error!

 

Maybe someone can help me. ... thanks

 

here is my categories.php file : http://xdot.ro/osc/

I didn't knew how to post it otherway

Share this post


Link to post
Share on other sites

I have installed this contribution, which is great BTW, but the problem is that I have several contributions installed and I have one problem!

I cannot access the categories/products menu in admin. I just get a blank page! I run the test but there is nothing wrong, I don't get any error!

Please read the Install_Admin.txt file for how to handle this.

Share this post


Link to post
Share on other sites

I am in the progress of installing this contribution and stumbled across an issue. I cannot find the code in includes/application_top.php for step 5 shown below:

 

5) In includes/application_top.php,

  FIND:

// add category names or the manufacturer name to the breadcrumb trail
 if (isset($cPath_array)) {
   for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
     $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");
     if (tep_db_num_rows($categories_query) > 0) {
       $categories = tep_db_fetch_array($categories_query);
       $breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
     } else {
       break;
     }
   }
 } elseif (isset($HTTP_GET_VARS['manufacturers_id'])) {
   $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
   if (tep_db_num_rows($manufacturers_query)) {
     $manufacturers = tep_db_fetch_array($manufacturers_query);
     $breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id']));
   }
 }

// add the products model to the breadcrumb trail
 if (isset($HTTP_GET_VARS['products_id'])) {
   $model_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
   if (tep_db_num_rows($model_query)) {
     $model = tep_db_fetch_array($model_query);
     $breadcrumb->add($model['products_model'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));
   }
 }

  REPLACE with:

/*** Begin Header Tags SEO ***/  
// add category names or the manufacturer name to the breadcrumb trail
 if (isset($cPath_array)) {
   for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
     $categories_query = tep_db_query("select categories_htc_title_tag from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "' LIMIT 1");
     if (tep_db_num_rows($categories_query) > 0) {
       $categories = tep_db_fetch_array($categories_query);
       $breadcrumb->add($categories['categories_htc_title_tag'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
     } else {
       break;
     }
   }
 } elseif (isset($_GET['manufacturers_id'])) {
   $manufacturers_query = tep_db_query("select manufacturers_htc_title_tag from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' AND languages_id = '" . (int)$languages_id . "' LIMIT 1");
   if (tep_db_num_rows($manufacturers_query)) {
     $manufacturers = tep_db_fetch_array($manufacturers_query);
     $breadcrumb->add($manufacturers['manufacturers_htc_title_tag'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $_GET['manufacturers_id']));
   }
 }

// add the products name to the breadcrumb trail
if (isset($_GET['products_id'])) {
 $products_query = tep_db_query("select pd.products_head_title_tag from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_id = '" . (int)$_GET['products_id'] . "' and pd.language_id ='" .  (int)$languages_id . "' LIMIT 1");
 if (tep_db_num_rows($products_query)) {
   $products = tep_db_fetch_array($products_query);
   $breadcrumb->add($products['products_head_title_tag'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $_GET['products_id']));
 }
} 
/*** End Header Tags SEO ***/

Share this post


Link to post
Share on other sites

I am in the progress of installing this contribution and stumbled across an issue. I cannot find the code in includes/application_top.php for step 5 shown below:

The instructions are for a standard oscommerce shop. If that code ins't in your file, then your shop has been altered and there's no way to help in a support thread like this.

Share this post


Link to post
Share on other sites

I compared the code to the standard shop code and it did not find the select code inside that document either. Nor was it around the given line number.

Share this post


Link to post
Share on other sites

I compared the code to the standard shop code and it did not find the select code inside that document either. Nor was it around the given line number.

Then you are looking at the wrong file or your standard shop file has been changed.

Share this post


Link to post
Share on other sites

Please read the Install_Admin.txt file for how to handle this.

 

i have gone through this two times, i got the same problem everytime! I don't know how to proceed anymore!

Share this post


Link to post
Share on other sites

i have gone through this two times, i got the same problem everytime! I don't know how to proceed anymore!

You can try creating a test shop and installing by uploading to see that it does work and then compare against it.

Edited by Jack_mcs

Share this post


Link to post
Share on other sites

You can try creating a test shop and installing by uploading to see that it does work and then compare against it.

 

hello

i have tried that and it is working ... as I told you, I have multiple addons installed, is it possible to be a conflict between them?

Share this post


Link to post
Share on other sites

hello

i have tried that and it is working ... as I told you, I have multiple addons installed, is it possible to be a conflict between them?

It's unlikley there is a conflict in the code. Header Tags will work with all contribtuions except for other meta tags contributions and the Categories Description contribution. You do have to merge the changes with those of the other contributions though so maybe you missed that part?

Share this post


Link to post
Share on other sites

I will post the code within my application_top.php to see if you guys can help alter this file the way it needs to be for this to work.

 

<?php
/*
 $Id: application_top.php 1833 2008-01-30 22:03:30Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2008 osCommerce

 Released under the GNU General Public License
*/

// Start the clock for the page parse time log
 define('PAGE_PARSE_START_TIME', microtime());

// Set the level of error reporting
 error_reporting(E_ALL & ~E_NOTICE);

// check support for register_globals
 if (function_exists('ini_get') && (ini_get('register_globals') == false) && (PHP_VERSION < 4.3) ) {
   exit('Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory. Please use PHP 4.3+ if register_globals cannot be enabled on the server.');
 }

// Set the local configuration parameters - mainly for developers
 if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');

// Include application configuration parameters
 require('includes/configure.php');

// Define the project version
 define('PROJECT_VERSION', 'osCommerce Online Merchant v2.2 RC2a');

// some code to solve compatibility issues
 require(DIR_WS_FUNCTIONS . 'compatibility.php');

// set php_self in the local scope
 $PHP_SELF = (isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME']);

// Used in the "Backup Manager" to compress backups
 define('LOCAL_EXE_GZIP', '/usr/bin/gzip');
 define('LOCAL_EXE_GUNZIP', '/usr/bin/gunzip');
 define('LOCAL_EXE_ZIP', '/usr/local/bin/zip');
 define('LOCAL_EXE_UNZIP', '/usr/local/bin/unzip');

// include the list of project filenames
 require(DIR_WS_INCLUDES . 'filenames.php');

// include the list of project database tables
 require(DIR_WS_INCLUDES . 'database_tables.php');

// customization for the design layout
 define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125)

// Define how do we update currency exchange rates
// Possible values are 'oanda' 'xe' or ''
 define('CURRENCY_SERVER_PRIMARY', 'oanda');
 define('CURRENCY_SERVER_BACKUP', 'xe');

// include the database functions
 require(DIR_WS_FUNCTIONS . 'database.php');

// make a connection to the database... now
 tep_db_connect() or die('Unable to connect to database server!');

// set application wide parameters
 $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
 while ($configuration = tep_db_fetch_array($configuration_query)) {
   define($configuration['cfgKey'], $configuration['cfgValue']);
 }

// define our general functions used application-wide
 require(DIR_WS_FUNCTIONS . 'general.php');
 require(DIR_WS_FUNCTIONS . 'html_output.php');

// initialize the logger class
 require(DIR_WS_CLASSES . 'logger.php');

// include shopping cart class
 require(DIR_WS_CLASSES . 'shopping_cart.php');

// check to see if php implemented session management functions - if not, include php3/php4 compatible session class
 if (!function_exists('session_start')) {
   define('PHP_SESSION_NAME', 'osCAdminID');
   define('PHP_SESSION_PATH', '/');
   define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);

   include(DIR_WS_CLASSES . 'sessions.php');
 }

// define how the session functions will be used
 require(DIR_WS_FUNCTIONS . 'sessions.php');

// set the session name and save path
 tep_session_name('osCAdminID');
 tep_session_save_path(SESSION_WRITE_DIRECTORY);

// set the session cookie parameters
  if (function_exists('session_set_cookie_params')) {
   session_set_cookie_params(0, DIR_WS_ADMIN);
 } elseif (function_exists('ini_set')) {
   ini_set('session.cookie_lifetime', '0');
   ini_set('session.cookie_path', DIR_WS_ADMIN);
 }

// lets start our session
 tep_session_start();

 if ( (PHP_VERSION >= 4.3) && function_exists('ini_get') && (ini_get('register_globals') == false) ) {
   extract($_SESSION, EXTR_OVERWRITE+EXTR_REFS);
 }

// set the language
 if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
   if (!tep_session_is_registered('language')) {
     tep_session_register('language');
     tep_session_register('languages_id');
   }

   include(DIR_WS_CLASSES . 'language.php');
   $lng = new language();

   if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
     $lng->set_language($HTTP_GET_VARS['language']);
   } else {
     $lng->get_browser_language();
   }

   $language = $lng->language['directory'];
   $languages_id = $lng->language['id'];
 }

// redirect to login page if administrator is not yet logged in
 if (!tep_session_is_registered('admin')) {
   $redirect = false;

   $current_page = basename($PHP_SELF);

   if ($current_page != FILENAME_LOGIN) {
     if (!tep_session_is_registered('redirect_origin')) {
       tep_session_register('redirect_origin');

       $redirect_origin = array('page' => $current_page,
                                'get' => $HTTP_GET_VARS);
     }

     $redirect = true;
   }

   if ($redirect == true) {
     tep_redirect(tep_href_link(FILENAME_LOGIN));
   }

   unset($redirect);
 }

// include the language translations
 require(DIR_WS_LANGUAGES . $language . '.php');
 $current_page = basename($PHP_SELF);
 if (file_exists(DIR_WS_LANGUAGES . $language . '/' . $current_page)) {
   include(DIR_WS_LANGUAGES . $language . '/' . $current_page);
 }

// define our localization functions
 require(DIR_WS_FUNCTIONS . 'localization.php');

// Include validation functions (right now only email address)
 require(DIR_WS_FUNCTIONS . 'validations.php');

// setup our boxes
 require(DIR_WS_CLASSES . 'table_block.php');
 require(DIR_WS_CLASSES . 'box.php');

// initialize the message stack for output messages
 require(DIR_WS_CLASSES . 'message_stack.php');
 $messageStack = new messageStack;

// split-page-results
 require(DIR_WS_CLASSES . 'split_page_results.php');

// entry/item info classes
 require(DIR_WS_CLASSES . 'object_info.php');

// email classes
 require(DIR_WS_CLASSES . 'mime.php');
 require(DIR_WS_CLASSES . 'email.php');

// file uploading class
 require(DIR_WS_CLASSES . 'upload.php');

// calculate category path
 if (isset($HTTP_GET_VARS['cPath'])) {
   $cPath = $HTTP_GET_VARS['cPath'];
 } else {
   $cPath = '';
 }

 if (tep_not_null($cPath)) {
   $cPath_array = tep_parse_category_path($cPath);
   $cPath = implode('_', $cPath_array);
   $current_category_id = $cPath_array[(sizeof($cPath_array)-1)];
 } else {
   $current_category_id = 0;
 }

// default open navigation box
 if (!tep_session_is_registered('selected_box')) {
   tep_session_register('selected_box');
   $selected_box = 'configuration';
 }

 if (isset($HTTP_GET_VARS['selected_box'])) {
   $selected_box = $HTTP_GET_VARS['selected_box'];
 }

// the following cache blocks are used in the Tools->Cache section
// ('language' in the filename is automatically replaced by available languages)
 $cache_blocks = array(array('title' => TEXT_CACHE_CATEGORIES, 'code' => 'categories', 'file' => 'categories_box-language.cache', 'multiple' => true),
                       array('title' => TEXT_CACHE_MANUFACTURERS, 'code' => 'manufacturers', 'file' => 'manufacturers_box-language.cache', 'multiple' => true),
                       array('title' => TEXT_CACHE_ALSO_PURCHASED, 'code' => 'also_purchased', 'file' => 'also_purchased-language.cache', 'multiple' => true)
                      );

// check if a default currency is set
 if (!defined('DEFAULT_CURRENCY')) {
   $messageStack->add(ERROR_NO_DEFAULT_CURRENCY_DEFINED, 'error');
 }

// check if a default language is set
 if (!defined('DEFAULT_LANGUAGE')) {
   $messageStack->add(ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
 }

 if (function_exists('ini_get') && ((bool)ini_get('file_uploads') == false) ) {
   $messageStack->add(WARNING_FILE_UPLOADS_DISABLED, 'warning');
 }
?>

Share this post


Link to post
Share on other sites

I will post the code within my application_top.php to see if you guys can help alter this file the way it needs to be for this to work.

It may be that the template you are using has had the breadcrumb code removed. In that case, adding it to the application_top file won't help since there is more to it than that. You will either need to skip that step or re-install the breadcrumb code.

Share this post


Link to post
Share on other sites

Uncheck the root box in Page Control for index.php.

 

Hello, thank you very much, if you fix the problem, I really thank you very much :thumbsup: :thumbsup: :thumbsup:

Share this post


Link to post
Share on other sites

It's unlikley there is a conflict in the code. Header Tags will work with all contribtuions except for other meta tags contributions and the Categories Description contribution. You do have to merge the changes with those of the other contributions though so maybe you missed that part?

Here is the code. I think the problem may be from an addon called product specifications, but that just adds some extra buttons in product info page.

 

http://xdot.ro/osc/categories.txt i am sorry that I am adding the code like this but I don't know how to do it other way, it is a text doc, pre-scanned with kaspersky

 

Please help me!

Thanks in advace!

Share this post


Link to post
Share on other sites

Here is the code. I think the problem may be from an addon called product specifications, but that just adds some extra buttons in product info page.

You need to figure out the merging or hire someone to do it for you. There are too many variations to even think of doing that here.

Share this post


Link to post
Share on other sites

Hi Jack,

 

Thank you so much for the add-on. Finally installed it. Unfortunately, some issues did arise.

 

1. "Parse error: syntax error, unexpected T_CASE in /home/***/public_html/admin/categories.php on line 1108"

 

Here's what I've got there (second last line is 1108):

 

        $contents[] = array('text' => '<br>' . TEXT_CATEGORIES_NAME . $category_inputs_string);
       $contents[] = array('text' => '<br>' . TEXT_CATEGORIES_IMAGE . '<br>' . tep_draw_file_field('categories_image'));
       $contents[] = array('text' => '<br>' . TEXT_SORT_ORDER . '<br>' . tep_draw_input_field('sort_order', '', 'size="2"'));
       /*** Begin Header Tags SEO ***/
       $contents[] = array('text' => '<br>' . 'Header Tags Category Title' . $category_htc_title_string);
       $contents[] = array('text' => '<br>' . 'Header Tags Category Description' . $category_htc_desc_string);
       $contents[] = array('text' => '<br>' . 'Header Tags Category Keywords' . $category_htc_keywords_string);
       $contents[] = array('text' => '<br>' . 'Header Tags Categories Description' . $category_htc_description_string);
       /*** End Header Tags SEO ***/		
       $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
       break;
     case 'edit_category':
       $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_CATEGORY . '</b>');

 

2. Description and keywords override don't seem to work. Both tags keep on containing product and category names, i.e. everything that comes up in page titles but for the the default title (according to my preferred sort order).

 

3. Is it possible to specify the sort order for categories in titles (Full mode)? I'd like to have the following order: product name - subcategory - category.

 

Thanks again and looking forward to hearing from you.

 

Nick

Share this post


Link to post
Share on other sites

1. "Parse error: syntax error, unexpected T_CASE in /home/***/public_html/admin/categories.php on line 1108"

 

2. Description and keywords override don't seem to work. Both tags keep on containing product and category names, i.e. everything that comes up in page titles but for the the default title (according to my preferred sort order).

 

3. Is it possible to specify the sort order for categories in titles (Full mode)? I'd like to have the following order: product name - subcategory - category.

1 - Covered in the installation files.

 

2 - Fill tags doesn't change the default tags.

 

3 - Yes, use the sort order boxes in Page Control.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×