Page 3 of 3 FirstFirst 123
Results 21 to 29 of 29
  1. #21
    Join Date
    Oct 2007
    Location
    Emporia, Kansas
    Posts
    1,762
    Plugin Contributions
    0

    Default Re: Meta_tag_fbtitle

    this is what mine looks like:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?> xmlns:fb="http://www.facebook.com/2008/fbml">
    <head>
    <title><?php echo META_TAG_TITLE; ?></title>

    <meta property="og:title" content="<?php echo META_TAG_FBTITLE; ?>"/>
    <meta property="og:title" content="<?php echo META_TAG_TITLE; ?>"/>
    <meta property="og:site_name" content="<?php echo TITLE; ?>"/>
    <meta property="og:image" content="<?php echo META_TAG_FBIMG; ?>"/>
    <meta property="og:url" content="<?php echo $canonicalLink; ?>"/>
    <meta property="og:type" content="product"/>
    <meta property="fb:myinfo" content="my number"/>

    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
    <meta name="keywords" content="<?php echo CUSTOM_KEYWORDS; ?>" />
    <meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>" />
    <meta http-equiv="imagetoolbar" content="no" />
    <meta name="author" content="The Zen Cart&trade; Team and others" />
    <meta name="generator" content="shopping cart program by Zen Cart&trade;, http://www.zen-cart.com eCommerce" />
    <?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance') { ?>
    <meta name="robots" content="noindex, nofollow" />


    hopw that helps

  2. #22
    Join Date
    Oct 2007
    Posts
    328
    Plugin Contributions
    0

    Default Re: Meta_tag_fbtitle

    Quote Originally Posted by niccol View Post
    Well the code is appearing fine in your pages.

    But you do have a problem with the og:image tag which appears to be messing things up for you.

    You can use http://developers.facebook.com/tools/debug to see what I mean.

    As this isn't my mod, and I don't use it (instead I just wrote my own version of it ) , I can't really comment about why that is happening with this mod.

    What I do is add this line into the html_header.php file

    Code:
    <!--Add OG tags-->
    <?include(DIR_WS_MODULES . zen_get_module_directory('og_tags.php'));?>
    which just includes a module in that spot. I tend to put it under the generator meta-tag.

    Then in the modules folder ( either in default or in your template or both ) I put the file that is in the attachment.

    Then I upload a image to use as the default og:image to the images folder. It needs to be called og_logo.jpg.

    That seems to work pretty well for me. Of course, you'd want to remove the alterations that the previous mod had made to html_header.php.

    All that does is write the og:tags the way I want. I think that there are other things the previous module does - so you either need to leave those bits alone or recode them. What that means is use the rest of the previous module and just use my version to load the og:tags into the header.
    The og_tags.php file works for me, thanks for providing this. One question I have: how can I select the medium sized images instead of the regular sized images?
    I assume that I need to modify this code:

    if(substr($_GET['main_page'],-5) == '_info')
    {
    // this is a product info page
    $sql = "SELECT p.products_image
    FROM ".TABLE_PRODUCTS." p
    WHERE p.products_id = '" . (int)$_GET['products_id'] . "'"
    ;
    $obj = $db->Execute($sql);
    $og_image = HTTP_SERVER.DIR_WS_CATALOG.DIR_WS_IMAGES.$obj->fields['products_image'];
    }

    however Im not a programmer so Im not sure exactly how to change it.

  3. #23
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: Meta_tag_fbtitle

    depends whether you are using image handler or not.

    I haven't thought about this for ages to be honest. What is the problem with using the main image?

  4. #24
    Join Date
    Oct 2007
    Posts
    328
    Plugin Contributions
    0

    Default Re: Meta_tag_fbtitle

    Quote Originally Posted by niccol View Post
    depends whether you are using image handler or not.

    I haven't thought about this for ages to be honest. What is the problem with using the main image?
    Im not using image handler. Im using the standard, MED and LRG image names.

    The problem right now is that the images Facebook posts are the small images (those also used on the product listing page) so they get very blurred since Facebook are making them larger. So I want to have the code take my medium or even large sized images instead of small images.

  5. #25
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: Meta_tag_fbtitle

    Well, if you send me an example of a large image name I will scribble some code for you. Or you can try this which is completely off the top of my head:

    if(substr($_GET['main_page'],-5) == '_info')
    {
    // this is a product info page
    $sql = "SELECT p.products_image
    FROM ".TABLE_PRODUCTS." p
    WHERE p.products_id = '" . (int)$_GET['products_id'] . "'"
    ;
    $obj = $db->Execute($sql);
    $large_image = str_replace('.','_LRG.',$obj->fields['products_image']);
    $og_image = HTTP_SERVER.DIR_WS_CATALOG.DIR_WS_IMAGES.$large_image;
    }

    That is very rough and ready. It will break if your image names have a '.' in them. It will fail if there isn't a large image at all and won't fallback to the medium then the small. It won't work if you use a suffix other than 'LRG'.

  6. #26
    Join Date
    Oct 2007
    Posts
    328
    Plugin Contributions
    0

    Default Re: Meta_tag_fbtitle

    Quote Originally Posted by niccol View Post
    Well, if you send me an example of a large image name I will scribble some code for you. Or you can try this which is completely off the top of my head:

    if(substr($_GET['main_page'],-5) == '_info')
    {
    // this is a product info page
    $sql = "SELECT p.products_image
    FROM ".TABLE_PRODUCTS." p
    WHERE p.products_id = '" . (int)$_GET['products_id'] . "'"
    ;
    $obj = $db->Execute($sql);
    $large_image = str_replace('.','_LRG.',$obj->fields['products_image']);
    $og_image = HTTP_SERVER.DIR_WS_CATALOG.DIR_WS_IMAGES.$large_image;
    }

    That is very rough and ready. It will break if your image names have a '.' in them. It will fail if there isn't a large image at all and won't fallback to the medium then the small. It won't work if you use a suffix other than 'LRG'.
    Ok thanks, a bit of fallback/failproof code would be great. My image names are for example: "usb-rs232-adapter-MED.jpg" for medium images and "usb-rs232-adapter-MED.jpg" for large images. (I changed the _MED to -MED).

  7. #27
    Join Date
    Oct 2007
    Posts
    328
    Plugin Contributions
    0

    Default Re: Meta_tag_fbtitle

    I just tried using the code you suggested above, unfortunately its not working, no image is being posted to Facebook. Could it be because I changed the name of the medium image from _MED to -MED? (I also changed the code to that, but still wont work)

  8. #28
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: Meta_tag_fbtitle

    Shoot.

    Yeah, I forgot to put the folder name in there too.

    So something like:

    if(substr($_GET['main_page'],-5) == '_info')
    {
    // this is a product info page
    $sql = "SELECT p.products_image
    FROM ".TABLE_PRODUCTS." p
    WHERE p.products_id = '" . (int)$_GET['products_id'] . "'"
    ;
    $obj = $db->Execute($sql);
    $medium_image = str_replace('.','-MED.',$obj->fields['products_image']);
    $og_image = HTTP_SERVER.DIR_WS_CATALOG.DIR_WS_IMAGES.'medium/'.$medium_image;
    }

    I'll have a think about fallback when I get a moment but it may not be for a few days.

  9. #29
    Join Date
    Oct 2007
    Posts
    328
    Plugin Contributions
    0

    Default Re: Meta_tag_fbtitle

    Thanks again but it still seems to be taking the small images because the images posted on Facebook are still blurred, like when a small image gets enlarged. Very strange.

 

 
Page 3 of 3 FirstFirst 123

Similar Threads

  1. v139h Facebook like addon weird appearance on facebook activity
    By navido in forum General Questions
    Replies: 0
    Last Post: 7 Sep 2014, 06:34 PM
  2. v150 Trouble with facebook addon...
    By rainbow_pixie_star in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 22 Jul 2012, 08:55 AM
  3. META_TAG_FBTITLE in my Facebook links
    By duiwel in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 23 May 2012, 02:56 AM
  4. Facebook addon mod doesn't incorporate PHPBB support
    By HaIzI72G3T in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 6 Dec 2011, 01:36 AM
  5. Facebook addon problems
    By Maynards in forum All Other Contributions/Addons
    Replies: 14
    Last Post: 22 Apr 2010, 03:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR