Socialshare Plugin - New Version - Now with Facebook Comments - Page 2 Socialshare Plugin - New Version - Now with Facebook Comments - Page 2
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Socialshare Plugin - New Version - Now with Facebook Comments

Started by gtgillis, November 22, 2011, 10:45:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gtgillis

Quote from: mitko on November 26, 2011, 05:39:59 PM
Tried to follow this instruction
Created app than enter $CONF_SOCIALSHARE_CM['comment_appid'] and $CONF_SOCIALSHARE_CM['comment_nameid']
Comment page is available at the picture page. But moderation queue in FB still empty. Suspect the problem is simple, but cant understand :)

If you had comments before you created and entered your app id and name id you may not be able to moderate those comments on Facebook since they are tied together.

mitko

No, i tried to add tests comments after creation of application, but they didn't appear. May be it's the syntax problem? Do i need to keep values after =  in ' ' etc ?

gtgillis

Quote from: mitko on November 27, 2011, 08:43:47 AM
No, i tried to add tests comments after creation of application, but they didn't appear. May be it's the syntax problem? Do i need to keep values after =  in ' ' etc ?

If your App ID is 123456789123 then you should edit the config file and replace YOUR_APP_ID_GOES_HERE with 123456789123

//Enter your App ID here
$CONF_SOCIALSHARE_CM['comment_appid'] = "123456789123";



When I click on  my profile page in Facebook and look at the url I see https://www.facebook.com/greg.gillis. This shows that my facebook ID is greg.gillis. This is the Facebook ID of the person that can moderate the comments. Put your own  Facebook ID here.
//Enter your FB account name
$CONF_SOCIALSHARE_CM['comment_nameid'] = "greg.gillis";

gtgillis

Deleted

gtgillis

To force the correct photo will require you to edit two theme files. Theme.php and template.html. I tried doing this in the plugin itself but ran into a few issues. I'll keep looking but for now this works.

Let me know the name of the theme you are using and I can give your more detailed instructions for your theme.

Here are the changes for the theme I am using, mac_ox_x.

edit theme.php and add three FB_META_ lines to $template_vars.

    $template_vars = array('{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => $CONFIG['gallery_name'] . ' -- ' . strip_tags(bb_decode($section)),
        '{CHARSET}' => $charset,
        '{META}' => $meta,
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{SYS_MENU}' => theme_main_menu('sys_menu'),
        '{SUB_MENU}' => theme_main_menu('sub_menu'),
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
        '{CUSTOM_HEADER}' => $custom_header,
        '{JAVASCRIPT}' => theme_javascript_head(),
        '{MESSAGE_BLOCK}' => theme_display_message_block(),

        '{FB_META_TITLE}' => $CONFIG['gallery_name'],
        '{FB_META_DESC}' => strip_tags(bb_decode($section)),
        '{FB_META_IMG}' => $_CONF['site_url'].'/coppermine/'.$CURRENT_PIC_DATA['url']
        );


edit template.html. Add three lines
<!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" xml:lang="en" lang="en" dir="{LANG_DIR}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
<meta http-equiv="Pragma" content="no-cache" />

<meta name="title" content="{FB_META_TITLE}" />
<meta name="description" content="{FB_META_DESC}"  />
<link rel="image_src" href="{FB_META_IMG}" />








Quote from: metamog on November 23, 2011, 11:59:23 AM
I have an issue with the thumbnail attached to the facebook comment:

Every time I make a comment on my CPG the comment inside my facebook has the wrong thumbnail attached. The chosen thumbnail for the attachment is always the thumbnail one step to the left, in filmstrip.

I've tried to change in config how many thumbs showing but this won't do it.

Is there any possibillity to change what thumbnail is attached by editing the code of this plugin?

Morgan
http://echinopsis.eu

metamog

Thank you gtgillis!


I'm using the theme "Igames".

Can I use your code anyway?


Morgan Larsson

metamog

my theme.php looks nothing like yours code (on macosx).

I've edited the "theme.html" but that didn't make it (no thumbnail at all).

Morgan Larsson

gtgillis

You will need to add the following function to your theme.php. Edit theme.php go to the bottom of the file and insert the following code just before the ?>

function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR, $CURRENT_PIC_DATA, $_CONF;
    global $template_header, $lang_charset, $lang_text_dir;

    $custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);

        $charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset'];

    header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
        header("Content-Type: text/html; charset=$charset");
//    user_save_profile();

    $template_vars = array('{LANG_DIR}' => $lang_text_dir,
        '{FB_META_TITLE}' => $CONFIG['gallery_name'],
        '{FB_META_DESC}' => strip_tags(bb_decode($section)),
        '{FB_META_IMG}' => $_CONF['site_url'].'/coppermine/'.$CURRENT_PIC_DATA['url']
        );

    echo template_eval($template_header, $template_vars);
}



Double check the the top of your template.html looks like this
<!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" xml:lang="en" lang="en" dir="{LANG_DIR}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
<meta http-equiv="Pragma" content="no-cache" />
<meta name="title" content="{FB_META_TITLE}" />
<meta name="description" content="{FB_META_DESC}"  />
<link rel="image_src" href="{FB_META_IMG}" />
<title>{TITLE}</title>



Quote from: metamog on November 29, 2011, 07:41:27 PM
my theme.php looks nothing like yours code (on macosx).

I've edited the "theme.html" but that didn't make it (no thumbnail at all).

Morgan Larsson

metamog

When I did what said in your last message: I've got problem with all my "buttons" top menu. See attachment.

gtgillis

OK. Change the function in theme.php to the following.

function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR, $CURRENT_PIC_DATA, $_CONF;
    global $template_header, $lang_charset, $lang_text_dir;

    $custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);

        $charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset'];

    header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
        header("Content-Type: text/html; charset=$charset");
//    user_save_profile();

    $template_vars = array('{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => $CONFIG['gallery_name'] . ' -- ' . strip_tags(bb_decode($section)),
        '{CHARSET}' => $charset,
        '{META}' => $meta,
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{SYS_MENU}' => theme_main_menu('sys_menu'),
        '{SUB_MENU}' => theme_main_menu('sub_menu'),
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
        '{CUSTOM_HEADER}' => $custom_header,
        '{JAVASCRIPT}' => theme_javascript_head(),
        '{MESSAGE_BLOCK}' => theme_display_message_block(),
'{FB_META_TITLE}' => $CONFIG['gallery_name'],
        '{FB_META_DESC}' => strip_tags(bb_decode($section)),
        '{FB_META_IMG}' => $_CONF['site_url'].'/coppermine/'.$CURRENT_PIC_DATA['url']
        );

    echo template_eval($template_header, $template_vars);
}



Quote from: metamog on November 29, 2011, 08:23:10 PM
When I did what said in your last message: I've got problem with all my "buttons" top menu. See attachment.

metamog

Thank you gtgillis!

Now it doesn't show up any thumbnail at facebook (tried 2 times).

Morgan Larsson

gtgillis

Make sure that template.html has the following 3 lines just below the <head> tag.

<meta name="title" content="{FB_META_TITLE}" />
<meta name="description" content="{FB_META_DESC}"  />
<link rel="image_src" href="{FB_META_IMG}" />


Once you have this and the function added to theme.php it should work.

I also did a view source of the web page below and I see the meta name="title", meta name="description" and link rel="image_src".
http://www.rudebastard.com/coppermine/displayimage.php?album=31&pid=2742#top_display_media

<!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" xml:lang="en" lang="en" dir="ltr">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta http-equiv="Pragma" content="no-cache" />

<meta name="title" content="Photo Gallery" />

<meta name="description" content="0012 - 0012-10"  />

<link rel="image_src" href="http://www.rudebastard.com/coppermine/../Photographs/0012/normal_0012-10.jpg" />





Quote from: metamog on November 29, 2011, 08:45:55 PM
Thank you gtgillis!

Now it doesn't show up any thumbnail at facebook (tried 2 times).

Morgan Larsson

metamog

Same trouble: no thumbnail at facebook comment.

(I've also noticed that people has replied to comments on my CPG, that was not updated to facebook, I never got any hint about people replying until I saw the replies at my CPG)


Morgan Larsson
http://echinopsis.eu

TeknoSounds

does this use the new styled version of FB comments? the one in the other share/comment plugin uses an old style, I can't remember off the top of my head the difference... 

but anyway, what I would really like to see as a feature request:
ability to email admin upon comment
insert comment into CPG DB so comments aren't lost if FB does an update (this is whats about to happen to me since I need to switch it to the new style of FB comments, its going to cause me to lose all the comments that were made since I put in the other plugin)

Russ_

Two things:
1. Can I turn off the FB comments? I can't see how.
2. Instead of icons under the picture I get text links, like the attachment. Any ideas on what's wrong (keep in mind I'm ungeeky please  :-\)


gtgillis

Quote from: Russ_ on March 02, 2012, 12:00:53 AM
Two things:
1. Can I turn off the FB comments? I can't see how.
2. Instead of icons under the picture I get text links, like the attachment. Any ideas on what's wrong (keep in mind I'm ungeeky please  :-\)

I would guess that it's related to your theme's CSS. What theme are you using and is it somewhere where I can download it?



gtgillis


Russ_

No other plug-ins at all, and no cms.
Maybe I'll try uploading all the theme files again.