Author Topic: [MOD] Facebook like/share/send button  (Read 142102 times)

0 Members and 1 Guest are viewing this topic.

Offline comicart

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: [MOD] Facebook like/share/send button
« Reply #45 on: April 20, 2011, 06:12:35 PM »
I hate to ask for help.  I really tried everything to remedy this issue by following instructions and then following a fix that was similar to the problem I'm having.

What I have is - when clicking on the "LIKE" button, is a brief white-looking small pop-up that disappears before anything happens... before I can type into a window.  So essentially, I click the "LIKE" button and it adds a "1" to the button, then goes back to just a "LIKE" button.  Facebook doesn't recognize the "LIKE" either.

I know this isn't right.  Can you tutor me a bit here?

Code: [Select]
My site URL is http://www.richardhasawebsite.com
Be aware that my site is adult only.

Thank you so much and sorry for needing your time!

That's one of the reasons I changed mine to a "Share" button.
T

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] Facebook like/share/send button
« Reply #46 on: April 21, 2011, 02:21:36 AM »
@thomseye and everyone else with same issue,
Don't feel bad asking for help, this is how I know something is wrong. I think I know what the problem is but I need to do some more testing this weekend before I know for certain.

Everyone hold tight and I will post what I find. It is suppose to rain all weekend so I should have plenty of time to work on it.

PS: I am regretting ever starting with facebook connectors  :lol:
They need better documentation and help. I am learning more from other programmers that are having the same problems then I ever did with facebooks help area.
But I think I am onto something...
Buddy Duke
www.budduke.com

Offline comicart

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: [MOD] Facebook like/share/send button
« Reply #47 on: April 21, 2011, 04:49:51 AM »
Thanks for all your hard work Buddy.

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] Facebook like/share/send button
« Reply #48 on: April 24, 2011, 08:39:32 PM »
Here is my Facebook adventure in a nutshell...

Even though it does not state in the documentation that you have to have an application setup on facebook to have a Like button,
from all the people I have talked with and other sites I looked over that seem to be working correctly,
You DO have to create an application on Facebook's website to get the Like button to work correctly.
That being said, Version 3 of this mod now has this built in and all my testing has been successfull and I even have added a new feature to it.

How do you create an application on Facebook?
It isn't that difficult, but they do now require that you are verified user to do it.
You will either need to give them your credit card # or cell phone #.
I did the cell phone route and then just turned off all notifactions going to my cell phone, so it won't be going aff all day long.
After I did that setting up the application was easy...
Go to this link
http://www.facebook.com/developers/createapp.php
Give your application a name.
In the set up page you have different fields to enter, but only these are needed
Click on the "website" menu option on the left.
"Site url", you should enter the root of your gallery, for the example: "http://www.yourwebsite.com/gallery/" (Don't forget the last / )
"Site Domain", you should enter the root of your site, for the example: "yourwebsite.com"
Take note of the "application ID", (write down or be ready to copy this information)
and save everything and your application should be ready.
You can create multiple applications under one user account, so you can do this for multiple domains that you are running.
One thing, if you are listed as an admin for the pages, you may see something different posted when you like a page, you will see a link to an admin page to do more things to your pages. Not sure of its purpose yet, but I had to create another account that I could use for testing to make sure the likes are posted correctly for normal users.

Bugs, Bugs, Bugs...
Of course there are a few bugs that you may run into using the like button on your site.
Here are a couple that I know about in case they start happening to you,
They all seem to be Internet Explorer related
1. On IE6,IE7,IE8(compatability mode) all seem to keep refreshing the webpage till the browser crashes. I do know Facebook is looking into it.
2. On IE browsers the popup comment window sometimes does not render correclty
   (post button chopped off at bottom)
   (Window does not go away after posting)
   So far they are saying to user the "standard" layout for the like button with a width of 450 (not good for category pages, but OK for detail pages)
3. If you have multiple Admins listed for a page, only the first admin can actually admin the page. Facebook is aware of this.

With all that being said, Please load up version 3 of my mod and let me know how it is working for you...
Buddy Duke
www.budduke.com

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [MOD] Facebook like/share/send button
« Reply #49 on: April 24, 2011, 09:46:19 PM »
German Language
Code: [Select]
//[MOD] Facebook like button
/*-- Setting-Group Facebook --*/
$setting_group["facebook"]="Facebook Optionen";
$setting['fb_appid'] = "Geben Sie hier die Anwendungs-ID ein, die Sie auf <a href=\"http://wiki.developers.facebook.com/index.php/Connect/Setting_Up_Your_Site\">Facebook</a> erhalten haben.";
$setting['fb_admins'] = "Liste der Facebook-IDs der Admins<br><span class=\"smalltext\">IDs durch Komma trennen</span>";
$setting['fb_main_url'] = "Vollständiger Pfad zu Ihrer Webseite<br><span class=\"smalltext\">Die URL, die Sie auf Facebook angegeben haben</span>";
$setting['fb_image'] = "Vollständiger Pfad zu Ihrem Logo";
$setting['fb_title'] = "Geben Sie hier den Titel ihrer Seite ein. Mit dieser Option werden sämtliche Seitentitel überschrieben. Wird das Feld leer gelassen, wird der normale Titel-Tag ausgelesen.";
$setting['fb_description'] = "Geben Sie hier die Beschreibung Ihrer Webseite ein<br><span class=\"smalltext\">HTML code wird automatisch entfernt</span>";
$setting['fb_language'] = "Wählen Sie hier Ihre Sprache aus";
$fb_language_optionlist = array(
'ca_ES' => 'Catalan',
'cs_CZ' => 'Czech',
'cy_GB' => 'Welsh',
'da_DK' => 'Danish',
'de_DE' => 'German',
'eu_ES' => 'Basque',
'en_PI' => 'English (Pirate)',
'en_UD' => 'English (Upside Down)',
'ck_US' => 'Cherokee',
'en_US' => 'English (US)',
'es_LA' => 'Spanish',
'es_CL' => 'Spanish (Chile)',
'es_CO' => 'Spanish (Colombia)',
'es_ES' => 'Spanish (Spain)',
'es_MX' => 'Spanish (Mexico)',
'es_VE' => 'Spanish (Venezuela)',
'fb_FI' => 'Finnish (test)',
'fi_FI' => 'Finnish',
'fr_FR' => 'French (France)',
'gl_ES' => 'Galician',
'hu_HU' => 'Hungarian',
'it_IT' => 'Italian',
'ja_JP' => 'Japanese',
'ko_KR' => 'Korean',
'nb_NO' => 'Norwegian (bokmal)',
'nn_NO' => 'Norwegian (nynorsk)',
'nl_NL' => 'Dutch',
'pl_PL' => 'Polish',
'pt_BR' => 'Portuguese (Brazil)',
'pt_PT' => 'Portuguese (Portugal)',
'ro_RO' => 'Romanian',
'ru_RU' => 'Russian',
'sk_SK' => 'Slovak',
'sl_SI' => 'Slovenian',
'sv_SE' => 'Swedish',
'th_TH' => 'Thai',
'tr_TR' => 'Turkish',
'ku_TR' => 'Kurdish',
'zh_CN' => 'Simplified Chinese (China)',
'zh_HK' => 'Traditional Chinese (Hong Kong)',
'zh_TW' => 'Traditional Chinese (Taiwan)',
'fb_LT' => 'Leet Speak',
'af_ZA' => 'Afrikaans',
'sq_AL' => 'Albanian',
'hy_AM' => 'Armenian',
'az_AZ' => 'Azeri',
'be_BY' => 'Belarusian',
'bn_IN' => 'Bengali',
'bs_BA' => 'Bosnian',
'bg_BG' => 'Bulgarian',
'hr_HR' => 'Croatian',
'nl_BE' => 'Dutch (België)',
'en_GB' => 'English (UK)',
'eo_EO' => 'Esperanto',
'et_EE' => 'Estonian',
'fo_FO' => 'Faroese',
'fr_CA' => 'French (Canada)',
'ka_GE' => 'Georgian',
'el_GR' => 'Greek',
'gu_IN' => 'Gujarati',
'hi_IN' => 'Hindi',
'is_IS' => 'Icelandic',
'id_ID' => 'Indonesian',
'ga_IE' => 'Irish',
'jv_ID' => 'Javanese',
'kn_IN' => 'Kannada',
'kk_KZ' => 'Kazakh',
'la_VA' => 'Latin',
'lv_LV' => 'Latvian',
'li_NL' => 'Limburgish',
'lt_LT' => 'Lithuanian',
'mk_MK' => 'Macedonian',
'mg_MG' => 'Malagasy',
'ms_MY' => 'Malay',
'mt_MT' => 'Maltese',
'mr_IN' => 'Marathi',
'mn_MN' => 'Mongolian',
'ne_NP' => 'Nepali',
'pa_IN' => 'Punjabi',
'rm_CH' => 'Romansh',
'sa_IN' => 'Sanskrit',
'sr_RS' => 'Serbian',
'so_SO' => 'Somali',
'sw_KE' => 'Swahili',
'tl_PH' => 'Filipino',
'ta_IN' => 'Tamil',
'tt_RU' => 'Tatar',
'te_IN' => 'Telugu',
'ml_IN' => 'Malayalam',
'uk_UA' => 'Ukrainian',
'uz_UZ' => 'Uzbek',
'vi_VN' => 'Vietnamese',
'xh_ZA' => 'Xhosa',
'zu_ZA' => 'Zulu',
'km_KH' => 'Khmer',
'tg_TJ' => 'Tajik',
'ar_AR' => 'Arabic',
'he_IL' => 'Hebrew',
'ur_PK' => 'Urdu',
'fa_IR' => 'Persian',
'sy_SY' => 'Syriac',
'yi_DE' => 'Yiddish',
'gn_PY' => 'Guaraní',
'qu_PE' => 'Quechua',
'ay_BO' => 'Aymara',
'se_NO' => 'Northern Sámi',
'ps_AF' => 'Pashto',
'tl_ST' => 'Klingon'
);
//END [MOD] Facebook like button

Offline mailoo

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: [MOD] Facebook like/share/send button
« Reply #50 on: April 27, 2011, 02:46:00 AM »
Nice, But

if i like the main site it show the url of site?

i want show the title name of site.

http://daralaujam.com/gallery/

you can see like link above on right.

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] Facebook like/share/send button
« Reply #51 on: April 27, 2011, 03:10:17 PM »
Nice, But

if i like the main site it show the url of site?

i want show the title name of site.

http://daralaujam.com/gallery/

you can see like link above on right.

Recheck step #1 and 2b, the code has changed for version 3 that should have taken care of that. Or you can zip your changed files and I can take a look at them for you...
Buddy Duke
www.budduke.com

Offline mailoo

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: [MOD] Facebook like/share/send button
« Reply #52 on: May 01, 2011, 02:25:22 AM »
Nice, But

if i like the main site it show the url of site?

i want show the title name of site.

http://daralaujam.com/gallery/

you can see like link above on right.

Recheck step #1 and 2b, the code has changed for version 3 that should have taken care of that. Or you can zip your changed files and I can take a look at them for you...

plz check an attachment files,
tanx

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] Facebook like/share/send button
« Reply #53 on: May 01, 2011, 08:19:40 PM »
@ Mailoo,
It looks like everything is correct...
The only leftover code I saw was in your header.html file
remove
Code: [Select]
{endif page_details}
Also, since you are not using the facebook admins, you may want to also remove from the header.html file
Code: [Select]
<meta property="fb:admins" content="{fb_admins}"/>
I will be making a change to not place that admin info in the header if it is blank. I saw some people complaining about it on Facebook's boards.

The meta properties seem to be correct now so your main link should be now correct.
Buddy Duke
www.budduke.com

Offline comicart

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: [MOD] Facebook like/share/send button
« Reply #54 on: May 01, 2011, 08:48:28 PM »
So...
What's wrong with continuing to use version 2.0?
It works for me.

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] Facebook like/share/send button
« Reply #55 on: May 02, 2011, 12:11:04 AM »
So...
What's wrong with continuing to use version 2.0?
It works for me.
The only thing that version 3 gives you that 2 did not was if you were going to have a like button for your main website and not the thumbnails.
When the code was rendered in version 2, it would give garbage for the main site link unless you were in the details page.
Version 3 now renders the header info for your main site on all pages except the details page so your main like button will work for your site, but if you do not have one then version 2 should still be fine.
Buddy Duke
www.budduke.com

Offline mailoo

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: [MOD] Facebook like/share/send button
« Reply #56 on: May 02, 2011, 04:51:34 AM »
mr. budduke

thank you very much, for your hard work :)

can you plz see the attachment image. :)

« Last Edit: May 03, 2011, 10:09:01 AM by mailoo »

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] Facebook like/share/send button
« Reply #57 on: May 03, 2011, 02:07:47 AM »
@ mailoo,
You are requesting that the Category name will be diplayed for the image description instead of the image description. That would take a different sql call to make that happen. Not sure if anyone else would want that or not so I am posting the change here for anyone who is interested.

Replace the insert you did in Step #1 with this code and it should change it for you...
Code: [Select]
//[MOD] Facebook Like Button
if ($array["details"]){
$sql = "SELECT i.image_name, i.cat_id, i.image_media_file, i.image_description, c.cat_name
FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
WHERE i.image_id = $image_id AND i.cat_id = c.cat_id AND image_active = 1";
$image_row = $site_db->query_firstrow($sql);
$facebook['image'] = get_file_path($image_row['image_media_file'], "thumb", $image_row['cat_id'], 0, 1);
$facebook['image'] = $script_url.substr($facebook['image'],1);
$facebook['title'] = $image_row['image_name'];
$facebook['type'] = "article";//this is what facebook says images should be filed under
$facebook['description'] = !empty($image_row['cat_name']) ? strip_tags($image_row['cat_name']) : "";
$facebook['url1'] = $site_sess->url($script_url."/".$self_url);
if (strpos($facebook['url1'],"&")){
$facebook['url1']=substr($facebook['url1'],0,strpos($facebook['url1'],"&"));
}
}
else{
$facebook['image'] = $config['fb_image'];
$facebook['title'] = $config['fb_title'];
$facebook['type'] = "website";// types setting for your default website
$facebook['description'] = strip_tags($config['fb_description']);
$facebook['url1'] = $config['fb_main_url'];
}
$facebook['main_url']= $config['fb_main_url'];
$site_template->register_vars(array(
"fb_title" => $facebook['title'],
"fb_image" => $facebook['image'],
"fb_type" => $facebook['type'],
"fb_desc" => $facebook['description'],
"fb_url1" => $facebook['url1'],
"fb_main_url" => $facebook['main_url'],
"fb_appid" => $config['fb_appid'],
"fb_admins" => $config['fb_admins'],
"fb_language" => ($lang['fb_language']) ? $lang['fb_language'] : $config['fb_language']
)
);
unset($facebook, $image_row);
//END [MOD] Facebook Like Button
Buddy Duke
www.budduke.com

Offline mailoo

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: [MOD] Facebook like/share/send button
« Reply #58 on: May 03, 2011, 10:05:53 AM »
yaaa wow great work my friend :)

your code is correct but, i make small edit to work 100%

you forget this line:
Code: [Select]
$facebook['title'] = $image_row['image_name'];
should be change to:
Code: [Select]
$facebook['title'] = $image_row['cat_name'];
and a right final code:
Code: [Select]
//[MOD] Facebook Like Button
if ($array["details"]){
$sql = "SELECT i.image_name, i.cat_id, i.image_media_file, i.image_description, c.cat_name
FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
WHERE i.image_id = $image_id AND i.cat_id = c.cat_id AND image_active = 1";
$image_row = $site_db->query_firstrow($sql);
$facebook['image'] = get_file_path($image_row['image_media_file'], "thumb", $image_row['cat_id'], 0, 1);
$facebook['image'] = $script_url.substr($facebook['image'],1);
$facebook['title'] = $image_row['cat_name'];
$facebook['type'] = "article";//this is what facebook says images should be filed under
$facebook['description'] = !empty($image_row['cat_name']) ? strip_tags($image_row['cat_name']) : "";
$facebook['url1'] = $site_sess->url($script_url."/".$self_url);
if (strpos($facebook['url1'],"&")){
$facebook['url1']=substr($facebook['url1'],0,strpos($facebook['url1'],"&"));
}
}
else{
$facebook['image'] = $config['fb_image'];
$facebook['title'] = $config['fb_title'];
$facebook['type'] = "website";// types setting for your default website
$facebook['description'] = strip_tags($config['fb_description']);
$facebook['url1'] = $config['fb_main_url'];
}
$facebook['main_url']= $config['fb_main_url'];
$site_template->register_vars(array(
"fb_title" => $facebook['title'],
"fb_image" => $facebook['image'],
"fb_type" => $facebook['type'],
"fb_desc" => $facebook['description'],
"fb_url1" => $facebook['url1'],
"fb_main_url" => $facebook['main_url'],
"fb_appid" => $config['fb_appid'],
"fb_admins" => $config['fb_admins'],
"fb_language" => ($lang['fb_language']) ? $lang['fb_language'] : $config['fb_language']
)
);
unset($facebook, $image_row);
//END [MOD] Facebook Like Button

Offline mailoo

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: [MOD] Facebook like/share/send button
« Reply #59 on: May 06, 2011, 03:31:02 AM »
Mr. budduke
thank u 4 this mod. great work :)

Also you can add this code anywhere in details.html
Code: [Select]
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:comments href="http://domain.com/gallery/img{image_id}.htm" num_posts="2" width="500"></fb:comments>replace domain.com with your domain link.

that code allow users to add comments to images in your gallery by using Facebook account.
« Last Edit: May 06, 2011, 05:14:55 AM by mailoo »