Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Header Tags SEO


Jack_mcs

Recommended Posts

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
Link to comment
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.

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

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.

Link to comment
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/';

 

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

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
Link to comment
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

Link to comment
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

Link to comment
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 .....

Link to comment
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.

Link to comment
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
Link to comment
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.

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

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.

 

Link to comment
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.

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

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.

Link to comment
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?

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

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
Link to comment
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.

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

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
Link to comment
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.

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

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?

Link to comment
Share on other sites

Something else I hadn't noticed. The following changes should fix it.  In headertags_seo_styles.css, add

.hts_bookmarks_place {padding:10px 0;float:right}

In includes/modules/header_tags_social_bookmarks.php change

    echo '<div style="float:right;">';
    if (HEADER_TAGS_ENABLE_GOOGLE_PLUS == 'true') {
    echo '<div style="float:left; padding-top:' . $padding . 'px; padding-right:20px;"><g:plusone></g:plusone></div>';
    }
    echo '<div style="float:right;">' . $dataStr . '</div>';

to this (you are just removing the style code)

    echo '<div>';
    if (HEADER_TAGS_ENABLE_GOOGLE_PLUS == 'true') {
    echo '<div style="float:left; padding-top:' . $padding . 'px; padding-right:20px;"><g:plusone></g:plusone></div>';
    }
    echo '<div>' . $dataStr . '</div>';

In index.php, or wherever it is in your shop, change

          if (HEADER_TAGS_DISPLAY_SOCIAL_BOOKMARKS == 'true') {
            echo '<div>';
            include(DIR_WS_MODULES . 'header_tags_social_bookmarks.php'); 
            echo '</div>';
          }

to

          if (HEADER_TAGS_DISPLAY_SOCIAL_BOOKMARKS == 'true') {
            echo '<div class="row"><div class="hts_bookmarks_place">';
            include(DIR_WS_MODULES . 'header_tags_social_bookmarks.php'); 
            echo '</div></div>';
          }

 

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

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...