Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Header Tags Controller for Admin MS 2.2


Farrukh

Recommended Posts

#1 common mistake

 

the Catalog Install instruction "Around line 247:" says find this:

 

	?>
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

 

replace with this:

 

   $category_query = tep_db_query("select cd.categories_htc_title_tag, cd.categories_htc_description from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
  $category = tep_db_fetch_array($category_query); 
?>
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

 

you most likely missed "replacing" the ?> tag and left it in there.

 

#2 make sure this was added to your /catalog/includes/application_top.php. Make sure you completed this instruction

 

Add to /catalog/includes/application_top.php at the end of

the file right before the last ?>

 

// BOF: WebMakers.com Added: Header Tags Controller v2.5.2

require(DIR_WS_FUNCTIONS . 'header_tags.php');

// Clean out HTML comments from ALT tags etc.

require(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

// EOF: WebMakers.com Added: Header Tags Controller v2.5.2

Link to comment
Share on other sites

  • Replies 4.6k
  • Created
  • Last Reply

Top Posters In This Topic

Thank you, your suggestions corrected both problems!!

 

Two additional cosmetic questions for you...

 

 

1) If I wanted to put a background color in the cell where category header shows on the page where would I do that?

 

2) Where can I remove what's causing the spacing below the category header.

 

 

Thanks!

Link to comment
Share on other sites

here's a little CSS 101 for ya...

 

If you are talking about where the Category name is showing in the title area of the page, you would modify the additions to your stylesheet.css:

 

h1 {

font-family: Verdana, Arial, sans-serif;

font-size: 20px;

font-weight: bold;

background-color: #DDDDDD;

display: inline;

}

 

h2 {

font-family: Verdana, Arial, sans-serif;

font-size: 14px;

display: inline;

}

 

the background-color: #DDDDDD; is pretty much self explanatory,

display: inline; prevents the <h1> tag from treating the surroundings like it's a paragraph break.

 

 

If you want the background to go across the entire title area, leave the background out of the previous change, and you will need to change the page code a little.

 

In the Install_Catalog.TXT, the two instructions that are "Around line 78:" and "Around line 247:". Find the <td><h1> in each replacement. change the background for the <td> in each case. either change each TD to <td style="background-color: #DDDDDD;">

 

-OR-

 

<td class="newTitleBackstyle"> and add the style to your stylesheet.css file.

 

.newTitleBackstyle {

background-color: #DDDDDD;

}

Link to comment
Share on other sites

Hi,

 

I seem to install this contribution fine. The header tags are working great from the Home up to the sub-categories.

 

However, when I click on the particular product it says 'osCommerce' on the Title. I filled all the three infos for header tags when I add a product, and then updated the Fill Tags for Products, but its not working.

 

Please help :-(

Link to comment
Share on other sites

Hi there,

 

i have a slight problem with this. If I have already set up a category with an image and then i edit that category to change the tags, unless i re-specify an image for that category before i update it then it forgets that an image was previously specified and i have to re-upload it?!?

 

any ideas how to fix this?

 

cheers

 

stubbsy

Link to comment
Share on other sites

Hi,

 

I seem to install this contribution fine. The header tags are working great from the Home up to the sub-categories.

 

However, when I click on the particular product it says 'osCommerce' on the Title. I filled all the three infos for header tags when I add a product, and then updated the Fill Tags for Products, but its not working.

 

Please help :-(

If you edit a product in admin, iare the Header Tags sections filled in? I know you said you added iit but I am wondering if it is staying set.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi there,

 

i have a slight problem with this. If I have already set up a category with an image and then i edit that category to change the tags, unless i re-specify an image for that category before i update it then it forgets that an image was previously specified and i have to re-upload it?!?

 

any ideas how to fix this?

 

cheers

 

stubbsy

It sounds like a mistale was made in the admin/categories.php file. Try replacing yours with the one in the archive to see if the problem goes away.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

look in the instruction file: Install_Catalog.TXT

 

I believe you have missed the instruction that starts:

the two examples you provided are actually produced from two different location of the index.php file. (one has subcats, one doesn't)

 

I'm sorry but is your post directed to me? If so, in your example of the code your example ends at the text "line 78". There was nothing added after that.

Link to comment
Share on other sites

Hi Jack,

 

thanks for your help, i've overwritten my categories file with the categories file in the folder for the clean instal and i still get the same problem, the category image dissapears when i update the tags. If i edit it and then just hit update the tags get saved, just the image gets lost?

 

cheers

 

stubbsy

Link to comment
Share on other sites

Hi everyone. I'm in the middle of installing this great contribution.

 

Since I've already got many contribs installed, I'm installing the contrib manually. No problems there.

 

I've just about finished the category pages mods. Admin page mods haven't been done yet.

 

All pages work, you can see the new generated tags (that haven't been filled in yet as there is no admin control).

 

However, I'm having some problems with catalog/index.php. In the Install_Catalog.txt file it explains how to do 4 mods to index.php, at various line breaks. The mod at line 294 requires me to mod a line that has been commented out.

 

The line to be edited is this one:

<!--  removed image			<td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> -->

 

As you can see, it has been commented out.

 

Replacing the code above with the new contrib code doesn't work. Index.php still functions but on any page with a cPath ie index.php?cPath=28_39, the problem code appears in text format above the otherwise working page.

 

Any ideas??

Edited by CHinder
Link to comment
Share on other sites

have you tried commenting out the same part of the replaced code?

 

		  <!-- <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, $category['categories_htc_title_tag'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> -->
	  </tr>
	  <?php if (tep_not_null($category['categories_htc_description'])) { ?> 
	  <tr>
	   <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
	   <td><h2><?php echo $category['categories_htc_description']; ?></h2></td>
	  </tr>
	  <?php } ?>

Link to comment
Share on other sites

Good idea.

 

Tried that. It tidied the extra text on the page up a bit, but essentially theres still the same problem.

 

Heres the code near the problem part of catalog/index.php :) (With the line commented out, as suggested)

 

// Get the right image for the top-right
/*  Don't do the query
$image = DIR_WS_IMAGES . 'table_background_list.gif';
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
  $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
  $image = tep_db_fetch_array($image);
  $image = $image['manufacturers_image'];
} elseif ($current_category_id) {
  $image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
  $image = tep_db_fetch_array($image);
  $image = $image['categories_image'];
}
*/
?>

// BOF: Header Tags v2.5.6
<!-- <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, $category['categories_htc_title_tag'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> -->
	  </tr>
	  <?php if (tep_not_null($category['categories_htc_description'])) { ?> 
	  <tr>
	   <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
	   <td><h2><?php echo $category['categories_htc_description']; ?></h2></td>
	  </tr>
	  <?php } ?>
// EOF: Header Tags v2.5.6

Edited by CHinder
Link to comment
Share on other sites

I'm just guessing, but is it displaying this?

 

// BOF: Header Tags v2.5.6

// EOF: Header Tags v2.5.6

 

these are PHP tags. their position in your code is not within any <?php ?> tags. they should look like this if you want them there...

 

<?php  // BOF: Header Tags v2.5.6 ?>
<?php  // EOF: Header Tags v2.5.6 ?>

Edited by surfalot
Link to comment
Share on other sites

Hi Surfalot

 

Yes it was displaying those, and some other text.

 

I tracked down the particular text that was being displayed, it was around 20 lines up (from another edit..)

 

I'd missed one of these - ?>

 

I'm embarrased! Thanks for the help :)

Edited by CHinder
Link to comment
Share on other sites

Hi,

 

I love this contribution, thanks for all the great work of the developers.

 

I am having trouble with header tags controller to show header tags on infopages. I installed infopages v0.1b. Does anybody know how to do so?

 

Thank you very much in advance.

 

Michiel

Link to comment
Share on other sites

Hi

I have just installed this contribution its seems to be ok except that when I try and edit an existing category I can't and get the folloing message above the categories/products list in admin.

 

Fatal error: Call to undefined function: tep_get_category_htc_title() in /data/members/paid/e/c/ecobean.co.uk/htdocs/www/catalog/admin/categories.php on line 1017

 

How do I sort it out?

I found another post for a similar problem with a reply saying check instructions but I can't find anything in the instructions that helps.

 

I would be really grateful for some help.

 

Thanks

Jeanette

Link to comment
Share on other sites

The instructions for admin explain how to add that code to your admin/includes/functions/general.php file. It appears you missed that part.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi

following on from my other posts-ok that has sorted the error message when editing the categories and i can edit them-but now my headers are not actually being changed at all. I haven't edited anything else and it did work before.

Jeanette

Link to comment
Share on other sites

Ok

What I mean is the title. It says part way through the read me instructions that the page title should be changing. Previously it was showing the default' Oscommerce:' in the title but now it just shows the name of the store.

I haven't editied anything other than the previous file.

I am probably just being thick.

Jeanette

Link to comment
Share on other sites

Hi

I am going to completely work back through the instructions and start again to double check everything-I am not sure why it would have stopped working when it was but I will have another go then post if I don't get any joy.

Jeanette

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...