Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Add Facebook Comments Using PHP Code
Avatar
FidoSysop
Clearwater Florida
Member

VIP
sp_UserOfflineSmall Offline
Nov 18, 2016 - 3:57 pm

There are two code snippets. One for the header.php file and the other goes where the comments are supposed to appear. For my site i added the appear code just above my get comments line in single.php and page.php.

This website better explains the procedure.

  • Doc ~ An old Fidonet SysOp. Just hanging out in cyberspace keeping up with tech.
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Nov 18, 2016 - 4:51 pm

Any chance of a link to your forum page?

Actually to a topic page if possible,

andy-signature.png
YELLOW
SWORDFISH
Avatar
FidoSysop
Clearwater Florida
Member

VIP
sp_UserOfflineSmall Offline
Nov 18, 2016 - 4:59 pm

It does work - but only on topic posts that have replies. Does not show up on single topic posts.

It's also duplicating after each post. Only once is needed. The best place for it to appear is right after the 1st post content. It is also posting the comment to my FB wall properly.

https://www.docsplace.org/foru.....his-forum/

fbc-test.jpgImage Enlarger

  • Doc ~ An old Fidonet SysOp. Just hanging out in cyberspace keeping up with tech.
Avatar
FidoSysop
Clearwater Florida
Member

VIP
sp_UserOfflineSmall Offline
Nov 18, 2016 - 5:14 pm

If y'all ever consider a plugin to add this functionality I'm thinking a shortcode added to the tinymce editor would be the cats ass. If someone creates a post and wants optional Facebook comments clicking a button would add a shortcode [fbcomments] at the bottom of the post being created.

During the election i gained a great deal of Facebook trial and error knowledge. Facebookers are hesitant to click a link. But if enticed via the post title, once on the page they were directed to will comment if Facebook comments is installed.

I found Facebookers wouldn't comment using SP even if registration was not required. Thinking this would be a great tool for SP admins wanting to increase their forum use from Facebook members.

A plugin i used to run had the shortcode option [fbcomments] and that worked great putting it under the post text, but was not updated and caused amp pages errors.

My politics forum posts are out ranking WordPress blog posts. https://www.docsplace.org/forum/politics/

  • Doc ~ An old Fidonet SysOp. Just hanging out in cyberspace keeping up with tech.
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Nov 18, 2016 - 5:47 pm

Well just hold on... sorry to ay it is my code form yesterday that is wrong..

I told you to use:

if ($spThisPost->post_index > 1) {

and it SHOULD have been:

if ($spThisPost->post_index == 1) {

(That is two equal signs).

Apologies for that. Misunderstood the instructions. And we can certainly discuss the plugin idea....

andy-signature.png
YELLOW
SWORDFISH
Avatar
FidoSysop
Clearwater Florida
Member

VIP
sp_UserOfflineSmall Offline
Nov 18, 2016 - 6:00 pm

That works. But places fb comments on top of the post.

Would be better under the post if possible. wink

https://www.docsplace.org/foru.....n-chicago/

  • Doc ~ An old Fidonet SysOp. Just hanging out in cyberspace keeping up with tech.
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Nov 19, 2016 - 4:34 am

Sorry Doc - i think you must have just missed me last night by minutes!

If you look at the topic view template we altered the other day, we inserted the code just before the call to:

sp_SectionStart('tagClass=spTopicPostSection', 'post');

Trace the code down the template and you will come to the call to:

sp_SectionEnd('', 'post');

If you move the code to immediately AFTER that section end call, then it will appear after the post instead of before it.

andy-signature.png
YELLOW
SWORDFISH
Avatar
FidoSysop
Clearwater Florida
Member

VIP
sp_UserOfflineSmall Offline
Nov 19, 2016 - 10:22 am

Thanks Andy, worked like a charm, except on the mobile template it's duplicating and still on top of the forum.

  • Doc ~ An old Fidonet SysOp. Just hanging out in cyberspace keeping up with tech.
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Nov 19, 2016 - 10:27 am

Have you forgotten to edit that one separately?

andy-signature.png
YELLOW
SWORDFISH
Avatar
FidoSysop
Clearwater Florida
Member

VIP
sp_UserOfflineSmall Offline
Nov 19, 2016 - 10:50 am

Nope edited both mobile and desktop files.

Actually thinking the best place to put it would be inside the text area of the 1st posted topic.

  • Doc ~ An old Fidonet SysOp. Just hanging out in cyberspace keeping up with tech.
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626