Jump to content
Jack_mcs

Header Tags SEO

Recommended Posts

36 minutes ago, Jack_mcs said:

Thank you for reporting this. To fix it, in admin/categories.php, around line 407, find


              tep_db_query("insert into products_description (products_id, language_id, products_name, products_description, products_url, products_viewed, products_head_title_tag, products_head_title_tag_alt, products_head_title_tag_url, products_head_desc_tag, products_head_keywords_tag, products_head_breadcrumb_text, products_head_listing_text, products_head_sub_text, products_head_additional_words) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_head_title_tag']) . "', '" . tep_db_input($description['products_head_title_tag_alt']) . "', '" . tep_db_input($description['products_head_title_tag_url']) . "', '" . tep_db_input($description['products_head_desc_tag']) . "', '" . tep_db_input($description['products_head_keywords_tag']) . "', '" . tep_db_input($description['products_head_breadcrumb_text']) . "', '" . tep_db_input($description['products_head_listing_text']) . "', '" . tep_db_input($description['products_head_sub_text']) . "', '" . tep_db_input($description['products_head_additional_words']) . "', '" . tep_db_input($description['products_url']) . "', '0')");

and replace it with


              tep_db_query("insert into products_description (products_id, language_id, products_name, products_description, products_url, products_viewed, products_head_title_tag, products_head_title_tag_alt, products_head_title_tag_url, products_head_desc_tag, products_head_keywords_tag, products_head_breadcrumb_text, products_head_listing_text, products_head_sub_text, products_head_additional_words) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_url']) . "', '0', '" . tep_db_input($description['products_head_title_tag']) . "', '" . tep_db_input($description['products_head_title_tag_alt']) . "', '" . tep_db_input($description['products_head_title_tag_url']) . "', '" . tep_db_input($description['products_head_desc_tag']) . "', '" . tep_db_input($description['products_head_keywords_tag']) . "', '" . tep_db_input($description['products_head_breadcrumb_text']) . "', '" . tep_db_input($description['products_head_listing_text']) . "', '" . tep_db_input($description['products_head_sub_text']) . "', '" . tep_db_input($description['products_head_additional_words']) . "')");

 

Thank you thank you thank you !!!!!! As usual you are the bast.

Share this post


Link to post
Share on other sites

Hello,

on the admin page "social" [header_tags_seo_social.php]  Header Tags SEO V 3.3.5

I'm getting this error when clicking 'Save':
"Images and urls do not match."

Even, if I don't edit anything and just try to submit the few pre-filled entries.

Any ideas, what might be causing this?

osCommerce_Online_Merchant_Administration_Tool_-_2017-09-28_01.59.41.png

Edited by mk_osc
screenshot added

Share this post


Link to post
Share on other sites

That occurs when the url is not formatted correctly. Notice the text at the top state "...important to use the keywords URL and TITLE..." So if you have changed one of the entries, that is what it is. But there should be icons showing below the size options. That happens when the configure file isn't setup correctly and the code can't find the images. So my guess is that that is the problem. I think it is the DIR_WS_CATALOG, DIR_WS_HTTPS_CATALOG or DIR_FS_CATALOG that causes it (I'm not where I can check it ATM). This thread shows the basic settings and may help. If you can't get it to work, post your configure file here, minus the database credentials.

Share this post


Link to post
Share on other sites

Even if I clear all pre filled URL's I still get the same error.

Here is my admin configure file:
 

  define('HTTP_SERVER', 'https://www.domain.com');
  define('HTTPS_SERVER', 'https://www.domain.com');
  define('ENABLE_SSL', true);
  define('HTTP_COOKIE_DOMAIN', '');
  define('HTTPS_COOKIE_DOMAIN', '');
  define('HTTP_COOKIE_PATH', '/mypanel');
  define('HTTPS_COOKIE_PATH', '/mypanel');
  define('HTTP_CATALOG_SERVER', 'https://www.domain.com');
  define('HTTPS_CATALOG_SERVER', 'https://www.domain.com');
  define('ENABLE_SSL_CATALOG', 'true');
  define('DIR_FS_DOCUMENT_ROOT', '/home/username/public_html/');
  define('DIR_WS_ADMIN', '/mypanel/');
  define('DIR_WS_HTTPS_ADMIN', '/mypanel/');
  define('DIR_FS_ADMIN', '/home/username/public_html/mypanel/');
  define('DIR_WS_CATALOG', '/');
  define('DIR_WS_HTTPS_CATALOG', '/');
  define('DIR_FS_CATALOG', '/home/username/public_html/');


  define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');
 
  define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');
  define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
  define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
  define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
  define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
  define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

I have checked the php error log and the apache error log. Both logs don't show any error.
I think I'm lost as I don't know where to check in order to isolate the issue further.

Share this post


Link to post
Share on other sites

This is because one of the definitions that is used in the code was removed in the BS configure file. I hadn't noticed this problem so I appreciate you mentioning it. To fix it, edit the admin/header_tags_seo_ajax.php file and change this line

$pathLocal =  HTTPS_SERVER . $slash .DIR_WS_CATALOG_IMAGES . 'socialbookmark/';

to this

$pathLocal = DIR_FS_CATALOG . $slash . 'images/socialbookmark/';

 

Share this post


Link to post
Share on other sites

ah, cool. Good find.

However I noticed these lines in the original admin/header_tags_seo_ajax.php file:

                       $arry['div'] .= '<div class="container">';
                       $path =  HTTPS_SERVER . DIR_WS_CATALOG_IMAGES . 'socialbookmark/';
                       $slash = substr(DIR_FS_CATALOG, -1) == '/' ? '' : '/';
                       $pathLocal = DIR_FS_CATALOG . $slash .DIR_WS_IMAGES . 'socialbookmark/';

so I changed the lines to:

                       $arry['div'] .= '<div class="container">';
                       $pathLocal = DIR_FS_CATALOG . $slash . 'images/socialbookmark/';
                       $slash = substr(DIR_FS_CATALOG, -1) == '/' ? '' : '/';

 

I can now save it, but the icons which probably should show up, don't show on the admin page.

See screenshot. Thank you.

osCommerce_Online_Merchant_Administration_Tool_-_2017-09-28_19.01.43.png

Edited by mk_osc

Share this post


Link to post
Share on other sites

of course, I have tested it before :smile:
But when I put back the line

$pathLocal = DIR_FS_CATALOG . $slash .DIR_WS_IMAGES . 'socialbookmark/';

I have the same scenario as before. See screenshot.
So I assumed, it was there in error.

But here you go. hmmm .... everything back to start :unsure:

seo.jpg

Share this post


Link to post
Share on other sites

@mk_osc

 

1 hour ago, mk_osc said:

so I changed the lines to:


                       $arry['div'] .= '<div class="container">';
                       $pathLocal = DIR_FS_CATALOG . $slash . 'images/socialbookmark/';
                       $slash = substr(DIR_FS_CATALOG, -1) == '/' ? '' : '/';

I can now save it, but the icons which probably should show up, don't show on the admin page.

Shouldn't the $slash definition come before the $pathLocal definition?

Malcolm


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

even if I move the line and have:

                       $arry['div'] .= '<div class="container">';
                       $slash = substr(DIR_FS_CATALOG, -1) == '/' ? '' : '/';
                       $pathLocal = DIR_FS_CATALOG . $slash . 'images/socialbookmark/';
                       $pathLocal = DIR_FS_CATALOG . $slash .DIR_WS_IMAGES . 'socialbookmark/';

it makes no difference -> icons not loading, text not loading, check marks not loading .....

Share this post


Link to post
Share on other sites

resolved:

the lines should look like this:

                       $arry['div'] .= '<div class="container">';
                       $path =  HTTPS_SERVER . DIR_WS_CATALOG_IMAGES . 'socialbookmark/';
                       $slash = substr(DIR_FS_CATALOG, -1) == '/' ? '' : '/';
                       $pathLocal = DIR_FS_CATALOG . $slash . 'images/socialbookmark/';

I was confused first, since I did not found the quoted line:

$pathLocal =  HTTPS_SERVER . $slash .DIR_WS_CATALOG_IMAGES . 'socialbookmark/';

in the original file.
And replaced the only one with HTTPS_SERVER in it :tongue:  which was wrong.
Now the icons are loading fine.:thumbsup:
Thanks.

Share this post


Link to post
Share on other sites

However, I'm experiencing a new problem.
The link to Facebook is not working

http://www.facebook.com/share.php?u=URL&TITLE

or

https://www.facebook.com/sharer/sharer.php?u=URL&TITLE


when being used on a page and I click the link, it's producing an error on the facebook server, and the URL at facebook says:

https://www.facebook.com/dialog/return/close?error_code=100&error_message=param+media+must+be+an+array.#_=_

and the browser window with the facebook page is closed.

After some research it seems, that facebook is accepting only the URL with no TITLE, but I don't know how to do this, since it says I always need to use URL and TITLE in the URL's of the header_tags_seo_social.php

Edited by mk_osc
text added

Share this post


Link to post
Share on other sites

The format of both of the urls you show are valid. Maybe it is something in your domain name or title that the code isn't converting correctly? What happens if you substitute your domain and title in this url and then paste it into a browser:

http://www.facebook.com/share.php?u=URL&TITLE

Mouseover the FB icon on the site and make sure you copy it exactly as it appears for the test.

Share this post


Link to post
Share on other sites

I'm not exactly sure what I should substitute.
The link appears as:

 

https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fwww.debooks4u.com%2Fegypt-1890s-book-color-photos-old-cairo-thebes-sphinx-medinet-habu-p-916.html&ampEgypt+1890s+Book+w%2F+color+photos+of+Old+Cairo+Thebes+Sphinx+Medinet+Habu+Nile&media=https://www.debooks4u.com/images/autouregyptg.jpg&title=Egypt+1890s+Book+w%2F+color+photos+of+Old+Cairo+Thebes+Sphinx+Medinet+Habu+Nile

When I shorten the link and remove the link to the media item:

https://www.debooks4u.com/images/autouregyptg.jpg

I have the URL:

https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fwww.debooks4u.com%2Fegypt-1890s-book-color-photos-old-cairo-thebes-sphinx-medinet-habu-p-916.html&ampEgypt+1890s+Book+w%2F+color+photos+of+Old+Cairo+Thebes+Sphinx+Medinet+Habu+Nile&media=&title=Egypt+1890s+Book+w%2F+color+photos+of+Old+Cairo+Thebes+Sphinx+Medinet+Habu+Nile

And when I manually post it into the browser it is working now, and facebook is importing the media, though.
So not sure, where the conflict is here.

 

Share this post


Link to post
Share on other sites

You've altered the link code in admin so I can't help with this. If you restore it to the original you should see that it will work.

Share this post


Link to post
Share on other sites

ok, I tried that before, but the behavior and results are the same.
It is now:

http://www.facebook.com/share.php?u=https%3A%2F%2Fwww.debooks4u.com%2Fegypt-1890s-book-color-photos-old-cairo-thebes-sphinx-medinet-habu-p-916.html&ampEgypt+1890s+Book+w%2F+color+photos+of+Old+Cairo+Thebes+Sphinx+Medinet+Habu+Nile&media=https://www.debooks4u.com/images/autouregyptg.jpg&title=Egypt+1890s+Book+w%2F+color+photos+of+Old+Cairo+Thebes+Sphinx+Medinet+Habu+Nile

but still the same issue.

Share this post


Link to post
Share on other sites

The url you show has media= in it. That's not part of the social tag code in this addon. I don't know why it is showing up. maybe it is in your products title?

Share this post


Link to post
Share on other sites

hmm, I searched my files on the server for media=
and got a match on the file from your package
Use_if_version_BootStrap\catalog_only_new_files\includes\modules\header_tags_social_bookmarks.php

on two lines:

/home/username/public_html/includes/modules/header_tags_social_bookmarks.php:14:        $IMG = (tep_not_null($product_info['products_image']) ? "&amp;media=" . HTTP_SERVER . DIR_WS_HTTP_CATALOG. 'images/' . $product_info['products_image'] : '');
/home/username/public_html/includes/modules/header_tags_social_bookmarks.php:25:        $IMG = (tep_not_null($category['categories_image']) ? "&amp;media=" . HTTP_SERVER . DIR_WS_HTTP_CATALOG. 'images/' . $category['categories_image'] : '');

Is this the code which is responsible for the media= or where should I look at otherwise?

Any ideas?

Thanks :smile:

Edited by mk_osc

Share this post


Link to post
Share on other sites

You are correct. I didn't realize the problem was with a product page so I was just looking at the admin code and the FB on the home page. I totally forgot about that code. I apologize for the confusion.

It appears FB has changed their rules since I can't find any reference to the media tag now, though I didn't spend a lot of time on it.

You can try removing the first line that starts with

$IMG = (tep_not_nul

What happens if you try the button on a category page? If it fails there too, try removing the second line that starts that way.

Share this post


Link to post
Share on other sites

Cool, that did the trick. :thumbsup:
The button on the category page had the same issue, so I removed that line as well. However sharing category pages with facebook button no longer show category images on facebook. They don't show up with pinterest or others either, so not sure what's causing this.
 

Now to another issue, the social bookmarks are appearing twice on the index.php

I've followed the instructions which say to add it twice:

FIND:

    include('includes/modules/product_listing.php');
?>

</div>

REPLACE WITH:

 /*** Begin Header Tags SEO ***/
    if (tep_not_null($htc['htc_description'])) {
         echo '<h2 style="text-decoration:none;">'. $htc['htc_description'] . '</h2>';
     }
    /*** End Header Tags SEO ***/
    include('includes/modules/product_listing.php');
?>

</div>
    <!--- BEGIN Header Tags SEO Social Bookmarks -->
    <?php if (HEADER_TAGS_DISPLAY_SOCIAL_BOOKMARKS == 'true') {
      echo '<div style="margin-top:5px; float:right;">';
      include('includes/modules/header_tags_social_bookmarks.php');
      echo '</div>';    }
    ?>
    <!--- END Header Tags SEO Social Bookmarks -->

FIND:

  <?php echo $oscTemplate->getContent('index'); ?>
</div>

ADD BENEATH:

<?php
    
    //<!--- Begin Header Tags SEO Home Page Text and Social Bookmarks -->
    if (tep_not_null($header_tags_array['home_page_text'])) {
        echo '<div>';
        echo '<div style="padding:10px 0;">' . $header_tags_array['home_page_text'] . '</div>';
        echo '</div>';
    }

    if (HEADER_TAGS_DISPLAY_SOCIAL_BOOKMARKS == 'true') {
        echo '<div>';
        include('includes/modules/header_tags_social_bookmarks.php');
        echo '</div>';
    }
    //<!--- END Header Tags SEO Home Page Text and Social Bookmarks -->
    ?>

They show up twice as shown in the screenshot. Any ideas? .. sorry for all my questions :unsure:

Debooks4u.com_-_Original_German_Books_from_the_1920_s_1930_s_and_1940_s_-_2017-09-30_00.28.40.png

Edited by mk_osc
test added

Share this post


Link to post
Share on other sites

It's because of all of the versions of oscommerce or more accurately, the versions of the files they use.  The include statement is in a different section of the index file so that will not affect the home page. The second change may not be needed if a change was made to index module. Try removing that second block of code to see if that helps.

Share this post


Link to post
Share on other sites

I've removed the second block and this fixed the problem.  Thank you! :thumbsup::biggrin:

I'm trying to troubleshoot another issue now.
The social bookmark icons disappear on product pages when I downsize the resolution to simulate mobile devices.
The strange thing is, that this doesn't happen on the index.php page with smaller resolutions. They still show up on the index.php, but not on other pages.

Any idea or suggestion where to look at?

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

×