Topic-icon posted by Guest

9 years 8 months ago - 9 years 8 months ago #59510 by easykey
posted by Guest was created by easykey
When I receive an email notification from JFBConnect here is an example of what I receive...

Subject: New Facebook Comment - Easykey

Content:
This is an automated message from JFBConnect.

A new Facebook comment was posted by Guest EmailsinmyInboxaremissingOutlookTipsEssexHertfordshireBishopsStortfordandHarlowEasykey
easykey.uk/outlook/emails-in-my-inbox-are-missing

You can administer the comment at that page or at developers.facebook.com/tools/comments
-- JFBConnect

Is the following possible?

Change "A new Facebook comment was posted by Guest" to
"A new Facebook comment was posted by Fred Bloggs" (i.e. the actual name of the person)

Also
Change
"EmailsinmyInboxaremissingOutlookTipsEssexHertfordshireBishopsStortfordandHarlowEasykey"

to

"Emails in my Inbox are missing | Outlook Tips | Essex, Hertfordshire, Bishop's Stortford and Harlow | Easykey"
(i.e. the actual Title tag of the page)
Last edit: 9 years 8 months ago by easykey.
The topic has been locked.
Support Specialist
9 years 8 months ago #59517 by mel
Replied by mel on topic posted by Guest

Change "A new Facebook comment was posted by Guest" to
"A new Facebook comment was posted by Fred Bloggs" (i.e. the actual name of the person)

If the user is not logged into your site, then the only information we'd have is Guest. Facebook does not just give that information out over the API if the user does not accept your application and any associated permissions for your site. If the user is logged in (via their Joomla user or social network credentials), then the notification email should be using the Joomla username or real name (don't recall which off the top of my head).

Please try logging into your site and posting a comment to see if the notification has the correct name. If you are logged in and it still shows guest, then please let us know as this is something to investigate further.

Also Change "EmailsinmyInboxaremissingOutlookTipsEssexHertfordshireBishopsStortfordandHarlowEasykey" to
"Emails in my Inbox are missing | Outlook Tips | Essex, Hertfordshire, Bishop's Stortford and Harlow | Easykey"

This will require a code change. I checked this on my test site, but you will also need to test it on your site and let us know if you have any issues.

1. In /components/com_jfbconnect/includes/jfbconnect.js file around line 212, we'll need to encode the title before sending the email. Replace
comment: {
                create: function (response)
                {
                    var url = 'option=com_jfbconnect&task=social.comment&type=create&href=' + encodeURIComponent(escape(response.href)) + '&commentID=' + response.commentID + '&title=' + document.title;
                    jfbc.util.ajax(url, null);
                },
                remove: function (response)
                {
                    var url = 'option=com_jfbconnect&task=social.comment&type=remove&href=' + encodeURIComponent(escape(response.href)) + '&commentID=' + response.commentID + '&title=' + document.title;
                    jfbc.util.ajax(url, null);
                }
            },
            like: {
                create: function (response)
                {
                    var url = 'option=com_jfbconnect&task=social.share&provider=facebook&share=like&type=create&href=' + encodeURIComponent(escape(response)) + '&title=' + document.title;
                    jfbc.util.ajax(url, null);
                },
                remove: function (response)
                {
                    var url = 'option=com_jfbconnect&task=social.share&provider=facebook&share=like&type=remove&href=' + encodeURIComponent(escape(response)) + '&title=' + document.title;
                    jfbc.util.ajax(url, null);
                }
            }
with
comment: {
                create: function (response)
                {
                    var title = window.btoa(document.title);
                    var url = 'option=com_jfbconnect&task=social.comment&type=create&href=' + encodeURIComponent(escape(response.href)) + '&commentID=' + response.commentID + '&title=' + title;
                    jfbc.util.ajax(url, null);
                },
                remove: function (response)
                {
                    var title = window.btoa(document.title);
                    var url = 'option=com_jfbconnect&task=social.comment&type=remove&href=' + encodeURIComponent(escape(response.href)) + '&commentID=' + response.commentID + '&title=' + title;
                    jfbc.util.ajax(url, null);
                }
            },
            like: {
                create: function (response)
                {
                    var title = window.btoa(document.title);
                    var url = 'option=com_jfbconnect&task=social.share&provider=facebook&share=like&type=create&href=' + encodeURIComponent(escape(response)) + '&title=' + title;
                    jfbc.util.ajax(url, null);
                },
                remove: function (response)
                {
                    var title = window.btoa(document.title);
                    var url = 'option=com_jfbconnect&task=social.share&provider=facebook&share=like&type=remove&href=' + encodeURIComponent(escape(response)) + '&title=' + title;
                    jfbc.util.ajax(url, null);
                }
            }

2. In components/com_jfbconnect/controllers/social.php around line 30, change
$title = $input->get('title');
to
$title = base64_decode($input->get('title'));
The topic has been locked.